summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/player.cpp5
-rw-r--r--server/player.h21
2 files changed, 15 insertions, 11 deletions
diff --git a/server/player.cpp b/server/player.cpp
index 9530c10..e1796d8 100644
--- a/server/player.cpp
+++ b/server/player.cpp
@@ -3,8 +3,7 @@
Player::Player(){}
Player::~Player(){}
-Player::Player(std::string& ip, std::string& port, std::string& nick){
- this->ip = ip;
- this->port = port;
+Player::Player(const Connection::p& connection, const std::string& nick){
+ this->connection_pointer = connection;
this->nick = nick;
}
diff --git a/server/player.h b/server/player.h
index c2cecdf..8e04ab5 100644
--- a/server/player.h
+++ b/server/player.h
@@ -1,21 +1,26 @@
#ifndef PLAYER_H
#define PLAYER_H
-#include <string>
+#include <string>
+#include <boost/shared_ptr.hpp>
+#include "connection.h"
class Player{
private:
- //What the server needs to get in contact with player.
- std::string ip;
- std::string port;
- std::string nick;//The players nick
-
- unsigned int id;//Either generated or fetched from database
+
+ //! A smart pointer to the players connection
+ Connection::p connection_pointer;
+
+ //! The players nick
+ std::string nick;
+
+ //! Either generated or fetched from database. Not used yet.
+ unsigned int id;
public:
Player();
~Player();
- Player(std::string& ip, std::string& port, std::string& nick);
+ Player(const Connection::p& connection, const std::string& nick);
};
#endif // PLAYER_H_INCLUDED