public override void OnHandshakeInbound(Packet pPacket) { Logger.WriteLine("Received HandShake packet"); Program.UpdateDate(); short version = (short)MapleVersion; string patchLocation = MaplePatchLocation; byte locale = MapleLocale; if (oldPatchLocation == "XD" || (oldVersion == version && oldPatchLocation == patchLocation && oldLocale == locale)) { TwitterClient.Instance.SendMessage("Connected with the {0} server. Version: V{1}.{2}", GetMapleStoryLocale(locale), version, patchLocation); } else { TwitterClient.Instance.SendMessage("Connected with the {0} server, and it seems to be updated! From V{1}.{2} to V{3}.{4} #MapleStory", GetMapleStoryLocale(locale), oldVersion, oldPatchLocation, version, patchLocation); } oldVersion = version; oldPatchLocation = patchLocation; oldLocale = locale; Logger.WriteLine("Version: {0}; Patch location: '{1}'; Locale: {2}", oldVersion, oldPatchLocation, oldLocale); switch (locale) { case 1: MapleClient = new MapleKorea(this, version, short.Parse(patchLocation)); break; case 7: MapleClient = new MapleSEA(this, version, short.Parse(patchLocation)); break; case 8: GMSKeys.Initialize(); MapleClient = new MapleGlobal(this, version, short.Parse(patchLocation)); break; } State = MapleState.WorldSelect; Logger.WriteLine("MapleClient: {0}", MapleClient.ToString()); MapleClient.HandlingVersion = version; MapleClient.sendClientReady(); Logger.WriteLine("Done"); MapleClient.sendWorldListReRequest(); connected = true; if (lostConnection && lastDisconnect != DateTime.MinValue && (DateTime.Now - lastDisconnect).TotalMinutes > 5) { TwitterClient.Instance.SendMessage("{0} downtime: {1} minutes", GetMapleStoryLocale(locale), (DateTime.Now - lastDisconnect).TotalMinutes); } lastDisconnect = DateTime.MinValue; lostConnection = false; }