using Protobuf; using UnityEngine; namespace KTGMGemClient { public class CommonDebugHelper { public static void Debug(object str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.Log(str); } } public static void DebugLong(string str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.Log("************** " + str + " **************"); } } public static void DebugError(string str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.LogError(str); } } public static void DebugSocket(int Errorcode) { string log = ""; ErrorCode code = (ErrorCode)Errorcode; if (GameConfig.OpenDebug) { switch (code) { case ErrorCode.Success: log = "成功"; UnityEngine.Debug.Log("成功"); break; case ErrorCode.ChannelIdNoExist: log = "************** 渠道ID不存在 **************"; UnityEngine.Debug.LogWarning("************** 渠道ID不存在 **************"); break; case ErrorCode.UserNameInvalid: log = "************** 账号名太短 **************"; UnityEngine.Debug.LogWarning("************** 账号名太短 **************"); break; case ErrorCode.UserPassWordInvalid: log = "************** 账号密码不正确 **************"; UnityEngine.Debug.LogWarning("************** 账号密码不正确 **************"); break; case ErrorCode.UnknowError: log = "************** 内部错误 **************"; UnityEngine.Debug.LogWarning("************** 内部错误 **************"); break; case ErrorCode.InputInvalid: log = "************** 参数错误 **************"; UnityEngine.Debug.LogWarning("************** 参数错误 **************"); break; case ErrorCode.Timeout: log = "************** 超时 **************"; UnityEngine.Debug.LogWarning("************** 超时 **************"); break; case ErrorCode.SessionKeyInvalid: log = "************** 登陆失败,SessionKey错误 **************"; UnityEngine.Debug.LogWarning("************** 登陆失败,SessionKey错误 **************"); break; case ErrorCode.LoginNoUser: log = "************** 没有角色,请创建 **************"; UnityEngine.Debug.LogWarning("************** 没有角色,请创建 **************"); break; case ErrorCode.NotEnoughMoney: log = "************** 金币不足 **************"; UnityEngine.Debug.LogWarning("************** 金币不足 **************"); break; case ErrorCode.NotEnoughGold: log = "************** 钻石不足 **************"; UnityEngine.Debug.LogWarning("************** 钻石不足 **************"); break; case ErrorCode.NotEnoughGem: log = "************** 宝石不足 **************"; UnityEngine.Debug.LogWarning("************** 宝石不足 **************"); break; case ErrorCode.NotFoundFriend: log = "************** 好友没有找到 **************"; UnityEngine.Debug.LogWarning("************** 好友没有找到 **************"); break; case ErrorCode.AlreadyFriend: log = "************** 已经是好友了 **************"; UnityEngine.Debug.LogWarning("************** 已经是好友了 **************"); break; case ErrorCode.InBlockFriend: log = "************** 黑名单不能添加好友 **************"; UnityEngine.Debug.LogWarning("************** 黑名单不能添加好友 **************"); break; case ErrorCode.MaxFriend: log = "************** 好友已经达到上限 **************"; UnityEngine.Debug.LogWarning("************** 好友已经达到上限 **************"); break; case ErrorCode.MaxNickName: log = "************** 昵称大于最大长度 **************"; UnityEngine.Debug.LogWarning("************** 昵称大于最大长度 **************"); break; case ErrorCode.InvalidNickName: log = "************** 昵称有非法字符 **************"; UnityEngine.Debug.LogWarning("************** 昵称有非法字符 **************"); break; case ErrorCode.MaxStoreLimit: log = "************** !购买失败,超过最大限制 **************"; UnityEngine.Debug.LogWarning("************** !购买失败,超过最大限制 **************"); break; case ErrorCode.NotEnoughStoreBuy: log = "************** !购买失败,货币不足 **************"; UnityEngine.Debug.LogWarning("************** !购买失败,货币不足 **************"); break; case ErrorCode.NotOpenPassPort: log = "************** !高级通行证购买失败,活动未开启 **************"; UnityEngine.Debug.LogWarning("************** !高级通行证购买失败,活动未开启 **************"); break; case ErrorCode.AlreadyPassPort: log = "************** !高级通行证购买失败,已经购买了 **************"; UnityEngine.Debug.LogWarning("************** !高级通行证购买失败,已经购买了 **************"); break; case ErrorCode.NeedVipPassPortTakeItem: log = "************** !领取通行证奖励失败,不是高级通行证 **************"; UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,不是高级通行证 **************"); break; case ErrorCode.NeedLevelPassPortTakeItem: log = "************** !领取通行证奖励失败,等级不足 **************"; UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,等级不足 **************"); break; case ErrorCode.AlreadyPassPortTakeItem: log = "************** !领取通行证奖励失败,已经领取了 **************"; UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,已经领取了 **************"); break; case ErrorCode.InvalidPassPortBuyLevel: log = "************** !购买通行证等级失败,购买等级小于当前等级 **************"; UnityEngine.Debug.LogWarning("************** !购买通行证等级失败,购买等级小于当前等级 **************"); break; case ErrorCode.HasUnlockArenaBox: log = "************** ! 解锁失败,已经解锁了 **************"; UnityEngine.Debug.LogWarning("************** ! 解锁失败,已经解锁了 **************"); break; case ErrorCode.OtherUnlockingArenaBox: log = "************** ! 解锁失败,另一个在解锁中 **************"; UnityEngine.Debug.LogWarning("************** ! 解锁失败,另一个在解锁中 **************"); break; case ErrorCode.NotTimeTakeArenaBox: log = "************** ! 开宝箱失败,时间没到 **************"; UnityEngine.Debug.LogWarning("************** ! 开宝箱失败,时间没到 **************"); break; } //UIManager.Instance.ShowWarningWind(log); } } } }