mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-26 17:43:21 +01:00
feat(guild): implement rookie and return guild assignment
New/returning players are now auto-assigned to temporary holding guilds on MSG_MHF_ENTRY_ROOKIE_GUILD (pkt.Unk=0 → rookie guild, ≥1 → comeback guild). Guilds are created on demand and capped at 60 members. Players leave via the OperateGuildGraduateRookie/Return actions. The guild info response now reports isReturnGuild from the DB instead of hardcoded false. Migration 0014_return_guilds adds return_type to the guilds table.
This commit is contained in:
@@ -125,6 +125,13 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.logger.Error("Failed to exchange guild event RP", zap.Error(err))
|
||||
}
|
||||
bf.WriteUint32(balance)
|
||||
case mhfpacket.OperateGuildGraduateRookie, mhfpacket.OperateGuildGraduateReturn:
|
||||
// Player graduates (leaves) a temporary return/rookie guild.
|
||||
// No extra packet data — just remove and succeed.
|
||||
isApplicant := characterGuildInfo != nil && characterGuildInfo.IsApplicant
|
||||
if _, err := s.server.guildService.Leave(s.charID, guild.ID, isApplicant, guild.Name); err != nil {
|
||||
s.logger.Error("Failed to graduate from return guild", zap.Error(err))
|
||||
}
|
||||
default:
|
||||
s.logger.Error("unhandled operate guild action", zap.Uint8("action", uint8(pkt.Action)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user