mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 10:03:06 +01:00
fix(guild): implement alliance application toggle (#166)
Alliance applications were hardcoded to always-open. Add a `recruiting` column to guild_alliances and handle OperateJoint actions 0x06 (Allow) and 0x07 (Deny) confirmed via Wii U debug symbols. Only the parent guild leader can toggle the setting, matching the existing disband guard.
This commit is contained in:
@@ -11,6 +11,7 @@ SELECT
|
||||
ga.id,
|
||||
ga.name,
|
||||
created_at,
|
||||
ga.recruiting,
|
||||
parent_id,
|
||||
CASE
|
||||
WHEN sub1_id IS NULL THEN 0
|
||||
@@ -79,6 +80,12 @@ func (r *GuildRepository) RemoveGuildFromAlliance(allianceID, guildID, subGuild1
|
||||
return err
|
||||
}
|
||||
|
||||
// SetAllianceRecruiting updates whether an alliance is accepting applications.
|
||||
func (r *GuildRepository) SetAllianceRecruiting(allianceID uint32, recruiting bool) error {
|
||||
_, err := r.db.Exec("UPDATE guild_alliances SET recruiting=$1 WHERE id=$2", recruiting, allianceID)
|
||||
return err
|
||||
}
|
||||
|
||||
// scanAllianceWithGuilds scans an alliance row and populates its guild data.
|
||||
func (r *GuildRepository) scanAllianceWithGuilds(rows *sqlx.Rows) (*GuildAlliance, error) {
|
||||
alliance := &GuildAlliance{}
|
||||
|
||||
Reference in New Issue
Block a user