public void handlePacket(Client c, PacketReader packet) { foreach (KeyValuePair<string, CenterServer> cserv in Program.mServer.centerServers) { c.SendPacket(PacketDefinitions.WorldInformation((byte)cserv.Value.world, cserv.Key, 2, "Hello", 100, 100, cserv.Value.channels)); c.SendPacket(PacketDefinitions.WorldInformationEnd()); c.SendPacket(PacketDefinitions.LastConnectedWorld(c.RecentWorld)); c.SendPacket(PacketDefinitions.RecommendWorldMessage()); } }
public void handlePacket(Client c, PacketReader packet) { packet.Skip(1); byte world = packet.ReadByte(); byte channel = packet.ReadByte(); c.RecentChannel = channel; c.RecentWorld = world; c.Characters = Database.GetCharacters(c.AccountId); c.SaveAccountToDatabase(); c.SendPacket(PacketDefinitions.CharacterLoadout(c)); }
public void handlePacket(Client c, PacketReader packet) { byte region = packet.ReadByte(); short majorVersion = packet.ReadShort(); short minorVersion = packet.ReadShort(); if (region == 8 // North America && majorVersion == Common.Config.MajorVersion) c.validated = true; else { Logger.Write(Logger.LogTypes.경고, "Client at {0} connected with invalid version ({1},{2},{3})", c.mSession.Socket.RemoteEndPoint.ToString(), region, majorVersion, minorVersion); c.Close(); } }
public void handlePacket(Client c, PacketReader packet) { string pic = Database.MySqlEscape(packet.ReadMapleString()); int cid = packet.ReadInt(); string macs = packet.ReadMapleString(); // i should probably do something with these lol string HWID = packet.ReadMapleString(); // ?_hdd serial if (pic != c.Pic) c.SendPacket(PacketDefinitions.BadPic()); else { c.Migrate = true; Program.mServer.GetCenterServerById(c.RecentWorld).mCenterConnection.mSession.SendPacket(CenterServerPacketDefinitions.RequestMigrate(c.AccountId, cid, c.RecentChannel)); } }
public void handlePacket(Client c, PacketReader packet) { short world = packet.ReadShort(); int count = 0; foreach (KeyValuePair<int, int> server in Program.mServer.GetCenterServerById(world).channels) { count += server.Value; } if (count > 30) c.SendPacket(PacketDefinitions.CheckUserLimit(0, 1)); else c.SendPacket(PacketDefinitions.CheckUserLimit(0, 0)); }
public void handlePacket(Client c, PacketReader packet) { string pic = packet.ReadMapleString(); int cid = packet.ReadInt(); if (pic != c.Pic) c.SendPacket(PacketDefinitions.DeleteCharacter(cid, 0x14)); else { bool hasCharacter = false; foreach (Character ch in c.Characters) if (ch.mID == cid) hasCharacter = true; if (!hasCharacter) return; // TODO: AUTOBAN Database.DeleteCharacter(cid); c.SendPacket(PacketDefinitions.DeleteCharacter(cid, 0)); } }
public void handlePacket(Client c, PacketReader packet) { Console.WriteLine("CLIENT ERROR {0}", packet.ReadMapleString()); }
public void handlePacket(Client c, PacketReader packet) { packet.ReadByte(); // unknown, client sends 0x02 c.Characters = Database.GetCharacters(c.AccountId); c.SendPacket(PacketDefinitions.ViewAllCharacters(c.Characters)); }
public void handlePacket(Client c, PacketReader packet) { c.LastKeepAlive = DateTime.Now.ToFileTime(); }