Esempio n. 1
0
        public void SendMsg(Protomsg.MsgBase msg)
        {
            //UnityEngine.Debug.Log("msg:"+ msg.ToString());

            ByteBuf bb = new ByteBuf(msg.ToByteArray());

            this.Send(bb);
        }
Esempio n. 2
0
        public void SendHeartMsg()
        {
            Protomsg.MsgBase msg1 = new Protomsg.MsgBase();
            msg1.MsgType = "CS_Heart";
            ByteBuf bb = new ByteBuf(msg1.ToByteArray());

            //UnityEngine.Debug.Log("SendHeartMsg:"+ Tool.getMemory(this));
            this.Send(bb);

            m_SendHeartTime = Tool.GetTime();
        }
Esempio n. 3
0
        public void SendMsg(String modetype, String msgtype, IMessage msg)
        {
            Protomsg.MsgBase msg1 = new Protomsg.MsgBase();
            msg1.ModeType = modetype;
            msg1.MsgType  = msgtype;
            if (msg != null)
            {
                msg1.Datas = ByteString.CopyFrom(msg.ToByteArray());
            }


            ByteBuf bb = new ByteBuf(msg1.ToByteArray());

            this.Send(bb);
        }