Client -> Server communication for game logic |
Mon, 27 February 2006 12:17 |
|
sirgwain | | Senior Chief Petty Officer | Messages: 86
Registered: March 2004 Location: Tucson | |
|
Hi,
I was browsing through the source code trying to view it from a client perspective and I have a couple of questions. How does the client get game logic information from the server. By game logic I mean things like how much fuel is used by a fleet going warp n, or how many minerals a remote miner will suck from a planet surface.
The client could compute all of these I suppose, but that means you have duplicate code and it means the client goes out of date anytime a server config file changes.
A couple alternatives would be to compile the game logic classes as a dll and have the client consume that. It's not too much to ask to require the client have an up to date server.dll. You would still have to have some way to transfer the specific server configuration xml down to each client in case custom changes were made by the host (the same goes for technology data).
Another alternative is to have each client constantly asking the server for important game logic information when they want to display fuel usage and such to the user. Considering bandwidth these days that would certainly be feasable, but the existing FreeStars! architecture seems to be targeted towards offline clients that get one set of turn data and return one set of submit data.
Any ideas, comments?
Report message to a moderator
|
|
|
|
|
Re: Client -> Server communication for game logic |
Mon, 27 February 2006 15:38 |
|
LEit | | Lt. Commander | Messages: 879
Registered: April 2003 Location: CT | |
|
It will be up to the client to keep track of manually merged/split fleets, there is server code to to that as well of course, and the client will probably just use that.
There will be no communication between the server and client execpt the .m and .x files. The client will have either a library with the server code, or a seperate exe that will have the server code, but the actual server will not be accessable to the client. So the client could claim to split two fleets into idenical fleets and try to merge them. However, the server checks everything, so in this case, when you try to split a fleet of 4 ships into two fleets of 4 ships, it will fail. Actually, the message telling the server to split tells how many ships are leaving the original fleet, so you'd end up with 1 fleet with 0 ships and 1 with 4. The server will not allow splitting 5 ships off a fleet with 4, it will limit it to 4 (and send a message about attempting to cheat, to the host too, if they have a way to look at that).
In general, the server needs to not trust the client, and check everything that it's asked to do.
- LEitReport message to a moderator
|
|
|