/TGame/TCommon/Message/MsgBase.cpp

http://awoe.googlecode.com/ · C++ · 73 lines · 60 code · 13 blank · 0 comment · 0 complexity · 84e6b7ad822552efefcfa153a2353750 MD5 · raw file

  1. #include "stdafx.h"
  2. #include "MsgBase.h"
  3. using namespace woe;
  4. MsgBase::MsgBase(char nCate, short nID)
  5. :m_nCate(nCate), m_nID(nID),m_nSessionID(0)
  6. {
  7. ;
  8. }
  9. void
  10. MsgBase::setMsgID(short nID)
  11. {
  12. m_nID = nID;
  13. }
  14. short
  15. MsgBase::getMsgID()const
  16. {
  17. return m_nID;
  18. }
  19. void
  20. MsgBase::setMsgCate(char nID)
  21. {
  22. m_nCate = nID;
  23. }
  24. char
  25. MsgBase::getMsgCate()const
  26. {
  27. return m_nCate;
  28. }
  29. void
  30. MsgBase::setSID(int nPID)
  31. {
  32. m_nSessionID = nPID;
  33. }
  34. int
  35. MsgBase::getSID()const
  36. {
  37. return m_nSessionID;
  38. }
  39. bool
  40. MsgBase::decode(MsgIStream& stream)
  41. {
  42. LOG_DEBUG("Fuck, Please don't call me! MsgBase::decode");
  43. return false;
  44. }
  45. bool
  46. MsgBase::encode(MsgOStream& stream)
  47. {
  48. LOG_DEBUG("Fuck, Please don't call me! MsgBase::encode");
  49. return false;
  50. }
  51. void
  52. MsgBase::dump()
  53. {
  54. LOG_DEBUG_V("Msg[%d, %d][SID:%d]", m_nCate, m_nID, m_nSessionID);
  55. }
  56. bool
  57. MsgBase::validate()
  58. {
  59. return true;
  60. }