00001 /*************************************************************************** 00002 * Copyright (C) 2005 by yunfan * 00003 * yunfan_zg@163.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef LIBEVALEVEL_H 00022 #define LIBEVALEVEL_H 00023 00024 #include "evapacket.h" 00025 #include <list> 00026 00027 class EvaGetLevelPacket : public OutPacket { 00028 public: 00029 EvaGetLevelPacket() {} 00030 EvaGetLevelPacket(const std::list<int> &l); 00031 EvaGetLevelPacket(const EvaGetLevelPacket &rhs); 00032 virtual ~EvaGetLevelPacket() {}; 00033 00034 EvaGetLevelPacket &operator=(const EvaGetLevelPacket &rhs); 00035 00036 const std::list<int> &getList() const { return friends; } 00037 void setList(const std::list<int> &l) { friends = l; } 00038 00039 protected: 00040 virtual int putBody(unsigned char *buf); 00041 private: 00042 std::list<int> friends; 00043 }; 00044 00045 typedef struct LevelItem{ 00046 int qqNum; 00047 unsigned int onlineTime; // note: the time is presented in seconds 00048 unsigned short level; 00049 unsigned short timeRemainder; // note: the time is presented in hours 00050 } LevelUserItem; 00051 00052 class EvaGetLevelReplyPacket: public InPacket 00053 { 00054 public: 00055 EvaGetLevelReplyPacket() {} 00056 EvaGetLevelReplyPacket(unsigned char *buf, int len); 00057 EvaGetLevelReplyPacket(const EvaGetLevelReplyPacket &rhs); 00058 virtual ~EvaGetLevelReplyPacket(){}; 00059 00060 const unsigned char getReplyCode() const { return replyCode; } 00061 const std::list<LevelUserItem> &getLevelList() const { return friends; } 00062 00063 EvaGetLevelReplyPacket &operator=(const EvaGetLevelReplyPacket &rhs); 00064 protected: 00065 virtual void parseBody() ; 00066 private: 00067 unsigned char replyCode; 00068 std::list<LevelUserItem> friends; 00069 }; 00070 00071 #endif 00072
1.4.4