diff --git a/MCGalaxy/CorePlugin/MiscHandlers.cs b/MCGalaxy/CorePlugin/MiscHandlers.cs index e8fb10bc2..711b3abb2 100644 --- a/MCGalaxy/CorePlugin/MiscHandlers.cs +++ b/MCGalaxy/CorePlugin/MiscHandlers.cs @@ -64,22 +64,6 @@ namespace MCGalaxy.Core { if (!p.level.Config.UseBlockDB) { Player.Message(p, "BlockDB is disabled here, &cyou will not be able to /undo or /redo"); } - ShowWelcome(p); - } - - static void ShowWelcome(Player p) { - if (p.showedWelcome) return; - p.showedWelcome = true; - p.LastAction = DateTime.UtcNow; - TextFile welcomeFile = TextFile.Files["Welcome"]; - - try { - welcomeFile.EnsureExists(); - string[] welcome = welcomeFile.GetText(); - Player.MessageLines(p, welcome); - } catch (Exception ex) { - Logger.LogError(ex); - } } internal static void HandlePlayerClick(Player p, MouseButton button, MouseAction action, ushort yaw, ushort pitch, diff --git a/MCGalaxy/Player/Player.Fields.cs b/MCGalaxy/Player/Player.Fields.cs index 7f44f667d..5eecccce6 100644 --- a/MCGalaxy/Player/Player.Fields.cs +++ b/MCGalaxy/Player/Player.Fields.cs @@ -182,7 +182,6 @@ namespace MCGalaxy { public bool showPortals, showMBs; public string prevMsg = ""; - internal bool showedWelcome; //Movement internal int oldIndex = -1, lastWalkthrough = -1, startFallY = -1, lastFallY = -1; diff --git a/MCGalaxy/Player/Player.Login.cs b/MCGalaxy/Player/Player.Login.cs index 81a881a39..76dd80c34 100644 --- a/MCGalaxy/Player/Player.Login.cs +++ b/MCGalaxy/Player/Player.Login.cs @@ -20,10 +20,11 @@ using MCGalaxy.Commands; using MCGalaxy.DB; using MCGalaxy.Events.PlayerEvents; using MCGalaxy.Games; +using MCGalaxy.Maths; using MCGalaxy.Network; using MCGalaxy.SQL; using MCGalaxy.Tasks; -using MCGalaxy.Maths; +using MCGalaxy.Util; namespace MCGalaxy { public partial class Player : IDisposable { @@ -78,6 +79,7 @@ namespace MCGalaxy { LastLogin = DateTime.Now; TotalTime = TimeSpan.FromSeconds(1); GetPlayerStats(); + ShowWelcome(); Server.Background.QueueOnce(ShowAltsTask, name, TimeSpan.Zero); CheckState(); @@ -89,7 +91,7 @@ namespace MCGalaxy { Directory.CreateDirectory("players"); PlayerDB.Load(this); Game.Team = Team.FindTeam(this); - SetPrefix(); + SetPrefix(); LoadCpeData(); if (ServerConfig.verifyadmins && group.Permission >= ServerConfig.VerifyAdminsRank) @@ -105,7 +107,7 @@ namespace MCGalaxy { } OnPlayerConnectEvent.Call(this); - if (cancellogin) { cancellogin = false; return; } + if (cancellogin) { cancellogin = false; return; } string joinm = "&a+ " + FullName + " %S" + PlayerDB.GetLoginMessage(this); if (hidden) joinm = "&8(hidden)" + joinm; @@ -127,7 +129,7 @@ namespace MCGalaxy { SendMessage("&cPlease complete admin verification with %T/Pass [Password]!"); } - try { + try { if (group.CanExecute("inbox") && Database.TableExists("Inbox" + name) ) { using (DataTable table = Database.Backend.GetRows("Inbox" + name, "*")) { if (table.Rows.Count > 0) @@ -159,7 +161,20 @@ namespace MCGalaxy { Loading = false; } - unsafe static byte NextFreeId() { + void ShowWelcome() { + LastAction = DateTime.UtcNow; + TextFile welcomeFile = TextFile.Files["Welcome"]; + + try { + welcomeFile.EnsureExists(); + string[] welcome = welcomeFile.GetText(); + Player.MessageLines(this, welcome); + } catch (Exception ex) { + Logger.LogError(ex); + } + } + + unsafe static byte NextFreeId() { byte* used = stackalloc byte[256]; for (int i = 0; i < 256; i++) used[i] = 0;