From 06284cece2e4878e15407a393066dc17fda5a781 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 10 Jul 2018 01:13:19 +1000 Subject: [PATCH] readd AFK/un-AFK event --- MCGalaxy/Commands/Chat/CmdAfk.cs | 2 ++ MCGalaxy/Events/PlayerEvents.cs | 2 +- MCGalaxy/Games/CTF/{CTFGame.DB.cs => CtfGame_.DB.cs} | 0 3 files changed, 3 insertions(+), 1 deletion(-) rename MCGalaxy/Games/CTF/{CTFGame.DB.cs => CtfGame_.DB.cs} (100%) diff --git a/MCGalaxy/Commands/Chat/CmdAfk.cs b/MCGalaxy/Commands/Chat/CmdAfk.cs index 65ebdf148..f014b7f16 100644 --- a/MCGalaxy/Commands/Chat/CmdAfk.cs +++ b/MCGalaxy/Commands/Chat/CmdAfk.cs @@ -42,6 +42,7 @@ namespace MCGalaxy.Commands.Chatting { p.CheckForMessageSpam(); } p.AFKCooldown = DateTime.UtcNow.AddSeconds(2); + OnPlayerActionEvent.Call(p, PlayerAction.AFK, null, cantSend); } else { if (cantSend) { Player.Message(p, "You are no longer marked as being AFK."); @@ -49,6 +50,7 @@ namespace MCGalaxy.Commands.Chatting { ShowMessage(p, "-λNICK%S- is no longer AFK"); p.CheckForMessageSpam(); } + OnPlayerActionEvent.Call(p, PlayerAction.UnAFK, null, cantSend); } } diff --git a/MCGalaxy/Events/PlayerEvents.cs b/MCGalaxy/Events/PlayerEvents.cs index d5509b1e6..9a308d5e5 100644 --- a/MCGalaxy/Events/PlayerEvents.cs +++ b/MCGalaxy/Events/PlayerEvents.cs @@ -19,7 +19,7 @@ using System; using BlockID = System.UInt16; namespace MCGalaxy.Events.PlayerEvents { - public enum PlayerAction { Me, Referee, UnReferee }; + public enum PlayerAction { Me, Referee, UnReferee, AFK, UnAFK }; public enum MouseButton { Left, Right, Middle } public enum MouseAction { Pressed, Released } public enum TargetBlockFace { AwayX, TowardsX, AwayY, TowardsY, AwayZ, TowardsZ, None } diff --git a/MCGalaxy/Games/CTF/CTFGame.DB.cs b/MCGalaxy/Games/CTF/CtfGame_.DB.cs similarity index 100% rename from MCGalaxy/Games/CTF/CTFGame.DB.cs rename to MCGalaxy/Games/CTF/CtfGame_.DB.cs