private void OnTestProtoCallBack(Role role, byte[] content) { TestProto proto = TestProto.GetProto(content); Console.WriteLine(string.Format("Id:{0} Name{1}", proto.Id, proto.Name)); proto.Id = 1002; proto.Name = "杨明"; role.Client_Socket.SendMsg(proto.ToArray()); }
/// <summary> /// 委托回调 /// </summary> /// <param name="protoCode"></param> /// <param name="buffer"></param> private void OnReceiveProtoCallBack(ushort protoCode, byte[] buffer) { Debug.Log("protoCode=" + protoCode); TestProto tmpprot = TestProto.GetProto(buffer); Debug.Log("tmpprotID=" + tmpprot.Id); Debug.Log("tmpprotName=" + tmpprot.Name); }