- Timestamp:
- Oct 4, 2013, 5:06:20 PM (11 years ago)
- Branches:
- master
- Children:
- 90eaad2
- Parents:
- e6c26b8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
re6c26b8 r95ffe57 674 674 { 675 675 wndCurrent = wndLobby; 676 677 Player p("", ""); 678 p.deserialize(msg.buffer); 679 680 if (mapPlayers.find(p.id) != mapPlayers.end()) 681 delete mapPlayers[p.id]; 682 mapPlayers[p.id] = new Player(p); 683 curPlayerId = p.id; 676 677 // this message should only be sent when a player first logs in so they know their id 678 679 Player* p = new Player("", ""); 680 p->deserialize(msg.buffer); 681 682 if (mapPlayers.find(p->id) != mapPlayers.end()) 683 delete mapPlayers[p->id]; 684 mapPlayers[p->id] = p; 685 curPlayerId = p->id; 684 686 685 687 cout << "Got a valid login response with the player" << endl; 686 688 cout << "Player id: " << curPlayerId << endl; 687 cout << "Player health: " << p .health << endl;689 cout << "Player health: " << p->health << endl; 688 690 cout << "player map size: " << mapPlayers.size() << endl; 689 691 } … … 708 710 cout << "Received MSG_TYPE_PLAYER" << endl; 709 711 710 Player p("", "");711 p .deserialize(msg.buffer);712 p .timeLastUpdated = getCurrentMillis();713 p .isChasing = false;714 if (p .health <= 0)715 p .isDead = true;712 Player* p = new Player("", ""); 713 p->deserialize(msg.buffer); 714 p->timeLastUpdated = getCurrentMillis(); 715 p->isChasing = false; 716 if (p->health <= 0) 717 p->isDead = true; 716 718 else 717 p .isDead = false;718 719 if (mapPlayers.find(p .id) != mapPlayers.end())720 delete mapPlayers[p .id];721 mapPlayers[p .id] = new Player(p);719 p->isDead = false; 720 721 if (mapPlayers.find(p->id) != mapPlayers.end()) 722 delete mapPlayers[p->id]; 723 mapPlayers[p->id] = p; 722 724 723 725 break;
Note:
See TracChangeset
for help on using the changeset viewer.