Disallow joining same chatroom
This commit is contained in:
parent
760f52df71
commit
6183ccd6bf
3 changed files with 10 additions and 0 deletions
|
@ -86,6 +86,9 @@ public class ChatManager {
|
|||
*/
|
||||
public void setPlayerChatRoom(ChatRoom chatRoom, Player player) {
|
||||
ChatRoom oldRoom = getPlayerChatRoom(player);
|
||||
|
||||
if (chatRoom.equals(oldRoom)) return; // no change if changing to the same room
|
||||
|
||||
oldRoom.players.remove(player);
|
||||
|
||||
player.getPersistentDataContainer().set(chatRoomKey, PersistentDataType.STRING, chatRoom.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue