Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-09 14:11:44 +0000
committerStijn Buys <ingar@osirion.org>2011-07-09 14:11:44 +0000
commite942db1c8d87b7db286545d72c604e879f7aeab0 (patch)
tree4b07ef3422ee265156e020707c3bc96ecd9ed1e0 /src/core/player.h
parentf39aec30f0e5c6f466681ed34bffd41150976ab9 (diff)
Cleanup of the messaging interface.
Diffstat (limited to 'src/core/player.h')
-rw-r--r--src/core/player.h45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/core/player.h b/src/core/player.h
index dbcc161..afd1bc9 100644
--- a/src/core/player.h
+++ b/src/core/player.h
@@ -15,6 +15,7 @@ class Player;
#include "core/entity.h"
#include "core/message.h"
#include "core/zone.h"
+#include "core/netclient.h"
#include "math/mathlib.h"
#include <string>
@@ -28,9 +29,10 @@ class Player
{
public:
/// default constructor
- Player();
+ Player(NetClient *client);
+
/// default destructor
- virtual ~Player();
+ ~Player();
/*----- inspectors ------------------------------------------------ */
@@ -111,7 +113,7 @@ public:
}
/// print player info to console
- virtual void print() const;
+ void print() const;
/// player level
const int level() const {
@@ -128,27 +130,21 @@ public:
return player_guid;
}
- /*----- messages -------------------------------------------------- */
+ /// network client associated with this player
+ NetClient *client() {
+ return player_client;
+ }
+
+ /*----- server-side mesage functions ------------------------------ */
+ /// send a message to the player on one of the message channels
+ void message(core::Message::Channel channel, const std::string text);
+
/// send a text message
void send(const std::string text);
- /**
- * @brief send a warning message
- * Send the player a warning message abd set the warning
- * message timestamp to the current application time
- * @see last_warning()
- */
- void send_warning(const std::string text);
-
- virtual void sound(const std::string name);
-
- virtual void message(core::Message::Channel channel, const std::string text);
-
- /// time of the last warning message
- float last_warning() const {
- return player_warningtime;
- }
+ /// send a sound for the client to play
+ void sound(const std::string name);
/*----- mutators -------------------------------------------------- */
@@ -253,14 +249,17 @@ public:
std::list<EntityControlable *> assets;
private:
+ // associated network client
+ NetClient *player_client;
+
// entity the Player is currently controling
- EntityControlable *player_control;
+ EntityControlable *player_control;
// entity the Player is currently looking at
- Entity *player_view;
+ Entity *player_view;
// current mission target
- Entity *player_mission_target;
+ Entity *player_mission_target;
// the zone the player is currently in
Zone *player_zone;