Merge branch 'ccgauche/fix-tracy' into 'master'

Fixed tracy

See merge request veloren/veloren!1852
This commit is contained in:
Joshua Barretto 2021-03-05 22:00:22 +00:00
commit 8b88df7219
2 changed files with 7 additions and 2 deletions

View File

@ -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(),

View File

@ -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,