Browse Source

removal group guil refreshes group windows

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
bd536961e2
  1. 22
      src/engine/net/client/handlers/BanishUnbanishHandler.java
  2. 15
      src/engine/net/client/handlers/LeaveGuildHandler.java

22
src/engine/net/client/handlers/BanishUnbanishHandler.java

@ -21,12 +21,10 @@ import engine.net.DispatchMessage; @@ -21,12 +21,10 @@ import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.group.GroupUpdateMsg;
import engine.net.client.msg.guild.BanishUnbanishMsg;
import engine.net.client.msg.guild.GuildListMsg;
import engine.objects.Guild;
import engine.objects.GuildHistory;
import engine.objects.GuildStatusController;
import engine.objects.PlayerCharacter;
import engine.objects.*;
import org.joda.time.DateTime;
public class BanishUnbanishHandler extends AbstractClientMsgHandler {
@ -117,8 +115,20 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler { @@ -117,8 +115,20 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
GuildListMsg guildListMsg = new GuildListMsg(guild);
dispatch = Dispatch.borrow(source, guildListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
if(GroupManager.getGroup(target) != null)
GroupManager.removeFromGroups(PlayerCharacter.getFromCache(target));
if(GroupManager.getGroup(target) != null) {
Group group = GroupManager.getGroup(target);
group.removeGroupMember(PlayerCharacter.getPlayerCharacter(target));
GroupManager.removeFromGroups(PlayerCharacter.getPlayerCharacter(target));
GroupUpdateMsg gim;
gim = new GroupUpdateMsg();
gim.setGroup(group);
gim.setMessageType(3);
gim.setPlayer(PlayerCharacter.getPlayerCharacter(target));
group.sendUpdate(gim);
String text = PlayerCharacter.getPlayerCharacter(target).getFirstName() + " has left your group.";
ChatManager.chatGroupInfo(source, text);
}
} else {
ErrorPopupMsg.sendErrorPopup(source, 103); // You may not banish this char
}

15
src/engine/net/client/handlers/LeaveGuildHandler.java

@ -18,6 +18,7 @@ import engine.net.Dispatch; @@ -18,6 +18,7 @@ import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.group.GroupUpdateMsg;
import engine.net.client.msg.guild.LeaveGuildMsg;
import engine.objects.*;
@ -59,8 +60,20 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler { @@ -59,8 +60,20 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
return true;
}
if(GroupManager.getGroup(playerCharacter) != null)
if(GroupManager.getGroup(playerCharacter) != null) {
Group group = GroupManager.getGroup(playerCharacter);
group.removeGroupMember(playerCharacter);
GroupManager.removeFromGroups(playerCharacter);
GroupUpdateMsg gim;
gim = new GroupUpdateMsg();
gim.setGroup(group);
gim.setMessageType(3);
gim.setPlayer(playerCharacter);
group.sendUpdate(gim);
String text = playerCharacter.getFirstName() + " has left your group.";
ChatManager.chatGroupInfo(playerCharacter, text);
}
// Send left guild message to rest of guild
ChatManager.chatGuildInfo(oldGuild, playerCharacter.getFirstName() + " has left the guild.");

Loading…
Cancel
Save