当前位置: 首页>>代码示例>>C#>>正文


C# Game.OnUnexpectedOperationError方法代码示例

本文整理汇总了C#中Game.OnUnexpectedOperationError方法的典型用法代码示例。如果您正苦于以下问题:C# Game.OnUnexpectedOperationError方法的具体用法?C# Game.OnUnexpectedOperationError怎么用?C# Game.OnUnexpectedOperationError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game的用法示例。


在下文中一共展示了Game.OnUnexpectedOperationError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnOperationReturn

        /// <summary>
        /// The on operation return.
        /// </summary>
        /// <param name="game">
        /// The mmo game.
        /// </param>
        /// <param name="response">
        /// The operation response.
        /// </param>
        public void OnOperationReturn(Game game, OperationResponse response)
        {
            if (response.ReturnCode == 0)
            {
                switch ((OperationCode)response.OperationCode)
                {
                    case OperationCode.RemoveInterestArea:
                    case OperationCode.AddInterestArea:
                        {
                            return;
                        }

                    case OperationCode.AttachInterestArea:
                        {
                            HandleEventInterestAreaAttached(game, response.Parameters);
                            return;
                        }

                    case OperationCode.DetachInterestArea:
                        {
                            HandleEventInterestAreaDetached(game);
                            return;
                        }

                    case OperationCode.SpawnItem:
                        {
                            HandleEventItemSpawned(game, response.Parameters);
                            return;
                        }

                    case OperationCode.RadarSubscribe:
                        {
                            return;
                        }
                }
            }

            game.OnUnexpectedOperationError(response);
        }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:48,代码来源:WorldEntered.cs

示例2: OnOperationReturn

        /// <summary>
        /// The on operation return.
        /// </summary>
        /// <param name="game">
        /// The mmo game.
        /// </param>
        /// <param name="response">
        /// The operation response.
        /// </param>
        public void OnOperationReturn(Game game, OperationResponse response)
        {
            if (response.ReturnCode == 0)
            {
                switch ((OperationCode)response.OperationCode)
                {
                    case OperationCode.RemoveInterestArea:
                    case OperationCode.AddInterestArea:
                        {
                            return;
                        }

                    case OperationCode.AttachInterestArea:
                        {
                            HandleEventInterestAreaAttached(game, response.Parameters);
                            return;
                        }

                    case OperationCode.DetachInterestArea:
                        {
                            HandleEventInterestAreaDetached(game);
                            return;
                        }

                    case OperationCode.SpawnItem:
                        {
                            HandleEventItemSpawned(game, response.Parameters);
                            return;
                        }

                    case OperationCode.RadarSubscribe:
                        {
                            return;
                        }

                    #region PopBloop Codes
    
                    case OperationCode.QuestJournal:
                        {
                            return;
                        }

                    case OperationCode.UpdateInventory:
                        {
                            // Every time we update the inventory, we should refetch the new one
                            Operations.FetchInventory(game);
                            return;
                        }

                    case OperationCode.FetchInventory:
                        {
                            HandleEventFetchInventory(game, response.Parameters);
                            return;
                        }

                    case OperationCode.UpdateEquipment:
                        {
                            Operations.FetchEquipments(game);
                            return;
                        }

                    case OperationCode.FetchEquipments:
                        {
                            HandleEventFetchEquipments(game, response.Parameters);
                            return;
                        }

                    case OperationCode.LevelInfo:
                        {
                            HandleGetLevelInfo(game, response.Parameters);
                            return;
                        }

                    #endregion
                }
            }

            game.Listener.LogDebug(game, "WorldEntered: Error with return code " + response.ReturnCode + " opcode = " + response.OperationCode);

            game.OnUnexpectedOperationError(response);
        }
开发者ID:azanium,项目名称:Klumbi-Unity,代码行数:90,代码来源:WorldEntered.cs

示例3: OnOperationReturn


//.........这里部分代码省略.........

                            return;
                        }

                    case OperationCode.GameItemMove:
                    case OperationCode.GameItemAnimate:
                        {
                            // DO NOTHING, THIS WILL BE HANDLED BY WORLDENTERED STATE
                            return;
                        }

                    #region ORIGINAL CODES

                    /*
                    case OperationCode.CreateWorld:
                        {
                            game.Avatar.EnterWorld();
                            return;
                        }

                    case OperationCode.EnterWorld:
                        {
                            var worldData = new WorldData
                                {
                                    Name = (string)response.Parameters[(byte)ParameterCode.WorldName],
                                    BottomRightCorner = (float[])response.Parameters[(byte)ParameterCode.BottomRightCorner],
                                    TopLeftCorner = (float[])response.Parameters[(byte)ParameterCode.TopLeftCorner],
                                    TileDimensions = (float[])response.Parameters[(byte)ParameterCode.TileDimensions]
                                };
                            game.SetStateWorldEntered(worldData);
                            return;
                        }

                     */

                    #endregion
                }
            }
            else
            {
                switch ((OperationCode)response.OperationCode)
                {
                    case OperationCode.LoadWorld:
                        {
                            // Do something when load world is failed
                            game.Listener.LogError(game, "LoadWorld failed: " + ((ReturnCode)response.ReturnCode).ToString() + " => " + response.DebugMessage);

                            if (game.Listener.IsDebugLogEnabled)
                            {
                                game.Listener.LogError(game, "LoadWorld failed, Game disconnected, Return Code: " + response.ReturnCode + ", OpCode: " + response.OperationCode + ", " +
                                    response.DebugMessage);
                            }

                            game.Listener.OnAuthenticated(game, false);

                            return;
                        }

                    case OperationCode.Login:
                    case OperationCode.Authenticate:
                        {
                            game.Listener.LogError(game, "Auth failed: " + ((ReturnCode)response.ReturnCode).ToString() + " => " + response.DebugMessage);
                            if (game.Listener.IsDebugLogEnabled)
                            {
                                game.Listener.LogError(game, "Authentication failed, Game disconnected, Return Code: " + response.ReturnCode + ", OpCode: " + response.OperationCode + ", " +
                                    response.DebugMessage);
                            }

                            game.Listener.OnAuthenticated(game, false);

                            return;
                        }

                    case OperationCode.EnterWorld:
                        {
                            if (game.Listener.IsDebugLogEnabled)
                            {
                                game.Listener.LogDebug(game, "OpCode: Invalid EnterWorld");
                            }

                            Operations.CreateWorld(
                                game, game.WorldData.Name, game.WorldData.TopLeftCorner, game.WorldData.BottomRightCorner, game.WorldData.TileDimensions);
                            return;
                        }

                    #region ORIGINAL CODES
                    /*
                    case OperationCode.EnterWorld:
                        {
                            Operations.CreateWorld(
                                game, game.WorldData.Name, game.WorldData.TopLeftCorner, game.WorldData.BottomRightCorner, game.WorldData.TileDimensions);
                            return;
                        }
                         */
                    #endregion
                }
            }

            game.OnUnexpectedOperationError(response);
        }
开发者ID:azanium,项目名称:PopBloop-Unity,代码行数:101,代码来源:Connected.cs

示例4: OnOperationReturn

        /// <summary>
        /// The on operation return.
        /// </summary>
        /// <param name="game">
        /// The game logic.
        /// </param>
        /// <param name="response">
        /// The response.
        /// </param>
        public void OnOperationReturn(Game game, OperationResponse response)
        {
            // by default, a return of 0 is "successfully done"
            if (response.ReturnCode == 0)
            {
                switch ((OperationCode)response.OperationCode)
                {
                    case OperationCode.CreateWorld:
                        {
                            game.Avatar.EnterWorld();
                            return;
                        }

                    case OperationCode.EnterWorld:
                        {
                            var worldData = new WorldData
                                {
                                    Name = (string)response.Parameters[(byte)ParameterCode.WorldName],
                                    BottomRightCorner = (float[])response.Parameters[(byte)ParameterCode.BottomRightCorner],
                                    TopLeftCorner = (float[])response.Parameters[(byte)ParameterCode.TopLeftCorner],
                                    TileDimensions = (float[])response.Parameters[(byte)ParameterCode.TileDimensions]
                                };
                            game.SetStateWorldEntered(worldData);
                            return;
                        }
                }
            }
            else
            {
                switch ((OperationCode)response.OperationCode)
                {
                    case OperationCode.EnterWorld:
                        {
                            Operations.CreateWorld(
                                game, game.WorldData.Name, game.WorldData.TopLeftCorner, game.WorldData.BottomRightCorner, game.WorldData.TileDimensions);
                            return;
                        }
                }
            }

            game.OnUnexpectedOperationError(response);
        }
开发者ID:ommziSolution,项目名称:PhotonServer,代码行数:51,代码来源:Connected.cs

示例5: OnOperationReturn

 public void OnOperationReturn(Game game, OperationResponse operationResponse)
 {
     game.OnUnexpectedOperationError(operationResponse);
 }
开发者ID:valentin-bas,项目名称:PhotonGame,代码行数:4,代码来源:WaitingForConnect.cs


注:本文中的Game.OnUnexpectedOperationError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。