Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - wodan

Pages: [1] 2
Drivers / FluffOS-2.27
« on: April 28, 2013, 08:21:28 pm »

FluffOS 2.27
Fixed Changelog name for 2.26
fix incorrect sha1() hashes  (Voltara <>)
Fix db.c with PACKAGE_ASYNC. (
allow floating point for heart beat interval
added extra file:linenumber result for call_stack(4)
fix call_other type errors as warnings and some timezone leaking bugs (driver timezone would be changed after efun/error in efun)
Fix a valgrind complain in posix_timer.c (Yucong Sun <>)
Testsuit fixes. (Yucong Sun <>)
compile with C99  (Yucong Sun <>)
Unbreak DEBUG_MALLOC & CHECK_MEMORY, now everything is accounted for. (Yucong Sun <>)
Crypto package multiple fixes and enhancements (Voltara <>)
Code cleanup/fixes (Yucong Sun <>)
LPC MIN_INT, MAX_FLOAT, MIN_FLOAT predefines. (Yucong Sun <>)
Added POSIX_TIMERS alternative for eval timer (Voltara <>)
IPV6 compile fix on unbuntu. (Yucong Sun <>)

Drivers / FluffOS future
« on: April 26, 2013, 07:32:08 pm »
Right, so in the medium term I'm going to have even less time, but I don't want to hold up driver development, so this is what I want to do.

I'll release the current dwwodan/fluffos fluffos-2.27 branch as 2.27, after that 2.x should only be bugfixes.
There's a fluffos-3.0 branch as well, I'd like sunyc to take that and add to that as a new alpha/beta branch (in the fluffos repository) and do alpha/beta releases, I'll comment on what's going on when I have time.

Then at some point 4.0 starts and 3.0 goes bug fix only, etc

The only thing I currently plan to add in 3.0 (unless someone beats me to it) is C++ try/catch instead of the setjmp/longjmp that's currently used.

Hopefuly I'll see stuff I didn't want in before it gets too hard to revert changes.

scream loudly now if any of that seems a bad idea

Drivers / FluffOS-2.26
« on: March 03, 2013, 06:45:22 pm »

This doesn't quite include all suggested changes, please redo patches based on this version if I did not say no, and it's not in.
I had to stop, or it would be delayed longer.

FluffOS 2.25
Compile warning fixes (
add_action moved objects fix (
Properly report 64 bit linux when starting (
heart_beat() now sets current_interactive
Changes for C99 (
GMCP telnet negotiation now following the correct protocol, probably
Websocket support, add a port in the config file with type websocket, when it
        gets a connection on that it will ask the master object for a
        connection as usual, this object will need to do the websocket
        handshake, incoming data will go to process_input(), after finishing
        the handshake call websocket_handshake_done(), after calling that it
        will act like a normal user connection on the mud side, the other side
        is a binary websocket. I suggest you change to the normal login object
        after the handshake.
Added a break at the end of mssp activation to stop it from turning on mccp as
Stop skipping next user input when we get user input (no idea why that was
Several LPC stack fixes (
Added several missing type checks (
Fixed wrong int/long variable types, this includes fixing sha1, so if you used
        that for passwords on 64bit, you'll need to figure out how to get
        around sha1 results changing.(, me (with suggestions from
sizeof now returns an actual number (reported by
Fixed crasher in local_time() (
Overflow improvement on eval_cost calculation (
Stop reading past the end of the read data in read_file()
Fixed possible crasher in using floats
Fixed crasher in call_other type warnings (
Several testsuite improvements (
Added GCmalloc (
Mapping fix for 32bit
Fixed crasher in f_unique_mapping (reported by
options.h fixes (, me)
Added placeholder for now missing old binary config (
File closing fix for compressed files (
Fixed zonetime crasher (
Fixed is_daylight_savings_time crasher (
Fixed remove_get_char crasher (reported by

FluffOS 2.25
Fixed the defer() fix
Added new test_load() efun which will try to load a file, it will return 0 when
      it failed, 1 when the file can load, and error if there was a compilation

Drivers / FluffOS-2.24
« on: September 23, 2012, 02:56:40 pm »

been too long between releases, so I can't quite remember what people may have sent/posted/requested and what went in, if you have patches that did not make it, let me know, and I'll try to be a bit quicker with the next release!

FluffOS 2.24
LPC floats are now C doubles
number of structs (or classes) allowed is now 127
defer() now hopefully notices if you try to change this_player, so it won't
        then destroy the change after the deffered function finishes
changed something for the terminal_colours_replace apply, but can't remember
        what (need to release more often!)
added some flags in debug_info
added some argument checking to replace() (dwlib.c)
a fix in pcre (woom) (again, can't remember what was fixed)

Drivers / FluffOS-2.23
« on: July 26, 2011, 04:24:47 pm »

FluffOS 2.23
added a terminal_colour_replace apply, this will be called with every string between two %^ delimiters, and will be replaced with whatever is returned.
fixed protocol number for GMCP
fixed sprintf code for MSSP uptime
added defer efun, it takes a function pointer that will be called when the current function ends (even if that was caused by a runtime)
the old range behaviour warning for negative array indexes is now optional
the driver can now be compiled to use either struct or class for structs, or even allow both
fixed crasher in uniq_array
fixed crasher in socket_status
added missing ',' in non iconv driver pcre support

Drivers / FluffOS-2.22
« on: February 14, 2011, 04:25:31 pm »

FluffOS 2.22
fixed potential crasher in pcre_extract
removed limit for number of matches in pcre efuns
added classes() efun (woom)
   classes(ob) returns a list of class names available in ob
   classes(ob, 1) returns the same list, with all the fields in the class (type and name)
you can now have more than 256 Globals (
added postgres support (
fixed zmp crash
removed some obsolete malloc options

Drivers / FluffOS-2.21
« on: November 08, 2010, 04:34:07 pm »

FluffOS 2.21
small cleanup in malloc32
added gmcp support
      gmcp_enable() gets called when a user has gmcp
      gmcp() will get called with any received message
      send_gmcp(string) will send the string as a gmcp message
      has_gmcp(object) returns if the object supports gmcp
fixed sorting when the compare function returns values that don't fit in a 32 bit int.
fixed memory leak in sorting
new deep_inventory functionality (tiz)
    it can now take an array of objects, and a function pointer that can return
    0 don't include this object or it's contents
    1 do include
    2 include this object but not it's contents
    3 don't include this object but do add the contents
    the function will be called with one object from the inventory (for each object looked at)
fixed memory leak in new deep_inventory
added pcre support (Volothamp@Final Realms)
      string pcre_version(void);
      version of the pcre lib
      mixed pcre_match(string | string *, string, void | int);
      like the regexp efun
      mixed *pcre_assoc(string, string *, mixed *, mixed | void);
      like reg_assoc
      string *pcre_extract(string, string);
      extract matching parts
      string pcre_replace(string, string, string *);
      string replace, one entry in the array for each match
      string pcre_replace_callback(string, string, string | function, ...);
      string replace uses a callback to get the replace string (called with the matched string and match number, starting with 0)
      mapping pcre_cache(void);
      returns content of the pcre cache (not all that useful)
fixed memory leaks in pcre efuns
fixed crashers in pcre efuns
small optimisation in reg_assoc and pcre_assoc
fixed memory leak in compiling files
restore_object will no longer randomly set 0 values as undefined
fixed crasher in asking for an unused config setting
sprintf buffer is now big enough for max string size
fixed crasher in async_db_exec (never seen for real, but it was possible!)
db_fetch will no longer randomly return some 0s as undefined
dwlib package now has a replace_dollars function which searches for patterns starting with a $ only, otherwise the same as replace() (but faster as it only scans once)

Drivers / FluffOS-2.20
« on: April 22, 2010, 03:59:52 pm »

FluffOS 2.20
more error check in malloc64
bigger arrays   (up to 2^31 elements)
bigger mappings (see arrays)
more efficient clean_up()
setting sockets to close on exec done in a more compatible way (only worked on rather new linux kernels)
no longer sends mccp messages when already compressed (fixes older cmud vversions)
some cleanups for compiler warnings
new roulette_wheel() efun in the dwlib package (Woom)
new replace_objects() efun int the dwlib package (replaces all object references in the argument with filenames recursively)
check_valid_path apply now also used for compile paths (source files)
32BIT fix (Kalinash)
use less chars for string hashes (faster)
correctly do tables in (s)printf with utf-8 strings
use the already existing precalculated string hashes more often
save string length for bigger strings as well instead of using strlen on strings > 64k all the time
NetBSD IPV6 fix (Tiz)
fixed crasher in reference_allowed() (in dwlib.c)

Drivers / FluffOS cvs
« on: April 15, 2010, 08:21:58 am »
It's not down, you just can't reach it!
My cable modem died and no fix is expected until monday.


Drivers / FluffOS-2.19
« on: January 16, 2010, 05:02:21 pm »

Note that although this has fixes for sparc64, I don't actually know if it works on those because I tried to fix one of the problems (stralloc.h) in a cleaner way, but I have no sparc64 to test it on!

FluffOS 2.19
attempt to fix string block alignments. hopefuly helps sparc64
open sockets as close on exec if available (so they don't end up in external programs started from the driver)
fix conflict between ed and solaris (both used the same define!)
fix bug with freeing an object table in backend.c
some fixes for sparc64 (Kalinash)
added missing Mysql data types so they don't always get returned as 0 anymore
changed some optional efun args to default to 0 instead for slightly cleaner code (woom)
new addition to pluralize() (diff from cratylus)

Drivers / diff Cratylus sent me
« on: December 04, 2009, 01:59:56 pm »
Right, Crat sent me a big diff, and I do wonder what some changes are for! So if they're your's please explain. I'll also explain why I won't consider some of it. If anyone wonders why the driver hasn't changed in CVS it's because I've gotten to the point where my LPC parser (the one written in LPC!) can parse it's own code now! So that project is currently slightly more exciting than FluffOS :)

Code: [Select]
diff -Naur fluffos-2.18/addr_server.c fluffos-2.18-ds06/addr_server.c
--- fluffos-2.18/addr_server.c 2009-10-19 15:02:22.000000000 -0400
+++ fluffos-2.18-ds06/addr_server.c 2009-11-26 14:38:25.000000000 -0500
@@ -541,6 +541,8 @@
diff -Naur fluffos-2.18/backend.c fluffos-2.18-ds06/backend.c
--- fluffos-2.18/backend.c 2009-10-19 15:02:22.000000000 -0400
+++ fluffos-2.18-ds06/backend.c 2009-11-26 14:38:25.000000000 -0500
@@ -631,8 +631,7 @@
 #ifdef F_SET_HIDE
  int apply_valid_hide = 1, display_hidden = 0;
- if(n)
- obtab = CALLOCATE(n, object_t *, TAG_TEMPORARY, "heart_beats");
+ obtab = CALLOCATE(n, object_t *, TAG_TEMPORARY, "heart_beats");
  while (n--) {
 #ifdef F_SET_HIDE
  if (hb->ob->flags & O_HIDDEN) {
@@ -653,8 +652,7 @@
  arr->item[nob].u.ob = obtab[nob];
  add_ref(arr->item[nob].u.ob, "get_heart_beats");
- if(n)
- FREE(obtab);
+ FREE(obtab);
  return arr;
I'll admit it has a bug, but this is not the way to fix it! Also wonder why I didn't suffer badly from the leaked memory. I'll fix this properly (if I'd include this patch it'll crash with no heart_beats()s.)

Code: [Select]
diff -Naur fluffos-2.18/build.FluffOS fluffos-2.18-ds06/build.FluffOS
--- fluffos-2.18/build.FluffOS 2009-10-19 15:02:22.000000000 -0400
+++ fluffos-2.18-ds06/build.FluffOS 2009-11-26 14:56:49.000000000 -0500
@@ -1,15 +1,17 @@
+export ENABLE_M64
 if test $# -ne 0; then
     case $1 in
      echo Preparing to build developmental version of MudOS driver ...
-     OPTIMIZE="-Wall -Wundef -DPEDANTIC -pedantic -Wmissing-declarations"
+     OPTIMIZE="-O0 -Wall -Wundef -DPEDANTIC -pedantic -Wmissing-declarations"
      echo Preparing to build debugging version of MudOS driver ...
+     OPTIMIZE="-O0"
      DEBUG="-g -DDEBUG"
@@ -198,19 +200,22 @@
 if test $? -eq 0; then
     if test "${DEBUG-x}" = "x"; then
-        OPTIMIZE=${OPTIMIZE-"-O3 -Q -qMAXMEM=16000"}
+        OPTIMIZE=${OPTIMIZE-"-O2 -Q -qMAXMEM=16000"}
     gcc comptest.c
     if test $? -eq 0; then
         if test "${DEBUG-x}" = "x"; then
-            OPTIMIZE=${OPTIMIZE-"-O3"}
+            OPTIMIZE=${OPTIMIZE-"-O2"}
-        gcc -m64 comptest.c
-        if test $? -eq 0; then
-            CC="gcc -m64"
+        if (test $? -eq 0); then
+            if (test $ENABLE_M64 -eq 1); then
+                CC="gcc -m64"
+                OPTIMIZE=$OPTIMIZE" -DM64"
+            fi
+        echo "CC: "$CC
@@ -233,7 +238,7 @@
      cc comptest.c
      if test $? -eq 0; then
@@ -337,7 +342,7 @@
 all: FOO
 bison comptest.y
-if test $? -eq 0 && test $CC != "xlc"; then
+if test $? -eq 0 && test "$CC" != "xlc"; then
     YACC="bison -d -y"
     byacc comptest.y
Is there a reason the DS version of the driver is allergic to 64 bit? Does anything actually go wrong with -O3? (O3 is a good idea because it inlines small functions)

Code: [Select]
diff -Naur fluffos-2.18/compiler.c fluffos-2.18-ds06/compiler.c
--- fluffos-2.18/compiler.c 2009-10-19 15:02:22.000000000 -0400
+++ fluffos-2.18-ds06/compiler.c 2009-11-26 14:38:25.000000000 -0500
@@ -2384,7 +2384,13 @@
     prog->function_table = (function_t *)p;
     for (i = 0; i < num_func; i++)
-        prog->function_table[i] = *FUNC(func_index_map[i]);
+    {
+        function_t *tf;
+        tf = FUNC(func_index_map[i]);
+        memcpy(&prog->function_table[i], tf, sizeof(function_t));
+    }
     p += align(sizeof(function_t) * num_func);
This is doing the same as the old code in more lines, what is this change supposed to do?

Code: [Select]
diff -Naur fluffos-2.18/grammar.y.pre fluffos-2.18-ds06/grammar.y.pre
--- fluffos-2.18/grammar.y.pre 2009-10-19 15:02:22.000000000 -0400
+++ fluffos-2.18-ds06/grammar.y.pre 2009-11-26 14:38:25.000000000 -0500
@@ -133,7 +133,6 @@
     long number;
     float real;
     char *string;
-    int type;
     struct { short num_arg; char flags; } argument;
     ident_hash_elem_t *ihe;
     parse_node_t *node;
@@ -183,11 +182,11 @@
 %type <ihe> L_DEFINED_NAME
 /* These hold a type */
-%type <type> type optional_star type_modifier_list
-%type <type> opt_basic_type L_TYPE_MODIFIER L_BASIC_TYPE basic_type atomic_type
-%type <type> cast arg_type
+%type <number> type optional_star type_modifier_list
+%type <number> opt_basic_type L_TYPE_MODIFIER L_BASIC_TYPE basic_type atomic_type
+%type <number> cast arg_type
-%type <type> opt_atomic_type
+%type <number> opt_atomic_type
 /* This holds compressed and less flexible def_name information */

Although this looks harmless, I also can't see how it helps anything?

Code: [Select]
diff -Naur fluffos-2.18/stralloc.h fluffos-2.18-ds06/stralloc.h
--- fluffos-2.18/stralloc.h 2009-10-19 15:02:23.000000000 -0400
+++ fluffos-2.18-ds06/stralloc.h 2009-11-26 14:38:25.000000000 -0500
@@ -48,7 +48,7 @@
 typedef struct malloc_block_s {
     int extra_ref;
     unsigned short size;

This doesn't make any sense to me

Drivers / FluffOS-2.18
« on: October 19, 2009, 02:10:07 pm »

FluffOS 2.18
compiles for netbsd (tiz)
make more empty arrays point to the_null_array, saves memory and allows
     comparing with ({}) to see if arrays are empty (reported by Woom)
clear this_user etc when runtimes get us all the way back to backend()
fix the inherits() return value if the inherit was indirectly inherited
     (reported by Woom)
member_array now return -1 for failure if you search beyond the end of the array
     (reported by Woom)
no longer loops forever when adding a reference whole destructing things with
     too many references
fixed crasher in async db_exec
fixed crasher in filedescriptor leak fix
parser changed to be less strict (Cratylus)
stop wasting memory if repeat_string would exceed max string size (reported by woom)
fixed crasher in pragma optimize

General / zmp
« on: October 05, 2009, 03:18:25 pm »
As you may have noticed, version 2.17 added zmp support, you can read up on zmp on the intarwebs with google, so I'll skip telling you what it is and continue with the one package I added for having a client side editor.

Code: [Select]
lpc.getefuns,             make the mud send a lpc.efuns reply
lpc.getsfuns,             make the mud send a lpc.sfuns reply
lpc.getlfuns <path>,      make the mud send a lpc.lfuns reply
lpc.getvars <path>,       make the mud send a lpc.vars reply
lpc.getfile <path>,       make the mud send a lpc.file reply
lpc.getdir <path>,        make the mud send a lpc.dir reply

lpc.efuns <list>,           list of all the efuns
lpc.sfuns <list>,           list of all the sefuns
lpc.lfuns <path> <list>,    list of all the functions in object <path>
lpc.vars <path> <list>,     list of all the variables in object <path>
lpc.file <path> <filedata>, send the <path> file
lpc.dir <path> <list>,      sends a list of files/directories in directory <path>
lpc.edit <path>,            start a client side editor with file <path>

This is all implemented on the mud side at discworld, sadly I didn't get to writing the actual editor yet! I do however abuse the lpc.getdir for filename completion in my client.

Drivers / FluffOS-2.17
« on: September 15, 2009, 05:20:13 pm »

FluffOS 2.17
math package updates: Added vector norm, dotprod, distance, angle.
     Also added log2() and round() which works on floats (surprisingly useful).
     Added int args to the efuns as apppropriate (Hamlet)
fixed above so the int args actually work without needing casts for the result
fixed 64bit malloc for large allocations (never happened on dw, so I doubt it was a problem!)
added 32bit malloc (malloc32) which is sysmalloc with realloc replaced by
      malloc->memcpy->free, saves lots of memory
telnet environment support (Cratylus)
windows compile fix for add_action (Cratylus)
added dtrace support! just define DTRACE in local_options if you have it
zmp support
    zmp calls from the client result in an apply on the player object
        zmp_command(string command, string *args);
    sending zmp is done with
        send_zmp(string command, string *args);
    check if a player supports zmp, returns 1 if they do, 0 otherwise.
        has_zmp(object player)
    note: zmp protocol is just a way to transfer information for zmp packages,
          You'll still need to implement those in LPC
fixed the use of select()
compiles with C++ again (with dw's local_options anyway)
even more places to look for mysql libs
fixed profiling recursive functions
fixed profiling when a runtime error happens
fixed filedescriptor leak with compressed save files
fixed crasher in unloading object programs (this should have happened constantly
      , so there's probably a bug preventing this from actually happening most
      of the time).
the driver now finishes all async IO before finishing shutdown()
blocked socket fix for lpc network sockets (Hamlet)
package async now does sql!
        async_db_exec(int db, string request, function callback);
        don't use the same database handle with this call if you also use it
        with db_exec(), just make an extra connection for your async sql.
new efun restore_from_string(string savedata), does what it says on the tin,
    the string format is the same as a save file.
added optional int argument to request_term_size().  If 0, the client is asked
     _not_ to offer any further term size updates (Hamlet, suggested by Detah)

Drivers / FluffOS-2.16
« on: April 21, 2009, 02:50:06 pm »

FluffOS 2.16
improved single char mode support (Cratylus)
         this includes some new efuns:
              int query_charmode(object);
              int remove_charmode(object);
              int remove_get_char(object);
efun to send nullbytes (Raudhrskal)
     int send_nullbyte(object);
improved ed failure mess (Cratylus)
new no arguments version of save_object, which returns the save string
fix to stop iconv looping forever
faster hashing for big strings (now stops after 1000 chars)
some new predefines (Cratylus)
async io fixes, sadly now requires pthreads
parser update (Cratylus)
sqlite support (Ajandurah@Demonslair)
compile warning fixes (Ajandurah@Demonslair)
crypto and sha1 package (Ajandurah@Demonslair)
added MSSP support, the driver will call get_mud_stats() on the master ob,
      which should return a mapping with the keys/values, if a value is an
      array of strings they'll all be sent as values for that key. The driver
      send the NAME (from config file) PLAYERS and UPTIME values if the
      function doesn't exist, if it does but didn't include one of those fields
      the driver will add the field as those are required.
new malloc option malloc64 which tries to avoid needing big copies on realloc by
 spreading all allocations a few MB apart in virtual memory.

Pages: [1] 2