Пример #1
0
        public Player(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTAPlayer";

            PlayerId = bind <uint>(t, "m_iPlayerID");
            Hero     = handle(t, "m_hAssignedHero");
        }
Пример #2
0
        public Player(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTAPlayer";

            PlayerId = bind<uint>(t, "m_iPlayerID");
            Hero = handle(t, "m_hAssignedHero");
        }
Пример #3
0
 public DotaGame(DotaGameState state, DotaGameConnection connection)
 {
     this.state         = state;
     this.connection    = connection;
     entityUpdater      = new EntityUpdater(state);
     stringTableUpdater = new StringTableUpdater();
 }
Пример #4
0
 public Handle(Property property, DotaGameState state)
 {
     this.property = property;
     this.state    = state;
     this.value    = 0;
     this.ReadAt   = null;
 }
Пример #5
0
 /// <summary>
 ///     Initialize the signon handler.
 /// </summary>
 /// <param name="state"></param>
 /// <param name="connection"></param>
 public DotaSignon(DotaGameState state, DotaGameConnection connection, DOTAConnectDetails details)
 {
     this.state         = state;
     this.details       = details;
     this.connection    = connection;
     entityUpdater      = new EntityUpdater(state);
     sendTableFlattener = new SendTableFlattener();
     stringTableUpdater = new StringTableUpdater();
 }
Пример #6
0
 /// <summary>
 ///     Init a new game connect session.
 /// </summary>
 /// <param name="deets"></param>
 /// <param name="toArray"></param>
 /// <param name="poolBuilder">Pool builder</param>
 internal DotaGameSession(DOTAConnectDetails deets, IDotaGameController[] controllers, DotaEntityPool.Builder poolBuilder)
 {
     _details              = deets;
     Running               = false;
     _gameState            = new DotaGameState(deets);
     _gameState.EntityPool = poolBuilder.Build(_gameState);
     _connection           = null;
     Controllers           = controllers;
 }
Пример #7
0
        public Ability(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTABaseAbility";

            Level          = bind <uint>(t, "m_iLevel");
            Cooldown       = bind <float>(t, "m_fCooldown");
            CooldownLength = bind <float>(t, "m_flCooldownLength");
            ManaCost       = bind <uint>(t, "m_iManaCost");
            CastRange      = bind <uint>(t, "m_iCastRange");
        }
Пример #8
0
 public DotaHandshake(
     DOTAConnectDetails details,
     DotaGameState state,
     DotaGameConnection connection)
 {
     this.details     = details;
     this.connection  = connection;
     this.state       = state;
     client_challenge = (uint)new Random().Next();
 }
Пример #9
0
        public Ability(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTABaseAbility";

            Level = bind<uint>(t, "m_iLevel");
            Cooldown = bind<float>(t, "m_fCooldown");
            CooldownLength = bind<float>(t, "m_flCooldownLength");
            ManaCost = bind<uint>(t, "m_iManaCost");
            CastRange = bind<uint>(t, "m_iCastRange");
        }
Пример #10
0
        public UserCmdGenerator(DotaGameState state, DotaGameConnection connection)
        {
            this.state      = state;
            this.connection = connection;

            backup = new List <UserCmd>();
            next   = new List <UserCmd>();

            commandNumber = 0;
            orderNumber   = 0;
        }
Пример #11
0
        private DotaEntityPool(DotaGameState state, Dictionary <string, Constructor> constructors)
        {
            _state           = state;
            _pendingMappings = constructors;
            Entities         = new Dictionary <uint, MappedEntityClass>();
            EntitiesByType   = new Dictionary <Type, HashSet <uint> >();

            foreach (var con in constructors.Values)
            {
                EntitiesByType[con.type] = new HashSet <uint>();
            }
        }
Пример #12
0
        /// <summary>
        /// Banned heros
        /// </summary>
        //todo: public RangeValue<uint> BannedHeros;

        /// <summary>
        /// Selected heros
        /// </summary>
        //todo: public RangeValue<uint> SelectedHeros;

        #endregion


        public GameRules(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTAGamerules";

            GameState        = bindE <DOTA_GameState>(t, "m_nGameState");
            GameTime         = bind <float>(t, "m_fGameTime");
            GameStartTime    = bind <float>(t, "m_flGameStartTime");
            GameEndTime      = bind <float>(t, "m_flGameEndTime");
            PreGameStartTime = bind <float>(t, "m_flPreGameStartTime");
            //MatchID = bind<ulong>(t, "m_unMatchID"); broken
            GameMode          = bindE <DOTA_GameMode>(t, "m_nGameState");
            PauseTeam         = bindE <DOTA_ServerTeam>(t, "m_iPauseTeam");
            GameWinner        = bindE <DOTA_ServerTeam>(t, "m_nGameWinner");
            NetTimeOfDay      = bind <ulong>(t, "m_iNetTimeOfDay");
            DraftStartingTeam = bindE <DOTA_ServerTeam>(t, "m_iStartingTeam");
            DraftActiveTeam   = bindE <DOTA_ServerTeam>(t, "m_iActiveTeam");
            HeroPickState     = bindE <DOTA_HeroPickState>(t, "m_nHeroPickState");
            //ExtraTimeRemaining = bind<float>(t, "m_fExtraTimeRemaining"); broken

            //todo: BannedHeros = range<uint>("m_BannedHeroes", )
            //todo: handle m_nGGTeam and m_flGGEndsAtTime
        }
Пример #13
0
 internal PlayerResource(uint id, DotaGameState state) : base(id, state)
 {
     Names = range<string>("m_iszPlayerNames", 32);
     SteamIds = range<ulong>("m_iPlayerSteamIDs", 32);
 }
Пример #14
0
        /// <summary>
        /// Banned heros
        /// </summary>
        //todo: public RangeValue<uint> BannedHeros; 

        /// <summary>
        /// Selected heros
        /// </summary>
        //todo: public RangeValue<uint> SelectedHeros; 

        #endregion


        public GameRules(uint id, DotaGameState state) : base(id, state)
        {
            const string t = "DT_DOTAGamerules";

            GameState = bindE<DOTA_GameState>(t, "m_nGameState");
            GameTime = bind<float>(t, "m_fGameTime");
            GameStartTime = bind<float>(t, "m_flGameStartTime");
            GameEndTime = bind<float>(t, "m_flGameEndTime");
            PreGameStartTime = bind<float>(t, "m_flPreGameStartTime");
            //MatchID = bind<ulong>(t, "m_unMatchID"); broken
            GameMode = bindE<DOTA_GameMode>(t, "m_nGameState");
            PauseTeam = bindE<DOTA_ServerTeam>(t, "m_iPauseTeam");
            GameWinner = bindE<DOTA_ServerTeam>(t, "m_nGameWinner");
            NetTimeOfDay = bind<ulong>(t, "m_iNetTimeOfDay");
            DraftStartingTeam = bindE<DOTA_ServerTeam>(t, "m_iStartingTeam");
            DraftActiveTeam = bindE<DOTA_ServerTeam>(t, "m_iActiveTeam");
            HeroPickState = bindE<DOTA_HeroPickState>(t, "m_nHeroPickState");
            //ExtraTimeRemaining = bind<float>(t, "m_fExtraTimeRemaining"); broken

            //todo: BannedHeros = range<uint>("m_BannedHeroes", )
            //todo: handle m_nGGTeam and m_flGGEndsAtTime
        }
Пример #15
0
 protected MappedEntityClass(uint id, DotaGameState state)
 {
     this.Id    = id;
     this.state = state;
 }
Пример #16
0
 internal PlayerResource(uint id, DotaGameState state) : base(id, state)
 {
     Names    = range <string>("m_iszPlayerNames", 32);
     SteamIds = range <ulong>("m_iPlayerSteamIDs", 32);
 }
Пример #17
0
 /// <summary>
 /// Finalize the entity mappings.
 /// </summary>
 /// <returns></returns>
 public DotaEntityPool Build(DotaGameState state)
 {
     return(new DotaEntityPool(state, _constructors));
 }
Пример #18
0
 public EntityUpdater(DotaGameState state)
 {
     this.state = state;
     unpacker   = new PropertyValueUnpacker();
 }