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

Pages: [1]
1
General / Re: Bear Bones Lib
« on: January 04, 2007, 04:18:36 pm »
There's also the kernel mudlib that is included with DGD itself (and provides the foundation for a few different DGD mudlibs).

2
Promotions / indent-lpc v0.1
« on: October 06, 2006, 11:19:53 am »
The indent-lpc distribution contains a patch for GNU indent version 2.2.9, which adds support for LPC's mapping and array datatypes.



Available in the http://llyrland.slayn.net/index.php?option=com_docman&Itemid=28">Downloads section of http://llyrland.slayn.net">Llyrland.

3
Code Vault / sefun for adding commas to an integer
« on: October 23, 2006, 09:11:16 pm »
Mudlib: Dead Souls 2.1.1

Driver: ShazbotOS v0.1.2/MudOS v22.2b14



What follows is a simulated efun for taking an integer and creating a grouped-by-commas string representation of it. I'm sure there's better terminology for this concept, but the basic idea is to take 1234567 and turn it into "1,234,567".





code:

string comma_int(int i)
{
  int power = 0;
  int tmp = 0;
  string output = "";

  power = to_int(log(i) / log(10));

  while(power) {
    tmp = to_int(pow(10, power));
    output += itoa(i / tmp);
    if ((power > 0) && ((power % 3) == 0))
      output += ",";
    i -= i / tmp * tmp;
    power--;
  }
  output += itoa(i);

  return output;
}




The above was modified to incorporate Jimorie's log() advice as well as fix the bug noticed by Daelas. Thanks folks!

4
Intermud / down?
« on: October 04, 2006, 02:47:45 pm »
Sadly, I can't connect either.

--

Llyr


5
Dead Souls Support / Button Object code
« on: October 13, 2006, 09:00:05 pm »
No clue about the SetItems bit, but maybe this will help with the add_action:



lpc code:

#include <lib.h>
#include <vendor_types.h>

inherit LIB_ITEM;

string color;

int once;

string is_pushed()
{
  return "A big, round button, currantly " + "color " + "in color.";
}


static void create()
{
  ::create();
  SetMass(5);
  SetShort("A metal panel");
  SetLong("A metal panel with a big " + color +
          " button in the middle labeled \"PUSH ME\".");
  SetKeyName("panel");
  SetId("panel", "metal panel");
  SetItems(([ ({ "button" }) : ( : is_pushed :) ]));
  once = 0;
  color = "red";
}


void init()
{
  ::init();
  add_action("push_button", "push");
}


int push_button(string str)
{
  if (str != "button")
  {
    write("Push what, the button?");
    return 1;
  }
  else
  {
    if (once == 1)
    {
      write("The button has already been pushed!\n");
      return 1;
    }

    color = "blue";
    once = 1;

    say(this_player()->GetName() + " pushes the button, which turns blue!");
    write("You push the button, which turns blue!");
    return 1;
  }

  return 1;
}

6
Drivers / ShazbotOS v0.1.2
« on: October 20, 2006, 05:45:59 pm »
ShazbotOS v0.1.2 is now available.



ShazbotOS (SOS) is an attempt to modernize and simplify the MudOS LPC driver, specifically in regards to its configuration and build process. Currently it is a minimalistic distribution that is only expected to work on a modern, current Linux distribution with the Dead Souls 2.1.1 mudlib. If it works for anything else, it is purely by coincidence.



Version 0.1.2 adds support for proper package selection via the configure build script.



It is available http://llyrland.slayn.net/index.php?option=com_docman&task=cat_view&gid=15&Itemid=28">here.



There's a mailing list set up at http://groups.google.com/group/shazbotos">http://groups.google.com/group/shazbotos for development, support and submitting bug reports/patches/hatemail/etc.



Enjoy. :)

7
Drivers / ShazbotOS v0.1.1
« on: October 17, 2006, 10:27:16 am »

It's important to note, I think, that this is not meant to supplant MudOS development. I'm hacking the driver, but I'm not a driver hacker.



I wouldn't expect any functional improvements in the actual operation of the driver anytime soon. For performance and functionality, it should remain pretty much on par with MudOS, and I'll be porting over any further MudOS development that surfaces as best I can.



Of course, that -may- change in the future should my understanding of the driver code increase substantially, or if other skilled people contribute to the project, but for the moment this should really be taken as MudOS with a different/better build system, rather than as any significant development.



--

Llyr, who's currently folding in package activation into the build scripts.


8
Drivers / ShazbotOS v0.1.1
« on: October 15, 2006, 08:50:39 pm »
ShazbotOS

=========



ShazbotOS (SOS) is an attempt to modernize and simplify the MudOS LPC driver, specifically in regards to its configuration and build process. Currently it is a minimalistic distribution that is only expected to work on a modern, current Linux distribution with the Dead Souls 2.1.1 mudlib. If it works for anything else, it is purely by coincidence.



----



It is available http://llyrland.slayn.net/index.php?option=com_docman&task=cat_view&gid=15&Itemid=28">here.



It's based on MudOS v22.2b14, but is not in any way affiliated with the MudOS distributions. The initial release has no major changes from the v22.2b14 distribution other than the build system and making the heartbeat interval a runtime config options. I've tested it on Ubuntu 6.10 Beta (Edgy Eft) and CentOS 4.3 with Dead Souls 2.1.1 -- it compiles and runs nicely for me. There are caveats, though.



1) This is a very rough, initial release. Dead Souls' local_options are the default and the configure scripts do just enough to compile and install the driver binary. For any configuration changes you'll need to edit local_options or the source yourself. Obviously this will improve as more actual configuration options get (re)added to the configuration scripts.



2) I'm not a VM or compiler expert. I don't even really know autotools all that well. This is a learning experience and I'm sharing the results. If it works for you, that's awesome. If it doesn't.. I'm working on it. It'll go faster if you give feedback and help.



There's a mailing list set up at http://groups.google.com/group/shazbotos">http://groups.google.com/group/shazbotos for support and submitting bug reports/patches/hatemail/etc.



Enjoy. :)

9
Drivers / Runtime Configurable Heartbeat Interval
« on: October 10, 2006, 07:22:15 pm »
In order to help facilitate some experimentation with heartbeats, I've made the heartbeat interval runtime-configurable from your config file. The patch is based on Dead Souls 2.1.1, which includes MudOS v22.2b14 as its driver.



The patch is available http://llyrland.slayn.net:8486/ll?cs=e61d4c966708;style=raw">here.



quote:


Instructions for use:



$ wget --quiet http://dead-souls.net/code/dead_souls.zip">http://dead-souls.net/code/dead_souls.zip

$ wget --quiet --output-document heartbeat.patch http://llyrland.slayn.net:8486/ll?cs=e61d4c966708;style=raw">"http://llyrland.slayn.net:8486/ll?cs=e61d4c966708;style=raw"

$ unzip -q dead_souls.zip

$ cd ds2.1.1

$ patch -p1 < ../heartbeat.patch

patching file bin/mudos.cfg.orig

patching file lib/secure/cfg/mudos.cfg

Hunk #1 succeeded at 58 (offset 13 lines).

patching file v22.2b14/Config.example

patching file v22.2b14/config.h

patching file v22.2b14/include/runtime_config.h

patching file v22.2b14/local_options

patching file v22.2b14/options.h

patching file v22.2b14/rc.c





Okay, so the instructions might be a little cryptic. If there's enough interest I'll package this up as a proper patch with a nice readme and all that.

10
General / Help filtering a mapping
« on: October 30, 2006, 09:12:51 am »
code:

string searchkey = "type";
string searchval = "ideas";

mapping Bits = ([
  1 : ([ "desc" : "thedesc1", "type" : "bugs" ]),
  2 : ([ "desc" : "thedesc2", "type" : "ideas" ]),
  3 : ([ "desc" : "thedesc3", "type" : "ideas" ]) ]);

foreach(int key, mapping value in Bits) {
  if (value[searchkey] == searchval) {
    do_whatever_with_this_mapping( Bits[key] );
  }
}




Here's one way to do it. The foreach iterates over the mapping, and checks to see if the searchkey:searchvalue pair exists in the inner mapping. If it does, then do something with that inner mapping (Bits[key]). The searchkey and searchvalue are provided for demonstration -- they would be taken from your search command's input normally, of course.

11
General / offline editor
« on: October 25, 2006, 01:13:33 pm »

Generally I use kate locally due to it being essentially the default editor for KDevelop, which was my primary IDE for few years and it holds its own as a standalone editor as well. For quick edits in the shell I use pico/nano or vi. I'm -attempting- to actually gain some proficiency in vi (gvim on my desktop) for more complex editing and for having the same amount of power when editting remotely as I do when working on my local desktop. If nothing else it might add a little geek cred to get the "what? no vi or emacs? SACRILEGE!" crowd off my back.



My primary requirements for an editor are:

  * Syntax highlighting for a wide variety of programming and markup languages.

  * Brace matching

  * Code folding

  * Automatic indenting

  * Line numbering. I prefer having each line visually numbered, rather than simply reporting what line you're on in a status bar.

  * Easy scripting (both internally and interfacing with external scripts)



Of course, everything but the scripting is more for style and convenience concerns than actual functionality. :)


12
General / DS 2.1.1 and LoginSite
« on: October 20, 2006, 11:58:59 am »
In order to help facilitate being able to easily move characters to different rooms at login based on attributes, interactive.c needed a little tweaking. Specifically, it provided no get or set methods for the LoginSite variable. A patch follows, which contains the interactive.c changes and an example usage in /secure/lib/connect.c.



code:

diff -r c285c760f457 lib/lib/interactive.c
--- a/lib/lib/interactive.c     Thu Oct 12 10:15:00 2006 -0700
+++ b/lib/lib/interactive.c     Fri Oct 20 11:55:50 2006 -0700
@@ -682,3 +682,11 @@ void eventDescribeEnvironment(int brief)
            }
            return (WebPage = page);
        }
+
+string SetLoginSite(string site) {
+  return LoginSite = site;
+}
+
+string GetLoginSite() {
+  return LoginSite;
+}
diff -r c285c760f457 lib/secure/lib/connect.c
--- a/lib/secure/lib/connect.c  Thu Oct 12 10:15:00 2006 -0700
+++ b/lib/secure/lib/connect.c  Fri Oct 20 11:24:53 2006 -0700
@@ -456,6 +456,7 @@ static void cmdPick(string args) {
     this_player()->SetTerminal("ansi");
     PLAYERS_D->AddPlayerInfo(Name);
     call_out( (: eventCre, Name :), 3);
+    Player->SetLoginSite("/domains/town/room/mayor");
     eventEnterGame();
 }


13
General / help with room code--weird errors
« on: October 15, 2006, 05:30:11 pm »
This line:



code:

if ((!cmds[0])||(lower_case(str) != "to")||(member_array(cmds[2], attribs) == -1)




needs another closing parenthesis at the end.





Fixed code:

code:

if ((!cmds[0])||(lower_case(str) != "to")||(member_array(cmds[2], attribs) == -1))

14
General / MudOS Driver Platform
« on: October 12, 2006, 12:49:54 pm »

15
General / MudOS Driver Platform
« on: October 12, 2006, 12:49:54 pm »

Pages: [1]