summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--scripts/init.rb19
-rw-r--r--src/bindings.i48
3 files changed, 83 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e95882..6b78c18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-11-12 Aaron Marks <nymacro@gmail.com>
+
+ * src/main.cpp: Added scripting with Ruby support
+ * src/bindings.i: Created basic SWIG bindings.
+ * src/Makefile.am: Updated to support Ruby & generate SWIG
+ bindings.
+ * configure.ac: Updated to detect SWIG & Ruby, using them
+ appropriately.
+ * scripts/init.rb: Server initialization test script.
+
+2005-11-10 Aaron Marks <nymacro@gmail.com>
+
+ * src/client.cpp: Updated client to support moving and equipping.
+ * src/being.h, src/being.cpp: Added "hasItem"
+ * src/state.cpp: Added beings updating.
+
2005-10-24 Yohann Ferreira <Bertram@cegetel.net>
* src/main.cpp: Added more useful infos at startup.
diff --git a/scripts/init.rb b/scripts/init.rb
new file mode 100644
index 0000000..25e8dbc
--- /dev/null
+++ b/scripts/init.rb
@@ -0,0 +1,19 @@
+print "Hello there, this is embedded into TMW!\n"
+
+class EquipHandler < Tmw::MessageHandler
+ def initialize()
+ super
+ end
+
+ # this isn't possible -- does not override parent receiveMessage
+ def receiveMessage(computer, message)
+ item = message.readLong()
+ slot = message.readByte()
+ print "Trying to equip ", item, " at ", slot, "\n"
+ end
+end
+
+a = EquipHandler.new()
+Tmw::connectionHandler.registerHandler(Tmw::CMSG_EQUIP, a)
+
+print "Done init.rb\n"
diff --git a/src/bindings.i b/src/bindings.i
new file mode 100644
index 0000000..7dbbfc9
--- /dev/null
+++ b/src/bindings.i
@@ -0,0 +1,48 @@
+/*
+ * The Mana World Server
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with The Mana World; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+%module Tmw
+
+%{
+#include "defines.h"
+#include "messagehandler.h"
+#include "packet.h"
+#include "messagein.h"
+#include "netcomputer.h"
+#include "connectionhandler.h"
+#include "object.h"
+#include "being.h"
+#include "items.h"
+
+extern ConnectionHandler connectionHandler;
+%}
+
+%include "defines.h"
+%include "messagehandler.h"
+%include "packet.h"
+%include "messagein.h"
+%include "netcomputer.h"
+%include "connectionhandler.h"
+%include "object.h"
+%include "being.h"
+%include "items.h"
+
+extern ConnectionHandler connectionHandler;