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.


Messages - shadyman

Pages: [1] 2 3 4
1
Intermud / Re: I4
« on: May 28, 2009, 10:13:13 PM »
Futureproofing.

Allow it to accept new "modules" like I3 does.

I know back with Zebedee mud, there was a big community built around making commands for the intermud. There were things like FTP, BBS, etc., all of which were not part of the original specification.

2
Code Vault / Re: Buzzzzzz.....
« on: May 28, 2009, 09:42:54 PM »
They didn't like THAT? I can't imagine why.  ::)

3
Drivers / Re: MySQL on MudOS/FluffOS
« on: December 01, 2008, 05:19:23 PM »
It seems to be something to do with int.

when casted as both signed and unsigned ints, they return as UNKNOWN
({ ({ "woo", "cast(42 as unsigned int)", "foo", "cast(COUNT(4) as signed int)" }), ({ "woo", UNKNOWN, "foo", UNKNOWN }) })

A workaround is to cast as char, which returns it as a string.
({ ({ "woo", "cast(42 as char)", "foo", "cast(COUNT(4) as char)" }), ({ "woo", "42", "foo", "1" }) })

4
Drivers / Re: MySQL on MudOS/FluffOS
« on: December 01, 2008, 03:29:34 PM »
I changed the FIELD_TYPE part of /packages/db.c to read:
Code: [Select]
} else {
    switch (field->type) {
case FIELD_TYPE_BIT:
case FIELD_TYPE_TINY:
case FIELD_TYPE_SHORT:
case FIELD_TYPE_DECIMAL:
case FIELD_TYPE_NEWDECIMAL:
case FIELD_TYPE_LONG:
case FIELD_TYPE_INT24:
    v->item[i].type = T_NUMBER;
    v->item[i].u.number = atoi(target_row[i]);
    break;

case FIELD_TYPE_FLOAT:
case FIELD_TYPE_DOUBLE:
    v->item[i].type = T_REAL;
    v->item[i].u.real = atof(target_row[i]);
    break;

case FIELD_TYPE_TINY_BLOB:
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_LONG_BLOB:
case FIELD_TYPE_LONGLONG:
case FIELD_TYPE_BLOB:
case FIELD_TYPE_STRING:
case FIELD_TYPE_VAR_STRING:
case FIELD_TYPE_TIMESTAMP:
case FIELD_TYPE_DATE:
case FIELD_TYPE_TIME:
case FIELD_TYPE_NEWDATE:
case FIELD_TYPE_DATETIME:
case FIELD_TYPE_YEAR:
case FIELD_TYPE_ENUM:
case FIELD_TYPE_SET:
case FIELD_TYPE_GEOMETRY:
                    if (field->flags & BINARY_FLAG) {
#ifndef NO_BUFFER_TYPE
                       v->item[i].type = T_BUFFER;
                       v->item[i].u.buf = allocate_buffer(field->max_length);
                       write_buffer(v->item[i].u.buf, 0, target_row[i], field->max_length);
#else
                        v->item[i] = const0u;
#endif
                    } else {
        v->item[i].type = T_STRING;
        if (target_row[i]) {
    v->item[i].subtype = STRING_MALLOC;
    v->item[i].u.string = string_copy(target_row[i], "MySQL_fetch");
        } else {
    v->item[i].subtype = STRING_CONSTANT;
    v->item[i].u.string = "";
        }
                    }
    break;

case FIELD_TYPE_NULL:
default:
    v->item[i] = const0u;
    break;
    }
}
    }

And now "SELECT 'woo', 42, 'foo', COUNT(4)" returns "({ ({ "woo", "42", "foo", "COUNT(4)" }), ({ "woo", UNKNOWN, "foo", UNKNOWN }) })"

So I think i'm getting closer. My guess is that at some point in MySQL development, they added new FIELD_TYPES, and the /packages/db.c hasn't been updated to reflect that.

So this begs the question.. What part of this code returns UNKNOWN as opposed to UNDEFINED in the stock version?

5
Drivers / Re: MySQL on MudOS/FluffOS
« on: December 01, 2008, 03:21:43 AM »
Hmm, I'm having a weird issue, I'd like to know if anyone else is.

Try a query for "SELECT COUNT(42)" and see what the result is? All I'm getting are 0's for count()s.

Is it just me?

For example, given the following code..:
Code: [Select]
    string* ret = ({});
    mixed rows;
    int i, handle;
    string query = "SELECT 'woo', 42, 'foo', COUNT(4)";

handle = db_connect("127.0.0.1", "db", "user");
rows = db_exec(handle, query);
for(i=0; i<=rows; i++) {
    ret += ({ db_fetch(handle, i) });
}
db_close(handle);
return ret;

Returns: ({ ({ "woo", "42", "foo", "COUNT(4)" }), ({ "woo", UNDEFINED, "foo", UNDEFINED }) })

So, as you can see,  the number and the count() both went in properly, but don't come out. Of course, this same query through MySQL itself (ala PhpMyAdmin) returns as expected, with "woo", 42, "foo", 4

6
Drivers / Re: MySQL on MudOS/FluffOS
« on: December 01, 2008, 02:55:54 AM »
Hmm, I'm having a weird issue, I'd like to know if anyone else is.

Try a query for "SELECT COUNT(42)" and see what the result is? All I'm getting are 0's for count()s.

Is it just me?

7
Code Vault / Re: SQL!
« on: November 27, 2008, 12:51:47 PM »
I added an item to the "Things you must do to get SQL running" list, it now includes "edit /secure/daemon/master.c to allow the SQL daemon to access a socket". I attached a file outlining the change that's required.

Without this, you'd get non-blocking sockets ending up as -7, instead of a positive integer.

8
Code Vault / DiffIt: Tool for selectively applying Dead Souls upgrades
« on: November 26, 2008, 03:47:46 PM »
Hey all!

I just (re)released DiffIt, a tool for picking and choosing files to upgrade (instead of using liveupgrade to bulk-overwrite files)

http://erroraccessdenied.com/node/1640

Public domain and all. *pokes Crat*

9
Drivers / Re: MySQL on MudOS/FluffOS
« on: November 24, 2008, 12:33:01 PM »
Maybe something else is causing the load? Try modding a fresh driver?  ???

10
Code Vault / Re: Eliza
« on: November 24, 2008, 11:45:55 AM »
You could also use extern_cmds to link to an eliza *nix executable, if you've got extern_cmds compiled in  ;D

11
Code Vault / Re: Name generator
« on: November 24, 2008, 11:16:32 AM »
Woo! That's hot. Thanks for sharing!

12
Code Vault / Re: Levenshtein and Damerau-Levenshtein distance sefuns
« on: November 24, 2008, 11:12:48 AM »
You're welcome.  Yeah, it's for fuzzymatch.  Identifying things like 'fiteball' and 'ifreball' is exactly what I had in mind.

Hmm. How about a Keyboard-based fuzzymatch, to fix common problems like finger-slips.. ie, 'y' instead of 't', 'b' instead of 'n', or hand-shifts, like 'cin' instead of 'com', or 'kik' instead of 'lol'?

13
Code Vault / Re: SQL!
« on: November 24, 2008, 11:09:52 AM »
Woot. Thanks  ;D

14
Code Vault / SQL!
« on: November 11, 2008, 05:58:40 PM »
See http://erroraccessdenied.com/node/1639 for my newly released SQL code.

It provides two methods of connecting to an SQL server:
1) Through the use of the driver efuns (to allow realtime, although blocking, SQL statements. YES, this means we can finally have SQL-ized player logins :))
2) Through the use of extern_cmds (sp?) to allow non-blocking SQL queries by using callbacks

15
Code Vault / Re: Obvious Exits with verbose and colorized support
« on: November 11, 2008, 05:53:55 PM »
Quote
I'll be submitting this to Cratylus for lib integration

Yay!

Licensing on this?

-Crat
Public Domain.

Pages: [1] 2 3 4