コード例 #1
0
ファイル: Game.cs プロジェクト: DZilli/mooege
        /// <summary>
        /// Creates a new game with given gameId.
        /// </summary>
        /// <param name="gameId"></param>
        public Game(int gameId)
        {
            this.GameId             = gameId;
            this.Players            = new ConcurrentDictionary <GameClient, Player>();
            this._objects           = new ConcurrentDictionary <uint, DynamicObject>();
            this._worlds            = new ConcurrentDictionary <int, World>();
            this.StartingWorldSNOId = 71150; // FIXME: This must be set according to the game settings (start quest/act). Better yet, track the player's save point and toss this stuff. /komiga
            this.Quests             = new QuestManager(this);
            this.Scripts            = new ScriptManager(this);

            this._tickWatch = new Stopwatch();
            var loopThread = new Thread(Update)
            {
                IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture
            };;                                                                                                           // create the game update thread.

            loopThread.Start();
            Pathfinder = new Mooege.Core.GS.AI.Pather(this); //Creates the "Game"s single Pathfinder thread, Probably could be pushed further up and have a single thread handling all path req's for all running games. - DarkLotus
            var patherThread = new Thread(Pathfinder.UpdateLoop)
            {
                IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture
            };

            patherThread.Start();
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: xPathin/DiIiS-
        /// <summary>
        /// Creates a new game with given gameId.
        /// </summary>
        /// <param name="gameId"></param>
        public Game(int gameId, List <MooNetClient> clients)
        {
            this.GameId   = gameId;
            this.Players  = new ConcurrentDictionary <GameClient, Player>();
            this._objects = new ConcurrentDictionary <uint, DynamicObject>();
            this._worlds  = new ConcurrentDictionary <int, World>();
            //Проверка на текущий акт!
            if (clients != null)
            {
                var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(clients[0].Account.CurrentGameAccount.CurrentToon.PersistentID);
                if (dbQuestProgress.ActiveAct == 1)
                {
                    this.StartingWorldSNOId = 71150;
                }
                else if (dbQuestProgress.ActiveAct == 2)
                {
                    this.StartingWorldSNOId = 71150;
                }
                // Леорик 1 - 2824, 2 - 58982, 3 - 58983
                DBSessions.AccountSession.Flush();
            }
            else
            {
                this.StartingWorldSNOId = 71150;
            }
            this.Quests = new QuestManager(this);

            this._tickWatch = new Stopwatch();
            var loopThread = new Thread(Update)
            {
                IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture
            };;                                                                                                           // create the game update thread.

            loopThread.Start();
            Pathfinder = new Mooege.Core.GS.AI.Pather(this); //Creates the "Game"s single Pathfinder thread, Probably could be pushed further up and have a single thread handling all path req's for all running games. - DarkLotus
            var patherThread = new Thread(Pathfinder.UpdateLoop)
            {
                IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture
            };

            patherThread.Start();
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: diablo1981/mooege
        /// <summary>
        /// Creates a new game with given gameId.
        /// </summary>
        /// <param name="gameId"></param>
        public Game(int gameId)
        {
            this.GameId = gameId;
            this.Players = new ConcurrentDictionary<GameClient, Player>();
            this._objects = new ConcurrentDictionary<uint, DynamicObject>();
            this._worlds = new ConcurrentDictionary<int, World>();
            this.StartingWorldSNOId = 71150; // FIXME: This must be set according to the game settings (start quest/act). Better yet, track the player's save point and toss this stuff. /komiga
            this.Quests = new QuestManager(this);

            this._tickWatch = new Stopwatch();
            var loopThread = new Thread(Update) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture }; ; // create the game update thread.
            loopThread.Start();
            Pathfinder = new Mooege.Core.GS.AI.Pather(this); //Creates the "Game"s single Pathfinder thread, Probably could be pushed further up and have a single thread handling all path req's for all running games. - DarkLotus
            var patherThread = new Thread(Pathfinder.UpdateLoop) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture };
            patherThread.Start();
        }