Last change
on this file since 4c202e0 was 4c202e0, checked in by dportnoy <dmp1488@…>, 12 years ago |
Added Player to the visual studio project, changed Common to use the #defines in Compiler.h, and added basic client support for processing MSG_TYPE_PLAYER messages
|
-
Property mode
set to
100644
|
File size:
733 bytes
|
Line | |
---|
1 | #include "Player.h"
|
---|
2 |
|
---|
3 | #include <iostream>
|
---|
4 |
|
---|
5 | using namespace std;
|
---|
6 |
|
---|
7 | Player::Player(string name, string password)
|
---|
8 | {
|
---|
9 | this->name = name;
|
---|
10 | this->password = password;
|
---|
11 | this->pos.x = 200;
|
---|
12 | this->pos.y = 200;
|
---|
13 |
|
---|
14 | cout << "Created new player: " << this->name << endl;
|
---|
15 | }
|
---|
16 |
|
---|
17 | Player::Player(string name, sockaddr_in addr)
|
---|
18 | {
|
---|
19 | this->name = name;
|
---|
20 | this->password = "";
|
---|
21 | this->pos.x = 200;
|
---|
22 | this->pos.y = 200;
|
---|
23 | this->addr = addr;
|
---|
24 |
|
---|
25 | cout << "Created new played: " << this->name << endl;
|
---|
26 | }
|
---|
27 |
|
---|
28 | Player::~Player()
|
---|
29 | {
|
---|
30 | }
|
---|
31 |
|
---|
32 | void Player::setAddr(sockaddr_in addr)
|
---|
33 | {
|
---|
34 | this->addr = addr;
|
---|
35 | }
|
---|
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.