source:
network-game/common/Player.cpp@
4c202e0
Last change on this file since 4c202e0 was 4c202e0, checked in by , 12 years ago | |
---|---|
|
|
File size: 733 bytes |
Rev | Line | |
---|---|---|
[8e540f4] | 1 | #include "Player.h" |
[2488852] | 2 | |
3 | #include <iostream> | |
4 | ||
5 | using namespace std; | |
6 | ||
[59061f6] | 7 | Player::Player(string name, string password) |
8 | { | |
9 | this->name = name; | |
10 | this->password = password; | |
[edfd1d0] | 11 | this->pos.x = 200; |
12 | this->pos.y = 200; | |
[59061f6] | 13 | |
14 | cout << "Created new player: " << this->name << endl; | |
15 | } | |
16 | ||
[8e540f4] | 17 | Player::Player(string name, sockaddr_in addr) |
[2488852] | 18 | { |
19 | this->name = name; | |
[59061f6] | 20 | this->password = ""; |
[edfd1d0] | 21 | this->pos.x = 200; |
22 | this->pos.y = 200; | |
[2488852] | 23 | this->addr = addr; |
24 | ||
25 | cout << "Created new played: " << this->name << endl; | |
26 | } | |
27 | ||
[8e540f4] | 28 | Player::~Player() |
[2488852] | 29 | { |
30 | } | |
31 | ||
[59061f6] | 32 | void Player::setAddr(sockaddr_in addr) |
33 | { | |
34 | this->addr = addr; | |
35 | } | |
[edfd1d0] | 36 | |
37 | void Player::clearSensitiveInfo() | |
38 | { | |
39 | this->password = ""; | |
40 | this->addr.sin_family = 0; | |
41 | this->addr.sin_port = 0; | |
42 | this->addr.sin_addr.s_addr = 0; | |
43 | } |
Note:
See TracBrowser
for help on using the repository browser.