public void SendMsg(Protomsg.MsgBase msg) { //UnityEngine.Debug.Log("msg:"+ msg.ToString()); ByteBuf bb = new ByteBuf(msg.ToByteArray()); this.Send(bb); }
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(); }
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); }