예제 #1
0
        public TheGame(IMemory m, Cache cache)
        {
            pM               = m;
            pCache           = cache;
            pTheGame         = this;
            Instance         = this;
            Address          = m.Read <long>(m.BaseOffsets[OffsetsName.GameStateOffset] + m.AddressOfProcess);
            _AreaChangeCount = new TimeCache <int>(() => M.Read <int>(M.AddressOfProcess + M.BaseOffsets[OffsetsName.AreaChangeCount]), 50);

            AllGameStates = ReadHashMap(Address + 0x48);

            PreGameStatePtr         = AllGameStates["PreGameState"].Address;
            LoginStatePtr           = AllGameStates["LoginState"].Address;
            SelectCharacterStatePtr = AllGameStates["SelectCharacterState"].Address;
            WaitingStatePtr         = AllGameStates["WaitingState"].Address;
            InGameStatePtr          = AllGameStates["InGameState"].Address;
            LoadingStatePtr         = AllGameStates["LoadingState"].Address;
            EscapeStatePtr          = AllGameStates["EscapeState"].Address;
            LoadingState            = new AreaLoadingState(AllGameStates["AreaLoadingState"].Address);
            IngameState             = new IngameState(InGameStatePtr);

            _inGame = new FrameCache <bool>(
                () => IngameState.Address != 0 && IngameState.Data.Address != 0 && IngameState.ServerData.Address != 0 && !IsLoading /*&&
                                                                                                                                      * IngameState.ServerData.IsInGame*/);

            Files              = new FilesContainer(m);
            DataOff            = Extensions.GetOffset <IngameStateOffsets>(nameof(IngameStateOffsets.Data));
            CurrentAreaHashOff = Extensions.GetOffset <IngameDataOffsets>(nameof(IngameDataOffsets.CurrentAreaHash));
        }
예제 #2
0
        public TheGame(IMemory m, Cache cache)
        {
            pM                      = m;
            pCache                  = cache;
            pTheGame                = this;
            Instance                = this;
            Address                 = m.Read <long>(m.BaseOffsets[OffsetsName.GameStateOffset] + m.AddressOfProcess);
            _AreaChangeCount        = new TimeCache <int>(() => M.Read <int>(M.AddressOfProcess + M.BaseOffsets[OffsetsName.AreaChangeCount]), 50);
            AllGameStates           = ReadList(Address);
            PreGameStatePtr         = AllGameStates[GameStateE.PreGameState].Address;
            LoginStatePtr           = AllGameStates[GameStateE.LoginState].Address;
            SelectCharacterStatePtr = AllGameStates[GameStateE.SelectCharacterState].Address;
            WaitingStatePtr         = AllGameStates[GameStateE.WaitingState].Address;
            InGameStatePtr          = AllGameStates[GameStateE.InGameState].Address;
            LoadingStatePtr         = AllGameStates[GameStateE.LoadingState].Address;
            EscapeStatePtr          = AllGameStates[GameStateE.EscapeState].Address;

            LoadingState = new AreaLoadingState(AllGameStates[GameStateE.AreaLoadingState]);
            IngameState  = new IngameState(AllGameStates[GameStateE.InGameState]);

            _inGame = new FrameCache <bool>(
                () => IngameState.Address != 0 && IngameState.Data.Address != 0 && IngameState.Data.ServerData.Address != 0 && !IsLoading /*&&
                                                                                                                                           * IngameState.ServerData.IsInGame*/);

            Files = new FilesContainer(m);
        }