|
Re: online game
hmm, im not sure about this as i am only just beginning Java so im not sure how it would handle something like what im about to suggest.
When a new client connects to the server a connection is established and sotred. Then it is passed to a new Thread and all data from that client is handled by that thread.
Now if you store that connection in a global array, if this is possible in Java. Then it becomes avaliable to everything. This means that other threads that are running for other clients can access the connection via the global array and send data to it.
Cheers,
Chris
__________________
Who said i couldn't program
sarcasm = raw_input('Type in a sarcastic remark: ')
print sarcasm
|