![]() |
|
Error Message + Server Down - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Error Message + Server Down (/showthread.php?tid=1213) |
Error Message + Server Down - JokeofWeek - 27-08-2007 So as I was just tinkering around with my source, I noticed that whenever you had the wrong password for logging in or deleting your account, it would always tell you Incorrect Password, which is perfectly fine, but then a second message box would appear stating that the server is offline. So if we look at the MenuState sub, we see that after all the Cases, there is a snippet which says : Code: If Not IsConnected ThenThis basically tells you if the server is down. So this is the line that is appearing the message box. Why? Because the IncorrectPassword line is a AlertMsg, which disconnects you. So let's look at the login and delete states : Code: Case MENU_STATE_DELACCOUNTAs you can see, those lines use the ConnectToServer function, which returns false if the server is down, so there is already a check. The reason for the second message box to appear is because the code keeps on going down, and by the time it checks whether it is connected or not, the connection has been broken by the Incorrect Password alert message. So just replace that code with : Code: Case MENU_STATE_DELACCOUNTAnd there you go, now it exits the sub once the login has been sent, because it knows that the server is online, and the incorrect password message will still appear.
|