[Package Index | Mudlib Index | Effect Index]

File /secure/simul_efun/modified_efuns.c

Cotains some simul_efuns.

Written by Pinkfish

Inherits

This class inherits the following classes /secure/simul_efun/base_name.c

Includes

This class includes the following files /include/player_handler.h, /include/login_handler.h, /include/login.h and /include/playtesters.h

Method index

Public Functions

These are functions that everyone can access.

cap_words
string cap_words(string words)

This method returns a string with each word capitalized.



Parameters:
words - the string to capitalize

Returns:
the string with all words capitalized


cat
void cat(string file,
         int start_line,
         int number)

Write the file out to the screen. This should not be used if possible. It is an interface to read_file and other things. You should perhaps look at using more_string ort more_file.

Parameters:
file - the file name to cat
start_line - the line to start on
number - the number of lines to print

See also:
/global/more_string->more_string() and /global/more_file->more_file()


db_connect
varargs int db_connect(mixed * args ...)
flush_log_files
void flush_log_files()

This method flushes out all the buffered stuff for the log files.
log_file
varargs void log_file(string name,
                      string fmt,
                      mixed * args ...)

This method writes a message out ot a log file. The log files are normally in "/log". If a file doesn't start with '/ then "/log/" will be preppended to it. This does automatic removal of the log files after they get over a certain length. The fmt and args parameters are used to print the actual message.

If more than one argument is passed to this function, then sprintf will be used to print out the results.

ie: log_file("ROGER", "%s: frog and %s\n", ctime(), query_gumboot());

Parameters:
name - the name of the log file
fmt - the format string
args - the arguments to the sprintf


memory_summary
string memory_summary()
mud_name
string mud_name()

This method returns the name of the mud.

Returns:
the name of the mud


other_call_out
varargs int other_call_out(object ob,
                           string func,
                           int delay,
                           mixed rest ...)

This does a call_out on another object.

Parameters:
object - object the delayed call is in
function - function to call
delay - time to wait


query_loggers
mapping query_loggers()

Return a mapping of what files were the last to write to what log files.

Returns:
A mapping of format ([ log file : file that logged ])


query_verb
string query_verb()

This returns the current verb name. This works if the verb is used through add_command or through add_action.

Returns:
the name of the verb


reference_allowed
varargs int reference_allowed(object referree,
                              mixed referrer)

This method is used to test to see if a reference is allowed to this object. It tests things like the allow array and that sort of stuff.

Parameters:
thing - the object to test

Returns:
1 if the reference is allowed


replace
varargs string replace(string str,
                       mixed bing,
                       string rep)

Replaces all occurances of a set of strings in the input string. Replaces an individual or an array of strings with new values. If the second argument is an array of strings, then the 1st, 3rd, 5th... elements will be the strings to search for and the 2nd, 4th, 6th etc will be the strings to replace with. If three arguments are specified then the second is the string to search for, the third the one to replace.

Eg:
str = replace(str, ({ "search", "replace", "orange", "apple" });

That will replace all occurances of "search" with "replace" and "orange" with "apple".

Parameters:
str - the string to do the replacement in
bing - the search or array argument
rep - the replacement string, or null

Returns:
the string with all the replacements done


shout
varargs void shout(string words,
                   object avoid)

This method sends a polite shout to everyone on line. It checks for earmuffs and all that sort of stuff.

Parameters:
words - the message to shout
avoid - who not to tell the message to


sob
object sob()

Returns the simul_efun object.

Returns:
The simul_efun object


strcasecmp
int strcasecmp(string str1,
               string str2)

Does a string compare... But case insensative...

Parameters:
str1 - the string to compare
str2 - the other string to compare

Returns:
0 if they are the same, <0 if they are less than each other, >0 if not

See also:
efun::strcmp()


tail
varargs string tail(string fname,
                    int nlines)

This will print the last bit of a file.

Parameters:
fname - the file to read

Returns:
1 if it succeeded, 0 if it failed


uniq_array
mixed * uniq_array(mixed * arr)

This method will return an array that contains no duplicates. uniq_array.c Written by: Wodan

This function will return an array that contains no duplicates. Gotta love them mappings. :)

Parameters:
arr - the array to convert

Returns:
an array with no duplicates


user_event
void user_event(mixed from,
                mixed first,
                mixed args ...)

This method calls an event on all the users online. It does not do any filtering, so it will send messages to people who are earmuffed and ignoring or lord invisible or whatever.

Parameters:
from - the person it is from
name - the name of the event
args - the arguments to the event


wizardp
int wizardp(mixed arg)

This method tells us if the object is a wizard.

Returns:
is the object a wizard


write
varargs void write(string str,
                   string language)

This method prints a message to the player.

Parameters:
str - the message to send