My msn : firstname.lastname@example.org
(not a hotmail address but it works).
For the networking, I need to define an overview of the architecture.
It 's surely not perfect but it runs really well and makes everything simple, here is my global approach:
-a Thread pool to handle Clients. (so one Thread per client). (ThreadPool)
-one Thread to handle connections. (ConnectionHandler)
-one Thread to process events and tasks. (let's call it the MessageProcessor)
-one MessageInOut object which acts as the nerve center of the communication between all Threads described above.
This object contains In queue and an Out queue to stack up Message objects.
These queues use the "ConcurrentLinkedQueue<E>" data structure which suits very well : it's Thread safe for reading/writing in it.
That means there won't need any effort to avoid Thread collisions.
Message objects stored in it will all extend a common abstract class like Message
A Message object can be used for networking and internal communication (for example, if a Client disconnects brutally, its Thread post a Message to warn MessageProcessor a Client disconnected and must be removed
) as well.
Almost the same architecture as the server:
-one Thread to handle Incoming packets. (NetworkThread)
-one Thread to process rendering, events and tasks... (MessageProcessor)
-one MessageInOut object (same principle as in the server).
If you ok to make it multiplayers (cooperative game), I prefer to tell you I can't rely on Phys2D unfortunately (very hard to make it synchronized from a Client to another one).
I need to rely on my simple collision system which doesn't provide complex physics
Also, all dynamic entity classes (players,enemies,...) must provide that method:
public int step(long elapsedTime); //update posisiton,...
Where the returned parameter is an identifier for a possible event.
I think with only that, I can abstract much thinks you guys will code
I hope my english and the way I explained is understandable lol.