Last change
on this file since 73f75c1 was 73f75c1, checked in by dportnoy <dmp1488@…>, 12 years ago |
Created findPlayerByAddr and added some more checks on the client name and address when receiving a message
|
-
Property mode
set to
100644
|
File size:
444 bytes
|
Rev | Line | |
---|
[2488852] | 1 | #include "player.h"
|
---|
| 2 |
|
---|
| 3 | #include <iostream>
|
---|
| 4 | #include <arpa/inet.h>
|
---|
| 5 |
|
---|
| 6 | using namespace std;
|
---|
| 7 |
|
---|
| 8 | player::player(string name, sockaddr_in addr)
|
---|
| 9 | {
|
---|
| 10 | this->name = name;
|
---|
| 11 | this->addr = addr;
|
---|
| 12 |
|
---|
| 13 | cout << "Created new played: " << this->name << endl;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | player::~player()
|
---|
| 17 | {
|
---|
| 18 | }
|
---|
| 19 |
|
---|
[73f75c1] | 20 | // was meant for the find find function. Currently unused
|
---|
[2488852] | 21 | bool player::operator == (const player &p)
|
---|
| 22 | {
|
---|
| 23 | bool eq = addr.sin_addr.s_addr == p.addr.sin_addr.s_addr;
|
---|
| 24 |
|
---|
| 25 | return eq;
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.