|
@ -15,7 +15,7 @@ pub enum AreaType { |
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
|
pub struct LobbyId(pub usize);
|
|
|
pub struct LobbyId(pub usize);
|
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, derive_more::Display)]
|
|
|
pub struct RoomId(pub usize);
|
|
|
pub struct RoomId(pub usize);
|
|
|
|
|
|
|
|
|
impl LobbyId {
|
|
|
impl LobbyId {
|
|
@ -26,7 +26,7 @@ impl LobbyId { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("create room")]
|
|
|
pub enum CreateRoomError {
|
|
|
pub enum CreateRoomError {
|
|
|
NoOpenSlots,
|
|
|
NoOpenSlots,
|
|
|
ClientInAreaAlready,
|
|
|
ClientInAreaAlready,
|
|
@ -34,7 +34,7 @@ pub enum CreateRoomError { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("join room")]
|
|
|
pub enum JoinRoomError {
|
|
|
pub enum JoinRoomError {
|
|
|
RoomDoesNotExist,
|
|
|
RoomDoesNotExist,
|
|
|
RoomFull,
|
|
|
RoomFull,
|
|
@ -42,7 +42,7 @@ pub enum JoinRoomError { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("join lobby")]
|
|
|
pub enum JoinLobbyError {
|
|
|
pub enum JoinLobbyError {
|
|
|
LobbyDoesNotExist,
|
|
|
LobbyDoesNotExist,
|
|
|
LobbyFull,
|
|
|
LobbyFull,
|
|
@ -50,7 +50,7 @@ pub enum JoinLobbyError { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("get area")]
|
|
|
pub enum GetAreaError {
|
|
|
pub enum GetAreaError {
|
|
|
NotInRoom,
|
|
|
NotInRoom,
|
|
|
NotInLobby,
|
|
|
NotInLobby,
|
|
@ -58,28 +58,28 @@ pub enum GetAreaError { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("client removal")]
|
|
|
pub enum ClientRemovalError {
|
|
|
pub enum ClientRemovalError {
|
|
|
ClientNotInArea,
|
|
|
ClientNotInArea,
|
|
|
InvalidArea,
|
|
|
InvalidArea,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("get clients")]
|
|
|
pub enum GetClientsError {
|
|
|
pub enum GetClientsError {
|
|
|
InvalidClient,
|
|
|
InvalidClient,
|
|
|
InvalidArea,
|
|
|
InvalidArea,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("get neighbor")]
|
|
|
pub enum GetNeighborError {
|
|
|
pub enum GetNeighborError {
|
|
|
InvalidClient,
|
|
|
InvalidClient,
|
|
|
InvalidArea,
|
|
|
InvalidArea,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("get leader")]
|
|
|
pub enum GetLeaderError {
|
|
|
pub enum GetLeaderError {
|
|
|
InvalidClient,
|
|
|
InvalidClient,
|
|
|
InvalidArea,
|
|
|
InvalidArea,
|
|
@ -87,7 +87,7 @@ pub enum GetLeaderError { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("clientlocation")]
|
|
|
pub enum ClientLocationError {
|
|
|
pub enum ClientLocationError {
|
|
|
CreateRoomError(#[from] CreateRoomError),
|
|
|
CreateRoomError(#[from] CreateRoomError),
|
|
|
JoinRoomError(#[from] JoinRoomError),
|
|
|
JoinRoomError(#[from] JoinRoomError),
|
|
|