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 - Hilapdatus

Pages: [1]
1
Drivers / Sending large strings through socket efuns
« on: January 10, 2018, 02:52:59 PM »
I am dicking around with code which converts LPC constructs to JSON and then uses socket efuns to PUT/POST this content to a document database.   This seems to work great for for smaller constructs but fails miserably as soon as the data size exceeds the value of LARGEST_PRINTABLE_STRING which is 8kB.

I can think of two solutions, perhaps there are more or better solutions?

The first idea is to patch socket_efuns.cc so that socket_write() accepts LPC string arrays.  I'd rather not patch the driver if I can avoid it unless this seems like a reasonable modification?

The second idea is to stuff the JSON data into an LPC buffer type, which is already handled by socket_write(), but building buffers seems kinda klunky if you're not sourcing the data from a file on disk.  Perhaps the read_buffer() efun could/should be modified so as to accept LPC string arrays and return buffer?

Thoughts or opinions?

Cheers!
Hil

2
Drivers / Verb parsing with FluffOS, different than MudOS?
« on: June 06, 2014, 12:23:13 PM »
Greetings, Parser Gurus.

I haven't compared src code between MudOS and FluffOS yet, I'm taking the lazy route and asking first...

We cast spells using the 'cast' verb.  To regenerate a severed limb we execute 'cast regen on <limb> of <target>'.  This is meant to be handled by the STR_ON_STR_OF_LIV rule.  This worked in MudOS but it isn't working with FluffOS 3.0-alpha7.4.  It is instead being parsed by the STR_ON_STR rule.

The debug output of parse_sentence() shows that it matches the LIV token, recognizes the 'on' and 'of' string literals, and that can_cast_str_on_str_of_liv() returns 1.  Why then does the parser end up matching STR_ON_STR and returning the error output of can_cast_str_on_str()?

Why doesn't the STR_ON_STR check fail with a 'Have better match; aborting ...' status?

Code: [Select]
> eval return parse_sentence("cast regen on tail of hilapdatus", 1)
Trying interpretation: cast:regen:on:tail:of:hilapdatus:
Trying rule: STR on STR of LIV
  parse_rule
  Trying potential STR match
    parse_rule
    Matched literal: on
    Trying potential STR match
      parse_rule
      Matched literal: of
        parse_obj:
        parse_rule
          we_are_finished
          Trying can_cast_str_on_str_of_liv ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
          Trying can_cast_str_word_str_word_liv ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
          Trying can_verb_str_word_str_word_liv ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
          Trying can_verb_rule ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
          Trying can_cast_str_on_str_of_liv ... (/verbs/players/cast.debug)
          Return value was: 1
        exiting parse_rule ...
      Done trying to match OBJ
    Trying potential STR match
      parse_rule
      last match to error ...
      Nope.  STR rule last.
    Trying potential STR match
      parse_rule
      Ran out of words to parse.
    Done trying to match STR
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    Ran out of words to parse.
  Done trying to match STR
Trying rule: STR on STR
  parse_rule
  Trying potential STR match
    parse_rule
    Matched literal: on
    Taking rest of sentence as STR
      parse_rule
        we_are_finished
        Trying can_cast_str_on_str ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
        Trying can_cast_str_word_str ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
        Trying can_verb_str_word_str ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
        Trying can_verb_rule ... (/realms/hilapdatus/CMD_EVAL_TMP_FILE)
        Trying can_cast_str_on_str ... (/verbs/players/cast.debug)
        Returned string was: Try cast regen on <LIMB> of <TARGET> instead.
      exiting parse_rule ...
    Done trying to match STR
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    last match to error ...
    Nope.  STR rule last.
  Trying potential STR match
    parse_rule
    Ran out of words to parse.
  Done trying to match STR
.
. <other verbs are tested and fail with a 'Have better match; aborting ...' status>
.
Result = "Try cast regen on <LIMB> of <TARGET> instead."

Cheers!
Hil

3
General / Is the FluffOS efun::terminal_colour() returning odd bits?
« on: February 21, 2014, 10:27:10 PM »
I'm too lazy to fire up a Dead Souls instance or test different drivers so I'm wondering if somebody could do me a favor... 

Our mud has a strip_colours(string str) sefun that calls TERMINAL_D->no_colours(str).  no_colours(string str) calls efun::terminal_colours(str, m) where m is a mapping that associates PinkFish codes with some sort of string to provide colour for a given terminal type, most often these are ANSI Escape sequences but in this instance the mapping associates each PinkFish code with a blank string.

My dilemma is that it is behaving oddly and our mudlib looks okay to my eyes so I'm thinking it is the driver.

In the first case, all is good.  The PinkFish codes are removed and the length of the resultant string, "asdf", is 4.  Normal and boring.

    > eval return strlen(strip_colours("%^BOLD%^%^YELLOW%^asdf%^BOLD%^"))
    Result = 4

If we change the last PinkFish code to a %^RESET%^, however, the length of the resultant string goes all screwy.

    > eval return strlen(strip_colours("%^BOLD%^%^YELLOW%^asdf%^RESET%^"))
    Result = 19
    > eval return strlen(strip_colours("asdf%^RESET%^"))
    Result = 19
    > eval return strlen(strip_colours("%^RESET%^")
    Result = 15

That final %^RESET%^ should be replaced with a blank string but it is getting replaced with I don't know what but whatever it is it's 15 characters long.  Does DS have the same/similar code and does it behave the same as well?

I am working on Dreamverse which is a modified Nightmare IV mudlib running on FluffOS v3.0-alpha7.4.

Thank you!
Hil

4
Drivers / SQL or NoSQL databases?
« on: June 25, 2013, 01:40:38 PM »
I'm curious as to how many people have compiled in PACKAGE_DB and utilize SQL databases in the muds.  Are the majority of people doing so or is this a rarely used feature?

Has anybody started using NoSQL databases?  I just started playing around with the redis database and wrote a simple package to tie it into the driver using the hiredis client library.  So far it is working nicely results in LPC code that is a hell of a lot cleaner than writing SQL.

My package is just a proof-of-concept effort at the moment and only provides get/set functionality but if anybody has any interest in it then I'll see what I can do to make it more functional.

- Hil

5
Drivers / LDAP Packages?
« on: January 11, 2010, 08:31:33 AM »
Is anybody aware of a FluffOS or MudOS package, or some other means, for accessing LDAP directories?

6
Drivers / Adding new MudOS efun packages
« on: June 11, 2007, 11:22:12 AM »
Greetings all, I would like to code a few efun packages for MudOS.  I remember seeing a doc somewhere that held a little information about this process -- nothing in depth but still helpful.  Hrm, perhaps it was included with the LIMA 1.0b5 distribution.... I'll have to check.

Do you know of any other references or attempts at documenting efun coding techniques?

I'm a wee bit lazy and don't want to delve in the code blind if I don't need to.  I'd like to get SOME sort of idea of what's going on beforehand.

On a seperate but simliar topic, have other folks coded their own efuns?  Would you mind describing your efforts and be willing to share?

My immediate goal is to create a single efun to generate UUIDs.  I don't want to do this in LPC nor do I want to execute a database query.  My efun is super simple.  It takes no arguments and returns a string.  The C source code, sans-MudOS, occupies five lines of code and uses a library provided by OSSP.  I'll have this efun done in no time but I still won't have an understanding of how efuns operate.

Pages: [1]