Пример #1
0
        public async Task ProcessInitialKeyRequest()
        {
            awaitingAuthKey = true;
            OutgoingPayloadHandler Payload = new OutgoingPayloadHandler()
            {
                SequenceId  = TS3SRV_WEBLIST_SEQUENCEID,
                PayloadType = PayloadTypes.Keyrequest,
            };

            Payload.ConstructHeader();
            await CHandler.SendPayloadAsync(Payload.Header);

            TS3SRV_WEBLIST_SEQUENCEID++;
        }
Пример #2
0
        private async void TimerElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
        {
            await ProcessInitialKeyRequest();

            while (awaitingAuthKey)
            {
                await Task.Delay(25);
            }
            var outgoingPayload = new OutgoingPayloadHandler(_serverProperties)
            {
                SequenceId = TS3SRV_WEBLIST_SEQUENCEID,
                AuthKey    = TS3SRV_WEBLIST_AUTHKEY,
            };

            outgoingPayload.ConstructHeader();
            if (outgoingPayload.ConstructDataPacket())
            {
                await CHandler.SendPayloadAsync(outgoingPayload.RawPayload);

                Logger.Log(LogLevel.Info, "Sent packet with info to serverlist");
                Console.WriteLine("Sent packet to the serverlist");
            }
        }