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

Add stats chat command

This commit is contained in:
NG (Graham)
2025-10-31 22:41:33 -04:00
parent 3ef1aa20d0
commit 340f571637
11 changed files with 177 additions and 1 deletions

View File

@@ -117,6 +117,7 @@ pub enum BuiltInChatOperation {
Intercom(IntercomChatOperation),
OnlineUsers,
TotalUsers,
Stats,
Version,
Help,
}

View File

@@ -29,4 +29,8 @@ impl super::CommonUser for UserData {
async fn resolve_config_vehicle(&self, vehicle: &crate::persist::config::VehicleInfo, factory: &dyn oj_rc_factory::VehicleFactoryAdapter, weapon_order: &crate::cubes::WeaponListParser, cpu_counter: &crate::cubes::CpuListParser) -> Result<super::ResolvedVehicle, polariton_server::operations::SimpleOpError> {
self.resolve_vehicle(vehicle, factory, weapon_order, cpu_counter).await
}
async fn db_metrics(&self) -> oj_rc_database::DatabaseMetrics {
self.db.metrics().await
}
}

View File

@@ -376,4 +376,5 @@ pub trait CommonUser: Send + Sync {
fn is_dev(&self) -> bool;
fn is_royal(&self) -> bool;
fn is_banned(&self) -> bool;
async fn db_metrics(&self) -> oj_rc_database::DatabaseMetrics;
}