history.pch
history.pch · 5.0 KB
From the archive tyche_history.tar.gz
Download the archive « Back to the archive contents
diff -urw Rom24/src/Makefile Rom24_patch/src/Makefile
--- Rom24/src/Makefile 1998-05-23 17:23:46.000000000 -0400
+++ Rom24_patch/src/Makefile 2006-04-03 03:23:26.349958400 -0400
@@ -8,7 +8,7 @@
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
- update.o
+ update.o dates.o history.o
rom: $(O_FILES)
rm -f rom
diff -urw Rom24/src/act_comm.c Rom24_patch/src/act_comm.c
--- Rom24/src/act_comm.c 1998-05-27 19:23:48.000000000 -0400
+++ Rom24_patch/src/act_comm.c 2006-04-03 03:21:37.032768000 -0400
@@ -39,6 +39,7 @@
#include "interp.h"
#include "recycle.h"
#include "tables.h"
+#include "history.h"
/* RT code to delete yourself */
@@ -66,6 +67,8 @@
{
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
wiznet("$N turns $Mself into line noise.",ch,NULL,0,0,0);
+ // Added for player history
+ g_stats.current_deletions++;
stop_fighting(ch,TRUE);
do_function(ch, &do_quit, "");
unlink(strsave);
@@ -1416,6 +1419,9 @@
sprintf( log_buf, "%s has quit.", ch->name );
log_string( log_buf );
wiznet("$N rejoins the real world.",ch,NULL,WIZ_LOGINS,0,get_trust(ch));
+ // Added for player history
+ g_stats.current_logouts++;
+ g_stats.current_play_time += (int) (current_time - ch->logon);
/*
* After extract_char the ch is no longer valid!
diff -urw Rom24/src/act_info.c Rom24_patch/src/act_info.c
--- Rom24/src/act_info.c 1998-05-27 20:37:18.000000000 -0400
+++ Rom24_patch/src/act_info.c 2006-04-03 03:00:48.847966400 -0400
@@ -42,6 +42,7 @@
#include "recycle.h"
#include "tables.h"
#include "lookup.h"
+#include "history.h"
char * const where_name [] =
{
@@ -2091,14 +2092,15 @@
if ( d->connected == CON_PLAYING && can_see( ch, d->character ) )
count++;
- max_on = UMAX(count,max_on);
+// Moved this update to update_stats(); in history.c
+// max_on = UMAX(count,max_on);
- if (max_on == count)
+ if (g_stats.max_on <= count)
sprintf(buf,"There are %d characters on, the most so far today.\n\r",
count);
else
sprintf(buf,"There are %d characters on, the most on today was %d.\n\r",
- count,max_on);
+ count,g_stats.max_on);
send_to_char(buf,ch);
}
diff -urw Rom24/src/comm.c Rom24_patch/src/comm.c
--- Rom24/src/comm.c 1998-05-27 20:25:22.000000000 -0400
+++ Rom24_patch/src/comm.c 2006-04-03 03:21:48.088665600 -0400
@@ -61,6 +61,7 @@
#include "interp.h"
#include "recycle.h"
#include "tables.h"
+#include "history.h"
/*
* Malloc debugging stuff.
@@ -995,6 +996,9 @@
}
else
{
+ // Added for player history
+ g_stats.current_logouts++;
+ g_stats.current_play_time += (int) (current_time - ch->logon);
free_char(dclose->original ? dclose->original :
dclose->character );
}
@@ -1667,6 +1671,8 @@
sprintf( log_buf, "%s@%s has connected.", ch->name, d->host );
log_string( log_buf );
wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch));
+ // Added for player history
+ g_stats.current_logins++;
if ( IS_IMMORTAL(ch) )
{
@@ -1909,6 +1915,9 @@
log_string( log_buf );
wiznet("Newbie alert! $N sighted.",ch,NULL,WIZ_NEWBIE,0,0);
wiznet(log_buf,NULL,NULL,WIZ_SITES,0,get_trust(ch));
+ // Added for player history code.
+ g_stats.current_creates++;
+ g_stats.current_logins++;
write_to_buffer( d, "\n\r", 2 );
write_to_buffer( d, "You may be good, neutral, or evil.\n\r",0);
diff -urw Rom24/src/interp.c Rom24_patch/src/interp.c
--- Rom24/src/interp.c 1998-05-25 03:13:00.000000000 -0400
+++ Rom24_patch/src/interp.c 2006-04-03 02:29:04.359446400 -0400
@@ -291,6 +291,7 @@
{ "disconnect", do_disconnect, POS_DEAD, L3, LOG_ALWAYS, 1 },
{ "flag", do_flag, POS_DEAD, L4, LOG_ALWAYS, 1 },
{ "freeze", do_freeze, POS_DEAD, L4, LOG_ALWAYS, 1 },
+ { "history", do_history, POS_DEAD, L1, LOG_NORMAL, 1 },
{ "permban", do_permban, POS_DEAD, L1, LOG_ALWAYS, 1 },
{ "protect", do_protect, POS_DEAD, L1, LOG_ALWAYS, 1 },
{ "reboo", do_reboo, POS_DEAD, L1, LOG_NORMAL, 0 },
diff -urw Rom24/src/interp.h Rom24_patch/src/interp.h
--- Rom24/src/interp.h 1998-05-27 20:44:20.000000000 -0400
+++ Rom24_patch/src/interp.h 2006-04-03 02:26:43.056262400 -0400
@@ -145,6 +145,7 @@
DECLARE_DO_FUN( do_heal );
DECLARE_DO_FUN( do_help );
DECLARE_DO_FUN( do_hide );
+DECLARE_DO_FUN( do_history );
DECLARE_DO_FUN( do_holylight );
DECLARE_DO_FUN( do_idea );
DECLARE_DO_FUN( do_immtalk );
diff -urw Rom24/src/update.c Rom24_patch/src/update.c
--- Rom24/src/update.c 1998-05-27 20:35:36.000000000 -0400
+++ Rom24_patch/src/update.c 2006-04-03 03:00:59.062654400 -0400
@@ -36,6 +36,7 @@
#include "merc.h"
#include "interp.h"
#include "music.h"
+#include "history.h"
/*
* Local functions.
@@ -1097,6 +1098,7 @@
{
pulse_music = PULSE_MUSIC;
song_update();
+ update_stats();
}
if ( --pulse_mobile <= 0 )