Пример #1
0
        public override void SendPacket(bool reliable, bool isWait = false)
        {
            base.SendPacket(isWait);
            var sendChatData = new ProtoData.ChatData( );

            sendChatData.index    = index;
            sendChatData.nickname = nick;
            sendChatData.msg      = msg;

            Send(OperationCode.Chat, BinSerializer.ConvertPacket(sendChatData));
            Debug.Log("[SendChat] Send");
        }
        public static void OnUpdateChat(ClientPeer peer, ProtoData.ChatData ChatData)
        {
            foreach (var client in TheLordServer.Instance.PeerList)
            {
                if (client.Equals(peer))
                {
                    continue;
                }

                EventData data = new EventData((byte)EventCode.UpdateChat);
                data.Parameters = BinSerializer.ConvertPacket(ChatData);
                client.SendEvent(data, new SendParameters( ));
            }
        }