Esempio n. 1
0
 protected override void PostStop()
 {
     _system.Actor <TelegramMessageChannel>().Tell(new MessageArgs <string>(_settings.Telegram.HostGroupId, "[TEAMSPEAK_ACTOR] I'm dead :("));
     _logger.LogInformation("Client disposal initiated");
     _teamSpeakClient.Unsubscribe <ClientEnterView>();
     _teamSpeakClient.Unsubscribe <ClientLeftView>();
     _teamSpeakClient.Dispose();
     _logger.LogInformation("Client disposed");
 }
Esempio n. 2
0
        public async Task Disconnect()
        {
            try
            {
                tsClient.Unsubscribe <ClientMoved>(ClientMoved);
                tsClient.Unsubscribe <TextMessage>(ChatMessageReceived);
                await tsClient.Logout();

                tsClient.Dispose();
                tsClient = null;
            }
            catch (Exception e)
            {
                logger.LogWarning(e.Message);
                logger.LogWarning(e.StackTrace);
            }
        }