Platoons social functionality (#91)

### Description

This implements and completes #87 (to the best of my knowledge)

### Game

Robocraft

### Please confirm

- [x] I am the legal owner or represent the owner of all work submitted
- [x] I consent to my submission being added to this FOSS project
- [ ] This PR used LLMs to generate some or all of the code changes

Reviewed-on: https://git.ngram.ca/OpenJam/rc-servers/pulls/91
Co-authored-by: NG (Graham) <ngniusness@gmail.com>
Co-committed-by: NG (Graham) <ngniusness@gmail.com>
This commit is contained in:
NG (Graham) authored and NGnius committed 2026-02-19 01:57:03 +00:00
1 parent a82488ab3a
commit 50b396f34a
49 files changed
+1152 -47

No files matched your search

@@ -0,0 +1,31 @@
#[derive(Clone)]
pub struct PlatoonMemberStatusUpdate {
pub member_public_id: String,
pub member_display_name: String,
pub member_status: crate::data::platoon::MemberStatus,
}
impl PlatoonMemberStatusUpdate {
pub const CODE: u8 = 18;
pub fn as_event_params<C>(&self) -> polariton::operation::ParameterTable<C> {
let mut params = std::collections::HashMap::with_capacity(2);
params.insert(1, polariton::operation::Typed::Str(self.member_public_id.clone().into()));
params.insert(75, polariton::operation::Typed::Str(self.member_display_name.clone().into()));
params.insert(3, polariton::operation::Typed::Int(self.member_status.as_u8() as i32));
params.into()
}
}
impl <C: Send + 'static> polariton_server::events::IntoEvent<C> for PlatoonMemberStatusUpdate {
const CHANNEL: u8 = 0;
const ENCRYPT: bool = true;
const RELIABLE: bool = true;
fn into_event(self) -> polariton::operation::Event<C> {
polariton::operation::Event {
code: Self::CODE,
params: self.as_event_params(),
}
}
}