/// <summary> /// Create a game client attached to an existing DOTA gc handler. /// </summary> /// <param name="gc">existing GC handler</param> /// <param name="cb">callback manager</param> /// <param name="publicIp">optionally help out by specifying the public ip address</param> public DotaGameClient(DotaGCHandler gc, CallbackManager cb, IPAddress publicIp = null) { Callbacks = cb; _registeredCallbacks = new List <CallbackBase>(); _gameConnectTokens = new Queue <byte[]>(11); DotaGc = gc; RegisterCallbacks(); if (DotaGc.SteamClient.IsConnected) { FetchAppTicket(); } if (publicIp != null) { publicIP = publicIp; } else if (DotaGc.SteamClient.IsConnected) { CheckPublicIP(); } EntityBuilder = DotaEntitySet.Associate(new DotaEntityPool.Builder()); Controllers = new List <IDotaGameController>(1); }
/// <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; }