source: network-game/server/player.cpp@ b13b001

Last change on this file since b13b001 was 2488852, checked in by dportnoy <dmp1488@…>, 12 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
RevLine 
[2488852]1#include "player.h"
2
3#include <iostream>
4#include <arpa/inet.h>
5
6using namespace std;
7
8player::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
16player::~player()
17{
18}
19
20bool 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.