diff --git a/IRC/ForgeBot.cs b/IRC/ForgeBot.cs index 3c9c1ecc4..3a6575299 100644 --- a/IRC/ForgeBot.cs +++ b/IRC/ForgeBot.cs @@ -148,7 +148,8 @@ namespace MCGalaxy { void Player_PlayerConnect(Player p) { if (!Server.irc || !IsConnected()) return; if (!Server.guestJoinNotify && p.group.Permission <= LevelPermission.Guest) return; - connection.Sender.PublicMessage(channel, p.name + " joined the game"); + if (!p.hidden) + connection.Sender.PublicMessage(channel, p.name + " joined the game"); } void Listener_OnQuit(UserInfo user, string reason) { diff --git a/Player/Player.cs b/Player/Player.cs index 94ba5541e..914c43978 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -760,15 +760,9 @@ namespace MCGalaxy { SetPrefix(); playerDb.Dispose(); - if (PlayerConnect != null) - PlayerConnect(this); - OnPlayerConnectEvent.Call(this); - if (Server.server_owner != "" && Server.server_owner.ToLower().Equals(name.ToLower())) { - if (color == Group.standard.color) - color = "&c"; - if (title == "") - title = "Owner"; + if (color == Group.standard.color) color = "&c"; + if (title == "") title = "Owner"; SetPrefix(); } @@ -780,8 +774,22 @@ namespace MCGalaxy { if (!File.Exists("text/login/" + this.name + ".txt")) CP437Writer.WriteAllText("text/login/" + this.name + ".txt", "joined the server."); + string joinm = "&a+ " + this.FullName + Server.DefaultColor + " " + File.ReadAllText("text/login/" + this.name + ".txt"); + if (group.Permission < Server.adminchatperm || !Server.adminsjoinsilent) { + if ((Server.guestJoinNotify && group.Permission <= LevelPermission.Guest) || group.Permission > LevelPermission.Guest) { + PlayerInfo.players.ForEach(p1 => Player.SendMessage(p1, joinm)); + } + } + if (group.Permission >= Server.adminchatperm && Server.adminsjoinsilent) { + hidden = true; + adminchat = true; + } + + if (PlayerConnect != null) + PlayerConnect(this); + OnPlayerConnectEvent.Call(this); + CheckLoginJailed(); - if (Server.agreetorulesonentry) { if (!File.Exists("ranks/agreed.txt")) File.WriteAllText("ranks/agreed.txt", ""); @@ -792,19 +800,6 @@ namespace MCGalaxy { } } - string joinm = "&a+ " + this.FullName + Server.DefaultColor + " " + File.ReadAllText("text/login/" + this.name + ".txt"); - if (group.Permission < Server.adminchatperm || Server.adminsjoinsilent == false) - { - if ((Server.guestJoinNotify && group.Permission <= LevelPermission.Guest) || group.Permission > LevelPermission.Guest) - { - PlayerInfo.players.ForEach(p1 => Player.SendMessage(p1, joinm)); - } - } - if (group.Permission >= Server.adminchatperm && Server.adminsjoinsilent) { - hidden = true; - adminchat = true; - } - if (Server.verifyadmins && group.Permission >= Server.verifyadminsrank) { if (!Directory.Exists("extra/passwords") || !File.Exists("extra/passwords/" + this.name + ".dat")) SendMessage("&cPlease set your admin verification password with &a/setpass [Password]!");