mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'ccgauche/fix-tracy' into 'master'
Fixed tracy See merge request veloren/veloren!1852
This commit is contained in:
commit
8b88df7219
@ -1,6 +1,7 @@
|
||||
use crate::settings::BanRecord;
|
||||
use authc::{AuthClient, AuthClientError, AuthToken, Uuid};
|
||||
use common_net::msg::RegisterError;
|
||||
#[cfg(feature = "plugins")]
|
||||
use common_sys::plugin::PluginMgr;
|
||||
use hashbrown::{HashMap, HashSet};
|
||||
use plugin_api::event::{PlayerJoinEvent, PlayerJoinResult};
|
||||
@ -57,7 +58,7 @@ impl LoginProvider {
|
||||
&mut self,
|
||||
username_or_token: &str,
|
||||
world: &World,
|
||||
plugin_manager: &PluginMgr,
|
||||
#[cfg(feature = "plugins")] plugin_manager: &PluginMgr,
|
||||
admins: &HashSet<Uuid>,
|
||||
whitelist: &HashSet<Uuid>,
|
||||
banlist: &HashMap<Uuid, BanRecord>,
|
||||
@ -78,7 +79,7 @@ impl LoginProvider {
|
||||
if !whitelist.is_empty() && !whitelist.contains(&uuid) && !admins.contains(&uuid) {
|
||||
return Err(RegisterError::NotOnWhitelist);
|
||||
}
|
||||
|
||||
#[cfg(feature = "plugins")]
|
||||
match plugin_manager.execute_event(&world, &PlayerJoinEvent {
|
||||
player_name: username.clone(),
|
||||
player_id: *uuid.as_bytes(),
|
||||
|
@ -3,6 +3,8 @@ use common_net::msg::{
|
||||
ClientRegister, PlayerInfo, PlayerListUpdate, RegisterError, ServerGeneral,
|
||||
ServerRegisterAnswer,
|
||||
};
|
||||
|
||||
#[cfg(feature = "plugins")]
|
||||
use common_sys::plugin::PluginMgr;
|
||||
use hashbrown::HashMap;
|
||||
use plugin_api::Uid;
|
||||
@ -29,10 +31,12 @@ pub(crate) fn handle_register_msg(
|
||||
editable_settings: &Fetch<'_, EditableSettings>,
|
||||
msg: ClientRegister,
|
||||
) -> Result<(), crate::error::Error> {
|
||||
#[cfg(feature = "plugins")]
|
||||
let plugin_mgr = world.read_resource::<PluginMgr>();
|
||||
let (username, uuid) = match login_provider.try_login(
|
||||
&msg.token_or_username,
|
||||
world,
|
||||
#[cfg(feature = "plugins")]
|
||||
&plugin_mgr,
|
||||
&*editable_settings.admins,
|
||||
&*editable_settings.whitelist,
|
||||
|
Loading…
Reference in New Issue
Block a user