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