Changeset 59061f6 in network-game for server/server.cpp
- Timestamp:
- Nov 27, 2012, 7:03:33 PM (12 years ago)
- Branches:
- master
- Children:
- 371ce29
- Parents:
- 36082e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
r36082e8 r59061f6 63 63 } 64 64 65 // not sure if we actually need this function66 // when I made it, I thought we did67 65 Player *findPlayerByAddr(vector<Player> &vec, const sockaddr_in &addr) 68 66 { … … 100 98 exit(1); 101 99 } 100 101 DataAccess da; 102 103 da.printPlayers(); 104 105 da.insertPlayer("playerName3", "playerPass"); 106 cout << endl << "Inserted player" << endl << endl; 107 108 Player* p = da.getPlayer("playerName"); 109 cout << "player name: " << p->name << endl; 110 delete(p); 111 112 p = da.getPlayer("playerName3"); 113 cout << "player name: " << p->name << endl; 114 delete(p); 115 116 da.printPlayers(); 117 cout << endl; 102 118 103 119 sock=socket(AF_INET, SOCK_DGRAM, 0); … … 162 178 if (p == NULL) 163 179 { 164 vctPlayers.push_back(Player(username, from)); 180 Player newP(username, ""); 181 newP.setAddr(from); 182 183 vctPlayers.push_back(newP); 165 184 strcpy(serverMsg.buffer, "I'm thinking of a number between 1 and 1000. Guess what it is."); 166 185 }
Note:
See TracChangeset
for help on using the changeset viewer.