summaryrefslogtreecommitdiff
path: root/server/player.h
diff options
context:
space:
mode:
authorOle Daniel Evensen <daniel@ICE.(none)>2010-11-08 11:43:32 +0100
committerOle Daniel Evensen <daniel@ICE.(none)>2010-11-08 11:43:32 +0100
commitdbe36b02350464b41510bf282531ed028ebae038 (patch)
treeb93deff6b978bf9a1e436f4b12e65b0a30f8690f /server/player.h
parentbbed785b301bd9380080489ad7b2f10f777b496d (diff)
Added smartpointer to connection in player, rather than storing ip and port.
Diffstat (limited to 'server/player.h')
-rw-r--r--server/player.h21
1 files changed, 13 insertions, 8 deletions
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