Bug Tracker – Attachment #240: implement sv_intervalscript for bug #689

View | Details | Raw Unified | Return to bug 689
Collapse All | Expand All

(-)server/src/sv_cvarlist.cpp (+2 lines)
Lines 74-79 Link Here
74
CVAR (sv_endmapscript, "", CVAR_ARCHIVE | CVAR_NOENABLEDISABLE)	
74
CVAR (sv_endmapscript, "", CVAR_ARCHIVE | CVAR_NOENABLEDISABLE)	
75
// script to run at start of each map (e.g. to override cvars)
75
// script to run at start of each map (e.g. to override cvars)
76
CVAR (sv_startmapscript, "", CVAR_ARCHIVE | CVAR_NOENABLEDISABLE)	
76
CVAR (sv_startmapscript, "", CVAR_ARCHIVE | CVAR_NOENABLEDISABLE)	
77
// script to run at a fixed interval, much more suitable for certain tasks such as auto-running a ban list
78
CVAR (sv_intervalscript, "", CVAR_ARCHIVE | CVAR_NOENABLEDISABLE)
77
// tracks last played map
79
// tracks last played map
78
CVAR (sv_curmap, "", CVAR_NOSET | CVAR_NOENABLEDISABLE)
80
CVAR (sv_curmap, "", CVAR_NOSET | CVAR_NOENABLEDISABLE)
79
// tracks next map to be played			
81
// tracks next map to be played			
(-)server/src/g_game.cpp (+5 lines)
Lines 462-467 Link Here
462
//
462
//
463
extern DCanvas *page;
463
extern DCanvas *page;
464
int mapchange;
464
int mapchange;
465
EXTERN_CVAR(sv_intervalscript)
465
466
466
void G_Ticker (void)
467
void G_Ticker (void)
467
{
468
{
Lines 534-539 Link Here
534
	default:
535
	default:
535
		break;
536
		break;
536
	}
537
	}
538
539
	// [tm512] -- jan 28 2011 -- Make a script run periodically
540
	if (!(gametic % 4200) && strlen(sv_intervalscript.cstring()))
541
		AddCommandString(sv_intervalscript.cstring());
537
}
542
}
538
543
539
544

Return to bug 689