mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Create initial multiplayer server skeleton
This commit is contained in:
2
rc_multiplayer/src/data/mod.rs
Normal file
2
rc_multiplayer/src/data/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod net_msg_ty;
|
||||
pub use net_msg_ty::MessageType;
|
||||
18
rc_multiplayer/src/data/net_msg_ty.rs
Normal file
18
rc_multiplayer/src/data/net_msg_ty.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
#[repr(i16)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum MessageType {
|
||||
ClientMsg = 48,
|
||||
ServerMsg = 49,
|
||||
RobotMotion = 50,
|
||||
}
|
||||
|
||||
impl MessageType {
|
||||
pub fn from_i16(num: i16) -> Option<Self> {
|
||||
match num {
|
||||
48 => Some(Self::ClientMsg),
|
||||
49 => Some(Self::ServerMsg),
|
||||
50 => Some(Self::RobotMotion),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user