예제 #1
0
        /// <summary>
        /// Executes the command and sends response.
        /// </summary>
        /// <param name="s">The session.</param>
        /// <param name="p">The package info.</param>
        public override void ExecuteCommand(Session s, Package p)
        {
            PacketBRequestUserAuthentication Request = new PacketBRequestUserAuthentication(p.Content);

            Logger.Debug($"{p.Key}::ExecuteCommand - Execute command: {Request}");

            PacketBResponseUserAuthentication ResponseContent = new PacketBResponseUserAuthentication(Request.Xuid, 0);

            Logger.Debug($"{p.Key}::ExecuteCommand - Execute command: {ResponseContent}");

            byte[] Response = ResponseContent.ToByteArray();

            Package Package = new Package(p.HeaderXuid, p.HeaderField20, p.HeaderServiceId, p.HeaderField22, PacketTypes.BResponseUserAuthentication, p.HeaderRequestId, Response);

            byte[] ToSend = Package.ToByteArray();

            s.Send(ToSend, 0, ToSend.Length);
        }
        /// <summary>
        /// Executes the command and sends response.
        /// </summary>
        /// <param name="s">The session.</param>
        /// <param name="i">The package info.</param>
        public override void ExecuteCommand(PlayerSession s, Package p)
        {
            var Request = new PacketBRequestUserAuthentication(p.Content);

            if (s.Logger.IsDebugEnabled)
            {
                s.Logger.Debug($"Execute command: {Request}");
            }

            var ResponseContent = new PacketBResponseUserAuthentication(Request.Xuid, 0);

            if (s.Logger.IsDebugEnabled)
            {
                s.Logger.Debug($"Command response: {ResponseContent}");
            }

            var Response = ResponseContent.ToByteArray();
            var Package  = new Package(p.HeaderXuid, p.HeaderField20, p.HeaderServiceId, p.HeaderField22, Response.Length, PacketTypes.BResponseUserAuthentication, p.HeaderRequestId, Response);

            var ToSend = Package.ToByteArray();

            s.Send(ToSend, 0, ToSend.Length);
        }