Changeset f203c5c in network-game
- Timestamp:
- Sep 26, 2013, 11:08:57 PM (11 years ago)
- Branches:
- master
- Children:
- 803566d
- Parents:
- f41a7f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
rf41a7f9 rf203c5c 621 621 cout << "Got login message" << endl; 622 622 623 serverMsg.type = MSG_TYPE_LOGIN;624 625 623 string username(clientMsg.buffer); 626 624 string password(strchr(clientMsg.buffer, '\0')+1); … … 638 636 else 639 637 { 640 serverMsg.type = MSG_TYPE_PLAYER;641 642 638 updateUnusedPlayerId(unusedPlayerId, mapPlayers); 643 639 p->id = unusedPlayerId; … … 647 643 // choose a random team (either 0 or 1) 648 644 p->team = rand() % 2; 645 646 serverMsg.type = MSG_TYPE_PLAYER; 649 647 650 648 // tell the new player about all the existing players … … 693 691 } 694 692 695 serverMsg.type = MSG_TYPE_LOGIN;696 693 mapPlayers[unusedPlayerId] = *p; 697 694 } 698 695 696 serverMsg.type = MSG_TYPE_LOGIN; 699 697 delete(p); 700 698 … … 955 953 // tell the new player about all the existing players 956 954 cout << "Sending other players to new player" << endl; 955 serverMsg.type = MSG_TYPE_LOGIN; 957 956 958 957 map<unsigned int, Player*>::iterator it; … … 1033 1032 // tell the new player about all the existing players 1034 1033 cout << "Sending other players to new player" << endl; 1034 serverMsg.type = MSG_TYPE_LOGIN; 1035 1035 1036 1036 map<unsigned int, Player*>::iterator it;
Note:
See TracChangeset
for help on using the changeset viewer.