#include <periserver.h>
Collaboration diagram for SWorld:
Public Methods | |
SWorld () | |
constructor. | |
~SWorld () | |
destructor. | |
bool | parseMap (string &map) |
parse the map. | |
void | run () |
run. | |
Private Methods | |
void | upDatePlayerPos (unsigned ID, int pX, int pY, int d) |
update the player positions. | |
void | addPlayer (unsigned index, string name, Race r, char color) |
add a new player to the game. | |
void | addPlayer (const SPlayer &p) |
add a new player to the game. | |
void | deletePlayer (unsigned i) |
delete a player from the game. | |
Tile & | getTile (unsigned i, unsigned j) |
get a tile from the map. | |
void | getNewClients () |
gets new clients from the networking module and sets them up. | |
void | processMessage (string msg, int playerIndex) |
get a single message and process it. | |
void | processMessagea (string c) |
process the a message the a message is the general move character message Message Form: appxxxxxyyyyyd pp = player ID | xxxxx = position in x | yyyyy = position in y | d = direction in cardinal points. More... | |
void | processMessageb (string c) |
process the b message the b message is the general request resource message Message Form: bpprrxxxyyy##### pp = player ID | rr = resource | xxx = tile in x | yyy = tile in y | ##### = amount of resources. More... | |
void | processMessagec (string c) |
process the c message the c message is the general request tool message Message Form: cppxxxyyy pp = player ID | xxx = tile location of the tool in x | yyy = tile location of the tool in y. More... | |
void | processMessagef (string c) |
process the f message the f message is the place a new building message Message Form: fppttxxxyyy pp = player ID tt = building type xxx = tile location of the building in x yyy = tile location of the building in y. | |
void | processMessageg (string c) |
process the g message the g message is the get resource from building message Message Form: gpprraaaaaxxxyyy pp = player ID rr = resource aaaaa = amount of resource xxx = tile location of the building in x yyy = tile location of the building in y. | |
void | processMessagei (string c, unsigned client) |
process the i message the m message is the "request information about a player" message Message Form: ipp pp = player ID. More... | |
void | processMessagem (string c) |
process the m message the m message is the add player message Message Form: mnnnnnrc nnnn... More... | |
void | processMessagen (string c) |
process the n message the n message is the remove player message Message Form: npp pp = player ID. More... | |
void | processMessageq (string c) |
process the q message the q message is the request cost of items Message Form: qpp pp = player ID. More... | |
void | processMessaget (string c, int playerIndex) |
process the t message the t message is the chat message Message Form: tmmmmmmmm... More... | |
void | processMessager (string c) |
process the r message the r message is the trade message Message Form: rpptrraaaaa. | |
void | processMessages (string c) |
process the s message the s message is the shop message Message Form: rpptrraaaaa. | |
void | processMessagex (string c) |
process the x message the x message is the blank message Message Form: x. More... | |
string | buildMessageA (unsigned p, int x, int y, int d) |
build the A message the A message is update Player Position Message Message Form: Appxxxxxyyyyyd p = player id x = x position y = y position d = direction. | |
string | buildMessageB (unsigned p, Resource r, char c, int a) |
string | buildMessageC (unsigned p, ToolType t) |
string | buildMessageD (ToolType t, int x, int y) |
string | buildMessageE (Resource r, int x, int y) |
string | buildMessageU () |
Private Attributes | |
vector< SPlayer > | players |
unsigned | height |
unsigned | width |
vector< Tile > | map |
int | temperature |
NetManagerServer | net |
string | mapName |
|
process the a message the a message is the general move character message Message Form: appxxxxxyyyyyd pp = player ID | xxxxx = position in x | yyyyy = position in y | d = direction in cardinal points. the a message is the general move character message Message Form: appxxxxxyyyyyd pp = player ID | xxxxx = position in x | yyyyy = position in y | d = direction in cardinal points |
|
process the b message the b message is the general request resource message Message Form: bpprrxxxyyy##### pp = player ID | rr = resource | xxx = tile in x | yyy = tile in y | ##### = amount of resources. the b message is the general request resource message Message Form: bpprrxxxyyy##### pp = player ID | rr = resource | xxx = tile in x | yyy = tile in y | ##### = amount of resources |
|
process the c message the c message is the general request tool message Message Form: cppxxxyyy pp = player ID | xxx = tile location of the tool in x | yyy = tile location of the tool in y. the c message is the general request tool message Message Form: cppxxxyyy pp = player ID | xxx = tile location of the tool in x | yyy = tile location of the tool in y |
|
process the i message the m message is the "request information about a player" message Message Form: ipp pp = player ID.
|
|
process the m message the m message is the add player message Message Form: mnnnnnrc nnnn...
= player name ends in a ' |
|
process the n message the n message is the remove player message Message Form: npp pp = player ID. the n message is the remove player message Message Form: npp pp = player ID |
|
process the q message the q message is the request cost of items Message Form: qpp pp = player ID. the q message is the request cost of items Message Form: qpp pp = player ID |
|
process the t message the t message is the chat message Message Form: tmmmmmmmm... mmmmmm... = message from client |
|
process the x message the x message is the blank message Message Form: x. the x message is the blank message Message Form: x |