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

Pages: 1 2 [3]
31
Code Vault / Re: mudconfig.c to show status information
« on: December 29, 2007, 10:27:21 pm »
Bah, sue me :P

32
Code Vault / Channel History Change in DS
« on: December 28, 2007, 10:10:15 pm »
The below changes support the following syntax:
hist <channel> [lines]

Where lines will default to 20.

This change will read the log of the channel if present rather than the stored information which is lost over reboots and updates to chat.c, also will let you control how much you see.

Change cmdLast in /secure/daemon/chat.c to:
Code: [Select]
int cmdLast(string feep){
  string history;
    string array chanhist;
    int lines;
   
    sscanf(feep,"%s %d", feep, lines);
    if(!lines) lines=20;
    if(!chanlast||!Channels[feep]||member_array(this_player(), Channels[feep])==-1){

        this_player()->eventPrint("You are not subscribed to that channel.", MSG_ERROR);
        return 1;
    }
    if(!CanListen(this_player(),feep)){
        write("You lack privileges to that channel.");
        return 1;
    }
    if(feep != "admin")
    history = read_file("/log/chan/"+feep);
    else
      history = read_file("/secure/log/admin");
    if(!history){
        if(!sizeof(chanlast[feep])){
            this_player()->eventPrint("That channel has no backlog.", MSG_ERROR);
            return 1;
        }
        else
            this_player()->eventPrint(implode(chanlast[feep], "\n"));
    return 1;
    }
    if( sizeof(chanhist = explode(history, "\n")) > lines )
       history = implode(chanhist[<lines..], "\n");
    this_player()->eventPrint(history);
    return 1;
}

Change hist.c in /cmds/players/hist.c entirely to:
Code: [Select]
// Modified 12-29-08 by Archaegeo to support reading channel logs
#include <lib.h>
#include <daemons.h>
#include <message_class.h>

inherit LIB_DAEMON;

mixed cmd(string args) {
    if(!args){
        this_player()->eventPrint("Syntax: <hist <channel> [lines]>");
        return 1;
    }

    this_player()->eventPrint("Retrieving history...");

    if(args == "tell"){
        load_object("/secure/cmds/players/tell")->cmd("hist");
        return 1;
    }

    return CHAT_D->cmdLast(args);
    return 1;
}

string GetHelp(string topic) {
    return ("Syntax: <hist <channel> [lines]>\n"
      "Gives you the hist of a channel.\nThe default length if lines not specified is 20.\n"
      "If <tell> is the channel, no lines arguement is used.");
}

33
Dead Souls Support / Re: DS2.6 help index menu fix
« on: December 27, 2007, 07:11:34 am »
Nice fix :)

Pages: 1 2 [3]