Changeset edfd1d0 in network-game for common/Player.cpp


Ignore:
Timestamp:
Dec 25, 2012, 6:27:14 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
4c202e0
Parents:
baaf6c8
Message:

Moved the Player class to the common directory, added a position to Player, added a new message type for sending player info, and made the server broadcast player positions everytime it receives and replies to a message

File:
1 moved

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    rbaaf6c8 redfd1d0  
    1010   this->name = name;
    1111   this->password = password;
     12   this->pos.x = 200;
     13   this->pos.y = 200;
    1214
    1315   cout << "Created new player: " << this->name << endl;
     
    1820   this->name = name;
    1921   this->password = "";
     22   this->pos.x = 200;
     23   this->pos.y = 200;
    2024   this->addr = addr;
    2125
     
    3135   this->addr = addr;
    3236}
     37
     38void Player::clearSensitiveInfo()
     39{
     40   this->password = "";
     41   this->addr.sin_family = 0;
     42   this->addr.sin_port = 0;
     43   this->addr.sin_addr.s_addr = 0;
     44}
Note: See TracChangeset for help on using the changeset viewer.