ErosOlmi
16-10-2008, 18:56
Hi all,
I was quite busy recently but in reality I was working on the networking area.
I'm finishing to implement few new functions in TcpUdp module and improving some already there.
I'm also finishing a prototype script that will show a possible implementation of the networking side of the game.
The script is composed of 2 parts: server and clients.
A server application starts and wait for clients to connect.
When a client starts, it sends a broadcast message on the LAN asking if a server is available.
If a Server reply, they exchange few info for next data exchange.
So far I've tested with 1 server and 10 clients.
For the moment data exchanged is the window position and size of the clients. So every time the client window is moved or resized, those data is sent to the server that collect them and show in a ListView.
Exchanged data can be whatever. For the moment I've just implemented few ideas.
ADDED: 2008.10.19
Attached to this post a demo of what I've so far. You will find a server application and a client application.
File attached contains a Server and a Client application
Server can be executed on any computer in your network, if you have a network. But if you have not a network it will be fine either. Important is to have a TcpIp stack installed but if you are reading this post it should be all ok :D
Client can be executed on the same computer of the server or in any other computer you can have on your local LAN
When Client and Server are executed nothing will happen.
Click on "I'm a Server" button in the server window. Server will start listening for clients to connect.
Click on "Find server" button on the Client side. If all ok, client will find the server and they will exchange few data for handshaking
If they seems connected, TRY TO MOVE client window around and see.
If you started more clients, move them around
Forgot to say that if you have a personal firewall active, you will have to authorize those applications to work on the net.
This is exact and normal because those applications try to act as server on UDP ports from 5000 to 5010. 5000 is Server, from 5001 to 5010 clients.
Added: 2008.12.17
added full source code for client and server. thinBasic 1.7.0.0 needed!
Ciao
Eros
I was quite busy recently but in reality I was working on the networking area.
I'm finishing to implement few new functions in TcpUdp module and improving some already there.
I'm also finishing a prototype script that will show a possible implementation of the networking side of the game.
The script is composed of 2 parts: server and clients.
A server application starts and wait for clients to connect.
When a client starts, it sends a broadcast message on the LAN asking if a server is available.
If a Server reply, they exchange few info for next data exchange.
So far I've tested with 1 server and 10 clients.
For the moment data exchanged is the window position and size of the clients. So every time the client window is moved or resized, those data is sent to the server that collect them and show in a ListView.
Exchanged data can be whatever. For the moment I've just implemented few ideas.
ADDED: 2008.10.19
Attached to this post a demo of what I've so far. You will find a server application and a client application.
File attached contains a Server and a Client application
Server can be executed on any computer in your network, if you have a network. But if you have not a network it will be fine either. Important is to have a TcpIp stack installed but if you are reading this post it should be all ok :D
Client can be executed on the same computer of the server or in any other computer you can have on your local LAN
When Client and Server are executed nothing will happen.
Click on "I'm a Server" button in the server window. Server will start listening for clients to connect.
Click on "Find server" button on the Client side. If all ok, client will find the server and they will exchange few data for handshaking
If they seems connected, TRY TO MOVE client window around and see.
If you started more clients, move them around
Forgot to say that if you have a personal firewall active, you will have to authorize those applications to work on the net.
This is exact and normal because those applications try to act as server on UDP ports from 5000 to 5010. 5000 is Server, from 5001 to 5010 clients.
Added: 2008.12.17
added full source code for client and server. thinBasic 1.7.0.0 needed!
Ciao
Eros