1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Get enemies spawning in singleplayer #23

This commit is contained in:
NG (Graham)
2025-05-30 23:03:02 -04:00
parent 1a7400d3d9
commit 50cc0cc3a9
19 changed files with 327 additions and 54 deletions

View File

@@ -60,3 +60,15 @@ pub enum ChatErrorCodes {
PasswordRequired = 16,
ChannelExpired = 17,
}
#[repr(i16)]
#[allow(dead_code)]
#[derive(Debug)]
pub enum SingleplayerErrorCode {
None = 0,
DatabaseError = 1,
UnexpectedError = 2,
WrongNumberOfAuthParams = 3,
MaintenanceMode = 4,
DuplicateLogin = 5,
}

View File

@@ -13,6 +13,7 @@ pub mod weapon_upgrade;
pub mod crf;
pub mod channel;
pub mod sanction;
pub mod robot_data;
pub mod error_codes;

View File

@@ -0,0 +1,23 @@
use polariton::operation::Typed;
pub struct PrebuiltRobotInfo {
//pub id: String,
pub name: String,
pub class: String,
pub category: String,
pub robot_data: Vec<u8>,
pub colour_data: Vec<u8>,
}
impl PrebuiltRobotInfo {
pub fn as_transmissible<C>(&self) -> Typed<C> {
Typed::HashMap(vec![
//(Typed::Str("[key]".into()), Typed::Str(self.id.clone().into())),
(Typed::Str("Name".into()), Typed::Str(self.name.clone().into())),
(Typed::Str("Class".into()), Typed::Str(self.class.clone().into())),
(Typed::Str("Category".into()), Typed::Str(self.category.clone().into())),
(Typed::Str("RobotData".into()), Typed::Bytes(self.robot_data.clone().into())),
(Typed::Str("ColourData".into()), Typed::Bytes(self.colour_data.clone().into())),
].into())
}
}