source: network-game/common/Player.cpp@ 4c202e0

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
RevLine 
[8e540f4]1#include "Player.h"
[2488852]2
3#include <iostream>
4
5using namespace std;
6
[59061f6]7Player::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]17Player::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]28Player::~Player()
[2488852]29{
30}
31
[59061f6]32void Player::setAddr(sockaddr_in addr)
33{
34 this->addr = addr;
35}
[edfd1d0]36
37void 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.