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


C# IContainer.RefreshGhosts方法代码示例

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


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

示例1: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            #region 清理登录标记
            engineBll.ClearLoginState();
            #endregion

            #region modified by dean 找出过期的USER并停用AGENT&PLAYER

            StopChipIn(10*60*1000);//这里设定TIMER周期,根据现在的业务逻辑暂时设置为每10分钟执行一次

            #endregion

            //CommonFunction.DirPath = Server.MapPath(@"~\Resource\");
            CommonFunction.DirPath = ConfigurationManager.AppSettings["ResourceFile"];

            //Todo Unit Test
            //betEngine = new BetEngineStub();
            //Todo Integration Test
            betEngine = new BetEngine();

            // 启动时查询
            // 1.登录所有玩家  LoginPlayers(List<Player> 玩家列表);
            // 2.登录所有Agent LoginAgents(List<Agent> agent列表);
            // 3.Agent监测的ghost列表  RefreshGhosts(Agent agent对象,List<Ghost> ghosts agent监测的列表);
            // 4.设置player跟随的ghost(一对一) SetFollowRelationship(Player 玩家对象,Ghost 玩家跟注的ghost,Agent ghost所属的agent);

            List<Player> listPlayer = engineBll.getEnginePlayerFollowGhost();
            List<Agent> listAgent = engineBll.getEngineAgent();

            if (listPlayer.Count > 0)
            {
                betEngine.LoginPlayers(listPlayer);
            }

            if (listAgent.Count > 0)
            {
                betEngine.LoginAgents(listAgent);
            }

            if (listAgent.Count > 0)
            {
                for (int i = 0; i < listAgent.Count; i++)
                {
                    if (listAgent[i].Id > 0 && engineBll.getEngineGhostByAgentID(listAgent[i].Id).Count > 0)
                        betEngine.RefreshGhosts(listAgent[i], engineBll.getEngineGhostByAgentID(listAgent[i].Id));
                }
            }

            if (listPlayer.Count > 0)
            {
                Ghost g = null;
                Agent a = null;
                for (int i = 0; i < listPlayer.Count; i++)
                {
                    if (listPlayer[i].Attachment2Ghost != null && listPlayer[i].Attachment2Ghost.ghostId > 0)
                    {
                        g = engineBll.getEngineGhostByPlayerID(listPlayer[i].Attachment2Ghost.ghostId);
                        if (g != null && g.ghostId > 0)
                        {
                            a = engineBll.getEngineAgentByID(g.Belong2Agent.Id);
                            if (g.Belong2Agent != null && g.Belong2Agent.Id > 0 && a != null && a.Id > 0)
                                betEngine.SetFollowRelationship(listPlayer[i], g, a);
                        }
                    }
                }
            }

            // 添加Agent
            // 2.登录所有Agent LoginAgents(List<Agent> agent列表);
            // 3.Agent监测的ghost列表  RefreshGhosts(Agent agent对象,List<Ghost> ghosts agent监测的列表);

            // 添加玩家
            // 1.登录所有玩家  LoginPlayers(List<Player> 玩家列表);
            // 4.设置player跟随的ghost(一对一) SetFollowRelationship(Player 玩家对象,Ghost 玩家跟注的ghost,Agent ghost所属的agent);

            // 关闭agent
            //LogoutAgent(Agent agent)

            // 关闭player
            //LogoutPlayer(Player player)

            // player改变跟注ghost
            // 4.设置player跟随的ghost(一对一) SetFollowRelationship(Player 玩家对象,Ghost 玩家跟注的ghost,Agent ghost所属的agent);
        }
开发者ID:yjtang,项目名称:AutoBws,代码行数:84,代码来源:Global.asax.cs


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