-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
40,371 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VPPAdminTools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
class VPPEventHandler | ||
{ | ||
private ref map<string, ref ScriptInvoker> events; | ||
|
||
void VPPEventHandler() | ||
{ | ||
events = new map<string, ref ScriptInvoker>; | ||
AddEvent("OnPlayerConnect"); | ||
AddEvent("OnPlayerDisconnected"); | ||
AddEvent("OnClientDisconnectCancel"); | ||
} | ||
|
||
void ~VPPEventHandler() | ||
{ | ||
foreach(string name, ScriptInvoker invoker : events) | ||
{ | ||
if(invoker != null) | ||
{ | ||
invoker.Clear(); | ||
} | ||
} | ||
events.Clear(); | ||
delete events; | ||
} | ||
|
||
void AddEvent(string eventName) | ||
{ | ||
if(events.Contains(eventName)) | ||
{ | ||
Print("[" + ClassName() + "]:: Duplicate Event Added: " + eventName); | ||
return; | ||
} | ||
|
||
if(!events.Contains(eventName)) | ||
events.Insert(eventName, new ScriptInvoker()); | ||
} | ||
|
||
ScriptInvoker GetEventInvoker(string eventName) | ||
{ | ||
ScriptInvoker eventInvoker; | ||
|
||
if(!events.Contains(eventName)) | ||
{ | ||
Print("[" + ClassName() + "]:: Invalid Event: " + eventName); | ||
return null; | ||
} | ||
|
||
if(events.Contains(eventName)) | ||
{ | ||
eventInvoker = events[eventName]; | ||
} | ||
|
||
return eventInvoker; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.