-
Notifications
You must be signed in to change notification settings - Fork 3
/
nocefdm.cs
41 lines (29 loc) · 1.31 KB
/
nocefdm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections.Generic;
using MCGalaxy;
using MCGalaxy.Events.ServerEvents;
namespace MCGalaxy {
public sealed class PluginNoCefDM : Plugin {
public override string name { get { return "nocefdm"; } }
public override string MCGalaxy_Version { get { return "1.9.5.0"; } }
public override string creator { get { return "???"; } }
public override void Load(bool startup) {
OnChatEvent.Register(HandleChat, Priority.High);
}
public override void Unload(bool shutdown) {
OnChatEvent.Unregister(HandleChat);
}
void HandleChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool irc) {
if (!IsCefMessage(msg)) { return; }
filter = (pl, xyz) => pl == source;
//source.Message("&eMESSAGE NOT DELIVERED.");
//source.Message("&WDirect messages are temporarily disabled on this server. Sorry!");
}
static bool IsCefMessage(string message) {
return message.Contains("?CEF?") || message.Contains("!CEF!");
}
//static bool IsDM(string message) {
// if (message.Contains("[<]") || message.Contains("[>]")) { return true; }
// return false;
//}
}
}