From 083228a10dffcaa77b1d0035c29013c6802befd4 Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Sun, 8 Jul 2012 21:01:08 +0000 Subject: Squirrel Plugins I worked a little bit on the squirrel Bindings They work now on linux and windows :) (OSX is untested, but should work also) but they are very limited at the moment. (Only made OnChat working) I also fixed some small bugs. git-svn-id: http://mc-server.googlecode.com/svn/trunk@648 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/SquirrelChatLog.nut | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'Plugins/SquirrelChatLog.nut') diff --git a/Plugins/SquirrelChatLog.nut b/Plugins/SquirrelChatLog.nut index 586e8d6e2..df43c3fb3 100644 --- a/Plugins/SquirrelChatLog.nut +++ b/Plugins/SquirrelChatLog.nut @@ -1,26 +1,20 @@ -class SquirrelChatLog extends cPlugin__Squirrel +class SquirrelChatLog extends Plugin { - constructor() - { - base.constructor(); - } - + name = "SquirrelChatLogger"; + function Initialize() { ::print("SquirrelChatLog initialize()"); - this.SetName("SquirrelChatLog"); - local PluginManager = cRoot.Get().GetPluginManager(); - PluginManager.AddHook( this, PluginManager.E_PLUGIN_CHAT ); + this.AddHook(Hook.Chat); + return true; } function OnChat( Message, Player ) { + ::print("CHAT"); ::print(Player.GetName() + ": " + Message); + } } - - -Plugin <- SquirrelChatLog(); -cRoot.Get().GetPluginManager().AddPlugin( Plugin ); -- cgit v1.2.3