void HandleGuildFinderGetApplications(LFGuildGetApplications lfGuildGetApplications) { List <MembershipRequest> applicatedGuilds = Global.GuildFinderMgr.GetAllMembershipRequestsForPlayer(GetPlayer().GetGUID()); LFGuildApplications lfGuildApplications = new LFGuildApplications(); lfGuildApplications.NumRemaining = 10 - Global.GuildFinderMgr.CountRequestsFromPlayer(GetPlayer().GetGUID()); for (var i = 0; i < applicatedGuilds.Count; ++i) { MembershipRequest application = applicatedGuilds[i]; LFGuildApplicationData applicationData = new LFGuildApplicationData(); Guild guild = Global.GuildMgr.GetGuildByGuid(application.GetGuildGuid()); LFGuildSettings guildSettings = Global.GuildFinderMgr.GetGuildSettings(application.GetGuildGuid()); applicationData.GuildGUID = application.GetGuildGuid(); applicationData.GuildVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress(); applicationData.GuildName = guild.GetName(); applicationData.ClassRoles = guildSettings.GetClassRoles(); applicationData.PlayStyle = guildSettings.GetInterests(); applicationData.Availability = guildSettings.GetAvailability(); applicationData.SecondsSinceCreated = (uint)(Time.UnixTime - application.GetSubmitTime()); applicationData.SecondsUntilExpiration = (uint)(application.GetExpiryTime() - Time.UnixTime); applicationData.Comment = application.GetComment(); lfGuildApplications.Application.Add(applicationData); } GetPlayer().SendPacket(lfGuildApplications); }
public MembershipRequest(MembershipRequest settings) { _comment = settings.GetComment(); _availability = settings.GetAvailability(); _classRoles = settings.GetClassRoles(); _interests = settings.GetInterests(); _guildId = settings.GetGuildGuid(); _playerGUID = settings.GetPlayerGUID(); _time = settings.GetSubmitTime(); }