Planeshift
events.h
Go to the documentation of this file.
1 /*
2  * events.h
3  *
4  * Copyright (C) 2004 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  * Author: Keith Fulton <keith@planeshift.it>
19  */
20 
21 #ifndef EVENTS_H_Z
22 #define EVENTS_H_Z
23 
24 //=============================================================================
25 // Crystal Space Includes
26 //=============================================================================
27 
28 //=============================================================================
29 // Project Includes
30 //=============================================================================
31 #include "net/messages.h"
32 #include "economymanager.h"
33 
34 //=============================================================================
35 // Local Includes
36 //=============================================================================
37 
38 
39 class gemActor;
40 class gemObject;
41 
43 {
44 public:
47  float damage;
48 
49  psDamageEvent(gemActor* attack,gemActor* victim,float dmg);
50  psDamageEvent(MsgEntry* event);
51 
53 
60  virtual csString ToString(NetBase::AccessPointers* accessPointers);
61 };
62 
63 
65 {
66 public:
69 
70  psDeathEvent(gemActor* dead, gemActor* killer);
71  psDeathEvent(MsgEntry* event);
72 
74 
81  virtual csString ToString(NetBase::AccessPointers* accessPointers);
82 };
83 
84 
86 {
87 public:
90 
91  psTargetChangeEvent(gemActor* targeter, gemObject* targeted);
93 
95 
102  virtual csString ToString(NetBase::AccessPointers* accessPointers);
103 };
104 
105 
109 {
110 public:
111  psZPointsGainedEvent(gemActor* actor, const char* name, int gained, bool rankup);
113 
115 
122  virtual csString ToString(NetBase::AccessPointers* accessPointers);
123 
124 public:
127  bool rankUp;
128  csString skillName;
129 };
130 
131 
133 {
134 public:
135  psBuyEvent(PID from, const char* fromName, PID to, const char* toName, unsigned int item, const char* itemName, int stack, int quality, unsigned int price);
136  psBuyEvent(MsgEntry* event);
137 
139 
146  virtual csString ToString(NetBase::AccessPointers* accessPointers);
147 
151  csRef<TransactionEntity> trans;
152 };
153 
154 
156 {
157 public:
158  psSellEvent(PID from, const char* fromName, PID to, const char* toName, unsigned int item, const char* itemName, int stack, int quality, unsigned int price);
159  psSellEvent(MsgEntry* event);
160 
162 
169  virtual csString ToString(NetBase::AccessPointers* accessPointers);
170 
174  csRef<TransactionEntity> trans;
175 };
177 {
178 public:
179  psPickupEvent(PID to, const char* toName, unsigned int item, const char* itemName, int stack, int quality,unsigned int price);
180  psPickupEvent(MsgEntry* event);
181 
183 
190  virtual csString ToString(NetBase::AccessPointers* accessPointers);
191 
195  csRef<TransactionEntity> trans;
196 };
197 
199 {
200 public:
201  psDropEvent(PID from, const char* fromName, unsigned int item, const char* itemName, int stack, int quality,unsigned int price);
202  psDropEvent(MsgEntry* event);
203 
205 
212  virtual csString ToString(NetBase::AccessPointers* accessPointers);
213 
217  csRef<TransactionEntity> trans;
218 };
219 
221 {
222 public:
223  psLootEvent(PID from, const char* fromName, PID to, const char* toName, unsigned int item, const char* itemName, int stack, int quality, unsigned int price);
224  psLootEvent(MsgEntry* event);
225 
227 
234  virtual csString ToString(NetBase::AccessPointers* accessPointers);
235 
239  csRef<TransactionEntity> trans;
240 };
241 
242 
248 {
249 protected:
251 
252 public:
253  psConnectEvent(int clientID);
254  psConnectEvent(MsgEntry* event);
255 
257 
264  virtual csString ToString(NetBase::AccessPointers* accessPointers);
265 };
266 
267 
273 {
274 protected:
276 
277 public:
278  psMovementEvent(int clientID);
279  psMovementEvent(MsgEntry* event);
280 
282 
289  virtual csString ToString(NetBase::AccessPointers* accessPointers);
290 };
291 
292 
298 {
299 public:
300  enum Type
301  {
302  UNKNOWN=0,
304  SPAWN_MOVE
305  };
306 
309 
310 
311  psGenericEvent(int clientID, psGenericEvent::Type type);
312  psGenericEvent(MsgEntry* event);
313 
315 
322  virtual csString ToString(NetBase::AccessPointers* accessPointers);
323 
324 };
325 
326 #endif
gemActor * deadActor
Definition: events.h:67
bool rankUp
The amount that was gained.
Definition: events.h:127
int client_id
Definition: events.h:308
csRef< TransactionEntity > trans
Contains informations about the specific event and will be taken in ownership by the economymanager f...
Definition: events.h:217
This message broadcasts client connect events to anyone who needs them, namely the TutorialManager...
Definition: events.h:247
gemObject * target
Definition: events.h:89
Type eventType
Definition: events.h:307
csRef< TransactionEntity > trans
Contains informations about the specific event and will be taken in ownership by the economymanager f...
Definition: events.h:195
Struct used by MessageCracker and ToString to distribute a number of access pointers.
Definition: netbase.h:125
This message broadcasts several different events to anyone who needs them, namely the TutorialManager...
Definition: events.h:297
This message broadcasts the first movement event to anyone who needs them, namely the TutorialManager...
Definition: events.h:272
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
csRef< TransactionEntity > trans
Contains informations about the specific event and will be taken in ownership by the economymanager f...
Definition: events.h:151
int client_id
Definition: events.h:250
csString skillName
True if the amount gained caused a rank up.
Definition: events.h:128
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
gemActor * actor
Definition: events.h:125
gemActor * character
Definition: events.h:88
gemActor * killer
Definition: events.h:68
csRef< TransactionEntity > trans
Contains informations about the specific event and will be taken in ownership by the economymanager f...
Definition: events.h:174
psDamageEvent(gemActor *attack, gemActor *victim, float dmg)
All net messages inherit from this class.
Definition: messages.h:343
gemActor * attacker
Definition: events.h:45
gemActor * target
Definition: events.h:46
csRef< TransactionEntity > trans
Contains informations about the specific event and will be taken in ownership by the economymanager f...
Definition: events.h:239
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
Definition: gem.h:314
Event when a player gains some Z (Practice) points.
Definition: events.h:108
float damage
Definition: events.h:47
virtual csString ToString(NetBase::AccessPointers *accessPointers)
Convert the message into human readable string.
int amountGained
The player that gained the points.
Definition: events.h:126