mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Implement most of the occasional packets sent in elimination, expand interface for custom game logic #30
This commit is contained in:
@@ -97,6 +97,7 @@ mod garage_slot_controls;
|
||||
mod garage_slot_set_customisations;
|
||||
mod garage_slot_name;
|
||||
mod garage_slot_copy;
|
||||
mod steam_promo;
|
||||
|
||||
use polariton_server::operations::OperationsHandler;
|
||||
|
||||
@@ -219,4 +220,5 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
|
||||
.add(garage_slot_copy::garage_slot_copy_provider())
|
||||
.add(polariton_server::operations::Ack::<12, _>::default()) // TODO handle UpdatePlayerDailyQuestProgressRequest instead of ignoring it
|
||||
.add(polariton_server::operations::Ack::<90, _>::default()) // TODO handle SubmitCRFRatingRequest instead of ignoring it
|
||||
.add(steam_promo::steam_promos_provider())
|
||||
}
|
||||
|
||||
22
rc_services_room/src/operations/steam_promo.rs
Normal file
22
rc_services_room/src/operations/steam_promo.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use polariton_server::operations::Immediate;
|
||||
use polariton::operation::Typed;
|
||||
|
||||
const CODE: u8 = 52;
|
||||
const PROMO_LIST_PARAM_KEY: u8 = 63; // list of str
|
||||
const STEAM_PROMOS_PARAM_KEY: u8 = 121; // string (json)
|
||||
const CUBES_AWARDED_PARAM_KEY: u8 = 128; // string (json)
|
||||
const PASS_AWARDED_PARAM_KEY: u8 = 4; // bool
|
||||
|
||||
pub(super) fn steam_promos_provider() -> Immediate<CODE, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(4);
|
||||
params.insert(PROMO_LIST_PARAM_KEY, Typed::Arr(polariton::operation::Arr {
|
||||
ty: polariton::serdes::TypePrefix::Str,
|
||||
items: Vec::default(),
|
||||
}));
|
||||
params.insert(STEAM_PROMOS_PARAM_KEY, Typed::Str("{}".into()));
|
||||
params.insert(CUBES_AWARDED_PARAM_KEY, Typed::Str("{}".into()));
|
||||
params.insert(PASS_AWARDED_PARAM_KEY, Typed::Bool(false));
|
||||
params.into()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user