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

Pages: [1]
1
Drivers / Re: Sending large strings through socket efuns
« on: January 12, 2018, 07:08:59 PM »
Thank you for the input.

2
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

3
Drivers / Re: Status update of fluffos 3.0
« on: October 21, 2014, 06:25:56 AM »
Thank you for your work.

I don't mud much, haven't in many years, but I keep track of what's going on with FluffOS and, to a lesser extent, Dead Souls.  I've kept Dreamverse running all this time and switched it over to FluffOS a while back.

4
General / Re: Parser Ignoring An Object?
« on: August 31, 2014, 12:17:19 PM »
You could sow confusion and invite trouble by using set_hide() and writing master()->valid_hide() to allow objects to be hidden under various circumstances.  :)

5
Drivers / Re: SQL or NoSQL databases?
« on: June 13, 2014, 12:30:27 AM »
One of the NoSQL databases that I've been wiring into Dreamverse lately is the Neo4j graph database.  I am currently modeling rooms as nodes.  The nodes are related via EXITS_TO relationships. Nodes are labeled with the name of their zone/area and the climate.  The labels make it super easy to work with a specific subset of the graph.

Neo4j comes with several path finding algos out of the box including shortest path and dijkstra's.  This makes it trivial to find a path from A to B without having to bog down the MUD by trying to do this in LPC or via efuns.

The database could easily be expanded to include characters as nodes with VISITED relationships to the room nodes.  The VISITED relationship could have a Count property indicating how many times a character has visited a given room.  This could let admins know what parts of the MUD are the least visited so that they could do something to attract players to those areas.  This information could be used by NPCs to setup automated ambushes or raids.  In a PvP MUD this information could be made available for sale to players so that they could setup their own ambushes or stay away from the areas frequented by their enemies.  Heavily traveled paths through the wilderness could result in the room descriptions being modified to include a description of the path.  Underutilized roads and paths could become overgrown.

I'm having fun with neo4j and I'm just warming up to it.  Its REST API and Cypher language are pretty dang easy to learn and plug into the mud.

I currently have 6500+ room nodes and 31,000+ EXITS_TO relationships created.  By poking through subsets of the graph I'm discovering all sorts of areas I never knew about before.

6
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

7
General / Re: Doxygen config file for Mudlib
« on: March 02, 2014, 11:51:48 PM »
I realize this is an old post but I was just about to re-start my Doxygenation.

I added this to the top of all my LPC files:

Code: [Select]
#ifdef DOXYGEN
struct <name> : <inherited>* {
#endif

where
  • <name> is the name of the object
  • <inherited>* is comma-delimited list of files that the object inherits.
and a similar block to the bottom with a closing curly bracket.  In my doxygen config I have it #define that DOXYGEN macro, can't remember if that is standard behavior or not.

It isn't pretty but it works well.

Code: [Select]
#ifdef DOXYGEN
struct car : vehicle {
#endif

inherit LIB_VEHICLE;

protected void create()
{
  vehicle::create();
  ...
}
...

#ifdef DOXYGEN
}
#endif

8
Dead Souls Support / Re: New Verb
« on: February 25, 2014, 07:21:00 PM »
George Reese wrote a pretty fantastic description of the verb parser.  You can google around a bit to find copies, here is one:

  http://ringbreak.dnd.utwente.nl/~krimud/Docs/NMAdmin/Parser/


9
General / Re: Is the FluffOS efun::terminal_colour() returning odd bits?
« on: February 21, 2014, 10:50:30 PM »
I tried to be a little less lazy and fired up tcpdump to take a look.  The 15 character sequence is an ANSI sequence:

    ^[49;49m^[0;10m

From http://en.wikipedia.org/wiki/ANSI_escape_code, it looks like that sequence is meant to reset/disable all ANSI attributes even though the mapping passed to terminal_colour() says to replace %^RESET%^ with an empty string.

A typical %^RESET%^ for an ansi-capable terminal is replaced with ^[0m and not all the junk above.

Does this look like a driver bug?  What am I missing?

10
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

11
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

12
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?

13
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]