public static GameLevel_FailReturnProto ToProto(byte[] buffer) { using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer)) { GameLevel_FailReturnProto proto = new GameLevel_FailReturnProto(); proto.IsSucess = ms.ReadBool(); return(proto); } }
/// <summary> /// 游戏关卡失败消息回调 /// </summary> /// <param name="p"></param> private void GameLevel_FailReturnProtoCallBack(byte[] p) { GameLevel_FailReturnProto proto = GameLevel_FailReturnProto.ToProto(p); if (proto.IsSucess) { Debug.Log("GameLevel_FailReturnProto IsSucess"); } }
public static GameLevel_FailReturnProto GetProto(byte[] buffer) { GameLevel_FailReturnProto proto = new GameLevel_FailReturnProto(); using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer)) { proto.IsSuccess = ms.ReadBool(); if (!proto.IsSuccess) { proto.MsgCode = ms.ReadInt(); } } return(proto); }
public static GameLevel_FailReturnProto GetProto(MMO_MemoryStream ms, byte[] buffer) { GameLevel_FailReturnProto proto = new GameLevel_FailReturnProto(); ms.SetLength(0); ms.Write(buffer, 0, buffer.Length); ms.Position = 0; proto.IsSuccess = ms.ReadBool(); if (!proto.IsSuccess) { proto.MsgCode = ms.ReadInt(); } return(proto); }