source:
network-game/server/Player.cpp@
87b3ee2
Last change on this file since 87b3ee2 was 59061f6, checked in by , 12 years ago | |
---|---|
|
|
File size: 694 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; | |
12 | ||
13 | cout << "Created new player: " << this->name << endl; | |
14 | } | |
15 | ||
[8e540f4] | 16 | Player::Player(string name, sockaddr_in addr) |
[2488852] | 17 | { |
18 | this->name = name; | |
[59061f6] | 19 | this->password = ""; |
[2488852] | 20 | this->addr = addr; |
21 | ||
22 | cout << "Created new played: " << this->name << endl; | |
23 | } | |
24 | ||
[8e540f4] | 25 | Player::~Player() |
[2488852] | 26 | { |
27 | } | |
28 | ||
[73f75c1] | 29 | // was meant for the find find function. Currently unused |
[8e540f4] | 30 | bool Player::operator == (const Player &p) |
[2488852] | 31 | { |
32 | bool eq = addr.sin_addr.s_addr == p.addr.sin_addr.s_addr; | |
33 | ||
34 | return eq; | |
35 | } | |
[59061f6] | 36 | |
37 | void Player::setAddr(sockaddr_in addr) | |
38 | { | |
39 | this->addr = addr; | |
40 | } |
Note:
See TracBrowser
for help on using the repository browser.