From b583e80d279ba0b6935aa77777e67a5dc2fe1713 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 17 Aug 2016 13:07:40 +1000 Subject: [PATCH] Fix not showing number of messages in /inbox (if you have any messages) after extra timer at login has elapsed. (Thanks JplaysClassic) --- Player/Player.Timers.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Player/Player.Timers.cs b/Player/Player.Timers.cs index 84a7ccf4d..483363542 100644 --- a/Player/Player.Timers.cs +++ b/Player/Player.Timers.cs @@ -57,14 +57,12 @@ namespace MCGalaxy { extraTimer.Stop(); try { - Group nobody = Group.findPerm(LevelPermission.Nobody); - if (!nobody.commands.Contains("inbox") && !nobody.commands.Contains("send") - && Database.TableExists("Inbox" + name) ) { + if (group.commands.Contains("inbox") && Database.TableExists("Inbox" + name) ) { //safe against SQL injections because no user input is given here - DataTable Inbox = Database.Fill("SELECT * FROM `Inbox" + name + "`"); - - SendMessage("&cYou have &f" + Inbox.Rows.Count + " &cmessages in /inbox"); - Inbox.Dispose(); + using (DataTable Inbox = Database.Fill("SELECT * FROM `Inbox" + name + "`")) { + if (Inbox.Rows.Count > 0) + SendMessage("You have &a" + Inbox.Rows.Count + " %Smessages in /inbox"); + } } } catch { }