Moved modified HL SDK to trunk

This commit is contained in:
Scott Ehlert
2006-08-27 02:22:59 +00:00
parent 28c4ea4fec
commit 30235e05e5
900 changed files with 344676 additions and 0 deletions

53
hlsdk/dedicated/Makefile Normal file
View File

@ -0,0 +1,53 @@
#
# hlds (front end for hlds_l) Makefile for Linux i386
#
# May 2000, Leon Hartwig (hartwig@valvesoftware.com)
#
#make sure this is the correct compiler for your system
CC=g++
SRCDIR=.
OBJDIR=$(SRCDIR)/obj
#safe optimization
CFLAGS=-Wall -Werror -m486 -O1
#full optimization
#CFLAGS=-Wall -Werror -m486 -O2 \
-ffast-math -funroll-loops \
-fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2
#use these when debugging
#CFLAGS=$(BASE_CFLAGS) -g
LDFLAGS=-lgcc -ldl
AR=ar
RANLIB=ranlib
INCLUDEDIRS=-I. -I../common
DO_CC=$(CC) $(INCLUDEDIRS) $(CFLAGS) -o $@ -c $<
#############################################################################
# HLDS FRONT END
#############################################################################
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(DO_CC)
OBJ = \
$(OBJDIR)/sys_ded.o \
$(OBJDIR)/engine.o
hlds : neat $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ)
neat:
-mkdir -p $(OBJDIR)
clean:
-rm -f $(OBJ)
-rm -f hlds
spotless: clean
-rm -r $(OBJDIR)

BIN
hlsdk/dedicated/NetGame.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

424
hlsdk/dedicated/conproc.cpp Normal file
View File

@ -0,0 +1,424 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// conproc.c -- support for qhost
#include "dedicated.h"
#include "sys_ded.h"
#include <stdio.h>
#include <process.h>
#include <windows.h>
#include "conproc.h"
static HANDLE heventDone;
static HANDLE hfileBuffer;
static HANDLE heventChildSend;
static HANDLE heventParentSend;
static HANDLE hStdout;
static HANDLE hStdin;
/*
==============
SetConsoleCXCY
==============
*/
BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy)
{
CONSOLE_SCREEN_BUFFER_INFO info;
COORD coordMax;
coordMax = GetLargestConsoleWindowSize(hStdout);
if (cy > coordMax.Y)
cy = coordMax.Y;
if (cx > coordMax.X)
cx = coordMax.X;
if (!GetConsoleScreenBufferInfo(hStdout, &info))
return FALSE;
// height
info.srWindow.Left = 0;
info.srWindow.Right = info.dwSize.X - 1;
info.srWindow.Top = 0;
info.srWindow.Bottom = cy - 1;
if (cy < info.dwSize.Y)
{
if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow))
return FALSE;
info.dwSize.Y = cy;
if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
return FALSE;
}
else if (cy > info.dwSize.Y)
{
info.dwSize.Y = cy;
if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
return FALSE;
if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow))
return FALSE;
}
if (!GetConsoleScreenBufferInfo(hStdout, &info))
return FALSE;
// width
info.srWindow.Left = 0;
info.srWindow.Right = cx - 1;
info.srWindow.Top = 0;
info.srWindow.Bottom = info.dwSize.Y - 1;
if (cx < info.dwSize.X)
{
if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow))
return FALSE;
info.dwSize.X = cx;
if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
return FALSE;
}
else if (cx > info.dwSize.X)
{
info.dwSize.X = cx;
if (!SetConsoleScreenBufferSize(hStdout, info.dwSize))
return FALSE;
if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow))
return FALSE;
}
return TRUE;
}
/*
==============
GetMappedBuffer
==============
*/
LPVOID GetMappedBuffer (HANDLE hfileBuffer)
{
LPVOID pBuffer;
pBuffer = MapViewOfFile (hfileBuffer,
FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
return pBuffer;
}
/*
==============
ReleaseMappedBuffer
==============
*/
void ReleaseMappedBuffer (LPVOID pBuffer)
{
UnmapViewOfFile (pBuffer);
}
/*
==============
GetScreenBufferLines
==============
*/
BOOL GetScreenBufferLines (int *piLines)
{
CONSOLE_SCREEN_BUFFER_INFO info;
BOOL bRet;
bRet = GetConsoleScreenBufferInfo (hStdout, &info);
if (bRet)
*piLines = info.dwSize.Y;
return bRet;
}
/*
==============
SetScreenBufferLines
==============
*/
BOOL SetScreenBufferLines (int iLines)
{
return SetConsoleCXCY (hStdout, 80, iLines);
}
/*
==============
ReadText
==============
*/
BOOL ReadText (LPTSTR pszText, int iBeginLine, int iEndLine)
{
COORD coord;
DWORD dwRead;
BOOL bRet;
coord.X = 0;
coord.Y = iBeginLine;
bRet = ReadConsoleOutputCharacter(
hStdout,
pszText,
80 * (iEndLine - iBeginLine + 1),
coord,
&dwRead);
// Make sure it's null terminated.
if (bRet)
pszText[dwRead] = '\0';
return bRet;
}
/*
==============
CharToCode
==============
*/
int CharToCode (char c)
{
char upper;
upper = toupper(c);
switch (c)
{
case 13:
return 28;
default:
break;
}
if (isalpha(c))
return (30 + upper - 65);
if (isdigit(c))
return (1 + upper - 47);
return c;
}
/*
==============
WriteText
==============
*/
BOOL WriteText (LPCTSTR szText)
{
DWORD dwWritten;
INPUT_RECORD rec;
char upper, *sz;
sz = (LPTSTR) szText;
while (*sz)
{
// 13 is the code for a carriage return (\n) instead of 10.
if (*sz == 10)
*sz = 13;
upper = toupper(*sz);
rec.EventType = KEY_EVENT;
rec.Event.KeyEvent.bKeyDown = TRUE;
rec.Event.KeyEvent.wRepeatCount = 1;
rec.Event.KeyEvent.wVirtualKeyCode = upper;
rec.Event.KeyEvent.wVirtualScanCode = CharToCode (*sz);
rec.Event.KeyEvent.uChar.AsciiChar = *sz;
rec.Event.KeyEvent.uChar.UnicodeChar = *sz;
rec.Event.KeyEvent.dwControlKeyState = isupper(*sz) ? 0x80 : 0x0;
WriteConsoleInput(
hStdin,
&rec,
1,
&dwWritten);
rec.Event.KeyEvent.bKeyDown = FALSE;
WriteConsoleInput(
hStdin,
&rec,
1,
&dwWritten);
sz++;
}
return TRUE;
}
/*
==============
RequestProc
==============
*/
unsigned _stdcall RequestProc (void *arg)
{
int *pBuffer;
DWORD dwRet;
HANDLE heventWait[2];
int iBeginLine, iEndLine;
heventWait[0] = heventParentSend;
heventWait[1] = heventDone;
while (1)
{
dwRet = WaitForMultipleObjects (2, heventWait, FALSE, INFINITE);
// heventDone fired, so we're exiting.
if (dwRet == WAIT_OBJECT_0 + 1)
break;
pBuffer = (int *) GetMappedBuffer (hfileBuffer);
// hfileBuffer is invalid. Just leave.
if (!pBuffer)
{
Sys_Printf ("Request Proc: Invalid -HFILE handle\n");
break;
}
switch (pBuffer[0])
{
case CCOM_WRITE_TEXT:
// Param1 : Text
pBuffer[0] = WriteText ((LPCTSTR) (pBuffer + 1));
break;
case CCOM_GET_TEXT:
// Param1 : Begin line
// Param2 : End line
iBeginLine = pBuffer[1];
iEndLine = pBuffer[2];
pBuffer[0] = ReadText ((LPTSTR) (pBuffer + 1), iBeginLine,
iEndLine);
break;
case CCOM_GET_SCR_LINES:
// No params
pBuffer[0] = GetScreenBufferLines (&pBuffer[1]);
break;
case CCOM_SET_SCR_LINES:
// Param1 : Number of lines
pBuffer[0] = SetScreenBufferLines (pBuffer[1]);
break;
}
ReleaseMappedBuffer (pBuffer);
SetEvent (heventChildSend);
}
_endthreadex (0);
return 0;
}
/*
==============
DeinitConProc
==============
*/
void DeinitConProc (void)
{
if ( heventDone )
{
SetEvent ( heventDone );
}
}
/*
==============
InitConProc
==============
*/
void InitConProc ( void )
{
unsigned threadAddr;
HANDLE hFile = (HANDLE)0;
HANDLE heventParent = (HANDLE)0;
HANDLE heventChild = (HANDLE)0;
int WantHeight = 50;
char *p;
// give external front ends a chance to hook into the console
if ( CheckParm ( "-HFILE", &p ) && p )
{
hFile = (HANDLE)atoi ( p );
}
if ( CheckParm ( "-HPARENT", &p ) && p )
{
heventParent = (HANDLE)atoi ( p );
}
if ( CheckParm ( "-HCHILD", &p ) && p )
{
heventChild = (HANDLE)atoi ( p );
}
// ignore if we don't have all the events.
if ( !hFile || !heventParent || !heventChild )
{
//Sys_Printf ("\n\nNo external front end present.\n" );
return;
}
Sys_Printf( "\n\nInitConProc: Setting up external control.\n" );
hfileBuffer = hFile;
heventParentSend = heventParent;
heventChildSend = heventChild;
// So we'll know when to go away.
heventDone = CreateEvent (NULL, FALSE, FALSE, NULL);
if (!heventDone)
{
Sys_Printf ("InitConProc: Couldn't create heventDone\n");
return;
}
if (!_beginthreadex (NULL, 0, RequestProc, NULL, 0, &threadAddr))
{
CloseHandle (heventDone);
Sys_Printf ("InitConProc: Couldn't create third party thread\n");
return;
}
// save off the input/output handles.
hStdout = GetStdHandle (STD_OUTPUT_HANDLE);
hStdin = GetStdHandle (STD_INPUT_HANDLE);
if ( CheckParm( "-conheight", &p ) && p )
{
WantHeight = atoi( p );
}
// Force 80 character width, at least 25 character height
SetConsoleCXCY( hStdout, 80, WantHeight );
}

30
hlsdk/dedicated/conproc.h Normal file
View File

@ -0,0 +1,30 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// conproc.h -- support for external server monitoring programs
#ifndef INC_CONPROCH
#define INC_CONPROCH
#define CCOM_WRITE_TEXT 0x2
// Param1 : Text
#define CCOM_GET_TEXT 0x3
// Param1 : Begin line
// Param2 : End line
#define CCOM_GET_SCR_LINES 0x4
// No params
#define CCOM_SET_SCR_LINES 0x5
// Param1 : Number of lines
void InitConProc ( void );
void DeinitConProc ( void );
void WriteStatusText( char *psz );
#endif // !INC_CONPROCH

View File

@ -0,0 +1,23 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// dedicated.h
#ifndef INC_DEDICATEDH
#define INC_DEDICATEDH
int Eng_Frame ( int fForce, double time );
int Eng_Load ( const char *cmdline, struct exefuncs_s *pef, int memory, void *pmembase, const char *psz, int iSubMode );
void Eng_Unload ( void);
void Eng_SetState ( int );
void Eng_SetSubState ( int );
char *CheckParm ( const char *psz, char **ppszValue = (char **)0 );
extern int gDLLState;
extern int gDLLStateInfo;
#endif

View File

@ -0,0 +1,72 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_HALFLIFE ICON DISCARDABLE "NetGame.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

361
hlsdk/dedicated/engine.cpp Normal file
View File

@ -0,0 +1,361 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#define snprintf _snprintf
#else
#include <memory.h>
#include <string.h>
#include <stdlib.h> // exit()
#endif
#include "dedicated.h"
#include "dll_state.h"
#include "enginecallback.h"
#include "sys_ded.h"
int iWait = 0;
int fDeferedPause = 0;
int gDLLState;
int gDLLStateInfo;
long ghMod = 0;
static engine_api_t nullapi;
engine_api_t engineapi = nullapi;
extern SleepType Sys_Sleep; // setup by sys_ded.cpp
typedef int (*engine_api_func)( int version, int size, struct engine_api_s *api );
#ifdef _WIN32
// This is a big chunk of uninitialized memory that we reserve for loading blobs into.
char g_rgchBlob[0x03800000];
#endif // _WIN32
/*
==============
Eng_LoadFunctions
Load engine->front end interface, if possible
==============
*/
int Eng_LoadFunctions( long hMod )
{
engine_api_func pfnEngineAPI;
pfnEngineAPI = ( engine_api_func )Sys_GetProcAddress( hMod, "Sys_EngineAPI" );
if ( !pfnEngineAPI )
return 0;
if ( !(*pfnEngineAPI)( ENGINE_LAUNCHER_API_VERSION, sizeof( engine_api_t ), &engineapi ) )
return 0;
// All is okay
return 1;
}
/*
==============
Eng_LoadStubs
Force NULL interface
==============
*/
void Eng_LoadStubs( void )
{
// No callbacks in dedicated server since engine should always be loaded.
memset( &engineapi, 0, sizeof( engineapi ) );
engineapi.version = ENGINE_LAUNCHER_API_VERSION;
engineapi.rendertype = RENDERTYPE_UNDEFINED;
engineapi.size = sizeof( engine_api_t );
}
/*
==============
Eng_Unload
Free engine .dll and reset interfaces
==============
*/
void Eng_Unload(void)
{
if ( ghMod )
{
Sys_FreeLibrary(ghMod);
ghMod = 0;
}
Eng_LoadStubs();
gDLLState = 0;
gDLLStateInfo = 0;
}
/*
==============
Eng_KillEngine
Load failure on engine
==============
*/
void Eng_KillEngine( long *phMod )
{
Sys_FreeLibrary( ghMod );
ghMod = *phMod = 0;
Eng_LoadStubs();
}
/*
==============
Eng_Load
Try to load the engine with specified command line, etc. etc. and the specified .dll
==============
*/
int Eng_Load( const char *cmdline, struct exefuncs_s *pef, int memory, void *pmembase, const char *psz, int iSubMode )
{
char szLastDLL[ 100 ];
long hMod = (long)NULL;
#if defined( _DEBUG )
char *p;
if ( psz && !stricmp( psz, "swds.dll" ) && CheckParm( "-force", &p ) && p )
{
psz = p;
}
#endif
// Are we loading a different engine?
if ( psz && ghMod && !strcmp( psz, szLastDLL ) )
{
return 1;
}
if ( ghMod )
{
Eng_KillEngine( &hMod );
}
if ( !psz )
{
hMod = 0;
Eng_LoadStubs();
}
else if ( !ghMod )
{
hMod = Sys_LoadLibrary( (char *)psz );
if ( !hMod )
{
return 0;
}
// Load function table from engine
if ( !Eng_LoadFunctions( hMod ) )
{
Sys_FreeLibrary( hMod );
Eng_LoadStubs();
return 0;
}
// Activate engine
Eng_SetState( DLL_ACTIVE );
}
Eng_SetSubState( iSubMode );
snprintf( szLastDLL, sizeof( szLastDLL ), "%s", psz );
ghMod = hMod;
if ( ghMod )
{
static char *szEmpty = "";
char *p = (char *)cmdline;
if ( !p )
{
p = szEmpty;
}
if ( !engineapi.Game_Init( p, (unsigned char *)pmembase, memory, pef, NULL, 1) )
{
Sys_FreeLibrary(ghMod);
ghMod = hMod = 0;
return 0;
}
if ( engineapi.SetStartupMode )
{
engineapi.SetStartupMode( 1 );
}
if ( engineapi.Host_Frame )
{
Eng_Frame( 1, 0.05 );
}
if ( engineapi.SetStartupMode )
{
engineapi.SetStartupMode( 0 );
}
}
return 1;
}
/*
==============
Eng_Frame
Run a frame in the engine, if it's loaded.
==============
*/
int Eng_Frame( int fForce, double time )
{
if ( ( gDLLState != DLL_ACTIVE ) && !fForce )
return 0;
if ( gDLLState )
{
gDLLStateInfo = DLL_NORMAL;
int iState = engineapi.Host_Frame ( (float)time, gDLLState, &gDLLStateInfo );
// Special Signal
if ( gDLLStateInfo != DLL_NORMAL )
{
switch (gDLLStateInfo)
{
case DLL_QUIT:
Eng_Unload();
#ifdef _WIN32
PostQuitMessage(0);
#else
exit( 0 );
#endif
break;
case DLL_RESTART:
Eng_Unload();
#ifdef _WIN32
PostQuitMessage(1);
#else
exit( 1 );
#endif
break;
default:
break;
}
}
// Are we in our transistion counter?
if (iWait)
{
iWait--;
// Defer all pauses until we're ready to bring up the launcher
if (iState == DLL_PAUSED)
{
fDeferedPause = 1;
Eng_SetState(DLL_ACTIVE);
iState = DLL_ACTIVE;
}
// Are we done waiting, if so, did someone request a pause?
if (!iWait && fDeferedPause)
{
//force a pause
iState = DLL_PAUSED;
gDLLState = DLL_ACTIVE;
fDeferedPause = 0;
}
}
// Are we now in a transistion?
if (iState == DLL_TRANS)
{
iState = DLL_ACTIVE;
iWait = 5; // Let's wait N frames before we'll allow a pause
Eng_SetState(DLL_ACTIVE);
}
// Has the state changed?
if (iState != gDLLState)
{
Eng_SetState(iState);
}
}
if ( gDLLState == DLL_CLOSE || gDLLState == DLL_RESTART)
{
static int bQuitting = 0;
if ( !bQuitting )
{
bQuitting = 1;
engineapi.Cbuf_AddText( "killserver\n" );
Eng_Frame( 1, 0.05 );
Sys_Sleep( 100 );
Eng_Frame( 1, 0.05 );
Sys_Sleep( 100 );
return gDLLState;
}
Eng_Unload();
#ifdef _WIN32
PostQuitMessage(0);
#else
if ( gDLLState == DLL_RESTART )
{
exit( 1 );
}
else
{
exit( 0 );
}
#endif
}
return gDLLState;
}
/*
==============
Eng_SetSubState
==============
*/
void Eng_SetSubState(int iSubState)
{
if ( !engineapi.GameSetSubState )
return;
if ( iSubState != ENG_NORMAL )
{
engineapi.GameSetSubState( iSubState );
}
}
/*
==============
Eng_SetState
==============
*/
void Eng_SetState(int iState)
{
gDLLState = iState;
if (engineapi.GameSetState)
{
engineapi.GameSetState( iState );
}
}

View File

@ -0,0 +1,32 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// enginecallback.h
#ifndef INC_ENGINECALLBACKH
#define INC_ENGINECALLBACKH
typedef enum
{
// A dedicated server with no ability to start a client
ca_dedicated,
// Full screen console with no connection
ca_disconnected,
// Challenge requested, waiting for response or to resend connection request.
ca_connecting,
// valid netcon, talking to a server, waiting for server data
ca_connected,
// valid netcon, autodownloading
ca_uninitialized,
// d/l complete, ready game views should be displayed
ca_active
} cactive_t;
#include "engine_launcher_api.h"
extern engine_api_t engineapi;
#endif // !INC_ENGINECALLBACKH

14
hlsdk/dedicated/exports.h Normal file
View File

@ -0,0 +1,14 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// functions exported from front end to engine
#ifndef INC_EXPORTSH
#define INC_EXPORTSH
extern void ErrorMessage(int nLevel, const char *pszErrorMessage);
#endif // !INC_EXPORTSH

View File

@ -0,0 +1,144 @@
# Microsoft Developer Studio Project File - Name="Dedicated" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Dedicated - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Dedicated.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Dedicated.mak" CFG="Dedicated - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Dedicated - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Dedicated - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Dedicated - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir ".\Release"
# PROP BASE Intermediate_Dir ".\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\engine" /I "..\..\common" /I "..\..\dedicated" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DEDICATED" /D "LAUNCHERONLY" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib /nologo /subsystem:windows /machine:I386 /out:".\Release/hlds.exe"
# SUBTRACT LINK32 /map /debug
!ELSEIF "$(CFG)" == "Dedicated - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir ".\Debug"
# PROP BASE Intermediate_Dir ".\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\Debug"
# PROP Intermediate_Dir ".\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\engine" /I "..\..\common" /I "..\..\dedicated" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DEDICATED" /D "LAUNCHERONLY" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:".\Debug/hlds.exe"
!ENDIF
# Begin Target
# Name "Dedicated - Win32 Release"
# Name "Dedicated - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
# Begin Source File
SOURCE=..\conproc.cpp
# End Source File
# Begin Source File
SOURCE=..\dedicated.rc
# End Source File
# Begin Source File
SOURCE=..\engine.cpp
# End Source File
# Begin Source File
SOURCE=..\sys_ded.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
# Begin Source File
SOURCE=..\conproc.h
# End Source File
# Begin Source File
SOURCE=..\..\common\crc.h
# End Source File
# Begin Source File
SOURCE=..\dedicated.h
# End Source File
# Begin Source File
SOURCE=..\resource.h
# End Source File
# Begin Source File
SOURCE=..\sys_ded.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=..\NetGame.ico
# End Source File
# End Group
# End Target
# End Project

View File

@ -0,0 +1,255 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Dedicated"
ProjectGUID="{5EB29B10-3E94-48BB-9CD3-CF9FBB5D832E}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\engine,..\..\common,..\..\dedicated"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;DEDICATED;LAUNCHERONLY"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/Dedicated.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib"
OutputFile=".\Release/hlds.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/hlds.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/Dedicated.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\engine,..\..\common,..\..\dedicated"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEDICATED;LAUNCHERONLY"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/Dedicated.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib"
OutputFile=".\Debug/hlds.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/hlds.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug/hlds.map"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/Dedicated.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90">
<File
RelativePath="..\conproc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\dedicated.rc">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\Documents and Settings\Scott\My Documents\HL Programming\hlsdk\dedicated"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\Documents and Settings\Scott\My Documents\HL Programming\hlsdk\dedicated"/>
</FileConfiguration>
</File>
<File
RelativePath="..\engine.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\sys_ded.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;fi;fd">
<File
RelativePath="..\conproc.h">
</File>
<File
RelativePath="..\..\common\crc.h">
</File>
<File
RelativePath="..\dedicated.h">
</File>
<File
RelativePath="..\resource.h">
</File>
<File
RelativePath="..\sys_ded.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe">
<File
RelativePath="..\NetGame.ico">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="Dedicated"
ProjectGUID="{5EB29B10-3E94-48BB-9CD3-CF9FBB5D832E}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/Dedicated.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\engine,..\..\common,..\..\dedicated"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;DEDICATED;LAUNCHERONLY"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/Dedicated.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib"
OutputFile=".\Release/hlds.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/hlds.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/Dedicated.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\engine,..\..\common,..\..\dedicated"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEDICATED;LAUNCHERONLY"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/Dedicated.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib winmm.lib ..\..\utils\procinfo\lib\win32_vc6\procinfo.lib"
OutputFile=".\Debug/hlds.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="LIBCMT"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/hlds.pdb"
GenerateMapFile="true"
MapFileName=".\Debug/hlds.map"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
>
<File
RelativePath="..\conproc.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\dedicated.rc"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\Documents and Settings\Scott\My Documents\HL Programming\hlsdk\dedicated"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="\Documents and Settings\Scott\My Documents\HL Programming\hlsdk\dedicated"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\engine.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\sys_ded.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;fi;fd"
>
<File
RelativePath="..\conproc.h"
>
</File>
<File
RelativePath="..\..\common\crc.h"
>
</File>
<File
RelativePath="..\dedicated.h"
>
</File>
<File
RelativePath="..\resource.h"
>
</File>
<File
RelativePath="..\sys_ded.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
>
<File
RelativePath="..\NetGame.ico"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,25 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Dedicated.rc
//
#define IDI_HALFLIFE 101
#define IDD_CDKEY 102
#define IDC_KEY 1000
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

1083
hlsdk/dedicated/sys_ded.cpp Normal file

File diff suppressed because it is too large Load Diff

31
hlsdk/dedicated/sys_ded.h Normal file
View File

@ -0,0 +1,31 @@
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#if !defined( SYS_DEDH )
#define SYS_DEDH
#ifdef _WIN32
#ifndef __MINGW32__
#pragma once
#endif /* not __MINGW32__ */
#endif
#if defined _MSC_VER && _MSC_VER >= 1400
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#pragma warning(disable: 4996) // deprecated functions
#endif
typedef void (*SleepType)(int);
long Sys_LoadLibrary( char *lib );
void Sys_FreeLibrary( long library );
void *Sys_GetProcAddress( long library, const char *name );
void Sys_Printf(char *fmt, ...);
void Sys_ErrorMessage( int level, const char *msg );
#endif // SYS_DEDH