/* * 客户端接受聊天消息 */ public void HandleRecvTalkPacket(GCPushChat2Client chatMsg) { HistoryMsg msg = new HistoryMsg(chatMsg); //Handle Special Command Send From Server AddToRecvHistoryQue(msg); //UI Update if (recvMsgDelegate != null) { recvMsgDelegate(msg); } }
/* * Client Send Message Out */ public static void addTalkMsg(string msg, ChannelType channel) { if (msg.Length == 0) { return; } var myData = ObjectManager.objectManager.GetMyData(); var build = GCPushChat2Client.CreateBuilder(); build.PlayerId = ObjectManager.objectManager.GetMyServerID(); build.PlayerName = ObjectManager.objectManager.GetMyName(); build.PlayerLevel = myData.GetProp(CharAttribute.CharAttributeEnum.LEVEL); build.PlayerJob = ObjectManager.objectManager.GetMyJob(); build.PlayerVip = 0; build.TargetId = -1; build.Channel = (int)channel; build.ChatContent = msg; //msg.chatMsg = build.BuildPartial(); HistoryMsg hisMsg = new HistoryMsg(build.BuildPartial()); talk.AddToRecvHistoryQue(hisMsg); }
public HistoryMsg(GCPushChat2Client rm) { recvMsg = rm; }