Beispiel #1
0
        /// <summary>
        /// Occurs when the client was not authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        /// <param name="Screen">A UIScreen instance on which to display a messagebox to inform the player of the
        ///                      failure state.</param>
        public static void OnLoginFailResponse(ref NetworkClient Client, PacketStream Packet)
        {
            byte Opcode = (byte)Packet.ReadByte();

            switch (Packet.ReadByte())
            {
            case 0x01:
                UIAlertOptions Options = new UIAlertOptions();
                Options.Title   = "Network error";
                Options.Message = "Invalid username!";
                Options.Buttons = UIAlertButtons.OK;
                UIScreen.ShowAlert(Options, true);
                break;

            case 0x02:
                Options         = new UIAlertOptions();
                Options.Title   = "Network error";
                Options.Message = "Invalid password!";
                Options.Buttons = UIAlertButtons.OK;
                UIScreen.ShowAlert(Options, true);
                break;
            }

            Client.Disconnect();
        }
Beispiel #2
0
        /// <summary>
        /// Occurs when the client was not authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        public static void OnLoginFailResponse(ref NetworkClient Client, ProcessedPacket Packet)
        {
            EventObject Event;

            switch (Packet.ReadByte())
            {
            case 0x01:
                Event = new EventObject(EventCodes.BAD_USERNAME);
                EventSink.RegisterEvent(Event);
                break;

            case 0x02:
                Event = new EventObject(EventCodes.BAD_PASSWORD);
                EventSink.RegisterEvent(Event);
                break;
            }

            Client.Disconnect();
        }
 /// <summary>
 /// Reconnects to a CityServer.
 /// </summary>
 public void Reconnect(ref NetworkClient Client, CityInfo SelectedCity, LoginArgsContainer LoginArgs)
 {
     Client.Disconnect();
     Client.Connect(LoginArgs);
 }
Beispiel #4
0
 public static void OnInvalidVersionResponse(ref NetworkClient Client, ProcessedPacket Packet)
 {
     Client.Disconnect();
 }
        /// <summary>
        /// Occurs when the client was not authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        /// <param name="Screen">A UIScreen instance on which to display a messagebox to inform the player of the
        ///                      failure state.</param>
        public static void OnLoginFailResponse(ref NetworkClient Client, PacketStream Packet, UIScreen Screen)
        {
            byte Opcode = (byte)Packet.ReadByte();

            switch (Packet.ReadByte())
            {
                case 0x01:
                    Screen.CreateMsgBox(250, 200, "Invalid accountname!");
                    break;
                case 0x02:
                    Screen.CreateMsgBox(250, 200, "Invalid password!");
                    break;
            }

            Client.Disconnect();
        }
        /// <summary>
        /// Occurs when the client was not authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        /// <param name="Screen">A UIScreen instance on which to display a messagebox to inform the player of the
        ///                      failure state.</param>
        public static void OnLoginFailResponse(ref NetworkClient Client, PacketStream Packet)
        {
            byte Opcode = (byte)Packet.ReadByte();

            switch (Packet.ReadByte())
            {
                case 0x01:
                    UIAlertOptions Options = new UIAlertOptions();
                    Options.Title = "Network error";
                    Options.Message = "Invalid username!";
                    Options.Buttons = UIAlertButtons.OK;
                    UIScreen.ShowAlert(Options, true);
                    break;
                case 0x02:
                    Options = new UIAlertOptions();
                    Options.Title = "Network error";
                    Options.Message = "Invalid password!";
                    Options.Buttons = UIAlertButtons.OK;
                    UIScreen.ShowAlert(Options, true);
                    break;
            }

            Client.Disconnect();
        }