Added a test build
[RedVex.git] / core / ModuleLink.cpp
blob2980480885d1fe6e686fca13c29349c045e10423
1 #include "ModuleLink.h"
2 #include "Globals.h"
3 #include "IProxy.h"
4 #include "Plugin.h"
5 #include "IProxy.h"
7 ModuleLink::ModuleLink(IModuleKind type, IModule* module, IProxy* proxy, Plugin* plugin) :
8 _type(type),
9 _module(module),
10 _proxy(proxy),
11 _plugin(plugin)
13 switch(_type)
15 case ChatModule: _typestr = "Chat"; break;
16 case RealmModule: _typestr = "Realm"; break;
17 case GameModule: _typestr = "Game"; break;
20 Log.Write("Loading \"%s\" into %s\n\n", _plugin->GetTitle(), _typestr);
23 void ModuleLink::Delete()
25 Log.Write("Removing \"%s\" from %s\n\n", _plugin->GetTitle(), _typestr);
27 __try
29 _module->Delete();
31 __except(_plugin->ExceptionHandler(GetExceptionInformation(), "IModule->Delete"))
35 delete this;
38 void ModuleLink::OnRelayDataToServer(IPacket* packet, const IModule* owner)
40 __try
42 _module->OnRelayDataToServer(packet, owner);
44 __except(_plugin->ExceptionHandler(GetExceptionInformation(), "IModule->OnRelayDataToServer"))
49 void ModuleLink::OnRelayDataToClient(IPacket* packet, const IModule* owner)
51 __try
53 _module->OnRelayDataToClient(packet, owner);
55 __except(_plugin->ExceptionHandler(GetExceptionInformation(), "IModule->OnRelayDataToClient"))
60 void ModuleLink::Update()
62 __try
64 _module->Update();
66 __except(_plugin->ExceptionHandler(GetExceptionInformation(), "IModule->Update"))