public int ZhengBaRequestEnter(int roleId, int gameId, EZhengBaEnterType enter) { ITianTiService kuaFuService = GetKuaFuService(); if (null != kuaFuService) { try { return(kuaFuService.ZhengBaRequestEnter(roleId, gameId, enter)); } catch (System.Exception ex) { ResetKuaFuService(); } } return(StdErrorCode.Error_Server_Internal_Error); }
public int ZhengBaRequestEnter(int roleId, int gameId, EZhengBaEnterType enter) { lock (Mutex) { if (StateMachine.GetCurrState() != ZhengBaStateMachine.StateType.NotifyEnter) { return(StdErrorCode.Error_Not_In_valid_Time); } JoinRolePkData roleData = TodayJoinRoleDatas.Find(_r => _r.RoleID == roleId && _r.CurrGameID == gameId); ZhengBaPkLogData logData = null; ThisLoopPkLogs.TryGetValue(gameId, out logData); if (roleData == null || logData == null) { return(StdErrorCode.Error_Operation_Denied); } if (!roleData.WaitReqEnter) { return(StdErrorCode.Error_Operation_Denied); } roleData.WaitReqEnter = false; roleData.WaitKuaFuLogin = true; if (enter == EZhengBaEnterType.Mirror) { if (logData.RoleID1 == roleId) { logData.IsMirror1 = true; } else if (logData.RoleID2 == roleId) { logData.IsMirror2 = true; } AsyncEvQ.Enqueue(new AsyncDataItem(KuaFuEventTypes.ZhengBaMirrorFight, new ZhengBaMirrorFightData() { RoleId = roleId, GameId = gameId, ToServerId = roleData.ToServerID })); } } return(StdErrorCode.Error_Success_No_Info); }
public int ZhengBaRequestEnter(int roleId, int gameId, EZhengBaEnterType enter) { lock (this.Mutex) { if (this.StateMachine.GetCurrState() != ZhengBaStateMachine.StateType.NotifyEnter) { return(-2001); } ZhengBaManagerK.JoinRolePkData roleData = this.TodayJoinRoleDatas.Find((ZhengBaManagerK.JoinRolePkData _r) => _r.RoleID == roleId && _r.CurrGameID == gameId); ZhengBaPkLogData logData = null; this.ThisLoopPkLogs.TryGetValue(gameId, out logData); if (roleData == null || logData == null) { return(-12); } if (!roleData.WaitReqEnter) { return(-12); } roleData.WaitReqEnter = false; roleData.WaitKuaFuLogin = true; if (enter == EZhengBaEnterType.Mirror) { if (logData.RoleID1 == roleId) { logData.IsMirror1 = true; } else if (logData.RoleID2 == roleId) { logData.IsMirror2 = true; } this.AsyncEvQ.Enqueue(new AsyncDataItem(KuaFuEventTypes.ZhengBaMirrorFight, new object[] { new ZhengBaMirrorFightData { RoleId = roleId, GameId = gameId, ToServerId = roleData.ToServerID } })); } } return(0); }
public int ZhengBaRequestEnter(int roleId, int gameId, EZhengBaEnterType enter) { return(ZhengBaManagerK.Instance().ZhengBaRequestEnter(roleId, gameId, enter)); }