onConnect notification for plugins
This commit is contained in:
1 parent
83ad822bad
commit
6025e97932
2 files changed
+9
No files matched your search
@@ -96,6 +96,7 @@ class ServerConnection(threading.Thread):
|
|||||||
|
|
||||||
#Send out a a packet FC to the server
|
#Send out a a packet FC to the server
|
||||||
PacketSenderManager.sendFC(self.socket, encryptedSharedSecret, encryptedSanityToken)
|
PacketSenderManager.sendFC(self.socket, encryptedSharedSecret, encryptedSanityToken)
|
||||||
|
self.pluginLoader.notify("onConnect")
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
@@ -113,6 +114,7 @@ class ServerConnection(threading.Thread):
|
|||||||
|
|
||||||
#Send out a a packet FC to the server
|
#Send out a a packet FC to the server
|
||||||
PacketSenderManager.sendFC(self.socket, encryptedSharedSecret, encryptedSanityToken)
|
PacketSenderManager.sendFC(self.socket, encryptedSharedSecret, encryptedSanityToken)
|
||||||
|
self.pluginLoader.notify("onConnect")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Connection to server failed"
|
print "Connection to server failed"
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ class PluginLoader():
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def notify(self, methodName):
|
||||||
|
for plugin in self.plugins:
|
||||||
|
try:
|
||||||
|
getattr(plugin, methodName)()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
def getPlugins(self):
|
def getPlugins(self):
|
||||||
return self.plugins
|
return self.plugins
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user