mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Fix dependency build error, rename operation modifier
This commit is contained in:
42
Cargo.lock
generated
42
Cargo.lock
generated
@@ -2498,7 +2498,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_auth"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2517,7 +2517,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_cdn"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
@@ -2531,7 +2531,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_polariton_auth"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"num",
|
||||
@@ -2543,7 +2543,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_chat"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2556,7 +2556,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_chat_room"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"clap",
|
||||
@@ -2574,7 +2574,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_core"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"async-trait",
|
||||
@@ -2595,7 +2595,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_database"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"sea-orm",
|
||||
@@ -2604,7 +2604,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_factory"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
@@ -2616,7 +2616,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_lobby"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2629,7 +2629,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_lobby_room"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"clap",
|
||||
@@ -2644,7 +2644,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_microtransactions"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"git-version",
|
||||
@@ -2655,7 +2655,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_services"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2668,7 +2668,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_services_room"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
@@ -2691,7 +2691,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_singleplayer"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2704,7 +2704,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_singleplayer_room"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"clap",
|
||||
@@ -2719,7 +2719,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_social"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
@@ -2732,7 +2732,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "oj_rc_social_room"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"clap",
|
||||
@@ -2984,17 +2984,13 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
|
||||
[[package]]
|
||||
name = "polariton"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "702e1d4db7a6a1fc945d934b6636fc4831ed22249141faf6ab21e6a273d153bf"
|
||||
dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polariton_server"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "564b6872c1aaf14b4281a7d2d87373eea18573ee717fb351e0d41beee5f5cb10"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"log",
|
||||
@@ -3908,7 +3904,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "servers"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
|
||||
[[package]]
|
||||
name = "sha1"
|
||||
|
||||
@@ -33,10 +33,10 @@ libfj = { version = "0.8" }
|
||||
log = "0.4"
|
||||
env_logger = "0.11"
|
||||
clap = { version = "4.5", features = [ "derive" ] }
|
||||
#polariton = { version = "0.2", path = "../polariton", features = [ "tokio-async" ] }
|
||||
#polariton_server = { version = "0.2", path = "../polariton/server", features = [ "tokio-async" ] }
|
||||
polariton = { version = "0.2", features = [ "tokio-async" ] }
|
||||
polariton_server = { version = "0.2", features = [ "tokio-async" ] }
|
||||
polariton = { version = "0.2", path = "../polariton", features = [ "tokio-async" ] }
|
||||
polariton_server = { version = "0.3", path = "../polariton/server", features = [ "tokio-async" ] }
|
||||
#polariton = { version = "0.2", features = [ "tokio-async" ] }
|
||||
#polariton_server = { version = "0.3", features = [ "tokio-async" ] }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
serde_json = "1.0"
|
||||
async-trait = "0.1"
|
||||
|
||||
@@ -14,7 +14,7 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler(chat_system: crate::state::chat::ChatImpl, conf: &oj_rc_core::persist::config::ConfigImpl) -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::new()
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::RcOpModifier)
|
||||
.add(more_auth::MoreLobbyAuth::new(chat_system.clone()))
|
||||
.add(chat_ignores::ignores_provider())
|
||||
.add(pending_sanctions::pending_sanctions_checker())
|
||||
|
||||
@@ -37,7 +37,7 @@ impl MoreLobbyAuth {
|
||||
let name = user_impl.token().uuid.clone();
|
||||
//let chat_user = super::get_chat_user(user_impl.as_ref().as_ref());
|
||||
let channels = user_impl.subscribed_channels_strings().await?;
|
||||
let event_tx = user.event_sender();
|
||||
let event_tx = user.event_chann();
|
||||
self.chat_system.system_mut().connect_user(name, channels, event_tx);
|
||||
let mut resp_params = std::collections::HashMap::new();
|
||||
resp_params.insert(Self::AUTH_PAYLOAD_KEY, polariton::operation::Typed::Byte(0));
|
||||
|
||||
@@ -24,5 +24,5 @@ libfj.workspace = true
|
||||
jsonwebtoken = "9"
|
||||
argon2 = { version = "0.5", features = [ "std" ] }
|
||||
|
||||
oj_rc_database = { version = "0.2", path = "../rc_database" }
|
||||
oj_rc_factory = { version = "0.2", path = "../rc_factory" }
|
||||
oj_rc_database = { version = "*", path = "../rc_database" }
|
||||
oj_rc_factory = { version = "*", path = "../rc_factory" }
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
mod svelto_uuid_copy;
|
||||
pub use svelto_uuid_copy::OpIdCopy;
|
||||
mod op_mod;
|
||||
pub use op_mod::RcOpModifier;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use polariton_server::operations::OperationModifier;
|
||||
|
||||
pub struct OpIdCopy;
|
||||
pub struct RcOpModifier;
|
||||
|
||||
impl OpIdCopy {
|
||||
impl RcOpModifier {
|
||||
const SERVICE_MAPPING_KEY: u8 = 0;
|
||||
}
|
||||
|
||||
impl <C: Clone + Send + Sync + 'static> OperationModifier<C> for OpIdCopy {
|
||||
impl <C: Clone + Send + Sync + 'static> OperationModifier<C> for RcOpModifier {
|
||||
fn after(&self, req: &mut polariton::operation::OperationRequest<C>, resp: &mut polariton::operation::OperationResponse<C>, flags: &mut u8) {
|
||||
if resp.params.get(&Self::SERVICE_MAPPING_KEY).is_none() {
|
||||
if let Some(svelto_service_id) = req.params.get(&Self::SERVICE_MAPPING_KEY) {
|
||||
@@ -1,12 +1,13 @@
|
||||
use crate::persist::user::UserProvider;
|
||||
use polariton_server::ToSend;
|
||||
|
||||
pub struct UserState<C: Clone = ()> {
|
||||
pub struct UserState<C: Clone + Send + 'static = ()> {
|
||||
state: std::sync::RwLock<InitState<C>>,
|
||||
event_tx: tokio::sync::mpsc::UnboundedSender<ToSend<C>>,
|
||||
event_emitter: polariton_server::events::EventEmitter<C>,
|
||||
}
|
||||
|
||||
impl <C: Clone> UserState<C> {
|
||||
impl <C: Clone + Send + 'static> UserState<C> {
|
||||
pub async fn update_with_auth(&self, auth_str: &str) -> bool {
|
||||
self.update_with_auth_ext(auth_str, |_| Some(Default::default())).await
|
||||
}
|
||||
@@ -53,9 +54,11 @@ impl <C: Clone> UserState<C> {
|
||||
}
|
||||
|
||||
pub fn new(provider: std::sync::Arc<crate::persist::user::UserImpl>, event_tx: tokio::sync::mpsc::UnboundedSender<ToSend<C>>) -> Self {
|
||||
let emitter = polariton_server::events::EventEmitter::new(event_tx.clone());
|
||||
Self {
|
||||
state: std::sync::RwLock::new(InitState::Unauthenticated(provider)),
|
||||
event_tx,
|
||||
event_emitter: emitter,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +70,16 @@ impl <C: Clone> UserState<C> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn event(&self, event_data: ToSend<C>) {
|
||||
/*pub fn event(&self, event_data: ToSend<C>) {
|
||||
self.event_tx.send(event_data).unwrap()
|
||||
}*/
|
||||
|
||||
pub fn event_chann(&self) -> tokio::sync::mpsc::UnboundedSender<ToSend<C>> {
|
||||
self.event_tx.clone()
|
||||
}
|
||||
|
||||
pub fn event_sender(&self) -> tokio::sync::mpsc::UnboundedSender<ToSend<C>> {
|
||||
self.event_tx.clone()
|
||||
pub fn event_sender(&self) -> &'_ polariton_server::events::EventEmitter<C> {
|
||||
&self.event_emitter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler(_init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::<crate::UserTy>::new()
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::RcOpModifier)
|
||||
.add(more_auth::MoreLobbyAuth)
|
||||
//.add(eac::EacChallengeIgnorer)
|
||||
//.add(polariton_server::operations::Ack::<2, _>::default())
|
||||
|
||||
@@ -102,7 +102,7 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::new()
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::RcOpModifier)
|
||||
.add(eac::EacChallengeIgnorer)
|
||||
.add(more_auth::MoreLobbyAuth)
|
||||
.add(versioner::VersionTeller)
|
||||
|
||||
@@ -6,7 +6,7 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::<crate::UserTy>::new()
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::RcOpModifier)
|
||||
.add(more_auth::MoreLobbyAuth)
|
||||
.add(eac::EacChallengeIgnorer)
|
||||
.add(load_ai_robots::tdm_machines_provider(&init_ctx.factory, init_ctx.parsers.weapon_order(), &init_ctx.config))
|
||||
|
||||
@@ -12,7 +12,7 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler() -> OperationsHandler<crate::UserTy, crate::data::custom::CustomType> {
|
||||
OperationsHandler::<crate::UserTy, crate::data::custom::CustomType>::new()
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::RcOpModifier)
|
||||
.add(more_auth::MoreLobbyAuth)
|
||||
//.add(polariton_server::operations::Ack::<33, _>::default()) // get user clan info (this is equivalent to not being in a clan)
|
||||
.add(friend_list::friends_provider()) // TODO friend object parsing Token: 0x0200169C RID: 5788
|
||||
|
||||
Reference in New Issue
Block a user