Beispiel #1
0
        /// <summary>
        /// 改变角色的在某个游戏副本中的状态
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="state"></param>
        /// <param name="serverId">如果不知道,传0</param>
        /// <param name="gameId"></param>
        /// <returns></returns>
        public int GameFuBenRoleChangeState(int roleId, int state, int serverId = 0, int gameId = 0)
        {
            try
            {
                ITianTiService kuaFuService = GetKuaFuService();
                if (null != kuaFuService)
                {
                    if (serverId <= 0 || gameId <= 0)
                    {
                        KuaFuRoleData kuaFuRoleData;
                        if (!RoleId2RoleDataDict.TryGetValue(roleId, out kuaFuRoleData))
                        {
                            return((int)KuaFuRoleStates.None);
                        }

                        serverId = kuaFuRoleData.ServerId;
                        gameId   = kuaFuRoleData.GameId;
                    }

                    return(KuaFuService.GameFuBenRoleChangeState(serverId, roleId, gameId, state));
                }
            }
            catch (System.Exception ex)
            {
                LogManager.WriteExceptionUseCache(ex.ToString());
            }

            return(0);
        }