public FlistService(IAccount model, IEventAggregator eventagg, IBrowseThings browser, IGetTickets ticketService, IFriendRequestService requestService) { this.browser = browser; this.ticketService = ticketService; this.requestService = requestService; try { this.model = model.ThrowIfNull("model"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent <LoginEvent>().Subscribe(GetTicket, ThreadOption.BackgroundThread); events.GetEvent <UserCommandEvent>().Subscribe(HandleCommand, ThreadOption.BackgroundThread); events.GetEvent <CharacterSelectedLoginEvent>().Subscribe(args => selectedCharacter = args); // fix problem with SSL not being trusted on some machines ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } catch (Exception ex) { Exceptions.HandleException(ex); } }
public FlistService(IAccount model, IEventAggregator eventagg, IBrowseThings browser, IGetTickets ticketService, IFriendRequestService requestService) { this.browser = browser; this.ticketService = ticketService; this.requestService = requestService; try { this.model = model.ThrowIfNull("model"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent<LoginEvent>().Subscribe(GetTicket, ThreadOption.BackgroundThread); events.GetEvent<UserCommandEvent>().Subscribe(HandleCommand, ThreadOption.BackgroundThread); events.GetEvent<CharacterSelectedLoginEvent>().Subscribe(args => selectedCharacter = args); // fix problem with SSL not being trusted on some machines ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } catch (Exception ex) { Exceptions.HandleException(ex); } }
public FchatService(IAccount user, IEventAggregator eventagg, WebSocket socket, IGetTickets service) { this.socket = socket; this.service = service; Account = user.ThrowIfNull("user"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent <CharacterSelectedLoginEvent>() .Subscribe(ConnectToChat, ThreadOption.BackgroundThread, true); errsThatDisconnect = new[] { NoLoginSlots, NoServerSlots, KickedFromServer, SimultaneousLoginKick, BannedFromServer, BadLoginInfo, TooManyConnections, UnknownLoginMethod, TimedOutFromServer }; errsThatPreventReconnect = new[] { BannedFromServer, TooManyConnections, KickedFromServer, UnknownLoginMethod, SimultaneousLoginKick, TimedOutFromServer }; noisyTypes = new[] { UserJoin, UserLeave, UserStatus, PublicChannelList, PrivateChannelList, UserList, ChannelMessage, ChannelAd }; autoPingTimer.Elapsed += (s, e) => TrySend(Constants.ClientCommands.SystemPing); staggerTimer = new Timer(GetNextConnectDelay()); // first reconnect is 5 seconds staggerTimer.Elapsed += (s, e) => DoReconnect(); timeoutTimer = new Timer(TimeoutTimeMs); // 30 seconds timeoutTimer.Elapsed += (s, e) => OnTimeout(); }
public FriendRequestService(IBrowseThings browser, IGetTickets ticketService, IAccount account, IEventAggregator events, ICharacterManager characterManager) { this.browser = browser; this.ticketService = ticketService; this.account = account; this.events = events; this.characterManager = characterManager; events.GetEvent<CharacterSelectedLoginEvent>().Subscribe(result => { selectedCharacter = result; UpdateOutgoingRequests(); UpdatePendingRequests(); }); }
public FriendRequestService(IBrowseThings browser, IGetTickets ticketService, IAccount account, IEventAggregator events, ICharacterManager characterManager) { this.browser = browser; this.ticketService = ticketService; this.account = account; this.events = events; this.characterManager = characterManager; events.GetEvent <CharacterSelectedLoginEvent>().Subscribe(result => { selectedCharacter = result; UpdateOutgoingRequests(); UpdatePendingRequests(); }); }
public FchatService(IAccount user, IEventAggregator eventagg, WebSocket socket, IGetTickets service) { this.socket = socket; this.service = service; Account = user.ThrowIfNull("user"); events = eventagg.ThrowIfNull("eventagg"); events.GetEvent<CharacterSelectedLoginEvent>() .Subscribe(ConnectToChat, ThreadOption.BackgroundThread, true); errsThatDisconnect = new[] { NoLoginSlots, NoServerSlots, KickedFromServer, SimultaneousLoginKick, BannedFromServer, BadLoginInfo, TooManyConnections, UnknownLoginMethod, TimedOutFromServer }; errsThatPreventReconnect = new[] { BannedFromServer, TooManyConnections, KickedFromServer, UnknownLoginMethod, SimultaneousLoginKick, TimedOutFromServer }; noisyTypes = new[] { UserJoin, UserLeave, UserStatus, PublicChannelList, PrivateChannelList, UserList, ChannelMessage, ChannelAd }; autoPingTimer.Elapsed += (s, e) => TrySend(Constants.ClientCommands.SystemPing); staggerTimer = new Timer(GetNextConnectDelay()); // first reconnect is 5 seconds staggerTimer.Elapsed += (s, e) => DoReconnect(); timeoutTimer = new Timer(TimeoutTimeMs); // 30 seconds timeoutTimer.Elapsed += (s, e) => OnTimeout(); }