Changeset c9f6a1c in network-game
- Timestamp:
- Dec 23, 2013, 8:05:55 PM (11 years ago)
- Branches:
- master
- Children:
- 3e44a59
- Parents:
- 8ce793b
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Game.cpp
r8ce793b rc9f6a1c 73 73 } 74 74 75 int Game::getRedScore() {75 unsigned int Game::getRedScore() { 76 76 return this->redScore; 77 77 } 78 78 79 int Game::getBlueScore() {79 unsigned int Game::getBlueScore() { 80 80 return this->blueScore; 81 81 } … … 89 89 } 90 90 91 void Game::setRedScore( int score) {91 void Game::setRedScore(unsigned int score) { 92 92 this->redScore = score; 93 93 } 94 94 95 void Game::setBlueScore( int score) {95 void Game::setBlueScore(unsigned int score) { 96 96 this->blueScore = score; 97 97 } -
common/Game.h
r8ce793b rc9f6a1c 24 24 map<unsigned int, Projectile> projectiles; 25 25 WorldMap* worldMap; 26 int blueScore;27 int redScore;26 unsigned int blueScore; 27 unsigned int redScore; 28 28 unsigned int unusedProjectileId; 29 29 … … 36 36 string getName(); 37 37 int getNumPlayers(); 38 int getBlueScore();39 int getRedScore();38 unsigned int getBlueScore(); 39 unsigned int getRedScore(); 40 40 WorldMap* getMap(); 41 41 42 42 void setId(unsigned int id); 43 void setBlueScore( int score);44 void setRedScore( int score);43 void setBlueScore(unsigned int score); 44 void setRedScore(unsigned int score); 45 45 46 46 map<unsigned int, Player*>& getPlayers(); -
server/makefile
r8ce793b rc9f6a1c 1 1 CC = g++ 2 LIB_FLAGS = -lssl -lmysqlclient -lcrypt -lrt 2 #LIB_FLAGS = -lssl -lmysqlclient -lcrypt -lrt 3 LIB_FLAGS = -lmysqlclient -lcrypt -lrt 3 4 FLAGS = $(LIB_FLAGS) 4 5 COMMON_PATH = ../common 5 DEPENDENCIES = Common.o MessageContainer.o MessageProcessor.o Player.o WorldMap.o DataAccess.o Projectile.o Game.o 6 DEPENDENCIES = Common.o MessageContainer.o MessageProcessor.o Player.o WorldMap.o DataAccess.o Projectile.o Game.o GameSummary.o 6 7 7 8 server : server.cpp $(DEPENDENCIES) … … 29 30 $(CC) -c -o $@ $? 30 31 32 GameSummary.o : $(COMMON_PATH)/GameSummary.cpp 33 $(CC) -c -o $@ $? 34 31 35 %.o : %.cpp 32 36 $(CC) -c -o $@ $? -
server/server.cpp
r8ce793b rc9f6a1c 36 36 #include "../common/Projectile.h" 37 37 #include "../common/Game.h" 38 #include "../common/GameSummary.h" 38 39 39 40 #include "DataAccess.h" … … 377 378 378 379 serverMsg.type = MSG_TYPE_FINISH_GAME; 380 381 // I should create an instance of the GameSummary object here and just serialize it into this message 379 382 memcpy(serverMsg.buffer+4, &winningTeam, 4); 380 383 memcpy(serverMsg.buffer+4, &scoreBlue, 4);
Note:
See TracChangeset
for help on using the changeset viewer.