summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAtle Hellvik Havsų <atle@havso.net>2010-11-08 11:45:48 +0100
committerAtle Hellvik Havsų <atle@havso.net>2010-11-08 11:45:48 +0100
commit22845bb4752bb5b8d601b542df01b5594f2bea31 (patch)
treeb93deff6b978bf9a1e436f4b12e65b0a30f8690f /server
parentbbed785b301bd9380080489ad7b2f10f777b496d (diff)
parentdbe36b02350464b41510bf282531ed028ebae038 (diff)
Merge branch 'master' of ssh://git.jvnv.net/srv/git/aotenjou
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