using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Google.Protobuf.WellKnownTypes; namespace SogClient { class TestFriendListChgNotify:ITestMessage { public CSFriendListChgNotify m_friendListChgNotify; public TestFriendListChgNotify(Player player) : base(player) { } public override void HandlerMsg(RequestPacket packet) { switch (packet.MsgID) { case (int)CSGameMsgID.FriendListChgNotify: TraceLog.Trace("TestFriendListChgNotify.HandlerMsg packet.MsgID:{0} packet.Msg: {1}", packet.MsgID, packet.Packet.ToString()); break; default: break; } } public override void RegisterMsg(TestHandlerMgr mgr) { mgr.RegisterPacketHandler((int)CSGameMsgID.FriendListChgNotify, this); } public override void Update(long nowSecond) { if (nowSecond - lastSendTime >= 40) { MakeMsg(); SendToServer(m_friendListChgNotify, (int)CSGameMsgID.FriendListChgNotify); lastSendTime = nowSecond; } } public override void MakeMsg() { if (m_friendListChgNotify == null) { m_friendListChgNotify = new CSFriendListChgNotify(); } m_friendListChgNotify.IsDelete = 0; DBFriendOne friendItem = new DBFriendOne(); friendItem.Uid = m_player.GetUid(); m_friendListChgNotify.Friend = friendItem; } } }