Пример #1
0
        public void Receive(Beetle.Express.IServer server, Beetle.Express.ChannelReceiveEventArgs e)
        {
            ArraySegment <byte> buffer = new ArraySegment <byte>(e.Data.Array, e.Data.Offset, e.Data.Count);
            object      message        = Models.ProtobufPacket.Deserialize(buffer);
            MessageTalk mt             = new MessageTalk();

            mt.Message = message;
            mt.Factory = mFactory;
            GetDispatch().Add(mt);
        }
 public static void SendTalk(MessageTalk msg)
 {
     MessageControl.SendTalk(msg);
 }
 public static void ReceiveTalk(MessageTalk msg)
 {
     GameFlow.OnTalk(msg);
 }
Пример #4
0
 public void Receive(Beetle.Express.IServer server, Beetle.Express.ChannelReceiveEventArgs e)
 {
     ArraySegment<byte> buffer = new ArraySegment<byte>(e.Data.Array, e.Data.Offset, e.Data.Count);
     object message = Models.ProtobufPacket.Deserialize(buffer);
     MessageTalk mt = new MessageTalk();
     mt.Message = message;
     mt.Factory = mFactory;
     GetDispatch().Add(mt);
     
 }
Пример #5
0
 public static void OnTalk(MessageTalk msg)
 {
     msg.Name = playerControl.GetNameById(msg.Id);
     playerControl.OnTalk(msg.Id, msg.Message);
     GameFlowControl.SendTalk(msg);
 }