src/network/MessageOut.h

00001 /*
00002  * Some code is taken from the mana world server project (http://themanaworld.org).
00003  */
00004 
00005 #ifndef MESSAGEOUT_H_
00006 #define MESSAGEOUT_H_
00007 
00008 #include "crc32.h"
00009 
00010 #include "Message.h"
00011 
00012 class NetPacket;
00013 
00014 using namespace std;
00020 class MessageOut : public Message
00021 {
00022 public:
00023 
00034         MessageOut(const message_type m_type);
00035         
00042         virtual ~MessageOut();
00043         
00052         void write1(char value);
00053         
00065     void write2(Uint16 value);
00066       
00078     void write4(Uint32 value);
00079     
00087     char* getData();
00088     
00096     Uint32 getDataSize();
00097     
00110      const NetPacket* getPacket();
00111      
00127      void writeString(const string &string, Sint16 length = -1);
00128         
00139         Uint32 addCRC();
00140         
00141 private:
00142  
00154         void expandData(Uint16 size);
00155 
00156         char* myData;                   
00157         Uint32 myDataSize;              
00158         Uint32 pos;                     
00159         NetPacket* myPacket;    
00160 };
00161 
00162 #endif /*MESSAGEOUT_H_*/

Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1