public void Tick() { CallbackManager.RunWaitCallbacks(TimeSpan.FromMilliseconds(200)); SteamManager.Tick(); if (DateTime.Now >= nextConnect) { nextConnect = DateTime.MaxValue; Log.WriteInfo("Steam", "Connecting to Steam..."); IRC.Instance.SendEmoteToTag("steam-logon", "Connecting to Steam..."); Client.Connect(); } }
public void Init() { Client = new SteamClient(); CallbackManager = new CallbackManager(Client); User = Client.GetHandler <SteamUser>(); Friends = Client.GetHandler <SteamFriends>(); Apps = Client.GetHandler <SteamApps>(); UserStats = Client.GetHandler <SteamUserStats>(); Cloud = Client.GetHandler <SteamCloud>(); Workshop = Client.GetHandler <SteamWorkshop>(); Unified = Client.GetHandler <SteamUnifiedMessages>(); MasterServer = Client.GetHandler <SteamMasterServer>(); GameCoordinator = Client.GetHandler <SteamGameCoordinator>(); Levels = new SteamLevels(); Games = new SteamGames(); AppInfo = new SteamAppInfo(); Account = new SteamAccount(); PublishedFiles = Unified.CreateService <IPublishedFile>(); Community = Unified.CreateService <ICommunity>(); Client.AddHandler(Levels); Client.AddHandler(Games); Client.AddHandler(AppInfo); Client.AddHandler(Account); SteamManager = new SteamManager(CallbackManager); GCManager = new GCManager(CallbackManager); JobManager = new JobManager(CallbackManager); CallbackManager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); CallbackManager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); CallbackManager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); CallbackManager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); CallbackManager.Subscribe <SteamUser.AccountInfoCallback>(OnAccountInfo); }
public void Init() { Client = new SteamClient(); CallbackManager = new CallbackManager( Client ); User = Client.GetHandler<SteamUser>(); Friends = Client.GetHandler<SteamFriends>(); Apps = Client.GetHandler<SteamApps>(); UserStats = Client.GetHandler<SteamUserStats>(); Cloud = Client.GetHandler<SteamCloud>(); Workshop = Client.GetHandler<SteamWorkshop>(); Unified = Client.GetHandler<SteamUnifiedMessages>(); MasterServer = Client.GetHandler<SteamMasterServer>(); Levels = new SteamLevels(); Games = new SteamGames(); AppInfo = new SteamAppInfo(); Account = new SteamAccount(); PublishedFiles = Unified.CreateService<IPublishedFile>(); Client.AddHandler( Levels ); Client.AddHandler( Games ); Client.AddHandler( AppInfo ); Client.AddHandler( Account ); TaskManager = new TaskManager( CallbackManager ); GCManager = new GCManager( CallbackManager ); SteamManager = new SteamManager( CallbackManager ); JobManager = new JobManager( CallbackManager ); new Callback<SteamClient.ConnectedCallback>( OnConnected, CallbackManager ); new Callback<SteamClient.DisconnectedCallback>( OnDisconnected, CallbackManager ); new Callback<SteamUser.LoggedOnCallback>( OnLoggedOn, CallbackManager ); new Callback<SteamUser.LoggedOffCallback>( OnLoggedOff, CallbackManager ); new Callback<SteamUser.AccountInfoCallback>( OnAccountInfo, CallbackManager ); }