From 4bae0e575841e40d08b54d1683dbfe48f608a8f3 Mon Sep 17 00:00:00 2001 From: wish Date: Thu, 30 Nov 2023 23:07:13 +1100 Subject: [PATCH] add option to alter maximum Clan Members --- config.json | 3 ++- config/config.go | 31 +++++++++++++------------- server/channelserver/handlers_guild.go | 19 ++++++++-------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/config.json b/config.json index 7b11421a1..fb1283ec3 100644 --- a/config.json +++ b/config.json @@ -46,7 +46,8 @@ "DisableLoginBoost": false, "DisableBoostTime": false, "BoostTimeDuration": 7200, - "GuildMealDuration": 3600, + "ClanMealDuration": 3600, + "ClanMemberLimits": [[0, 30], [3, 40], [7, 50], [10, 60]], "BonusQuestAllowance": 3, "DailyQuestAllowance": 1, "MezfesSoloTickets": 10, diff --git a/config/config.go b/config/config.go index 488321357..9b16156d0 100644 --- a/config/config.go +++ b/config/config.go @@ -123,21 +123,22 @@ type SaveDumpOptions struct { // GameplayOptions has various gameplay modifiers type GameplayOptions struct { - FeaturedWeapons int // Number of Active Feature weapons to generate daily - MaximumNP int // Maximum number of NP held by a player - MaximumRP uint16 // Maximum number of RP held by a player - MaximumFP uint32 // Maximum number of FP held by a player - TreasureHuntExpiry uint32 // Seconds until a Clan Treasure Hunt will expire - TreasureHuntPartnyaCooldown uint32 // Seconds until a Partnya can be assigned to another Clan Treasure Hunt - DisableLoginBoost bool // Disables the Login Boost system - DisableBoostTime bool // Disables the daily NetCafe Boost Time - BoostTimeDuration int // Second that the NetCafe Boost Time lasts - GuildMealDuration int // Second that a Guild Meal can be activated for after cooking - BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily - DailyQuestAllowance uint32 // Number of Daily Quests to allow daily - MezfesSoloTickets uint32 // Number of solo tickets given weekly - MezfesGroupTickets uint32 // Number of group tickets given weekly - LowLatencyRaviente bool // Toggles low latency mode for Raviente, can be network intensive + FeaturedWeapons int // Number of Active Feature weapons to generate daily + MaximumNP int // Maximum number of NP held by a player + MaximumRP uint16 // Maximum number of RP held by a player + MaximumFP uint32 // Maximum number of FP held by a player + TreasureHuntExpiry uint32 // Seconds until a Clan Treasure Hunt will expire + TreasureHuntPartnyaCooldown uint32 // Seconds until a Partnya can be assigned to another Clan Treasure Hunt + DisableLoginBoost bool // Disables the Login Boost system + DisableBoostTime bool // Disables the daily NetCafe Boost Time + BoostTimeDuration int // Second that the NetCafe Boost Time lasts + ClanMealDuration int // Second that a Clan Meal can be activated for after cooking + ClanMemberLimits [][]uint8 // Array of maximum Clan Members -> [Rank, Members] + BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily + DailyQuestAllowance uint32 // Number of Daily Quests to allow daily + MezfesSoloTickets uint32 // Number of solo tickets given weekly + MezfesGroupTickets uint32 // Number of group tickets given weekly + LowLatencyRaviente bool // Toggles low latency mode for Raviente, can be network intensive RegularRavienteMaxPlayers uint8 ViolentRavienteMaxPlayers uint8 BerserkRavienteMaxPlayers uint8 diff --git a/server/channelserver/handlers_guild.go b/server/channelserver/handlers_guild.go index 30a150eef..8da4102b4 100644 --- a/server/channelserver/handlers_guild.go +++ b/server/channelserver/handlers_guild.go @@ -989,15 +989,16 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { } bf.WriteUint32(guild.PugiOutfits) - if guild.Rank() >= 3 { - bf.WriteUint8(40) - } else if guild.Rank() >= 7 { - bf.WriteUint8(50) - } else if guild.Rank() >= 10 { - bf.WriteUint8(60) - } else { - bf.WriteUint8(30) + limit := s.server.erupeConfig.GameplayOptions.ClanMemberLimits[0][1] + for _, j := range s.server.erupeConfig.GameplayOptions.ClanMemberLimits { + if guild.Rank() >= uint16(j[0]) { + limit = j[1] + } } + if limit > 100 { + limit = 100 + } + bf.WriteUint8(limit) bf.WriteUint32(55000) bf.WriteUint32(0) @@ -1831,7 +1832,7 @@ func handleMsgMhfLoadGuildCooking(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfRegistGuildCooking(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfRegistGuildCooking) guild, _ := GetGuildInfoByCharacterId(s, s.charID) - startTime := TimeAdjusted().Add(time.Duration(s.server.erupeConfig.GameplayOptions.GuildMealDuration-3600) * time.Second) + startTime := TimeAdjusted().Add(time.Duration(s.server.erupeConfig.GameplayOptions.ClanMealDuration-3600) * time.Second) if pkt.OverwriteID != 0 { s.server.db.Exec("UPDATE guild_meals SET meal_id = $1, level = $2, created_at = $3 WHERE id = $4", pkt.MealID, pkt.Success, startTime, pkt.OverwriteID) } else {