Skip to content

Commit ea1607e

Browse files
committed
Drop support for legacy, pcl2ce typed rooms.
1 parent ab0db9d commit ea1607e

File tree

9 files changed

+139
-485
lines changed

9 files changed

+139
-485
lines changed

src/controller/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::sync::mpsc;
22
use crate::controller::states::AppState;
3-
use crate::controller::{experimental, ConnectionDifficulty, ExceptionType, Room};
3+
use crate::controller::{scaffolding, ConnectionDifficulty, ExceptionType, Room};
44
use crate::scaffolding::profile::Profile;
55
use crate::mc::scanning::MinecraftScanner;
66
use crate::MOTD;
@@ -131,7 +131,7 @@ pub fn set_scanning(room: Option<String>, player: Option<String>) {
131131
}
132132
};
133133

134-
experimental::start_host(room, port, player, capture, receiver.recv().unwrap())
134+
scaffolding::start_host(room, port, player, capture, receiver.recv().unwrap())
135135
});
136136
}
137137

src/controller/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ mod rooms;
44

55
pub use rooms::*;
66

7-
use crate::scaffolding;
87
pub use states::ExceptionType;
98
pub use api::*;
9+
use crate::controller::rooms::scaffolding::protocols::HANDLERS;
1010

1111
lazy_static::lazy_static! {
12-
pub static ref SCAFFOLDING_PORT: u16 = scaffolding::server::start(experimental::HANDLERS, 13448)
13-
.unwrap_or_else(|_| scaffolding::server::start(experimental::HANDLERS, 0).unwrap());
12+
pub static ref SCAFFOLDING_PORT: u16 = crate::scaffolding::server::start(HANDLERS, 13448)
13+
.unwrap_or_else(|_| crate::scaffolding::server::start(HANDLERS, 0).unwrap());
1414
}

src/controller/rooms/legacy.rs

Lines changed: 0 additions & 288 deletions
This file was deleted.

src/controller/rooms/mod.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
pub mod experimental;
2-
mod legacy;
3-
mod pcl2ce;
1+
pub mod scaffolding;
42

53
use crate::controller::states::AppStateCapture;
64

@@ -10,14 +8,13 @@ pub struct Room {
108

119
pub(crate) network_name: String,
1210
pub(crate) network_secret: String,
11+
#[allow(dead_code)]
1312
pub(crate) kind: RoomKind,
1413
}
1514

1615
#[derive(Debug, Clone)]
1716
pub(crate) enum RoomKind {
18-
Experimental { seed: u128 },
19-
TerracottaLegacy { mc_port: u16 },
20-
PCL2CE { mc_port: u16 },
17+
Scaffolding { #[allow(dead_code)] seed: u128 }
2118
}
2219

2320
#[derive(Debug)]
@@ -27,23 +24,14 @@ pub enum ConnectionDifficulty {
2724

2825
impl Room {
2926
pub fn create() -> Room {
30-
experimental::create_room()
27+
scaffolding::create_room()
3128
}
3229

3330
pub fn from(code: &str) -> Option<Room> {
34-
for parser in [experimental::parse, legacy::parse, pcl2ce::parse] {
35-
if let Some(room) = parser(code) {
36-
return Some(room);
37-
}
38-
}
39-
40-
None
31+
scaffolding::parse(code)
4132
}
4233

4334
pub fn start_guest(self, capture: AppStateCapture, player: Option<String>) {
44-
match self.kind {
45-
RoomKind::Experimental { .. } => experimental::start_guest(self, player, capture),
46-
RoomKind::TerracottaLegacy { .. } | RoomKind::PCL2CE { .. } => legacy::start_guest(self, capture),
47-
};
35+
scaffolding::start_guest(self, player, capture)
4836
}
4937
}

0 commit comments

Comments
 (0)