1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/stub_plugin/sdk_util.cpp Tue Apr 06 07:36:14 2004 +0000
1.3 @@ -0,0 +1,50 @@
1.4 +// vi: set ts=4 sw=4 :
1.5 +// vim: set tw=75 :
1.6 +
1.7 +// Selected portions of dlls/util.cpp from SDK 2.1.
1.8 +// Functions copied from there as needed...
1.9 +// And modified to avoid buffer overflows (argh).
1.10 +
1.11 +/***
1.12 +*
1.13 +* Copyright (c) 1999, 2000 Valve LLC. All rights reserved.
1.14 +*
1.15 +* This product contains software technology licensed from Id
1.16 +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
1.17 +* All Rights Reserved.
1.18 +*
1.19 +* Use, distribution, and modification of this source code and/or resulting
1.20 +* object code is restricted to non-commercial enhancements to products from
1.21 +* Valve LLC. All other use, distribution, or modification is prohibited
1.22 +* without written permission from Valve LLC.
1.23 +*
1.24 +****/
1.25 +/*
1.26 +
1.27 +===== util.cpp ========================================================
1.28 +
1.29 + Utility code. Really not optional after all.
1.30 +
1.31 +*/
1.32 +
1.33 +#include <extdll.h>
1.34 +#include <enginecallback.h> // ALERT()
1.35 +
1.36 +#include "osdep.h" // win32 vsnprintf, etc
1.37 +
1.38 +//=========================================================
1.39 +// UTIL_LogPrintf - Prints a logged message to console.
1.40 +// Preceded by LOG: ( timestamp ) < message >
1.41 +//=========================================================
1.42 +void UTIL_LogPrintf( char *fmt, ... )
1.43 +{
1.44 + va_list argptr;
1.45 + static char string[1024];
1.46 +
1.47 + va_start ( argptr, fmt );
1.48 + vsnprintf ( string, sizeof(string), fmt, argptr );
1.49 + va_end ( argptr );
1.50 +
1.51 + // Print to server console
1.52 + ALERT( at_logged, "%s", string );
1.53 +}