PageRenderTime 52ms CodeModel.GetById 29ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/TGame/TCommon/Message/MsgLogin.h

http://awoe.googlecode.com/
C++ Header | 523 lines | 415 code | 64 blank | 44 comment | 4 complexity | 44d47a1eb89f16d943ea4c5fc870d1c7 MD5 | raw file
  1//
  2//	Generated by lua
  3//	2009-2011	(C) Simplay Inc. Reserved
  4//
  5
  6#ifndef __MSG_Login_H__
  7#define __MSG_Login_H__
  8
  9#include "Message/MsgBase.h"
 10#include "Message/MsgCategory.h"
 11#include "CommonType.h"
 12
 13#pragma pack(push, 1)
 14
 15
 16//
 17//	Message Definition for PlayerInfo
 18struct PlayerInfo{
 19public:
 20	PlayerInfo()
 21	{
 22		pid = 1;
 23		sex = 0;
 24		hid = 0;
 25		headpic = 0;
 26		cid = 0;
 27		did = 0;
 28		sid = 0;
 29		lvl = 1;
 30		elvl = 0;
 31	}
 32
 33	virtual bool onEncode(MsgOStream& s) const
 34	{
 35		s<<pid;
 36		s<<name;
 37		s<<sex;
 38		s<<hid;
 39		s<<headpic;
 40		s<<cid;
 41		s<<did;
 42		s<<sid;
 43		s<<lvl;
 44		s<<elvl;
 45		return true;
 46	}
 47	virtual bool onDecode(MsgIStream& s)
 48	{
 49		s>>pid;
 50		s>>name;
 51		s>>sex;
 52		s>>hid;
 53		s>>headpic;
 54		s>>cid;
 55		s>>did;
 56		s>>sid;
 57		s>>lvl;
 58		s>>elvl;
 59		return true;
 60	}
 61
 62	int	pid;
 63	string	name;
 64	char	sex;
 65	short	hid;
 66	char	headpic;
 67	char	cid;
 68	char	did;
 69	char	sid;
 70	short	lvl;
 71	short	elvl;
 72};
 73
 74
 75//
 76//	Message Definition for SvrInfo
 77struct SvrInfo{
 78public:
 79	SvrInfo()
 80	{
 81		svrid = 1;
 82		state = 0;
 83	}
 84
 85	virtual bool onEncode(MsgOStream& s) const
 86	{
 87		s<<svrid;
 88		s<<name;
 89		s<<state;
 90		return true;
 91	}
 92	virtual bool onDecode(MsgIStream& s)
 93	{
 94		s>>svrid;
 95		s>>name;
 96		s>>state;
 97		return true;
 98	}
 99
100	char	svrid;
101	string	name;
102	char	state;
103};
104
105
106//
107//	Message Definition for LoginRequest
108//
109class MsgLoginRequest	: public MsgBase
110{
111public:
112	enum { Category = 10, Id = 5 };
113
114	MsgLoginRequest()
115		:MsgBase(Category, Id)
116	{
117	}
118
119
120	virtual bool encode(MsgOStream& s)
121	{
122		s<<authid;
123		return true;
124	}
125	virtual bool decode(MsgIStream& s)
126	{
127		s>>authid;
128		return true;
129	}
130public:
131	__int64	authid;
132};
133
134//
135//	Message Definition for LoginResponse
136//
137class MsgLoginResponse	: public MsgBase
138{
139public:
140	enum { Category = 10, Id = 6 };
141
142	MsgLoginResponse()
143		:MsgBase(Category, Id)
144	{
145	}
146
147
148	virtual bool encode(MsgOStream& s)
149	{
150		s<<errcode;
151		short list_size = playerlist.size();
152		s<<list_size;
153		if (list_size>0)
154		{
155			for (PlayerInfoList::iterator it = playerlist.begin(); it!=playerlist.end(); it++)
156			{
157				s<<*it;
158			}
159		}
160		return true;
161	}
162	virtual bool decode(MsgIStream& s)
163	{
164		s>>errcode;
165		short list_size = 0;
166		s>>list_size;
167		playerlist.clear();
168		while(list_size>0)
169		{
170			list_size--;
171			PlayerInfo val;
172			s>>val;
173			playerlist.push_back(val);
174		}
175		return true;
176	}
177public:
178	short	errcode;
179	typedef std::vector< PlayerInfo > PlayerInfoList;
180	PlayerInfoList	playerlist;
181};
182
183//
184//	Message Definition for EnterGameRequest
185//
186class MsgEnterGameRequest	: public MsgBase
187{
188public:
189	enum { Category = 10, Id = 7 };
190
191	MsgEnterGameRequest()
192		:MsgBase(Category, Id)
193	{
194	}
195
196
197	virtual bool encode(MsgOStream& s)
198	{
199		s<<pid;
200		return true;
201	}
202	virtual bool decode(MsgIStream& s)
203	{
204		s>>pid;
205		return true;
206	}
207public:
208	int	pid;
209};
210
211//
212//	Message Definition for EnterGameResponse
213//
214class MsgEnterGameResponse	: public MsgBase
215{
216public:
217	enum { Category = 10, Id = 8 };
218
219	MsgEnterGameResponse()
220		:MsgBase(Category, Id)
221	{
222	}
223
224
225	virtual bool encode(MsgOStream& s)
226	{
227		s<<errcode;
228		return true;
229	}
230	virtual bool decode(MsgIStream& s)
231	{
232		s>>errcode;
233		return true;
234	}
235public:
236	short	errcode;
237};
238
239//
240//	Message Definition for CreatePlayerRequest
241//
242class MsgCreatePlayerRequest	: public MsgBase
243{
244public:
245	enum { Category = 10, Id = 9 };
246
247	MsgCreatePlayerRequest()
248		:MsgBase(Category, Id)
249	{
250	}
251
252
253	virtual bool encode(MsgOStream& s)
254	{
255		s<<name;
256		s<<sex;
257		s<<hero;
258		s<<headpic;
259		s<<cid;
260		s<<reserve;
261		return true;
262	}
263	virtual bool decode(MsgIStream& s)
264	{
265		s>>name;
266		s>>sex;
267		s>>hero;
268		s>>headpic;
269		s>>cid;
270		s>>reserve;
271		return true;
272	}
273public:
274	string	name;
275	char	sex;
276	short	hero;
277	char	headpic;
278	char	cid;
279	char	reserve;
280};
281
282//
283//	Message Definition for CreatePlayerResponse
284//
285class MsgCreatePlayerResponse	: public MsgBase
286{
287public:
288	enum { Category = 10, Id = 10 };
289
290	MsgCreatePlayerResponse()
291		:MsgBase(Category, Id)
292	{
293		did = 0;
294		sid = 0;
295	}
296
297
298	virtual bool encode(MsgOStream& s)
299	{
300		s<<errcode;
301		s<<pid;
302		s<<did;
303		s<<sid;
304		return true;
305	}
306	virtual bool decode(MsgIStream& s)
307	{
308		s>>errcode;
309		s>>pid;
310		s>>did;
311		s>>sid;
312		return true;
313	}
314public:
315	short	errcode;
316	int	pid;
317	char	did;
318	char	sid;
319};
320
321//
322//	Message Definition for DeletePlayerRequest
323//
324class MsgDeletePlayerRequest	: public MsgBase
325{
326public:
327	enum { Category = 10, Id = 11 };
328
329	MsgDeletePlayerRequest()
330		:MsgBase(Category, Id)
331	{
332	}
333
334
335	virtual bool encode(MsgOStream& s)
336	{
337		s<<pid;
338		return true;
339	}
340	virtual bool decode(MsgIStream& s)
341	{
342		s>>pid;
343		return true;
344	}
345public:
346	int	pid;
347};
348
349//
350//	Message Definition for DeletePlayerResponse
351//
352class MsgDeletePlayerResponse	: public MsgBase
353{
354public:
355	enum { Category = 10, Id = 12 };
356
357	MsgDeletePlayerResponse()
358		:MsgBase(Category, Id)
359	{
360	}
361
362
363	virtual bool encode(MsgOStream& s)
364	{
365		s<<errcode;
366		s<<pid;
367		return true;
368	}
369	virtual bool decode(MsgIStream& s)
370	{
371		s>>errcode;
372		s>>pid;
373		return true;
374	}
375public:
376	short	errcode;
377	int	pid;
378};
379
380//
381//	Message Definition for AuthRequest
382//
383class MsgAuthRequest	: public MsgBase
384{
385public:
386	enum { Category = 10, Id = 1 };
387
388	MsgAuthRequest()
389		:MsgBase(Category, Id)
390	{
391	}
392
393
394	virtual bool encode(MsgOStream& s)
395	{
396		s<<name;
397		s<<pwd;
398		return true;
399	}
400	virtual bool decode(MsgIStream& s)
401	{
402		s>>name;
403		s>>pwd;
404		return true;
405	}
406public:
407	string	name;
408	string	pwd;
409};
410
411//
412//	Message Definition for AuthResponse
413//
414class MsgAuthResponse	: public MsgBase
415{
416public:
417	enum { Category = 10, Id = 2 };
418
419	MsgAuthResponse()
420		:MsgBase(Category, Id)
421	{
422	}
423
424
425	virtual bool encode(MsgOStream& s)
426	{
427		s<<errcode;
428		s<<authid;
429		short list_size = svrlist.size();
430		s<<list_size;
431		if (list_size>0)
432		{
433			for (SvrInfoList::iterator it = svrlist.begin(); it!=svrlist.end(); it++)
434			{
435				s<<*it;
436			}
437		}
438		return true;
439	}
440	virtual bool decode(MsgIStream& s)
441	{
442		s>>errcode;
443		s>>authid;
444		short list_size = 0;
445		s>>list_size;
446		svrlist.clear();
447		while(list_size>0)
448		{
449			list_size--;
450			SvrInfo val;
451			s>>val;
452			svrlist.push_back(val);
453		}
454		return true;
455	}
456public:
457	short	errcode;
458	__int64	authid;
459	typedef std::vector< SvrInfo > SvrInfoList;
460	SvrInfoList	svrlist;
461};
462
463//
464//	Message Definition for SelectSvrRequest
465//
466class MsgSelectSvrRequest	: public MsgBase
467{
468public:
469	enum { Category = 10, Id = 3 };
470
471	MsgSelectSvrRequest()
472		:MsgBase(Category, Id)
473	{
474	}
475
476
477	virtual bool encode(MsgOStream& s)
478	{
479		s<<svrid;
480		return true;
481	}
482	virtual bool decode(MsgIStream& s)
483	{
484		s>>svrid;
485		return true;
486	}
487public:
488	char	svrid;
489};
490
491//
492//	Message Definition for SelectSvrResponse
493//
494class MsgSelectSvrResponse	: public MsgBase
495{
496public:
497	enum { Category = 10, Id = 4 };
498
499	MsgSelectSvrResponse()
500		:MsgBase(Category, Id)
501	{
502	}
503
504
505	virtual bool encode(MsgOStream& s)
506	{
507		s<<ip;
508		return true;
509	}
510	virtual bool decode(MsgIStream& s)
511	{
512		s>>ip;
513		return true;
514	}
515public:
516	string	ip;
517};
518
519
520
521#pragma pack(pop)
522
523#endif