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

Pages: [1] 2
1
Thanks melkor!

Here's a share back so you can update your Tublib links...

https://drive.google.com/folderview?id=0B3OtVeTYlUjRS0FKOXV0VjlpN28&usp=sharing


2
Sorry for late bump, but if you could find that Heaven 7 3alpha that worked on amylaar and mudos that would be great.  I could maybe go through it and tweak my current lib (which is running on LD, but has some issues).

Thanks

3
I will let you know.

4
Really?  That would assume that I would never want to call command() on any other object other than this_object()

It's looking more and more like FluffOS isn't going to be the driver for me.  Just way too much work to get it to work with an old compat mudlib.  The efuns in 3.1.2 seem more mature, and that's been around since before MudOS.

It's looking like LDMud is the way to go.

Thanks for the help though.

5
I do have that defined in my local_options

#undef NO_ADD_ACTION

Here's the error

Code: [Select]
WARNING: rlimit for core dump is 0, you will not get core on crash.
using config file: config
Initializing internal tables....
----------------------------------------------------------------------------
Testmud (FluffOS v3.0-alpha7.3) starting up on Linux - Tue Aug 27 14:39:45 2013


Event backend in use: epoll
/closed/simul_efun/command_efun.c line 22: Too many arguments to command before ;
No error handler for error: *Error in loading object '/closed/simul_efun/command_efun'
program: (none), object: (none), file: (none)
The simul_efun (/obj/simul_efun) and master (/obj/master) objects must be loadable.

And here's the code
Code: [Select]
varargs int command(mixed str, mixed ob)
{
  int obLevel;
  object th;

  if(ob && objectp(ob) && query_ip_number(ob) &&
     (obLevel = (int)ob->query_level()) >= 21)
  {
    if((th = this_player()) && (int)th->query_level() <= obLevel &&
       th != ob)
    {
      tell_object(th, "Yeah, No.\n");
      tell_object(ob, (string)th->query_real_name() +
                        " tried to force you to " + str +".\n");
      return 0;
    }
    if(!th) return 0;
  }
  if(!ob) ob = previous_object();
  return efun::command(str, ob);
}

6
I've gotten around the to_string efun by just checking stringp and returning 0 if it's not a string.

Next question, how do you call an efun directly?  Say I have a simul_efun that does some checking on the command() efun before I pass it through.

Code: [Select]
varargs int command(mixed str, mixed ob) {
  do_some_checking here, if conditions are not what I want() {
     tell_object(some_ob, "Some message\n");
     return 0;
  }

  return efun::command(str, ob);  <--- This is not working, and it's the syntax I'm used to
}

Thanks

7
to_array() is used to convert strings and symbols to an int array that consists of the args characters
mixed * to_array(string)
mixed * to_array(symbol)
mixed * to_array(quotedarray)
mixed * to_array(mixed *)
mixed * to_array(struct)

to_object() is used to convert the argument into an object, if possible
object to_object(string arg)
object to_object(closure arg)
object to_object(object arg)
for strings, the object with a matching object_name() is returned, or 0 - like find_object()

Now, granted, I'm not sure how much these functions are used throughout all the current code in the mudlib, but I know they are supported, and I know that to_string() is used in a current simul_efun.  Recoding the simul_efun to use sprintf() is not such a big deal, but not knowing where else it is used and how much recoding would need to be redone, I was just curious as to if these efuns existed.

8
Just out of curiousity, am I going to have to write simul_efuns for all of these?

to_array
to_struct
to_int  (nevermind, I see this one in the 'floats' efun doc)
to_float (and this one is in the 'numbers' efun doc)
to_string
to_object

9
Think I'll have to create a simul_efun

Odd that it doesn't exist already. It's been in drivers for ever (literally since the early 90's)

10
is there an efun for  to_string(mixed str); - or is it even needed?

varargs string pad(mixed str, int len, int padchar) {
  string sp_format;

  str = to_string(str);
....

11
Heh, great.  I wonder how often 'new' is used in the mudlib code.....

Thanks!

12
Yeah, it's one line.  Here's the output

Code: [Select]
root@loafy:/home/fluffos/mud/bin# ./driver config -d
WARNING: rlimit for core dump is 0, you will not get core on crash.
using config file: config
Initializing internal tables....
----------------------------------------------------------------------------
Mud (FluffOS v3.0-alpha7.3) starting up on Linux - Thu Aug 22 19:45:12 2013


Event backend in use: epoll
/obj/simul_efun/resolv_path.c line 63: syntax error before ) {
No error handler for error: *Error in loading object '/obj/simul_efun/resolv_path'
program: (none), object: (none), file: (none)
The simul_efun (/obj/simul_efun) and master (/obj/master) objects must be loadable.


13
Yeah, I did a 'make clean' - then ./build.FluffOS - then make - then copied driver executable out again and used it.

And yes, I did try and change it to a single line.

Here's my local_options file so far as well

Code: [Select]
#include "options.h"

#define NONINTERACTIVE_STDERR_WRITE
#define NO_LIGHT
#undef NO_ADD_ACTION
#undef NO_SNOOP
#undef NO_ENVIRONMENT
#undef NO_WIZARDS
#define POSIX_TIMERS
#undef SENSIBLE_MODIFIERS
#define COMPAT_32

14
No, it's not <function> in the code, I just left out the function name.  Full code is as follows - #define COMPAT_32 didn't seem to make a difference..

Code: [Select]
string user_path(string name);
static string eliminate_ellipsis(string path);

#pragma strict_types
#pragma save_types

/*
// eliminate_ellipsis removes any occurences of .. from a path.
*/
static string
eliminate_ellipsis(string path) {
  int i;
  string *tmp;

  if(!path) return 0;
  tmp = explode(path,"/");
  if (!tmp)
    return "/";
  for (i = 0; i < sizeof(tmp); i++) {
    if (tmp[i] == "..") {
      if (sizeof(tmp) > 2) {
        tmp = tmp[0..(i-2)] + tmp[(i+1)..(sizeof(tmp)-1)];
        i -= 2;
      } else {
        tmp = tmp[2 ..(sizeof(tmp)-1)];
        i = 0;
      }
    }
    if (tmp[i] == ".") {
      tmp = tmp[0..(i - 1)] + tmp[(i + 1)..(sizeof(tmp) - 1)];
      i -= 1;
    }
  }
  path = "/" + implode(tmp, "/");
  if (path == "//")
    path = "/";

  if(path) {
    string haldo;
    if (sscanf(path, "//%s", haldo) == 1)
       path = "/"+haldo;
  }
  return path;
}
string
user_path(string name) {
  if (!name)
    return "";
  return eliminate_ellipsis("/players/" + name);
}

varargs string
resolv_path(string curr, string new) {
  string t1;

  if(!stringp(curr)) return "";
  if(this_player() && (int)this_player()->query_level() < 21)
  {
    write("curr: "+curr+"\n");
    return curr;
 }
  if (curr[strlen(curr) - 1] == '/')
    curr = curr[0..strlen(curr) - 2];
  if (!new || new == ".")
    return eliminate_ellipsis(curr);
  if (new == "here") {
#ifndef __LDMUD__
    return "/" + file_name(environment(this_player())) + ".c";
#else
    return "/" + object_name(environment(this_player())) + ".c";
#endif
  }
  if (new == "~" || new == "~/" )
    return user_path((string)this_player()->query_real_name());
  if (sscanf(new,"~/%s",t1))
    return user_path((string)this_player()->query_real_name() +
      "/" + t1);
  else if (sscanf(new,"~%s",t1))
    return user_path(t1);
  else if (new[0] != '/')
    new = curr + "/" + new;
  return eliminate_ellipsis(new);
}

15
Okay, getting much further now, at least I'm into troubleshooting master and simul_efuns  :)

Now it's erroring on a simul_efun that is using the following....

syntax error before ) {

...
varargs string <function> ( string str, string st2) {
...

Pages: [1] 2