Properties calc port for 1.7beta #7

Merged
xeon merged 2 commits from :1.7_beta into 1.7_beta 2025-03-19 08:52:05 +00:00
47 changed files with 15054 additions and 10593 deletions
Showing only changes of commit 219b92f004 - Show all commits

View file

@ -10,7 +10,7 @@ use trigger_sv::{
net::ServerType, net::ServerType,
}; };
use crate::{logic::GameState, session::BattleSession, AppState}; use crate::{AppState, logic::GameState, session::BattleSession};
pub async fn handle_message(state: &'static AppState, packet: trigger_sv::message::NetworkPacket) { pub async fn handle_message(state: &'static AppState, packet: trigger_sv::message::NetworkPacket) {
match packet.opcode { match packet.opcode {

View file

@ -1,5 +1,5 @@
use trigger_encoding::Decodeable; use trigger_encoding::Decodeable;
use trigger_protocol::{util::ProtocolUnit, ClientCmdID, EndBattleCsReq}; use trigger_protocol::{ClientCmdID, EndBattleCsReq, util::ProtocolUnit};
use trigger_sv::message::GameStateCallback; use trigger_sv::message::GameStateCallback;
use super::BattleSession; use super::BattleSession;

View file

@ -3,7 +3,7 @@ use std::{
sync::{LazyLock, OnceLock}, sync::{LazyLock, OnceLock},
}; };
use axum::{routing::get, Router}; use axum::{Router, routing::get};
use config::DispatchConfig; use config::DispatchConfig;
use tokio::net::TcpListener; use tokio::net::TcpListener;
use tracing::error; use tracing::error;

View file

@ -1,8 +1,8 @@
use axum::{extract::State, Json}; use axum::{Json, extract::State};
use crate::{ use crate::{
data::{QueryDispatchRsp, ServerListInfo},
AppState, AppState,
data::{QueryDispatchRsp, ServerListInfo},
}; };
pub const ROUTE_ENDPOINT: &str = "/query_dispatch"; pub const ROUTE_ENDPOINT: &str = "/query_dispatch";

View file

@ -1,20 +1,20 @@
use axum::{ use axum::{
Json,
extract::{Query, State}, extract::{Query, State},
response::IntoResponse, response::IntoResponse,
Json,
}; };
use base64::{display::Base64Display, engine::general_purpose::STANDARD, Engine}; use base64::{Engine, display::Base64Display, engine::general_purpose::STANDARD};
use serde::{Deserialize, Serialize, Serializer}; use serde::{Deserialize, Serialize, Serializer};
use tracing::debug; use tracing::debug;
use trigger_cryptography::rsa; use trigger_cryptography::rsa;
use trigger_sv::config::RsaSetting; use trigger_sv::config::RsaSetting;
use crate::{ use crate::{
AppState,
data::{ data::{
CdnConfExt, CdnDesignData, CdnGameRes, CdnSilenceData, RegionExtension, RegionSwitchFunc, CdnConfExt, CdnDesignData, CdnGameRes, CdnSilenceData, RegionExtension, RegionSwitchFunc,
ServerDispatchData, ServerGateway, ServerDispatchData, ServerGateway,
}, },
AppState,
}; };
pub const ROUTE_ENDPOINT: &str = "/query_gateway"; pub const ROUTE_ENDPOINT: &str = "/query_gateway";
@ -127,7 +127,10 @@ fn internal_process(
msg: String::with_capacity(0), msg: String::with_capacity(0),
region_name: Borrowed(&server.name), region_name: Borrowed(&server.name),
title: Borrowed(&server.title), title: Borrowed(&server.title),
client_secret_key: Owned(base64::engine::general_purpose::STANDARD.encode(&state.environment.security.static_key.seed_buf)), client_secret_key: Owned(
base64::engine::general_purpose::STANDARD
.encode(&state.environment.security.static_key.seed_buf),
),
cdn_check_url: String::with_capacity(0), cdn_check_url: String::with_capacity(0),
gateway: Some(ServerGateway { gateway: Some(ServerGateway {
ip: Borrowed(&server.addr), ip: Borrowed(&server.addr),
@ -139,20 +142,32 @@ fn internal_process(
cdn_conf_ext: Some(CdnConfExt { cdn_conf_ext: Some(CdnConfExt {
// TODO: unhardcode this // TODO: unhardcode this
design_data: CdnDesignData { design_data: CdnDesignData {
base_url: Borrowed("https://autopatchcn.juequling.com/design_data/beta_live/output_7054632_323d17319c/client/"), base_url: Borrowed(
"https://autopatchcn.juequling.com/design_data/beta_live/output_7054632_323d17319c/client/",
),
data_revision: Borrowed("7054632"), data_revision: Borrowed("7054632"),
md5_files: Borrowed(r#"[{"fileName": "data_version", "fileSize": 4503, "fileMD5": "419987357302147246"}]"#), md5_files: Borrowed(
r#"[{"fileName": "data_version", "fileSize": 4503, "fileMD5": "419987357302147246"}]"#,
),
}, },
game_res: CdnGameRes { game_res: CdnGameRes {
audio_revision: Borrowed("7025371"), audio_revision: Borrowed("7025371"),
base_url: Borrowed("https://autopatchcn.juequling.com/game_res/beta_live/output_7054632_323d17319c/client/"), base_url: Borrowed(
"https://autopatchcn.juequling.com/game_res/beta_live/output_7054632_323d17319c/client/",
),
branch: Borrowed("beta_live"), branch: Borrowed("beta_live"),
md5_files: Borrowed(r#"[{"fileName": "res_version", "fileSize": 2379030, "fileMD5": "15840336186912297231"}, {"fileName": "audio_version", "fileSize": 30435, "fileMD5": "15675397132378459243"}, {"fileName": "base_revision", "fileSize": 18, "fileMD5": "18079377284431001248"}]"#), md5_files: Borrowed(
r#"[{"fileName": "res_version", "fileSize": 2379030, "fileMD5": "15840336186912297231"}, {"fileName": "audio_version", "fileSize": 30435, "fileMD5": "15675397132378459243"}, {"fileName": "base_revision", "fileSize": 18, "fileMD5": "18079377284431001248"}]"#,
),
res_revision: Borrowed("7054632"), res_revision: Borrowed("7054632"),
}, },
silence_data: CdnSilenceData { silence_data: CdnSilenceData {
base_url: Borrowed("https://autopatchcn.juequling.com/design_data/beta_live/output_7054632_323d17319c/client_silence/"), base_url: Borrowed(
md5_files: Borrowed(r#"[{"fileName": "silence_version", "fileSize": 647, "fileMD5": "15019531890587528788"}]"#), "https://autopatchcn.juequling.com/design_data/beta_live/output_7054632_323d17319c/client_silence/",
),
md5_files: Borrowed(
r#"[{"fileName": "silence_version", "fileSize": 647, "fileMD5": "15019531890587528788"}]"#,
),
silence_revision: Borrowed("7042559"), silence_revision: Borrowed("7042559"),
}, },
pre_download: None, pre_download: None,
@ -174,7 +189,7 @@ fn internal_process(
url_check_nap: String::new(), url_check_nap: String::new(),
url_check_sdk: String::new(), url_check_sdk: String::new(),
}), }),
} },
}) })
} }

View file

@ -1,11 +1,11 @@
use tracing::{debug, warn}; use tracing::{debug, warn};
use trigger_logic::quest::EQuestType; use trigger_logic::quest::EQuestType;
use trigger_protocol::{util::ProtocolUnit, AvatarSync, CafeSync, ItemSync, PlayerSyncScNotify}; use trigger_protocol::{AvatarSync, CafeSync, ItemSync, PlayerSyncScNotify, util::ProtocolUnit};
use trigger_sv::gm_command::GMCommand; use trigger_sv::gm_command::GMCommand;
use crate::AppState; use crate::AppState;
use super::{player::AvatarPropertyChanges, NapPlayer}; use super::{NapPlayer, player::AvatarPropertyChanges};
pub struct CommandContext<'player> { pub struct CommandContext<'player> {
pub player: &'player mut NapPlayer, pub player: &'player mut NapPlayer,

View file

@ -6,7 +6,7 @@ use quest::QuestModel;
use ramen::RamenModel; use ramen::RamenModel;
use role::RoleModel; use role::RoleModel;
use scene::SceneModel; use scene::SceneModel;
use trigger_database::{entity::*, prelude::*, DatabaseConnection}; use trigger_database::{DatabaseConnection, entity::*, prelude::*};
use trigger_fileconfig::NapFileCfg; use trigger_fileconfig::NapFileCfg;
use trigger_logic::scene::ESceneType; use trigger_logic::scene::ESceneType;
use trigger_protocol::PlayerBasicInfo; use trigger_protocol::PlayerBasicInfo;

View file

@ -1,6 +1,6 @@
use trigger_database::DatabaseConnection;
use trigger_database::entity::*; use trigger_database::entity::*;
use trigger_database::prelude::*; use trigger_database::prelude::*;
use trigger_database::DatabaseConnection;
pub async fn load_player_basic_info( pub async fn load_player_basic_info(
db: &DatabaseConnection, db: &DatabaseConnection,

View file

@ -12,7 +12,7 @@ use tracing::{error, info};
use trigger_database::DatabaseConnection; use trigger_database::DatabaseConnection;
use trigger_fileconfig::NapFileCfg; use trigger_fileconfig::NapFileCfg;
use trigger_sv::{ use trigger_sv::{
config::{load_json_config, ServerEnvironmentConfiguration, TomlConfig}, config::{ServerEnvironmentConfiguration, TomlConfig, load_json_config},
die, logging, die, logging,
net::{ServerNetworkManager, ServerType}, net::{ServerNetworkManager, ServerType},
print_banner, print_banner,

View file

@ -1,9 +1,9 @@
use std::sync::Arc; use std::sync::Arc;
use crate::{ use crate::{
logic::{gm_util, NapPlayer},
session::GameSession,
AppState, AppState,
logic::{NapPlayer, gm_util},
session::GameSession,
}; };
use tokio::sync::Mutex; use tokio::sync::Mutex;
use tracing::{debug, info, warn}; use tracing::{debug, info, warn};

View file

@ -1,5 +1,5 @@
use trigger_encoding::Encodeable; use trigger_encoding::Encodeable;
use trigger_protocol::{util::ProtocolUnit, ClientCmdID}; use trigger_protocol::{ClientCmdID, util::ProtocolUnit};
use super::GameSession; use super::GameSession;
use crate::AppState; use crate::AppState;

View file

@ -15,7 +15,7 @@ use trigger_sv::{
net::{ServerNetworkManager, ServerType}, net::{ServerNetworkManager, ServerType},
}; };
use crate::logic::{scene_util, NapPlayer}; use crate::logic::{NapPlayer, scene_util};
pub mod message; pub mod message;

View file

@ -12,10 +12,10 @@ use trigger_sv::{
}; };
use crate::{ use crate::{
AppState,
net::{Connection, NetPacket}, net::{Connection, NetPacket},
session::SessionState, session::SessionState,
util::BinExt, util::BinExt,
AppState,
}; };
pub async fn handle_message(connection: &Connection, state: &'static AppState, packet: NetPacket) { pub async fn handle_message(connection: &Connection, state: &'static AppState, packet: NetPacket) {
@ -41,20 +41,33 @@ pub async fn handle_message(connection: &Connection, state: &'static AppState, p
on_keep_alive( on_keep_alive(
connection, connection,
state, state,
KeepAliveNotify::decode(&*packet.body).unwrap_or_default() KeepAliveNotify::decode(&*packet.body).unwrap_or_default(),
).await )
.await
} }
cmd_id if connection.session.is_logged_in() => { cmd_id if connection.session.is_logged_in() => {
match trigger_protobuf::pb_to_common_protocol_unit(cmd_id, &packet.body) { match trigger_protobuf::pb_to_common_protocol_unit(cmd_id, &packet.body) {
Ok(Some(unit)) => state.network_mgr.send_to(ServerType::GameServer, 0, ForwardClientProtocolMessage { Ok(Some(unit)) => {
session_id: connection.session.id, state
request_id: head.packet_id, .network_mgr
message: unit, .send_to(
}).await, ServerType::GameServer,
0,
ForwardClientProtocolMessage {
session_id: connection.session.id,
request_id: head.packet_id,
message: unit,
},
)
.await
}
Ok(None) => warn!("ignoring message with unknown cmd_id: {cmd_id}"), Ok(None) => warn!("ignoring message with unknown cmd_id: {cmd_id}"),
Err(err) => error!( Err(err) => error!(
"failed to decode a message with cmd_id: {} from {} (player_uid: {}), error: {}", "failed to decode a message with cmd_id: {} from {} (player_uid: {}), error: {}",
cmd_id, connection.addr(), connection.session.player_uid(), err cmd_id,
connection.addr(),
connection.session.player_uid(),
err
), ),
} }
} }

View file

@ -1,7 +1,7 @@
use tokio::sync::mpsc; use tokio::sync::mpsc;
use tracing::warn; use tracing::warn;
use crate::{net::NetPacket, AppState}; use crate::{AppState, net::NetPacket};
#[derive(Clone)] #[derive(Clone)]
pub struct MessageHandler(mpsc::UnboundedSender<(u64, NetPacket)>); pub struct MessageHandler(mpsc::UnboundedSender<(u64, NetPacket)>);

View file

@ -2,8 +2,8 @@ use std::{
io, io,
net::SocketAddr, net::SocketAddr,
sync::{ sync::{
atomic::{AtomicU32, Ordering::SeqCst},
Arc, OnceLock, Arc, OnceLock,
atomic::{AtomicU32, Ordering::SeqCst},
}, },
time::Duration, time::Duration,
}; };

View file

@ -1,6 +1,6 @@
use std::io::{Cursor, Write}; use std::io::{Cursor, Write};
use byteorder::{WriteBytesExt, BE}; use byteorder::{BE, WriteBytesExt};
use trigger_protobuf::PacketHead; use trigger_protobuf::PacketHead;
pub struct NetPacket { pub struct NetPacket {

View file

@ -3,7 +3,7 @@ use std::{io, net::SocketAddr};
use tokio::net::TcpListener; use tokio::net::TcpListener;
use tracing::info; use tracing::info;
use crate::{message_handler::MessageHandler, AppState}; use crate::{AppState, message_handler::MessageHandler};
pub async fn serve( pub async fn serve(
addr: SocketAddr, addr: SocketAddr,

View file

@ -1,6 +1,6 @@
use std::sync::{ use std::sync::{
atomic::{AtomicI64, Ordering::SeqCst},
OnceLock, OnceLock,
atomic::{AtomicI64, Ordering::SeqCst},
}; };
use atomic_enum::atomic_enum; use atomic_enum::atomic_enum;

View file

@ -107,6 +107,6 @@ use trigger_protocol::{
}; };
use trigger_sv::message::GameStateCallback; use trigger_sv::message::GameStateCallback;
use crate::logic::{message::RunEventGraphEvent, GameStateListener}; use crate::logic::{GameStateListener, message::RunEventGraphEvent};
use super::scene_unit::{InteractContainer, SceneUnitTag}; use super::scene_unit::{InteractContainer, SceneUnitTag};

View file

@ -1,6 +1,6 @@
use bevy_ecs::{prelude::*, query::QueryData}; use bevy_ecs::{prelude::*, query::QueryData};
use tracing::warn; use tracing::warn;
use trigger_fileconfig::{main_city_script::MainCityConfig, NapFileCfg}; use trigger_fileconfig::{NapFileCfg, main_city_script::MainCityConfig};
use crate::logic::save::HallSceneSaveData; use crate::logic::save::HallSceneSaveData;

View file

@ -3,13 +3,13 @@ use tracing::{debug, warn};
use trigger_protocol::InteractWithUnitScRsp; use trigger_protocol::InteractWithUnitScRsp;
use trigger_sv::message::GameStateCallback; use trigger_sv::message::GameStateCallback;
use crate::logic::{message::InteractWithUnitEvent, GameStateListener}; use crate::logic::{GameStateListener, message::InteractWithUnitEvent};
use super::{ use super::{
NapResources,
event_graph::{ActionChangeInteractCfgEvent, EventGraph, GraphEvent}, event_graph::{ActionChangeInteractCfgEvent, EventGraph, GraphEvent},
hall::MainCitySection, hall::MainCitySection,
scene_unit::{InteractContainer, SceneUnitTag}, scene_unit::{InteractContainer, SceneUnitTag},
NapResources,
}; };
pub fn tick_change_interact( pub fn tick_change_interact(

View file

@ -8,11 +8,11 @@ use scene::PlayerEnterScene;
use trigger_fileconfig::main_city_script::MainCityConfig; use trigger_fileconfig::main_city_script::MainCityConfig;
use super::{ use super::{
GameStateListener,
message::{ message::{
EnterSectionEvent, InteractWithUnitEvent, PlayerMoveEvent, RunEventGraphEvent, EnterSectionEvent, InteractWithUnitEvent, PlayerMoveEvent, RunEventGraphEvent,
SwitchRoleEvent, SwitchRoleEvent,
}, },
GameStateListener,
}; };
pub mod event_graph; pub mod event_graph;

View file

@ -1,8 +1,8 @@
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use crate::logic::{ use crate::logic::{
save::{HallSceneSaveData, MainCityPositionSave},
GameStateListener, GameStateListener,
save::{HallSceneSaveData, MainCityPositionSave},
}; };
use super::{ use super::{

View file

@ -1,6 +1,6 @@
use bevy_ecs::system::Resource; use bevy_ecs::system::Resource;
use trigger_encoding::Encodeable; use trigger_encoding::Encodeable;
use trigger_protocol::{util::ProtocolUnit, ClientCmdID}; use trigger_protocol::{ClientCmdID, util::ProtocolUnit};
use trigger_sv::{ use trigger_sv::{
message::{GameStateCallback, GameStateCallbackMessage}, message::{GameStateCallback, GameStateCallbackMessage},
net::{ServerNetworkManager, ServerType}, net::{ServerNetworkManager, ServerType},

View file

@ -2,8 +2,8 @@ use bevy_ecs::event::Event;
use trigger_encoding::Decodeable; use trigger_encoding::Decodeable;
use trigger_logic::scene::Transform; use trigger_logic::scene::Transform;
use trigger_protocol::{ use trigger_protocol::{
util::ProtocolUnit, ClientCmdID, EnterSectionCsReq, InteractWithUnitCsReq, RunEventGraphCsReq, ClientCmdID, EnterSectionCsReq, InteractWithUnitCsReq, RunEventGraphCsReq,
SavePosInMainCityCsReq, SwitchRoleCsReq, SavePosInMainCityCsReq, SwitchRoleCsReq, util::ProtocolUnit,
}; };
use super::ecs::NapEcs; use super::ecs::NapEcs;

View file

@ -1,6 +1,6 @@
use std::{collections::HashMap, sync::mpsc, thread}; use std::{collections::HashMap, sync::mpsc, thread};
use ecs::{scene::PlayerEnterScene, NapEcs}; use ecs::{NapEcs, scene::PlayerEnterScene};
use message::ProtocolEventHandler; use message::ProtocolEventHandler;
use tracing::debug; use tracing::debug;
use trigger_protocol::util::ProtocolUnit; use trigger_protocol::util::ProtocolUnit;
@ -11,8 +11,8 @@ mod listener;
mod message; mod message;
pub mod save; pub mod save;
pub use ecs::hall::HallInitData;
pub use ecs::NapResources; pub use ecs::NapResources;
pub use ecs::hall::HallInitData;
pub use listener::GameStateListener; pub use listener::GameStateListener;
#[derive(Clone)] #[derive(Clone)]

View file

@ -8,9 +8,9 @@ use dashmap::DashMap;
use logic::{GameRunner, NapResources}; use logic::{GameRunner, NapResources};
use session::HallSession; use session::HallSession;
use tracing::{error, info}; use tracing::{error, info};
use trigger_fileconfig::{main_city_script::MainCityConfig, NapFileCfg}; use trigger_fileconfig::{NapFileCfg, main_city_script::MainCityConfig};
use trigger_sv::{ use trigger_sv::{
config::{load_json_config, ServerEnvironmentConfiguration, TomlConfig}, config::{ServerEnvironmentConfiguration, TomlConfig, load_json_config},
die, logging, die, logging,
net::{ServerNetworkManager, ServerType}, net::{ServerNetworkManager, ServerType},
print_banner, print_banner,

View file

@ -5,9 +5,9 @@ use trigger_sv::message::{
}; };
use crate::{ use crate::{
AppState,
logic::{GameStateListener, HallInitData}, logic::{GameStateListener, HallInitData},
session::HallSession, session::HallSession,
AppState,
}; };
pub async fn handle_message(state: &'static AppState, packet: trigger_sv::message::NetworkPacket) { pub async fn handle_message(state: &'static AppState, packet: trigger_sv::message::NetworkPacket) {

View file

@ -1,9 +1,9 @@
use std::borrow::Cow; use std::borrow::Cow;
use axum::{ use axum::{
Json, Router,
extract::{Query, State}, extract::{Query, State},
routing::get, routing::get,
Json, Router,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tokio::net::TcpListener; use tokio::net::TcpListener;
@ -64,7 +64,7 @@ async fn gm_api(
return Json(Response { return Json(Response {
retcode: 2, retcode: 2,
message: Some(Cow::Owned(format!("invalid command format: {err}"))), message: Some(Cow::Owned(format!("invalid command format: {err}"))),
}) });
} }
}; };

View file

@ -1,8 +1,8 @@
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::quote; use quote::quote;
use syn::{ use syn::{
parse_macro_input, Data, DeriveInput, Field, Fields, GenericArgument, PathArguments, Type, Data, DeriveInput, Field, Fields, GenericArgument, PathArguments, Type, TypePath,
TypePath, parse_macro_input,
}; };
pub fn impl_gm_input(input: proc_macro::TokenStream) -> proc_macro::TokenStream { pub fn impl_gm_input(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
@ -114,7 +114,7 @@ pub fn impl_gm_input(input: proc_macro::TokenStream) -> proc_macro::TokenStream
fn from_str(input: &str) -> Result<Self, GMInputParseError> { fn from_str(input: &str) -> Result<Self, GMInputParseError> {
use GMInputParseError::*; use GMInputParseError::*;
static CMD_TYPE_MAP: ::std::sync::LazyLock<::std::collections::HashMap<&'static str, #internal_enum_name>> = static CMD_TYPE_MAP: ::std::sync::LazyLock<::std::collections::HashMap<&'static str, #internal_enum_name>> =
::std::sync::LazyLock::new(|| ::std::collections::HashMap::from([#internal_enum_mapping])); ::std::sync::LazyLock::new(|| ::std::collections::HashMap::from([#internal_enum_mapping]));
let mut data = input.split(' '); let mut data = input.split(' ');
@ -165,4 +165,3 @@ fn get_field_sub_type(field: &Field) -> String {
_ => panic!("Unsupported field type"), _ => panic!("Unsupported field type"),
} }
} }

View file

@ -1,6 +1,6 @@
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::quote; use quote::quote;
use syn::{parse_macro_input, Data, DeriveInput, Fields, Ident}; use syn::{Data, DeriveInput, Fields, Ident, parse_macro_input};
pub fn impl_decodeable(item: proc_macro::TokenStream) -> proc_macro::TokenStream { pub fn impl_decodeable(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = parse_macro_input!(item as DeriveInput); let input = parse_macro_input!(item as DeriveInput);

View file

@ -1,6 +1,6 @@
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::quote; use quote::quote;
use syn::{parse_macro_input, Data, DeriveInput, Fields, Ident}; use syn::{Data, DeriveInput, Fields, Ident, parse_macro_input};
pub fn impl_encodeable(item: proc_macro::TokenStream) -> proc_macro::TokenStream { pub fn impl_encodeable(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = parse_macro_input!(item as DeriveInput); let input = parse_macro_input!(item as DeriveInput);

View file

@ -1,6 +1,6 @@
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::{quote, ToTokens}; use quote::{ToTokens, quote};
use syn::{parse_macro_input, FnArg, Item, ItemMod, ReturnType}; use syn::{FnArg, Item, ItemMod, ReturnType, parse_macro_input};
pub fn imp(input: proc_macro::TokenStream) -> proc_macro::TokenStream { pub fn imp(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
const INVALID_FUNCTION_SIGNATURE_MSG: &str = "functions in message handler module should have following signature: fn(&mut MessageContext<'_>, CsReq) -> ScRsp"; const INVALID_FUNCTION_SIGNATURE_MSG: &str = "functions in message handler module should have following signature: fn(&mut MessageContext<'_>, CsReq) -> ScRsp";

View file

@ -1,6 +1,6 @@
use proc_macro::TokenStream; use proc_macro::TokenStream;
use quote::{quote, ToTokens}; use quote::{ToTokens, quote};
use syn::{parse_macro_input, DeriveInput, Meta, MetaList}; use syn::{DeriveInput, Meta, MetaList, parse_macro_input};
mod commands; mod commands;
mod decodeable; mod decodeable;

View file

@ -1,7 +1,7 @@
#![allow(unused)] #![allow(unused)]
use super::tables::{ use super::tables::{
LOOKUP_G11, LOOKUP_G13, LOOKUP_G14, LOOKUP_G2, LOOKUP_G3, LOOKUP_G9, LOOKUP_RCON, LOOKUP_SBOX, LOOKUP_G2, LOOKUP_G3, LOOKUP_G9, LOOKUP_G11, LOOKUP_G13, LOOKUP_G14, LOOKUP_RCON, LOOKUP_SBOX,
LOOKUP_SBOX_INV, SHIFT_ROWS_TABLE, SHIFT_ROWS_TABLE_INV, LOOKUP_SBOX_INV, SHIFT_ROWS_TABLE, SHIFT_ROWS_TABLE_INV,
}; };

View file

@ -1,6 +1,6 @@
use rsa::{ use rsa::{
pkcs1v15::SigningKey, sha2::Sha256, signature::RandomizedSigner, Pkcs1v15Encrypt, Pkcs1v15Encrypt, RsaPrivateKey, RsaPublicKey, pkcs1v15::SigningKey, sha2::Sha256,
RsaPrivateKey, RsaPublicKey, signature::RandomizedSigner,
}; };
const RSA_CHUNK_SIZE: usize = 117; const RSA_CHUNK_SIZE: usize = 117;

View file

@ -10,10 +10,10 @@ pub use sea_orm::DbErr;
use tracing::error; use tracing::error;
pub mod prelude { pub mod prelude {
pub use sea_orm::entity::prelude::*;
pub use sea_orm::entity::ActiveValue::*;
pub use sea_orm::query::Condition;
pub use sea_orm::TransactionTrait; pub use sea_orm::TransactionTrait;
pub use sea_orm::entity::ActiveValue::*;
pub use sea_orm::entity::prelude::*;
pub use sea_orm::query::Condition;
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]

View file

@ -1,4 +1,4 @@
use byteorder::{ReadBytesExt, WriteBytesExt, BE}; use byteorder::{BE, ReadBytesExt, WriteBytesExt};
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};

File diff suppressed because it is too large Load diff

View file

@ -88,4 +88,4 @@ pub enum EPropertyType {
HpMaxAdvance = 9999_111_1, HpMaxAdvance = 9999_111_1,
AtkAdvance = 9999_121_1, AtkAdvance = 9999_121_1,
DefAdvance = 9999_131_1, DefAdvance = 9999_131_1,
} }

View file

@ -5,7 +5,7 @@ use std::{
path::Path, path::Path,
}; };
use quote::{quote, ToTokens}; use quote::{ToTokens, quote};
use syn::{Field, GenericArgument, Item, PathArguments, Type, TypePath}; use syn::{Field, GenericArgument, Item, PathArguments, Type, TypePath};
fn main() { fn main() {

View file

@ -1793,4 +1793,4 @@ pub struct GetFlowerShopDataCsReq {}
#[id(7151)] #[id(7151)]
pub struct GetFlowerShopDataScRsp { pub struct GetFlowerShopDataScRsp {
pub retcode: i32, pub retcode: i32,
} }

View file

@ -1,4 +1,4 @@
use serde::{de::DeserializeOwned, Deserialize, Deserializer}; use serde::{Deserialize, Deserializer, de::DeserializeOwned};
use std::net::SocketAddr; use std::net::SocketAddr;
use tracing::error; use tracing::error;
use trigger_database::DatabaseSetting; use trigger_database::DatabaseSetting;

View file

@ -1,6 +1,6 @@
use crate::message::opcode; use crate::message::opcode;
use trigger_codegen::{Decodeable, Encodeable}; use trigger_codegen::{Decodeable, Encodeable};
use trigger_protocol::{util::ProtocolUnit, DungeonEquipInfo}; use trigger_protocol::{DungeonEquipInfo, util::ProtocolUnit};
#[derive(Debug, Encodeable, Decodeable)] #[derive(Debug, Encodeable, Decodeable)]
pub struct BindClientSessionMessage { pub struct BindClientSessionMessage {

View file

@ -4,7 +4,7 @@ use futures::future::BoxFuture;
use tokio::task::JoinHandle; use tokio::task::JoinHandle;
use tracing::warn; use tracing::warn;
use trigger_encoding::Decodeable; use trigger_encoding::Decodeable;
use zeromq::{prelude::*, PullSocket, ZmqError}; use zeromq::{PullSocket, ZmqError, prelude::*};
use crate::message::NetworkPacket; use crate::message::NetworkPacket;

View file

@ -3,7 +3,7 @@ mod socket;
use std::{collections::HashMap, io::Cursor, net::SocketAddr}; use std::{collections::HashMap, io::Cursor, net::SocketAddr};
pub use listener::{listen, RecvCallback}; pub use listener::{RecvCallback, listen};
use num_enum::{IntoPrimitive, TryFromPrimitive}; use num_enum::{IntoPrimitive, TryFromPrimitive};
pub use socket::ServerSocket; pub use socket::ServerSocket;

View file

@ -5,8 +5,8 @@ use std::time::Duration;
use tokio::sync::mpsc; use tokio::sync::mpsc;
use tracing::warn; use tracing::warn;
use trigger_encoding::Encodeable; use trigger_encoding::Encodeable;
use zeromq::prelude::*;
use zeromq::PushSocket; use zeromq::PushSocket;
use zeromq::prelude::*;
use crate::message::NetworkPacket; use crate::message::NetworkPacket;