Difference between revisions of "Server"
(→Battle state) |
(→Game state) |
||
Line 7: | Line 7: | ||
= [[Game state]] = | = [[Game state]] = | ||
+ | |||
+ | All information about game mechanics is stored in CGameState located in CGameState.h file and objects avaliable from it. | ||
= [[Battle state]] = | = [[Battle state]] = |
Revision as of 13:00, 10 November 2011
The main purpose of server is to maintain the state of game and to inform clients participating in game about changes. Ideally, all the mechanics should be handled by server in order to avoid cheating on client side.
Operation
Information about changes is sent to all clients with netpacks from GameHandler defined in gamehandler.cpp. This way every client receives synchronized information about changes in game state. Server receives requests in form of netpacks from clients entered via player interface and processes it according to game mechanics.
Game state
All information about game mechanics is stored in CGameState located in CGameState.h file and objects avaliable from it.
Battle state
Battle is unusual structure, as it is avaliable only during combat. Info about current battle is handled by BattleState class in BattleState.cpp