From 23055ca47090021dbf84d05d5e14c8990479bfe1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 27 May 2008 20:13:54 +0000 Subject: onServerStart vs onClientStart works. --- sources/events/VSRegisteredEvents.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sources/events/VSRegisteredEvents.java') 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> serverVariables = new HashMap>(); + private static HashMap isOnServerStartProtocol = + new HashMap(); + /** 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)); } } } @@ -244,6 +250,20 @@ public final class VSRegisteredEvents { return eventClassnamesByShortnames.get(eventShortname); } + /** + * 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. * -- cgit v1.2.3