Difference between revisions of "Server"

From VCMI Project Wiki
Jump to: navigation, search
(Game state)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
+
The main purpose of server is to maintain the [[game state]] 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 =
 
= 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.
+
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]].
 
Server receives requests in form of [[netpacks]] from clients entered via [[player interface]] and processes it according to [[game mechanics]].
  
= [[Game state]] =
+
= [[Game Handler]] =
 
 
All information about game mechanics is stored in CGameState located in CGameState.h file and objects avaliable from it:
 
 
 
* [[Player state]] handled by CPlayerState class
 
* [[Team state]] - a group of allied allied players who can cooperate in certain ways
 
* [[Adventure map state]] and scenario information stored in map.cpp as well as initial conditions (starting info)
 
* [[Campaign state]]
 
 
 
= Battle state =
 
 
 
Battle is unusual structure, as it is avaliable during combat.
 
Info about current battle is handled by BattleState class in BattleState.cpp
 

Latest revision as of 13:44, 10 November 2011

The main purpose of server is to maintain the game state 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 Handler