|
Last change
on this file since 2488852 was 2488852, checked in by dportnoy <dmp1488@…>, 13 years ago |
|
Added the player class, added a list of logged-in players, and changed the makefile to work properly, and made git ignore all build artifacts
|
-
Property mode
set to
100644
|
|
File size:
386 bytes
|
| Line | |
|---|
| 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 |
|
|---|
| 20 | bool player::operator == (const player &p)
|
|---|
| 21 | {
|
|---|
| 22 | bool eq = addr.sin_addr.s_addr == p.addr.sin_addr.s_addr;
|
|---|
| 23 |
|
|---|
| 24 | return eq;
|
|---|
| 25 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.