Planeshift
cmdusers.h
Go to the documentation of this file.
1 /*
2  * cmdusers.h - Author: Keith Fulton
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __CMDUSERS_H__
21 #define __CMDUSERS_H__
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 
26 //=============================================================================
27 // Project Includes
28 //=============================================================================
29 #include "net/cmdbase.h"
30 
31 //=============================================================================
32 // Local Includes
33 //=============================================================================
34 
35 
36 class MsgHandler;
37 class GEMClientObject;
38 
39 // Maximum range for the nearby target searches. NOTE: If you change this,
40 // update the command documentation in the constructor.
41 #define NEARBY_TARGET_MAX_RANGE 50
42 
45 class psUserCommands : public psCmdBase
46 {
47 
48 public:
49  psUserCommands(ClientMsgHandler* mh,CmdHandler *ch,iObjectRegistry* obj);
50  virtual ~psUserCommands();
51 
52  static void HandleSlay(bool answeredYes, void *data);
53 
54  // Load emotes from xml.
55  bool LoadEmotes();
56 
57  // iCmdSubscriber interface
58  virtual const char *HandleCommand(const char *cmd);
59 
60  // iNetSubscriber interface
61  virtual void HandleMessage(MsgEntry *msg);
62 
63 
64 protected:
65  // Directions for a search.
67  {
71  };
72 
74  {
82  };
83 
84  GEMClientObject* FindEntityWithName(const char *name);
85 
97  csString FormatTarget(const csString& target = "target");
98 
99  void UpdateTarget(SearchDirection searchDirection,
100  EntityTypes entityType,
101  const char* name);
102 
103 
105  struct EMOTE
106  {
107  csString command;
108  csString general;
109  csString specific;
110  csString anim;
111  bool enabled;
112  };
113 
114  csArray<EMOTE> emoteList;
115 
117 };
118 
119 #endif
virtual void HandleMessage(MsgEntry *msg)
csString FormatTarget(const csString &target="target")
Returns a target string formatted to be sent in a message.
virtual ~psUserCommands()
void UpdateTarget(SearchDirection searchDirection, EntityTypes entityType, const char *name)
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
Handles messages to be sent out, connects to server and send those.
virtual const char * HandleCommand(const char *cmd)
Interprets a received message and executes the command.
Manages different commands that are player based in nature.
Definition: cmdusers.h:45
All net messages inherit from this class.
Definition: messages.h:343
csArray< EMOTE > emoteList
Definition: cmdusers.h:114
An object that the client knows about.
Definition: pscelclient.h:373
This class is the client&#39;s and server&#39;s main interface for either sending network messages out or get...
Definition: msghandler.h:106
bool enabled
changed type of enabled from csString to bool
Definition: cmdusers.h:111
psUserCommands(ClientMsgHandler *mh, CmdHandler *ch, iObjectRegistry *obj)
void AskToSlayBeforeSending(psMessageCracker *msg)
Struct to hold our emote data.
Definition: cmdusers.h:105
GEMClientObject * FindEntityWithName(const char *name)
static void HandleSlay(bool answeredYes, void *data)