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

Pages: [1]
1
Dead Souls Support / Runtime error after character creation
« on: June 28, 2011, 03:27:23 am »
I am getting a runtime error after character creation

The error does not crash the mud

It occurs right after the character is presented with the "General news" and hits <return>

The log looks like this:
Code: [Select]

-----
2011.06.28-01.05,18: Test
*Owner (/secure/lib/connect#5072) of function pointer is destructed.
Object: <none> (0) at line 0


error:*Owner (/secure/lib/connect#5072) of function pointer is destructed.
, trace:BLANK ARRAY
-----
-----
2011.06.28-01.19,23: Testtwo
*Owner (/secure/lib/connect#5076) of function pointer is destructed.
Object: <none> (0) at line 0


error:*Owner (/secure/lib/connect#5076) of function pointer is destructed.
, trace:BLANK ARRAY
-----
-----
2011.06.28-01.51,31: Testthree
*Owner (/secure/lib/connect#5090) of function pointer is destructed.
Object: <none> (0) at line 0


error:*Owner (/secure/lib/connect#5090) of function pointer is destructed.
, trace:BLANK ARRAY
-----

The runtime error occurs only after character creation, with subsequent logins and displaying of news items there are no errors

I made a few minor changes to the connect.c, mostly wording changes, here is my connect.c:
Code: [Select]

/*    /secure/lib/connect.c
 *    from the Dead Souls Object Library
 *    the object a user connects to before determining their real body
 *    created by Descartes of Borg 951103
 *    Version: @(#) connect.c 1.2@(#)
 *    Last Modified: 96/05/28
 */

#include <lib.h>
#include ROOMS_H
#include <news.h>
#include <flags.h>
#include <cfg.h>
#include <daemons.h>
#include <message_class.h>
#include "include/connect.h"

#define CUSTOM_FORMAT 0
#define REAL_NAME 0

#ifndef __ANSI_SUBSTITUTE__
#define __ANSI_SUBSTITUTE__ 0x1e
#endif

inherit LIB_PAGER;
#include <mssp.h>

static private int CrackCount, NetDead, MaxPlayers;
static private string name, Name, Terminal, raza, TrueName, trabajo, extra;
static private string Passwort, Gendre, CapNamen, E_Mail, my_ip, client_ip;
static private object Player, pile;
static private mapping LastError, UserVars;
static private int *Screen;
static private int rescue, yescre, anyterm;
static private string *ip_permitted = ({}), instname, telopt_user;
static private string array anyterms = ({"97.107.133.86", "127.0.0.1"});

//Change this to 0 to disable color codes in /news/welcome
//then update the connect.c file.
static private int AllowColorSplash = 1;

//Change this to 1 to change your welcome screen to /news/moved
//and to disable the standard login prompts.
static private int Moved = 0;

int eventCheckPending(string str);
void eventCompleteChar();
void InputCre(string str);
static void cmdPickClass(string args);
static void cmdListClasses();
static void cmdHelpClass(string args);
static void InputClass(string str);
static void eventSelectClass();

int CheckIp(){
    int ips = 0;
    string tmp_ip;
    if(!SAME_IP_MAX) return 1;
    tmp_ip = query_ip_number();
    if(telopt_user && telopt_user != my_ip) tmp_ip = telopt_user;
    if(!ip_permitted) ip_permitted = ({});
    ip_permitted += PLAYERS_D->GetAdminIPs();
    ip_permitted = singular_array(ip_permitted);
    if(member_array(tmp_ip, ip_permitted) != -1) return 1;
    foreach(object jugador in users()){
        if(query_ip_number(jugador) == tmp_ip) ips++;
    }
    if(ips >= SAME_IP_MAX) return 0;
    return 1;
}

static void create(int binary) {
    extra = "";
    UserVars = ([]);
    if(query_windows()){
        MaxPlayers = 50;
    }
    else {
#ifdef __ULIMIT__
        MaxPlayers = (__ULIMIT__ - 10);
#else
#if __FD_SETSIZE__
        if(!MaxPlayers || MaxPlayers > __FD_SETSIZE__){
            MaxPlayers = (__FD_SETSIZE__ - 10);
        }
#endif
#endif
    }
    if(grepp(__ARCH__, "Solaris")){
#ifndef __M64__
        //Solaris has a problem with fd's over 256 in
        //32-bit applications.
        MaxPlayers = 200;
#endif
    }
    if(!MaxPlayers) MaxPlayers = 1000;
    if(MAX_USERS) MaxPlayers = MAX_USERS;
    CrackCount = 0;
    Name = "";
    Player = 0;
    NetDead = 0;
    if(ENABLE_INSTANCES){
        instname = INSTANCES_D->GetMyInstanceName();
    }
    ip_permitted = explode(read_file(CFG_IP_UNRESTRICT),"\n");
}

varargs static void logon(mixed foo) {
    /* orion_tweak
string welcome = "Connected to "+mud_name()+", an LP mud";
if(sizeof(architecture())) welcome += " running on "+architecture()+".\n";
    else welcome += ".\n"; */
string welcome = "Connected to "+mud_name()+", running Dead Souls "+mudlib_version();

    client_ip = query_ip_number();

    call_out((: eventTimeout :), LOGON_TIMEOUT);
    if(mud_name() == "Dead Souls" || mud_name() == "Dead Souls Dev" ){
        welcome += read_file(DS_WELCOME) || "Welcome to " + mud_name() + "!";
    }
    else {
        string wfile;
        if(instname && instname != "global"){
            wfile = NEWS_WELCOME+"."+__PORT__;
        }
        if(!wfile || !file_exists(wfile)) wfile = NEWS_WELCOME;
        welcome += read_file(wfile) || "Welcome to " + mud_name() + "!";
    }
    if(Moved){
        string wfile;
        if(instname && instname != "global"){
            wfile = NEWS_MOVED+"."+__PORT__;
        }
        if(!wfile || !file_exists(wfile)) wfile = NEWS_MOVED;
        welcome = read_file(wfile) || "Welcome to " + mud_name() + "!";
    }
    if(AllowColorSplash){
        receive(terminal_colour(welcome,TERMINAL_D->query_term_info("ansi")));
    }
    else {
        receive(welcome);
    }   
    if(!Moved){
/* orion_tweak
        receive("\n" + center("Driver: " + version() +
                    "               Mudlib: "+
                    mudlib() + " " + mudlib_version()) + "\n");
*/
        receive("\nName: "); // orion_tweak: receive("\nWhat name do you wish? ");
        input_to((: InputName :), I_NOESC);
    }
}

static void InputName(string namen, string kill_me) {
    string temp_name, news;
    mixed tmp;
    int toomany;
    name = namen;

    if(member_array(client_ip, anyterms) != -1){
        if(telopt_user){
            int bar = sscanf(telopt_user, "%*d.%*d.%*d.%*d");
            if(bar == 4){
                client_ip = telopt_user;
                anyterm = 1;
                extra = " ["+my_ip+"]";
            }
        }
    }

    if(!CheckIp()){
        receive("\nToo many users from your site are currently logged on.\n");
        receive("Please try again later.\n");
        flush_messages();
        Destruct();
        return;
    }

    if(sizeof(users()) >= MaxPlayers){
        toomany = 1;
    }

    if( !name || name == "" ) {
        if( kill_me ) {
            if(!Moved) receive("\nPerhaps try another time then?\n");
            Destruct();
            return;
        }
        else {
            if(!Moved){
                receive("\nYou must enter a name in order to join!\n");
                receive("\nWhat name do you wish? ");
            }
            input_to((: InputName :), I_NOESC, "kill me");
            return;
        }
    }
    if(grepp(name, "MSSP-REQUEST")){
        log_file("mssp",timestamp() + " " + my_ip + extra + "\n");
        receive(mssp_reply());
        flush_messages();
        input_to((: InputName :), I_NOESC);
        return;
    }
    if(sscanf(name,"%s_rescue",temp_name) == 1) {
        name = temp_name;
        rescue = 1;
    }
    Name = convert_name(name);
    name = capitalize(name);
    if( master()->is_locked() || toomany) {
        if(toomany){
            news = "Too many players logged in!";
        }
        else news = read_file(NEWS_LOCKED) || "No reason logged.";
        receive("\n" + mud_name() + " is locked.  Reason:\n" + news + "\n");
        if( CanLogin() ) receive("\n        >>> Access allowed <<<\n");
        else {
            receive("\n        >>> Access denied <<<\n");
            flush_messages();
            Destruct();
            return;
        }
    }
    if( !user_exists(Name) ) {
        eventCreatePlayer(name);
        return;
    }
    if( !(BANISH_D->eventConnect(Name, client_ip)) ) {
        news = read_file(NEWS_BANISHED) || "You are not allowed here.\n";
        receive("\n" + news + "\n");
        Destruct();
        return;
    }
    if( (tmp = CHARACTER_D->eventConnect(Name)) != 1 ) {
        if( tmp ) receive(tmp + "\n");
        else receive("One of your characters was recently logged in.\n"
                "You must wait a little longer before logging in.\n");
        Destruct();
        return;
    }

    if( find_player(Name) ) NetDead = 1;

    if(Name != "guest"){
        receive("Password: ");
        input_to((: InputPassword :), I_NOECHO | I_NOESC, name);
    }
    else InputPassword("guest","Guest");
}

static void InputPassword(string pass, string cap) {
    string control;

    if(Name != "guest"){

        if( !pass || pass == "" ) {
            receive("\nYou must enter a password.  Please try again later.\n");
            Destruct();
            return;
        }
        if(!cap || cap == "") {
            receive("\nAn unusual error has occurred.  Please try again.\n");
            Destruct();
            return;
        }

        control = PLAYERS_D->GetPlayerData(Name,"Password");
        if( control != crypt(pass, control) ) {
            receive("\nInvalid password.\n");
            if( ++CrackCount > MAX_PASSWORD_TRIES ) {
                receive("\nNo more attempts allowed\n");
                unguarded( (: log_file("/secure/log/security",
                  "Maximum password tries exceeded by " +
                        Name + " from " + client_ip + extra + "\n") :) );
                filter(users(), (: archp :))->eventPrint("System %^MAGENTA%^"
                        "<error>%^RESET%^ Maximum password "
                        "attempts exceeded by " + cap +
                        " from " + client_ip + ".\n",
                        MSG_ERROR);
                Destruct();
                return;
            }
            receive("Password: ");
            input_to( (: InputPassword :), I_NOECHO | I_NOESC, cap);
            return;
        }

        if(rescue) unguarded( (: wipe_inv(name) :) );
    }

    Player = master()->player_object(Name);
    if( !Player ) {
        receive("\nIt seems some work is being done right now, try later.\n");
        Destruct();
        return;
    }
    PLAYERS_D->AddPlayerInfo(Player);
    if( !Player->GetRace() || Player->GetRace() == "blob"
            || Name == "guest" ) {
        Player->SetRace("human");
    }

    if( !NetDead ){
        call_out( (: eventCheckPending, lower_case(Name) :), 3);
        eventEnterGame();
    }
    else eventReEnterGame(cap);
}

static void eventCreatePlayer(string cap) {
    string tmpdir, lcname = lower_case(Name);
    string *tmpfiles = ({});
    if( !(BANISH_D->valid_name(lcname)) ) {
        receive(capitalize(cap) + " is not a valid name.\n");
        receive(mud_name() + " requires that all names meet the following "
                "requirements:\n");
        receive("\tAll characters must be:\n");
        receive("\t\tA-Z\n\t\ta-z\n\t\t'\n\t\t-\n");
        receive("\tMinimum length: " + MIN_USER_NAME_LENGTH + "\n");
        receive("\tMaximum length: " + MAX_USER_NAME_LENGTH + "\n");
        receive("\nPlease enter a new name: \n");
        input_to( (: InputName :), I_NOESC );
        return;
    }
    tmpdir = DIR_PLAYERS "/" + lcname[0..0] + "/";
    if(directory_exists(tmpdir)){
        tmpfiles += get_dir(tmpdir);
    }
    tmpdir = DIR_CRES "/" + lcname[0..0] + "/";
    if(directory_exists(tmpdir)){
        tmpfiles += get_dir(tmpdir);
    }
    foreach(string tmpfile in tmpfiles){
        if(!strsrch(tmpfile, lcname+".")){
            receive("\nThat name is taken. Please choose a new one.\n");
            input_to( (: InputName :), I_NOESC );
            return;
        }
    }
    if( !(BANISH_D->eventConnect(Name, client_ip)) ) {
        string news;

        news = read_file(NEWS_REGISTER) || "No registration info.\n";
        receive(news);
        flush_messages();
        Destruct();
        return;
    }
    receive("Do you really wish to be known as " + cap + "? (y/n) \n");
    input_to((: ConfirmName :), I_NOESC, cap);
}

static void AgeCheck(string ans, string cap) {
    if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) {
        receive("\nSorry. You are not old enough to play here.\n");
        Destruct();
        return;
    }
    log_file("new_players", Name + " (" + ctime(time()) + ")\n");
    unguarded( (: log_file("/secure/log/new_players", Name + " from "
      + client_ip + extra + " (" + ctime(time()) + ")\n") :) );
    receive("\nCreate a password of at least 5 letters: \n");
    input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap);
}

static void ConfirmName(string ans, string cap) {
    if( !ans || ans == "" || lower_case(ans)[0..0] != "y" ) {
        receive("\nOk, then enter the name you really want: \n");
        input_to( (: InputName :), I_NOESC );
        return;
    }
    receive("\nAre you 18 years of age or older? (y/n) \n"); // orion_tweak: receive("\nAre you 13 years of age or older? (y/n) \n");
    input_to((: AgeCheck :), I_NOESC, cap);
}

static void eventReEnterGame(string cap) {
    if( interactive(Player) ) {
        receive("\nAn interactive copy of you currently exists.\n");
        receive("Do you wish to take over this copy? (y/n) \n");
        input_to((: ConfirmReconnect :), I_NOESC, cap);
        return;
    }
    if( exec(Player, this_object()) ) {
        if(rescue)
            if(sizeof(deep_inventory(Player)))
                deep_inventory(Player)->eventMove(ROOM_FURNACE);
        log_file("enter", cap + " (exec): " + ctime(time()) + "\n");
        unguarded( (: log_file("/secure/log/enter", Name + " (exec): " +
          ctime(time()) + " from " + client_ip + extra + "\n") :) );
        Player->eventReconnect();
        Player->RemoveProperty("afk");
        if(!anyterm){
            Player->CancelCharmode();
            Player->SetProperty("reprompt", 0);
            Player->SetTeloptIp(0);
        }
        else {
            Player->SetTeloptIp(telopt_user);
        }
        if(creatorp(Player))
            Player->AddChannel((CHAT_D->GetSystemChannels() - ({"muds"})));
        SNOOP_D->ReportReconnect(Player->GetKeyName());
        call_out( (: eventCheckPending, lower_case(Name) :), 3);
    }
    receive("\nProblem reconnecting.\n");
    Destruct();
}

static void ConfirmReconnect(string ans, string cap) {
    object tmp;

    if( !stringp(ans) || ans == "" || lower_case(ans)[0..0] != "y" ) {
        receive("\nThen please try again later!\n");
        Destruct();
        return;
    }
    if(rescue)
        if(sizeof(deep_inventory(Player))) deep_inventory(Player)->eventMove(ROOM_FURNACE);
    log_file("enter", cap + " (reconnect) ("+ctime(time())+")\n");
    unguarded( (: log_file("/secure/log/enter", Name + " (reconnect) from "
      + client_ip + extra + " (" + ctime(time()) + ")\n") :) );
    exec(tmp = new(LIB_PLAYER), Player);
    exec(Player, this_object());
    destruct(tmp);
    if(anyterm){
        int oldlock = Player->GetProperty("screenlock");
        Player->SetCharmode(1);
        Player->SetProperty("reprompt",1);
        Player->SetProperty("commandecho", "blue");
        Player->SetProperty("keepalive", 5);
        Player->SetProperty("screenlock", 0);
        Player->SetScreen(80, 25);
        Player->SetProperty("screenlock", oldlock);
        Player->SetTeloptIp(telopt_user);
    }
    else {
        Player->SetTeloptIp(0);
    }
    Player->eventPrint("\nAllowing login.\n", MSG_SYSTEM);
    call_out( (: eventCheckPending, lower_case(Name) :), 3);
    Destruct();
}

static int CanLogin() {
    string group;

    if( BANISH_D->GetGuest(Name) ) return 1;
    foreach(group in LOCKED_ACCESS_ALLOWED)
        if( member_group(Name, group) ) return 1;
    return 0;
}

static private void eventEnterGame() {
    if(!exec(Player, this_object())) {
        debug("problem connecting");
        receive("\nProblem connecting.\n");
        Player->eventDestruct();
        destruct(this_object());
        return;
    }
    if( Terminal ) Player->SetTerminal(Terminal);
    if( Screen ) Player->SetScreen(Screen[0], Screen[1]);
    Player->Setup();
    if(creatorp(Player)){ 
        string profile = user_path(Player->GetKeyName())+".profile";
        if(file_exists(profile)){
            string q = "";
            if(!MASTER_D->GetPerfOK()) q = "-q ";
            Player->eventForce("source "+q+profile);
        }
    }
    Player->RemoveProperty("afk");
    if(creatorp(Player))
        Player->AddChannel(((CHAT_D->GetSystemChannels()) - ({"muds"})));
    SNOOP_D->CheckBot(Player->GetKeyName());
    unguarded( (: log_file("/secure/log/enter", Name + " (enter): " +
      ctime(time()) + " from " + client_ip + extra + "\n") :) );
    if(anyterm){
        int oldlock = Player->GetProperty("screenlock");
        Player->SetCharmode(1);
        Player->SetProperty("reprompt",1);
        Player->SetProperty("commandecho", "blue");
        Player->SetProperty("keepalive", 5);
        Player->SetProperty("screenlock", 0);
        Player->SetScreen(80, 25);
        Player->SetProperty("screenlock", oldlock);
        Player->SetTeloptIp(telopt_user);
    }
    else {
        Player->SetTeloptIp(0);
    }
    call_out( (: destruct(this_object()) :), 10);
}

static void CreatePassword(string pass, string cap) {
    if( strlen(pass) < 3) {
        receive("\nYour password must be at least 5 letters in length.\n");
        receive("Please choose another password: ");
        input_to( (: CreatePassword :), I_NOECHO | I_NOESC, cap);
        return;
    }
    receive("\nPlease confirm your password: ");
    input_to( (: ConfirmPassword :), I_NOECHO | I_NOESC, cap, pass);
}

static void ConfirmPassword(string control, string cap, string pass) {
    if( control == pass ) {
        Player = master()->player_object(Name);
        pass = crypt(pass, 0);
        Passwort = pass;
        // orion_tweak: receive("\n\nPlease choose an interesting gender (male, female, neutral, or none): \n");
receive("\n\nChoose a gender for your character (male, female): \n");
        input_to((: InputGender :), I_NOESC, cap);
        return;
    }
    receive("\nPassword entries do not match, re-choose password: ");
    input_to((: CreatePassword :), I_NOECHO | I_NOESC, cap);
    return;
}

static void InputGender(string str, string cap) {
    if( str != "male" && str != "female") {
// orion_tweak: if( str != "male" && str != "female" && str != "neuter" && str != "neutral" && str != "none") {
// orion_tweak: receive("\nCute, but pretend to be male, female, neutral, or none instead.\n");
receive("\nInvalid choice.\n");
        receive("Gender: ");
        input_to((: InputGender :), I_NOESC, cap);
        return;
    }
    if(str == "none") str = "neuter";
    Gendre = str;
    if(CUSTOM_FORMAT){
        receive("\nYou may format " + cap + " to appear however you wish "
                "using spaces, ', or -.\nEnter a display name "
                "(default: " + cap +"): \n");
        input_to((: InputCapName :), I_NOESC, cap);
    }
    else {
        InputCapName(cap, cap);
    }
}

static void InputCapName(string name, string cap) {
    if( !name || name == "" ) name = cap;
    if( !(BANISH_D->valid_cap_name(name, Name)) ) {
        receive("\nThat was not a valid name format, choose again: \n");
        input_to((: InputCapName :), I_NOESC, cap);
        return;
    }
    cap = capitalize(name);
    CapNamen = cap;
    receive("\nFor security reasons, " + mud_name() + " requires a valid "
            "email.\n"
            "Email: \n");
    input_to((: InputEmail :), I_NOESC);
}

static void InputEmail(string email) {
    string user, host;

    if( !email || sscanf(email, "%s@%s", user, host) != 2 ) {
        receive("\nThat is not a valid email address.\n");
        receive("Please enter a valid email address: \n");
        input_to( (: InputEmail :), I_NOESC );
        return;
    }
    E_Mail = email;
    if(REAL_NAME){
        receive("\nIf you do not mind, please enter your real name "
            "(optional): \n");
        input_to( (: InputRealName :), I_NOESC );
    }
    else {
        InputRealName("");
    }
}

static void InputRealName(string rname) {
    if( !rname || rname == "" ) rname = "Unknown";
    TrueName = rname;
    if(!HUMANS_ONLY){
        receive("\n\nYou must now pick a race.\n");
        receive("Picking a race influences what physical traits your character "
                "will have.\n");
        receive("\nYou may issue the following commands:\n");
        receive("\tlist - lists all races from which you can choose\n");
        receive("\thelp - get help on what races mean\n");
        receive("\thelp RACE - (e.g. \"help human\") gives you information on "
                "a race\n");
        receive("\tpick RACE - pick a particular race for yourself\n");
        receive("\n\tValid races: ");
        receive(implode(sort_array(RACES_D->GetRaces(1), 1), " "));
        receive("\n\nRace: \n");
        input_to((: InputRace :), I_NOESC);
    }
    else InputRace("pick human");
}

static void InputRace(string str) {
    string cmd, args;
    string *valid = ( RACES_D->GetRaces(1) || ({}) );

    if( str == "" || !str ) {
        receive("\nRace: ");
        input_to((: InputRace :), I_NOESC);
        return;
    }
    if( sscanf(str, "%s %s", cmd, args) != 2 ) {
        cmd = str;
        args = 0;
    }
    if(member_array(cmd, valid) != -1){
        args = cmd;
        cmd = "pick";
    }
    switch(cmd) {
        case "list":
            cmdList();
        return;

        case "help":
            cmdHelp(args);
        return;

        case "pick":
            cmdPick(args);
        return;

        default:
        receive("\nInvalid command.\nRace: \n");
        input_to((: InputRace :), I_NOESC);
        return;
    }
}

static void cmdHelp(string args) {
    function f;
    string array races = RACES_D->GetRaces(1);
    string help;

    f = function(string str) {
        receive("\nRace: \n");
        input_to((: InputRace :), I_NOESC);
    };
    if( !args ) {
        help = read_file(DIR_PLAYER_HELP + "/races") ||
            "Error reading help file.\n";
        eventPage(explode(help, "\n"), MSG_HELP, f);
        return;
    }
    if( member_array(args = lower_case(args), races) == -1 ) {
        receive("No such race exists.\n\nRace: \n");
        input_to((: InputRace :), I_NOESC);
        return;
    }
    help = RACES_D->GetHelp(args);
    eventPage(explode(help, "\n"), MSG_HELP, f);
}

static void cmdList() {
    string list;

    list = format_page(sort_array(RACES_D->GetRaces(1), 1), 5);
    receive(list);
    receive("\nRace: \n");
    input_to((: InputRace :), I_NOESC);
}

static void cmdPick(string args) {
    if( !args || args == "" ) {
        receive("You must specify a race to pick.\n\nRace: \n");
        input_to((: InputRace :), I_NOESC);
        return;
    }
    if( member_array(args = lower_case(args),
                RACES_D->GetRaces(1)) == -1 ) {
        receive("No such race.\nRace: \n");
        input_to((: InputRace :), I_NOESC);
        return;
    }
    raza = args;
    if(!AUTO_WIZ){
        if(CLASS_SELECTION){
            eventSelectClass();
            return;
        }
        eventCompleteChar();
    }
    if(AUTO_WIZ == 2) InputCre("creator");
    else {
        receive("This mud has enabled AUTO_WIZ.\n");
        receive("This means that if you wish, you may be automatically \n");
        receive("promoted to creator status. \n\n");
        receive("If you want to be a player, enter: player\n");
        receive("If you want to be a creator, enter: creator\n");
        receive("What is your choice?\n");
        input_to((: InputCre :), I_NOESC);
    }
}

static void eventSelectClass(){
    receive("\n\nYou must now pick a class.\n");
    receive("Picking a class influences what skills your character "
            "will have.\n");
    receive("\nYou may issue the following commands:\n");
    receive("\tlist - lists all classes from which you can choose\n");
    receive("\thelp - get help on what classes mean\n");
    receive("\thelp CLASS - (e.g. \"help explorer\") gives you information on "
            "a class\n");
    receive("\tpick CLASS - pick a particular class for yourself\n");
    receive("\n\tValid classes: ");
    receive(implode(sort_array(CLASSES_D->GetClasses(1), 1), " "));
    receive("\nClass: \n");
    input_to((: InputClass :), I_NOESC);
}

static void InputClass(string str){
    string cmd, args;
    string *valid = ( CLASSES_D->GetClasses(1) || ({}) );

    if( str == "" || !str ) {
        receive("\nClass: ");
        input_to((: InputClass :), I_NOESC);
        return;
    }
    if( sscanf(str, "%s %s", cmd, args) != 2 ) {
        cmd = str;
        args = 0;
    }
    if(member_array(cmd, valid) != -1){
        args = cmd;
        cmd = "pick";
    }
    switch(cmd) {
        case "list":
            cmdListClasses();
        return;

        case "help":
            cmdHelpClass(args);
        return;

        case "pick":
            cmdPickClass(args);
        return;

        default:
        receive("\nInvalid command.\nClass: \n");
        input_to((: InputClass :), I_NOESC);
        return;
    }
}

static void cmdHelpClass(string args){
    function f;
    string array Classes = CLASSES_D->GetClasses(1);
    string help;

    f = function(string str) {
        receive("\nClass: \n");
        input_to((: InputClass :), I_NOESC);
    };
    if( !args ) {
        help = HELP_D->GetHelp("player documents classes") ||
            "Error reading help file.\n";
        eventPage(explode(help, "\n"), MSG_HELP, f);
        return;
    }
    if( member_array(args = lower_case(args), Classes) == -1 ) {
        receive("No such Class exists.\n\nClass: \n");
        input_to((: InputClass :), I_NOESC);
        return;
    }
    help = HELP_D->GetHelp("classes "+args);
    eventPage(explode(help, "\n"), MSG_HELP, f);
}

static void cmdListClasses() {
    string list;

    list = format_page(sort_array(CLASSES_D->GetClasses(1), 1), 5);
    receive(list);
    receive("\nClass: \n");
    input_to((: InputClass :), I_NOESC);
}

static void cmdPickClass(string args) {
    if( !args || args == "" ) {
        receive("You must specify a class to pick.\n\nClass: \n");
        input_to((: InputClass :), I_NOESC);
        return;
    }
    if( member_array(args = lower_case(args),
                CLASSES_D->GetClasses(1)) == -1 ) {
        receive("No such Class.\nClass: \n");
        input_to((: InputClass :), I_NOESC);
        return;
    }
    trabajo = args;
    eventCompleteChar();
}

int eventCre(string str){
    mixed mixt;
    if(yescre && AUTO_WIZ > 0){
        mixt = load_object("/secure/cmds/admins/encre")->cmd(str);
    }
    destruct(this_object());
    return 1;
}

int eventCheckPending(string str){
    mixed mixt;
    str = lower_case(str);
    if(member_array(str,PLAYERS_D->GetPendingEncres()) != -1){
        PLAYERS_D->RemovePendingEncre(str);
        mixt = load_object("/secure/cmds/admins/encre")->cmd(str);
    }
    else if(member_array(str,PLAYERS_D->GetPendingDecres()) != -1){
        PLAYERS_D->RemovePendingDecre(str);
        mixt = load_object("/secure/cmds/admins/decre")->cmd(str);
    }
    if(member_array(str,PLAYERS_D->GetPendingPauses()) != -1){
        PLAYERS_D->RemovePendingPause(str);
        mixt = Player->SetPlayerPaused(1);
    }
    else if(member_array(str,PLAYERS_D->GetPendingUnpauses()) != -1){
        PLAYERS_D->RemovePendingUnpause(str);
        mixt = Player->SetPlayerPaused(0);
    }
    destruct(this_object());
    return 1;
}

void InputCre(string str){
    if(!str || str == "" || !sizeof(str) || !stringp(str)) str = "foo";
    if(str != "creator" && str != "player"){
        receive("\nInvalid choice.\n");
        receive("If you want to be a player, enter: player\n");
        receive("If you want to be a creator, enter: creator\n");
        receive("What is your choice?\n");
        input_to((: InputCre :), I_NOESC);
        return;
    }
    if(str == "creator"){
        yescre = 1;
        receive("\n---\nYou will automatically be made a creator shortly");
        receive(" after login.\n---\n");
    }
    if(CLASS_SELECTION){
        eventSelectClass();
        return;
    }
    else {
        eventCompleteChar();
    }
}

void eventCompleteChar(){
    Player->SetRace(raza);
    Player->SetProperty("brand_spanking_new",1);
    // orion_tweak: Player->AddCurrency("silver",random(100)+57);
    Player->SetPassword(Passwort);
    Player->SetGender(Gendre);
    Player->SetCapName(CapNamen);
    Player->SetEmail(E_Mail);
    Player->SetRealName(TrueName);   
    if(lower_case(raza) != "poleepkwa"){
        Player->SetLanguage("Common",100);   
        Player->SetDefaultLanguage("Common");
        this_player()->SetWimpy(20);
    }
    else {
        Player->SetGender("neutral");
    }
    if(yescre) Player->SetPrompt("cwd");
    else Player->SetPrompt("status");
    if(trabajo) Player->ChangeClass(trabajo);
    this_player()->SetTerminal("ansi");
    PLAYERS_D->AddPlayerInfo(Name);
    call_out( (: eventCre, Name :), 3);
    eventEnterGame();
}

static void eventTimeout() {
    if( !interactive(this_object()) ) {
        Destruct();
    }
    else if( query_idle(this_object()) > LOGON_TIMEOUT ) {
        receive("\nLogin timed out.\n");
        Destruct();
    }
    else call_out( (: eventTimeout :), LOGON_TIMEOUT );
}

varargs int eventPrint(string msg, mixed cl, mixed arg3) {
    if( !cl || !intp(cl) ) return 0;
    if( cl & MSG_NOWRAP ) receive(strip_colours(msg));
    else receive(wrap(strip_colours(msg), GetScreen()[0]));
    return 1;
}

static private void Destruct() {
    if( Player && !NetDead ) destruct(Player);
    remove_call_out();
    destruct(this_object());
}

void eventDestruct() {
    Destruct();
}

string GetKeyName() {
    if(!interactive(this_object())) return 0;
    else if(Name) return Name;
    else return "";
}

string GetCapName() {
    string tmp;

    tmp = GetKeyName();
    return (tmp ? capitalize(tmp) : "");
}

static void terminal_type(string str) {
    if( !stringp(str) ) return;
    else Terminal = lower_case(str);
}

static void window_size(int width, int height) {
    Screen = ({ width, height });
}

static void CreateGuest() {
    receive("Enter the name you wish to use: \n");
    input_to( (: GetGuestName :), I_NOESC );
}

static void GetGuestName(string nom) {
    object ob;

    return;
    if( !nom || nom == "" || user_exists(convert_name(nom)) ) {
        receive("Illegal name choice, try again: ");
        return;
    }
    ob->SetCapName(nom);
    exec(ob, this_object());
    ob->Setup();
}

int *GetScreen() {
    if( Screen ) return Screen;
    else return ({ 80, 50 });
// orion_tweak: else return ({ 79, 25 });
}

void SetLastError(mapping m) {
    if (previous_object() != master()) return;
    LastError = m;
}

mapping GetLastError() {
    string caller = base_name(previous_object());
    if( caller == "/secure/cmds/creator/dbxwhere" ||
            caller  == "/secure/cmds/player/dbxframe" ) return LastError;
    error("Privilege Violation: " + caller);
}

int GetMaxPlayers(){
    return MaxPlayers;
}

void receive_environ(mixed foo){
    mixed *uservars;
    uservars = explode(foo, sprintf("%c", __ANSI_SUBSTITUTE__));
    foreach(string uservar in uservars){
        mixed tmp_arr = explode(uservar, sprintf("%c", 1));
        if(!sizeof(tmp_arr)) continue;
        if(sizeof(tmp_arr) < 2) tmp_arr += ({ 0 });
        UserVars[tmp_arr[0]] = tmp_arr[1];
    }
    if(!telopt_user && UserVars["USER"]) telopt_user = UserVars["USER"];
}

Any idea why this error is happening or where I can continue looking for the problem?

Thanks

2
Dead Souls Support / Everything on my server is asphyxiating (DS 3.4)
« on: June 21, 2011, 01:39:58 am »
I installed DS 3.4 and all the NPCs and PCs are asphyxiating immediately

SYSTEM <death> asphyxia has slain Drunken man.

Do you know what might be the cause?

My rooms all have:

room::create();
SetClimate("indoors"); or SetClimate("outdoors");

And the asphyxiation is happening in the default realms as well - I do not believe it is domain-specific

It's also not race-specific as it's happening to animals, humans, mutants, etc

3
I've got more than 400mb of core.tmp files in my /lib/ directory

Some going back as far as two months

Are these files supposed to be deleted automatically over time?

Can they be safely deleted?

4
Dead Souls Support / wizmapping problem
« on: May 12, 2011, 03:26:51 am »
I have a domain with only ~15 rooms

The wizmapping has never been right, so I decided to manually SetCoordinates for each room

My layout is simple and should look something like this:
Code: [Select]
X-X-X-X-X-X-X
|        |        |
X-X-X-X-X-X-X

I started with SetCoordinates("0, 0, 0"); for the bottom left room, and continued with the other rooms... SetCoordinates("1, 0, 0"), SetCoordinates("2, 0, 0"), etc.

I restarted the MUD and now the wizmapping is even worse!, it's showing stuff like:
Code: [Select]
                                                           
 5                                                            
          |                                                  
 4        # # #                                              
          | | |                                              
 3        #-#-#-#-#-                                          
          |   | |                                            
 2        #   # #                                            
              | |                                            
 1          @-#-#-#-                                          
                | |                                          
 0            #-#-#-                                          
                                                            
-1            #-#-#-                                          
              |                                              
                                                            
   -5-4-3-2-1 0 1 2

And

Code: [Select]
5                                                            
                                                            
 4  #                                                        
    |                                                        
 3 -#-#-#-#-#-#-#-#-                                          
    | |   |X|X|X|X|X                                        
 2  # #   #-#-#-#-#-                                          
    | |   |X|X|X|X|X                                        
 1 -#-#-#-#-@-#-#-#-                                          
      | | |X|X|X|X|X                                        
 0  #-#-#-#-#-#-#-#-                                          
          |X|X|X|X|X                                        
-1  #-#-#-#-#-#-#-#-                                          
    |     |X|X|X|X|X                                        
                                                            
    0 1 2 3 4 5 6 7

I know my coordinates are right, what else could be wrong?

Wizmapping is working fine in the /realms/user/workroom area, where there are only 3 rooms right next to each other

Why can't it work with the 15 or so rooms I have which form a box pattern?

Any help would be appreciated, thanks

5
Dead Souls Support / couldn't find object errors
« on: May 09, 2011, 12:59:57 am »
I get 5 errors on boot

There are no errors in runtime, but catch is displaying:

Code: [Select]
--- OrionMUD
2011.05.08-23.48,06
*call_other() couldn't find object 170245104
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/daemon/autoexec (/<driver>) at line 0
'eventRun' at /secure/daemon/autoexec at line 50
'CATCH' at /secure/daemon/autoexec at line 50
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:34
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

--- OrionMUD
2011.05.08-23.48,06
*call_other() couldn't find object 170282704
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/daemon/autoexec (/<driver>) at line 0
'eventRun' at /secure/daemon/autoexec at line 51
'CATCH' at /secure/daemon/autoexec at line 51
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:34
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

--- OrionMUD
2011.05.08-23.48,06
*call_other() couldn't find object 164913456
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/daemon/autoexec (/<driver>) at line 0
'eventRun' at /secure/daemon/autoexec at line 52
'CATCH' at /secure/daemon/autoexec at line 52
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:34
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

--- OrionMUD
2011.05.08-23.48,06
*call_other() couldn't find object 170151520
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/daemon/autoexec (/<driver>) at line 0
'eventRun' at /secure/daemon/autoexec at line 53
'CATCH' at /secure/daemon/autoexec at line 53
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:34
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

--- OrionMUD
2011.05.08-23.48,06
*call_other() couldn't find object 170209608
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/daemon/autoexec (/<driver>) at line 0
'eventRun' at /secure/daemon/autoexec at line 54
'CATCH' at /secure/daemon/autoexec at line 54
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:34
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

You will notice theres a number after the couldn't find object error, that's because I edited the driver to try and tell me what object it was trying to find, I tweaked this in efuns_main:
Code: [Select]
error("call_other() couldn't find object %d\n",arg[0].u.string);

But it's just spitting out a number, which is not very helpful

Any idea how I can begin to diagnose this?

6
Dead Souls Support / run a shell command?
« on: April 30, 2011, 06:56:16 pm »
Is there a way to run a shell command from within lib?

I want to execute a sendmail command once a user as created their account in connect.c

Is this possible? I'm guessing there would need to be a fluffos command like system()

7
just started recently, I haven't modified any of the core files
very strange

my inventory is empty, so it's not a missing inventory item

Code: [Select]
--- Shoulder of Orion
2011-02-08 21:52:23
*call_other() couldn't find object
Object: /secure/save/creators/s/sam (/lib/props/move.c) at line 85

'<fake>' at /secure/save/creators/s/sam (/<driver>) at line 0
'cmdAll' at /secure/save/creators/s/sam (/lib/command.c) at line 231
'cmd' at /secure/cmds/creators/update at line 84
'CacheAndCarry' at /secure/cmds/creators/update at line 30
'eventMove' at /secure/save/creators/s/sam (/lib/creator.c) at line 266
'eventMove' at /secure/save/creators/s/sam (/lib/player.c) at line 277
'eventMove' at /secure/save/creators/s/sam (/lib/interactive.c) at line 254
'eventMove' at /secure/save/creators/s/sam (/lib/props/move.c) at line 85
'CATCH' at /secure/save/creators/s/sam (/lib/props/move.c) at line 85

--- Shoulder of Orion
2011-02-08 21:52:23
*call_other() couldn't find object
Object: /secure/save/players/t/test (/lib/props/move.c) at line 85

'<fake>' at /secure/save/creators/s/sam (/<driver>) at line 0
'cmdAll' at /secure/save/creators/s/sam (/lib/command.c) at line 231
'cmd' at /secure/cmds/creators/update at line 84
'CacheAndCarry' at /secure/cmds/creators/update at line 30
'eventMove' at /secure/save/players/t/test (/lib/player.c) at line 277
'eventMove' at /secure/save/players/t/test (/lib/interactive.c) at line 254
'eventMove' at /secure/save/players/t/test (/lib/props/move.c) at line 85
'CATCH' at /secure/save/players/t/test (/lib/props/move.c) at line 85

8
Dead Souls Support / trying to fix a runtime error
« on: January 30, 2011, 09:55:18 pm »
I am trying to nail down a pesky runtime error

The error is triggered when a character (idle for a few hours) returns and attempts to move in any direction

The game continues to run as normal, and the character is moved in their desired direction, but a runtime error is generated (see below)

I have seen it happen in every room, so it's not room specific

CATCH log:
Code: [Select]
--- Shoulder of Orion
2011-01-30 20:28:05
*call_other() couldn't find object
Object: /secure/sefun/sefun at /secure/sefun/load_object.c:35

'<fake>' at /secure/save/creators/s/sam (/<driver>) at line 0
'cmdAll' at /secure/save/creators/s/sam (/lib/command.c) at line 210
'do_go_str' at /verbs/rooms/go at line 45
'eventGo' at /domains/los_angeles/room/lilhongkong_ave_b (/lib/exits.c) at line 107
'eventMoveLiving' at /secure/save/creators/s/sam (/lib/living.c) at line 719
'CheckMove' at /daemon/guard at line 95
'CATCH' at /daemon/guard at line 95
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'create' at /domains/los_angeles/room/happy_drink at line 11
'SetInventory' at /domains/los_angeles/room/happy_drink (/lib/props/inventory.c) at line 101
'eventLoadInventory' at /domains/los_angeles/room/happy_drink (/lib/props/inventory.c) at line 58
'eventLoadItem' at /domains/los_angeles/room/happy_drink (/lib/props/inventory.c) at line 36
'eventMove' at /domains/los_angeles/npc/chan#757 (/lib/npc.c) at line 293
'eventCompleteMove' at /domains/los_angeles/npc/chan#757 (/lib/npc.c) at line 212
'eventMove' at /domains/los_angeles/npc/chan#757 (/lib/props/move.c) at line 120
'init' at /domains/los_angeles/room/happy_drink at line 30
'init' at /domains/los_angeles/room/happy_drink (/lib/std/room.c) at line 1293
'create' at /secure/daemon/rooms at line 39
'CATCH' at /secure/daemon/rooms at line 39
'load_object' at /secure/sefun/sefun at /secure/sefun/load_object.c:35
'CATCH' at /secure/sefun/sefun at /secure/sefun/load_object.c:35

RUNTIME log:
Code: [Select]
Error in error handler: *Bad argument 2 to foreach
Expected: mapping Got: 0.
program: /secure/sefun/sefun.c, object: /secure/sefun/sefun, file: /secure/sefun/expand_keys.c:11
--- trace ---
Object: /secure/save/players/t/test, Program: <driver>
   in <fake>() at
Object: /secure/save/players/t/test, Program: /lib/command.c
   in cmdAll() at /lib/command.c:210
Object: /verbs/rooms/go, Program: /verbs/rooms/go.c
   in do_go_str() at /verbs/rooms/go.c:45
Object: /domains/los_angeles/room/lilhongkong_ave_d, Program: /lib/exits.c
   in eventGo() at /lib/exits.c:107
Object: /secure/save/players/t/test, Program: /lib/living.c
   in eventMoveLiving() at /lib/living.c:719
Object: /daemon/guard, Program: /daemon/guard.c
   in CheckMove() at /daemon/guard.c:95
Object: /daemon/guard, Program: /daemon/guard.c
   in <catch>() at /daemon/guard.c:95
Object: /secure/sefun/sefun, Program: /secure/sefun/sefun.c
   in load_object() at /secure/sefun/load_object.c:35
Object: /secure/sefun/sefun, Program: /secure/sefun/sefun.c
   in <catch>() at /secure/sefun/load_object.c:35
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /domains/los_angeles/room/lilhongkong_ave_e.c
   in create() at /domains/los_angeles/room/lilhongkong_ave_e.c:18
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /lib/props/inventory.c
   in SetInventory() at /lib/props/inventory.c:101
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /lib/props/inventory.c
   in eventLoadInventory() at /lib/props/inventory.c:58
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /lib/props/inventory.c
   in eventLoadItem() at /lib/props/inventory.c:36
Object: /domains/los_angeles/npc/chickenhead#707, Program: /lib/npc.c
   in eventMove() at /lib/npc.c:293
Object: /domains/los_angeles/npc/chickenhead#707, Program: /lib/npc.c
   in eventCompleteMove() at /lib/npc.c:212
Object: /domains/los_angeles/npc/chickenhead#707, Program: /lib/props/move.c
   in eventMove() at /lib/props/move.c:120
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /domains/los_angeles/room/lilhongkong_ave_e.c
   in init() at /domains/los_angeles/room/lilhongkong_ave_e.c:23
Object: /domains/los_angeles/room/lilhongkong_ave_e, Program: /lib/std/room.c
   in init() at /lib/std/room.c:1293
Object: /secure/daemon/rooms, Program: /secure/daemon/rooms.c
   in create() at /secure/daemon/rooms.c:39
Object: /secure/daemon/rooms, Program: /secure/daemon/rooms.c
   in <catch>() at /secure/daemon/rooms.c:39
Object: /secure/sefun/sefun, Program: /secure/sefun/sefun.c
   in load_object() at /secure/sefun/load_object.c:35
Object: /secure/sefun/sefun, Program: /secure/sefun/sefun.c
   in <catch>() at /secure/sefun/load_object.c:35
Object: /secure/daemon/master, Program: /secure/daemon/master.c
   in error_handler() at /secure/daemon/master.c:670
Object: /secure/sefun/sefun, Program: /secure/sefun/sefun.c
   in flat_map() at /secure/sefun/mappings.c:8
'    expand_keys' in '/secure/sefun/sefun.c' ('/  secure/sefun/sefun') /secure/sefun/expand_keys.c:11
--- end trace ---

Runtime.boot has given errors about a custom LIB I made, it doesn't occur at the same time as the errors above, but it might be related
Code: [Select]
--- Shoulder of Orion
2011-01-27 16:12:15
*Bad argument 1 to call_other()
Expected: string or array or object Got: 0.
Object: /domains/los_angeles/weap/lumebrella#650 (/lib/orion_lamp.c) at line 58

'heart_beat' at /domains/los_angeles/weap/lumebrella#650 at line 31
'eventToggle' at /domains/los_angeles/weap/lumebrella#650 (/lib/orion_lamp.c) at line 109
'regetID' at /domains/los_angeles/weap/lumebrella#650 (/lib/orion_lamp.c) at line 58
closed external ports

orion_lamp.c and lumebrella.c work like I want them to, but there might be a problem with the code (causing the errors above):

LIB_ORION_LAMP
Code: [Select]
/* simple lamp with on/off, disable on/off, toggle switch, and customizable lit message */

#include <lib.h>
inherit LIB_ITEM;
inherit LIB_TURN;

void SetLightLevel(int i);
void SetLitText(string i);
int eventRadiate(int i);

object player,env;
string name,me,littext;
int Lit,lightlevel,CanTurnOn,CanTurnOff;

void create(){
    ::create();
    Lit=0;
    CanTurnOn = 1;
    CanTurnOff = 1;
    littext="%^BOLD%^YELLOW%^lit%^RESET%^";
}

void init(){
    ::init();
    if(Lit == 1) {
        eventRadiate(lightlevel);
    }
    me=this_object()->GetKeyName();
}

string GetShort(){
    string ret, str, article;
    string litstr = "(" + littext + ") ";
    if(!Lit || query_verb() == "flip" || query_verb() == "turn"){
        return ::GetShort();
    }
    if(!(str = ::GetShort()) || str == "") return str;
    article = (replace_string(str, remove_article(str), "") || "");
    str = remove_article(str);
    ret = (sizeof(article) ? article : "") + litstr + str;
    return ret;
}

int eventRadiate(int i){
    SetRadiantLight(i);
}

void SetLightLevel(int i){
    if(i) lightlevel = i;
}

void SetLitText(string i){
    if(i) littext = i;
}

void regetID(){
    player=this_player();
    name=this_player()->GetName();
    env=environment(this_object());
}

int eventTurnOn(){
    if(CanTurnOn != 0) {
        regetID();

        if(player != env  && environment(player) !=env){
            write("It isn't within reach.");
            return 1;
        }
     
        if(Lit == 0){
            write("You turn on the "+me+".");
            say(name+" turns on a "+me+".");
            eventRadiate(lightlevel);
            Lit = 1;
            return 1;
        }

        if(Lit == 1){
            write("It is already lit.");
            return 1;
        }
    } else {
        write("You can't do that.");
    }
}

int eventTurnOff(){
    if(CanTurnOff != 0) {
        regetID();
        if(player != env  && environment(player) !=env){ write("It isn't within reach."); return 1; }
        if(Lit == 1){
            write("You turn off the "+me+".");
            say(name+" turns off a "+me+".");
            eventRadiate(0);
            Lit = 0;
            return 1;
        }
        if(Lit == 0){
            write("It is already off.");
            return 1;
        }
    } else {
        write("You can't do that.");
    }
}

int eventToggle(){
    regetID();

    if(player != env  && environment(player) !=env){
        write("It isn't within reach.");
        return 1;
    }
 
    if(Lit == 0){
        eventRadiate(lightlevel);
        Lit = 1;
        return 1;
    } else {
        if(Lit == 1) {
            eventRadiate(0);
            Lit = 0;
            return 1;       
        }
    }
}

WEAP/LUMEBRELLA.C
Code: [Select]
#include <lib.h>
#include <damage_types.h>
#include <vendor_types.h>
inherit LIB_ORION_LAMP;

mixed DoWield(object who);

void create(){
    ::create();
    SetKeyName("lumebrella");
    SetId(({"umbrella","lumebrella"}));
    SetShort("a lumebrella");
    SetLong("A black umbrella with a glowing neon tube for a handle.");
    SetMass(50);
    SetLightLevel(25);
    Lit=0;
    SetLitText("%^BOLD%^BLUE%^glowing%^RESET%^");
    SetBaseCost("dollars",20);
    SetVendorType(VT_WEAPON);
    SetDamagePoints(10);
    SetDamageType(BLUNT);
    SetWeaponType("blunt");
    SetWield( (: DoWield :) );
    set_heart_beat(2);
}

void heart_beat(){
    object env = environment();
    object room = room_environment();
    if(!GetWorn() && Lit==1){
        ::eventToggle();
    } else {
        if(GetWorn() && Lit!=1){
            ::eventToggle();
        }
    }
}

mixed DoWield(object who){
    object env = environment(who);
    who->eventPrint("You wield " + GetShort() + " and it illuminates.");
    if(env) tell_room(env, who->GetName() + " pulls out a lumebrella, and it illuminates.", ({who}));
    if(Lit != 1) {
        ::eventToggle();
    }
   
    return 1;
}

void init(){
    ::init();
}

mixed eventUnequip(object who){
    mixed ret = ::eventUnequip(who);
    object env = environment(who);
    if(ret && Lit==1){
        ::eventToggle();
        who->eventPrint("The " + GetKeyName() + " turns off.");
        if(env) tell_room(env, who->GetName()+"'s lumebrella turns off.", ({who}));
    }
    return ret;
}

int eventTurnOn(){
    write("The " + GetKeyName() + " automatically turns on if you are holding it, and off if you are not.");
    return 1;
}

int eventTurnOff(){
    write("The " + GetKeyName() + " automatically turns on if you are holding it, and off if you are not.");
    return 1;
}

Can someone help me in the right direction to diagnosing this error?  Are there errors in my LIB_ORION_LAMP code?

I'd be grateful for any advice, thank you

9
Intermud / cant connect to I3
« on: January 15, 2011, 11:41:56 am »
When I was running my MUD on my local computer, I could connect to I3 and use the channels

Now after moving to a MUD host, I am unable to connect to I3

I have tried all three servers:
204.209.44.3 8080
97.107.133.86 8787
195.242.99.94 7777

And contacted my host
My host says that all of these ports are open to me, and we are able to telnet to each of those addresses/ports from SSH

This is what I see when I use "mudconfig intermud enable" in the Network Room:

Code: [Select]
mudconfig intermud enable
Which: intermud arg: enable
Enabling intermud...
Command complete.
INTERMUD_D: socket closing!
INTERMUD_D: prev: ({ OBJ(/secure/cmds/creators/update),
OBJ(/secure/sefun/sefun), OBJ(/secure/daemon/master), OBJ(/secure/sefun/sefun),
OBJ(/secure/cmds/admins/mudconfig), OBJ(sam /secure/save/creators/s/sam) })
INTERMUD_D reloaded.
Loading object stack:
0:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: get_stack,
origin: simul
1:OBJ(/daemon/intermud), file: /daemon/intermud.c, fun: create, origin: driver
2:OBJ(/secure/cmds/creators/update), file: /secure/cmds/creators/update.c, fun:
CATCH, origin: local
3:OBJ(/secure/cmds/creators/update), file: /secure/cmds/creators/update.c, fun:
eventUpdate, origin: local
4:OBJ(/secure/cmds/creators/update), file: /secure/cmds/creators/update.c, fun:
cmd, origin: call_other
5:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: <function>,
origin: functional
6:OBJ(/secure/sefun/sefun), file: /<driver>, fun: <function>, origin: function
pointer
7:OBJ(/secure/daemon/master), file: /secure/daemon/master.c, fun: CATCH,
origin: call_other
8:OBJ(/secure/daemon/master), file: /secure/daemon/master.c, fun:
apply_unguarded, origin: call_other
9:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: unguarded,
origin: local
10:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: reload, origin:
simul
11:OBJ(/secure/cmds/admins/mudconfig), file: /secure/cmds/admins/mudconfig.c,
fun: ModIntermud, origin: local
12:OBJ(/secure/cmds/admins/mudconfig), file: /secure/cmds/admins/mudconfig.c,
fun: cmd, origin: call_other
13:OBJ(sam /secure/save/creators/s/sam), file: /lib/command.c, fun: cmdAll,
origin: local
14:OBJ(sam /secure/save/creators/s/sam), file: /<driver>, fun: <function>,
origin: function pointer
Loading object trail: ({ OBJ(/secure/cmds/creators/update),
OBJ(/secure/sefun/sefun), OBJ(/secure/daemon/master), OBJ(/secure/sefun/sefun),
OBJ(/secure/cmds/admins/mudconfig), OBJ(sam /secure/save/creators/s/sam) })
/ > INTERMUD_D: SocketStat: 0
INTERMUD_D setup: ({ "startup-req-3", 5, "Shoulder of Orion", 0, "*i4", 0,
123761214, -1, -1, 2019, 2025, 2027, "Dead Souls 3.0", "Dead Souls 3.0",
"FluffOS v2.18-ds07", "LPMud", "mudlib development", "", ([
"channel" : 1, "mail" : 1, "tell" : 1, "finger" : 1, "who" : 1, "auth" : 1,
"oob" : 2025, "locate" : 1, "emoteto" : 1, "http" : 2010 ]), ([ ]) })

IMC2 heartbeat: reloading IMC2_D due to timeout
IMC2 TIMEOUT! Reloading.

removing imc2. stack:
0:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: get_stack,
origin: simul
1:OBJ(/secure/daemon/imc2), file: /secure/daemon/imc2.c, fun: remove, origin:
local
2:OBJ(/secure/daemon/imc2), file: /secure/daemon/imc2.c, fun: eventDestruct,
origin: call_other
3:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: reload, origin:
simul
4:OBJ(/secure/daemon/reload), file: /secure/daemon/reload.c, fun: eventReload,
origin: call_other
5:OBJ(/secure/daemon/imc2), file: /secure/daemon/imc2.c, fun: heart_beat,
origin: driver
IMC2 OBJECT REMOVED

IMC2: created Sat Jan 15 11:37:48 2011
IMC2: setup Sat Jan 15 11:37:49 2011
Creating IMC2 object at Sat Jan 15 11:37:49 2011.

Creating IMC2 object at Sat Jan 15 11:37:49 2011.

socket_create: Created Socket 1

socket_connect: connected socket 1 to 74.207.247.83 5000

INTERMUD_D: socket closing!
INTERMUD_D: prev: ({ OBJ(/secure/sefun/sefun), OBJ(/secure/daemon/ping) })
INTERMUD_D reloaded.
Loading object stack:
0:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: get_stack,
origin: simul
1:OBJ(/daemon/intermud), file: /daemon/intermud.c, fun: create, origin: driver
2:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: CATCH, origin:
simul
3:OBJ(/secure/sefun/sefun), file: /secure/sefun/sefun.c, fun: update, origin:
simul
4:OBJ(/secure/daemon/ping), file: /secure/daemon/ping.c, fun: CheckOK, origin:
local
5:OBJ(/secure/daemon/ping), file: /secure/daemon/ping.c, fun: heart_beat,
origin: driver
Loading object trail: ({ OBJ(/secure/sefun/sefun), OBJ(/secure/daemon/ping) })
INTERMUD_D: SocketStat: 0
INTERMUD_D setup: ({ "startup-req-3", 5, "Shoulder of Orion", 0, "*i4", 0,
123761214, -1, -1, 2019, 2025, 2027, "Dead Souls 3.0", "Dead Souls 3.0",
"FluffOS v2.18-ds07", "LPMud", "mudlib development", "", ([
"channel" : 1, "mail" : 1, "tell" : 1, "finger" : 1, "who" : 1, "auth" : 1,
"oob" : 2025, "locate" : 1, "emoteto" : 1, "http" : 2010 ]), ([ ]) })

Does anyone know what else I might try to diagnose this problem?

Thank you

10
Dead Souls Support / can't seem to prevent IDLE_TIMEOUT
« on: January 12, 2011, 09:06:10 pm »
I have tried changing IDLE_TIMEOUT in config.h to 0 and huge numbers such as 3000000000 (then shutting down and restarting the MUD), yet my users still seem to get disconnected after about 30 minutes to an hour of idling

Is there another variable that I need to change? or do you think it could be a setting with my host?

11
Dead Souls Support / different seasons text for different domains
« on: January 12, 2011, 08:49:33 pm »
what would be the best way to go about having different seasons text for different domains?

take for example two domains, each representing a different planet with different atmospheres

so if the sun is rising on one planet, i'd like it to say "The sun shines weakly through the thick atmosphere." in one domain, vs and the standard in another domain "The sun is shining brightly in the daytime sky."

my first thought was to do a switches inside eventDawn, eventMorning, GetLong, etc - but what variable would I use to get the current domain? would that even work (getting current domain) with the way seasons.c is included?

i'm new to the codebase and am still learning

any suggestions would be appreciated, thank you

Pages: [1]