mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
broadcast message on player leaving, like joins
Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
@@ -323,8 +323,10 @@ public final class FServerManager {
|
|||||||
@Override
|
@Override
|
||||||
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
|
||||||
final RemoteClient client = clients.remove(ctx.channel());
|
final RemoteClient client = clients.remove(ctx.channel());
|
||||||
|
final String username = client.getUsername();
|
||||||
localLobby.disconnectPlayer(client.getIndex());
|
localLobby.disconnectPlayer(client.getIndex());
|
||||||
broadcast(new LogoutEvent(client.getUsername()));
|
broadcast(new MessageEvent(String.format("%s left the room", username)));
|
||||||
|
broadcast(new LogoutEvent(username));
|
||||||
super.channelInactive(ctx);
|
super.channelInactive(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user