Well, i've tried some network code using the borax code. I've used a single
PC with the balder program executing twice. I've opened a port on the 'server'
and i've tried to connet to it with the other instace as a client. Then i've
sent some data from the client to the server (and from server to the client
too) and it has worked fine. To do this, i fixed some errors in the borax
code and i did some bad things (i need the network instace in the mwindow
class, so i make bad code to get it, that's the reason because i don't commit
anything). I connect to my local machine using the 'localhost' as ip address.
3/ Can't develop efficient network code
It is going to be difficult for me with a single PC to write
networking code. Eventhough I thinck it is possible to open a socket
on the local machine (????) and simulate a local server.
that's ok, we just need to understand the framework we're working with;
will have (at least) 2 networked machines this summer to work with, so as
long as we keep a modular approach there should be plenty of non-
network stuff to do.
Now, i have a question. What port will we use to connect to? (i've use the
2222 port because it's used in the blocks programs).
One bug of the borax code is that HandleEvent is not called (when it should
be, because i think that it is handled correctly), so i call it manually
when the cscmdPreProcess event happens. This is not correct at all, but i
don't know how to solve this, and well, it works. This should be fixed (i'll
put some tag it in the code). You can see this when i commit the code. So
you won't surprise when you see a call to the network in the cscmdPreProcess
I'll create a class that manages connection and it will be responsible for
send all the events (and states) and recive all the events and process it
(interacting with the data game).
When i'll have something, i'll send it.
Well, CS network driver can not support broadcasting, but we can do it manually,
it's easy (if you hold all the ip address).
4/ CS network driver
does not support broadcasting apparently. So we can forget about
peer to peer ????
that's fine with me, one approach is probably all we want to try to handle
And one doubt. If the client sends an event, that event is reproduced in
the client when de server back it? in other words, when i press the button
to fire, in that moment the game only send that action to the server and
only start the action of fire on the client when the server send it back?
When you answer this, i'll make other questions... :-)