mssp_plaintext.tgz
snippets · 7.1 KB · 2010-03-30
MSSP plain-text support: mssp.c/h and data file for reporting MUD status to crawlers.
Download « Back to the snippets list
INSTALL.txt
1. Copy mssp.c and mssp.h to your src directory
2. Copy mssp.dat to your src/system directory
3. Add references to mssp.c in your Makefile
4. A little bit of code to add...
Close to the top of the file db.c locate:
#include "news.h"
After that add:
#include "mssp.h"
In the file db.c locate the code:
int last_pkroom;
After that add:
time_t mud_start_time;
In db.c, boot_db locate the code:
log_string( "Loading commands..." );
load_commands( );
After that add:
mud_start_time = current_time;
In db.c, boot_db locate the code:
log_string( "Making wizlist" );
make_wizlist( );
After that add:
log_string( "Loading MSSP Data..." );
load_mssp_data( );
Towards the top of the file comm.c locate:
#include "mccp.h"
#include "sha256.h"
After that add:
#include "mssp.h"
In the file comm.c, function nanny_get_name, locate:
if( argument[0] == '\0' )
{
close_socket( d, FALSE );
return;
}
argument[0] = UPPER( argument[0] );
After that add:
if( !str_cmp( argument, "MSSP-REQUEST" ) )
{
send_mssp_data( d );
//Uncomment below if you want to know when an MSSP request occurs
//log_printf( "IP: %s requested MSSP data!", d->host );
close_socket( d, FALSE );
return;
}
In the file mud.h locate the line:
DECLARE_DO_FUN( do_setmixture );
After that add:
DECLARE_DO_FUN( do_setmssp );
5. Copyover or hotboot your game
6. Do these commands:
cedit setmssp create do_setmssp
cedit save cmdtable
Viola, now you can set your MSSP variables and test it by typing MSSP-REQUEST at the login screen.
Also, as a side note, I simply made mud_start_time get updated anytime boot_db is run, which will include copyover/hotboots
so feel free to change that if you want.
Archive contents (4 files)
| File | Size |
|---|---|
| INSTALL.txt | 1.9 KB |
| mssp.c | 29.1 KB |
| mssp.dat | 1.1 KB |
| mssp.h | 1.5 KB |