forked from lavina/lavina
return AlreadyJoined when a player attempts to join a room they are already in
This commit is contained in:
parent
cebe354179
commit
5a09b743c9
|
@ -177,6 +177,7 @@ pub enum ClientCommand {
|
|||
|
||||
pub enum JoinResult {
|
||||
Success(RoomInfo),
|
||||
AlreadyJoined,
|
||||
Banned,
|
||||
}
|
||||
|
||||
|
@ -388,6 +389,9 @@ impl Player {
|
|||
if self.banned_from.contains(&room_id) {
|
||||
return JoinResult::Banned;
|
||||
}
|
||||
if self.my_rooms.contains_key(&room_id) {
|
||||
return JoinResult::AlreadyJoined;
|
||||
}
|
||||
|
||||
let room = match self.rooms.get_or_create_room(room_id.clone()).await {
|
||||
Ok(room) => room,
|
||||
|
|
Loading…
Reference in New Issue