Added /room command to know in which room the user is

This commit is contained in:
Clément
2025-03-02 12:28:53 +01:00
parent e9f1feaaad
commit e52066ce17
9 changed files with 80 additions and 31 deletions

View File

@@ -136,4 +136,15 @@ public class ServerConnexion implements PacketVisitor {
throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
}
@Override
public void visitPacket(RequestActualRoomPacket packet) {
sendPacket(new ActualRoomPacket(server.getRoomName(this)));
}
@Override
public void visitPacket(ActualRoomPacket packet) {
// I'm never supposed to receive this from the client
throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
}
}