예제 #1
0
        public static void PollInfo(NetState ns, CircularBufferReader reader, ref int packetLength)
        {
            var version = reader.ReadByte();

            if (_token != null)
            {
                unsafe {
                    byte *tok  = stackalloc byte[_token.Length];
                    var   span = new Span <byte>(tok, _token.Length);
                    reader.Read(span);

                    if (!span.SequenceEqual(_token))
                    {
                        ns.Disconnect("Invalid token sent for ConnectUO");
                        return;
                    }
                }
            }

            ns.WriteConsole($"ConnectUO (v{version}) is requesting stats.");
            if (version > ConnectUOProtocolVersion)
            {
                Utility.PushColor(ConsoleColor.Yellow);
                ns.WriteConsole("Warning! ConnectUO (v{version}) is newer than what is supported.");
                Utility.PopColor();
            }

            ns.SendServerPollInfo();
        }