diff options
Diffstat (limited to 'sources/events/VSRegisteredEvents.java')
| -rw-r--r-- | sources/events/VSRegisteredEvents.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 52cb042..05857be 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -42,6 +42,9 @@ public final class VSRegisteredEvents { private static HashMap<String,ArrayList<String>> serverVariables = new HashMap<String,ArrayList<String>>(); + private static HashMap<String,Boolean> isOnServerStartProtocol = + new HashMap<String,Boolean>(); + /** The prefs. */ private static VSPrefs prefs; @@ -95,6 +98,9 @@ public final class VSRegisteredEvents { variables.addAll(clientProtocol.getAllFullKeys()); clientVariables.put(protocolClassname, variables); } + + if (serverProtocol.hasOnServerStart()) + isOnServerStartProtocol.put(protocolClassname, new Boolean(true)); } } } @@ -245,6 +251,20 @@ public final class VSRegisteredEvents { } /** + * Checks if the protocol uses onServerStart or onClientStart + * + * @param protocolClassname the protocol's classname + * + * @return true if onServerStart, false if onClientStart + */ + public static boolean isOnServerStartProtocol(String protocolClassname) { + if (isOnServerStartProtocol.containsKey(protocolClassname)) + return isOnServerStartProtocol.get(protocolClassname).booleanValue(); + + return false; + } + + /** * Creates the event instance by classname. * * @param eventClassname the event classname |
