From 405063f036750ae5e3e7ea07ddd4c2b7c19dc68d Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 30 Aug 2024 18:34:07 -0500 Subject: [PATCH] guilds MOTD now persist --- src/engine/net/client/handlers/MOTDEditHandler.java | 13 ++++++++++--- src/engine/objects/Guild.java | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/engine/net/client/handlers/MOTDEditHandler.java b/src/engine/net/client/handlers/MOTDEditHandler.java index a9309021..9af489f3 100644 --- a/src/engine/net/client/handlers/MOTDEditHandler.java +++ b/src/engine/net/client/handlers/MOTDEditHandler.java @@ -62,16 +62,23 @@ public class MOTDEditHandler extends AbstractClientMsgHandler { return true; } - if (type == 1) // Guild MOTD + if (type == 1) { // Guild MOTD msg.setMessage(guild.getMOTD()); - else if (type == 3) // IC MOTD + guild.updateDatabase(); + }else if (type == 3) { // IC MOTD msg.setMessage(guild.getICMOTD()); - else if (type == 0) { // Nation MOTD + guild.updateDatabase(); + }else if (type == 0) { // Nation MOTD Guild nation = guild.getNation(); if (nation == null || !nation.isNation()) { ErrorPopupMsg.sendErrorMsg(playerCharacter, "You do not have such authority!"); return true; } + nation.setNMOTD(msg.getMessage()); + nation.updateDatabase(); + for(Guild sub : nation.getSubGuildList()){ + sub.setNMOTD(nation.getNMOTD()); + } msg.setMessage(nation.getMOTD()); } dispatch = Dispatch.borrow(playerCharacter, msg); diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index 5d1d4673..e1d39f40 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -521,6 +521,10 @@ public class Guild extends AbstractWorldObject { public void setICMOTD(String value) { this.icmotd = value; } + public void setNMOTD(String value) { + this.nmotd = value; + } + public String getNMOTD(){return nmotd;} public boolean isNPCGuild() {