Changes in client/Client/main.cpp [032e550:8c74150] in network-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r032e550 r8c74150 351 351 al_draw_text(font, al_map_rgb(0, 255, 0), 515, 80, ALLEGRO_ALIGN_LEFT, ossScoreRed.str().c_str()); 352 352 353 // update player s353 // update player positions 354 354 map<unsigned int, Player>::iterator it; 355 for (it = mapPlayers.begin(); it != mapPlayers.end(); it++)356 {357 it->second.updateTarget(mapPlayers);358 }359 360 355 for (it = mapPlayers.begin(); it != mapPlayers.end(); it++) 361 356 { … … 488 483 { 489 484 string response = string(msg.buffer); 485 486 cout << "Processing message" << endl; 490 487 491 488 switch(state) … … 591 588 case MSG_TYPE_PLAYER: 592 589 { 593 //cout << "Got MSG_TYPE_PLAYER message in STATE_LOGIN" << endl;590 cout << "Got MSG_TYPE_PLAYER message in STATE_LOGIN" << endl; 594 591 595 592 Player p("", ""); 596 593 p.deserialize(msg.buffer); 597 594 p.timeLastUpdated = getCurrentMillis(); 598 p.isChasing = false;599 595 mapPlayers[p.id] = p; 600 596 … … 656 652 case MSG_TYPE_ATTACK: 657 653 { 658 cout << "Received ATTACK message" << endl;659 660 break;661 }662 case MSG_TYPE_START_ATTACK:663 {664 cout << "Received START_ATTACK message" << endl;665 666 unsigned int id, targetID;667 memcpy(&id, msg.buffer, 4);668 memcpy(&targetID, msg.buffer+4, 4);669 670 cout << "source id: " << id << endl;671 cout << "target id: " << targetID << endl;672 673 Player* source = &mapPlayers[id];674 source->targetPlayer = targetID;675 source->isChasing = true;676 677 654 break; 678 655 }
Note:
See TracChangeset
for help on using the changeset viewer.