Make client output and read in game state and order files
This commit is contained in:
parent
18cfcff264
commit
b532f1c9c8
4 changed files with 88 additions and 71 deletions
|
@ -68,7 +68,7 @@ int runServer(int argc, char* argv[])
|
|||
CTTRTSGame game = GetGameFromFile("Tiny2Player.txt");
|
||||
|
||||
std::vector<player_t> players = game.GetPlayers();
|
||||
unsigned int numClients = game.GetPlayers().size();
|
||||
unsigned int numClients = players.size();
|
||||
auto player_iterator = players.begin();
|
||||
|
||||
// game mutex
|
||||
|
@ -103,10 +103,7 @@ int runServer(int argc, char* argv[])
|
|||
clientInfo.player = *player_iterator;
|
||||
|
||||
player_iterator++;
|
||||
|
||||
// Could verify if player is valid here
|
||||
|
||||
myClients.push_back({cli_addr,clientsockfd});
|
||||
myClients.push_back(clientInfo);
|
||||
}
|
||||
|
||||
// Perform the initial handshake with clients
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue