Planeshift
charmessages.h
Go to the documentation of this file.
1 #ifndef PS_CHAR_MESSAGES_H
2 #define PS_CHAR_MESSAGES_H
3 
4 #include <csutil/parray.h>
5 #include "net/messages.h"
6 
11 // GENDER VALUES FOR CHARACTERS
19 };
21 
34 };
35 //NOTE: Remember to update the locationString in pstrait.cpp each time something is changed here
36 
38 
39 
40 
42 
46 {
47 public:
49  psCharApprovedMessage( uint32_t clientnum );
50 
53 
55 
62  virtual csString ToString(NetBase::AccessPointers* accessPointers);
63 };
64 
65 
66 //--------------------------------------------------------------------------
67 
68 
69 
74 {
75 public:
78  {
84  FAILED_ACCOUNT
85  };
86 
88  psCharRejectedMessage ( uint32_t clientnum, int type=UNKNOWN, const char *msg="Unknown error" );
89 
92 
94 
101  virtual csString ToString(NetBase::AccessPointers* accessPointers);
102 
105 
107  csString errorMesg;
108 };
109 
110 
111 //--------------------------------------------------------------------------
112 
117 {
118 public:
119  struct Attribute
120  {
121  csString name;
122  int value;
123  };
124 
125  psCharVerificationMesg( uint32_t client );
127 
129 
136  virtual csString ToString(NetBase::AccessPointers* accessPointers);
137 
142  void AddStat( int value, const char* attributeName );
143  void AddSkill( int value, const char* attributeName );
144 
145  // Build the message
146  void Construct();
147 
148  csArray<psCharVerificationMesg::Attribute> stats;
149  csArray<psCharVerificationMesg::Attribute> skills;
150 
151  // Used in the creation of message.
152  size_t runningSize;
153 
154  // target of message
155  uint32_t clientnum;
156 };
157 
158 //--------------------------------------------------------------------------
159 
161 {
162 public:
163  psCharUploadMessage( bool verify, const char* name, const char* lastname, int race, int gender,
164  csArray<uint32_t> choices, int motherMod, int fatherMod, csArray<uint32_t> lifeEvents,
165  int selectedFace, int selectedHairStyle, int selectedBeardStyle,
166  int selectedHairColour, int selectedSkinColour, const char* bio, const char* path );
167 
169 
171 
178  virtual csString ToString(NetBase::AccessPointers* accessPointers);
179 
180 
181 public:
182  bool verify;
183  csString name;
184  csString lastname;
185  int race;
186  int gender;
187 
188  csArray<uint32_t> choices;
189  csArray<uint32_t> lifeEvents;
190 
196 
199 
200  csString bio;
201  csString path;
202 };
203 
204 //--------------------------------------------------------------------------
205 
212 {
221 };
222 
226 {
227  int id;
228  csString name;
229  csString description;
231  int cpCost;
232 };
233 
242 {
243 public:
244 
248  psCreationChoiceMsg( int listener );
249 
253 
261  psCreationChoiceMsg( int clientTo, int totalChoices, int listener );
262 
264 
271  virtual csString ToString(NetBase::AccessPointers* accessPointers);
272 
282  void AddChoice( int id, const char* name, const char* description, int area, int cost );
283 
285  void ConstructMessage();
286 
288  csArray<CreationChoice> choices;
289 };
290 
291 
292 //------------------------------------------------------------------------------
293 
297 {
298 public:
299  int id;
300  csString name;
301  csString description;
302  csArray<int> adds;
303  csArray<int> removes;
304  int common;
305  int cpCost;
306 };
307 
308 
314 {
315 public:
318  psLifeEventMsg();
319 
320  psLifeEventMsg( uint32_t client );
321 
322  psLifeEventMsg( MsgEntry* me );
323 
325 
332  virtual csString ToString(NetBase::AccessPointers* accessPointers);
333 
334  void AddEvent( LifeEventChoice *choice );
335 
336  void ConstructMessage();
337 
338  csPDelArray<LifeEventChoice> choices;
339 
340  uint32_t toclient;
341  size_t runningSize;
342 };
343 
346 #endif
347 
348 
349 
Defines the structure needed to send a life event across the network.
Definition: charmessages.h:296
csArray< int > adds
Description of choice ( will be displayed )
Definition: charmessages.h:302
csArray< psCharVerificationMesg::Attribute > stats
Definition: charmessages.h:148
int common
List of chices current choice removes.
Definition: charmessages.h:304
Opposite of psCharApprovedMessage.
Definition: charmessages.h:73
csArray< uint32_t > lifeEvents
Definition: charmessages.h:189
Struct used by MessageCracker and ToString to distribute a number of access pointers.
Definition: netbase.h:125
A Creation Choice that the client can make.
Definition: charmessages.h:225
int errorType
The error type ( from enum )
Definition: charmessages.h:104
virtual csString ToString(NetBase::AccessPointers *accessPointers)
Convert the message into human readable string.
Used to confirm that a character has been uploaded.
Definition: charmessages.h:45
csArray< int > removes
List of choices current choice can add.
Definition: charmessages.h:303
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
csArray< uint32_t > choices
Definition: charmessages.h:188
int cpCost
This is a base choice not dependent on others.
Definition: charmessages.h:305
csString description
Definition: charmessages.h:229
PSTRAIT_LOCATION
Define the player controled base customization that their model can have.
Definition: charmessages.h:24
Defines a Life Event message.
Definition: charmessages.h:313
Message that has a list of the stats and skills that will be created for a character.
Definition: charmessages.h:116
All net messages inherit from this class.
Definition: messages.h:343
PSCHARACTER_GENDER
Definition: charmessages.h:14
csString errorMesg
Holds error message from the server.
Definition: charmessages.h:107
psCharApprovedMessage(uint32_t clientnum)
Constructed on server for client.
csPDelArray< LifeEventChoice > choices
Definition: charmessages.h:338
CreationAreas
This is a list of all the possible choice areas.
Definition: charmessages.h:211
ErrorTypes
Possible Character Rejection Reasons.
Definition: charmessages.h:77
uint32_t toclient
Definition: charmessages.h:340
csRef< MsgEntry > msg
Definition: messages.h:348
csArray< psCharVerificationMesg::Attribute > skills
Definition: charmessages.h:149
csArray< CreationChoice > choices
Holds a list of all the choices in this message.
Definition: charmessages.h:288
csString description
Name of choice ( will be displayed in list box )
Definition: charmessages.h:301
csString name
The DB id.
Definition: charmessages.h:300
A general message class for sending a character creation choice.
Definition: charmessages.h:241
size_t runningSize
Definition: charmessages.h:341