private static void HandleDisband(GameSession session) { Guild guild = GameServer.GuildManager.GetGuildByLeader(session.Player); if (guild == null) { return; } // Remove any applications if (guild.Applications.Count > 0) { foreach (GuildApplication application in guild.Applications) { Player player = GameServer.Storage.GetPlayerById(application.CharacterId); if (player == null) { continue; } application.Remove(player, guild); // TODO: Send mail to player as rejected auto message } } session.Send(GuildPacket.DisbandConfirm()); session.FieldManager.BroadcastPacket(GuildPacket.UpdateGuildTag(session.Player)); guild.RemoveMember(session.Player); GameServer.GuildManager.RemoveGuild(guild); DatabaseManager.Guilds.Delete(guild.Id); }