initial
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// ----------------------------------------- //
|
||||
// File generated by VPC //
|
||||
// ----------------------------------------- //
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\dedicated_main\main.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\dedicated_main\main.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\dedicated_main\main.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\common\SteamAppStartup.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\common\SteamAppStartup.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\common\SteamAppStartup.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
13
dedicated_main/dedicated_main.exe.manifest
Normal file
13
dedicated_main/dedicated_main.exe.manifest
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<!-- Identify the application security requirements. -->
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel
|
||||
level="asInvoker"
|
||||
uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
73
dedicated_main/dedicated_main.rc
Normal file
73
dedicated_main/dedicated_main.rc
Normal file
@@ -0,0 +1,73 @@
|
||||
//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_LAUNCHER ICON DISCARDABLE "..\\launcher\\res\\launcher.ico"
|
||||
IDI_LAUNCHER2 ICON DISCARDABLE "..\\launcher\\res\\launcher.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
|
||||
|
||||
49
dedicated_main/dedicated_main.vpc
Normal file
49
dedicated_main/dedicated_main.vpc
Normal file
@@ -0,0 +1,49 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// DEDICATED_MAIN.VPC
|
||||
//
|
||||
// Project Script
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$Macro SRCDIR ".."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game"
|
||||
|
||||
$Macro OUTBINNAME "srcds" [$WIN32]
|
||||
$Macro OUTBINNAME "srcds_x64" [$WIN64]
|
||||
$Macro OUTBINNAME "srcds_linux" [$LINUX && !$CYGWIN]
|
||||
$Macro OUTBINNAME "srcds_osx" [$OSX32 || $OSX64]
|
||||
$Macro OUTBINNAME "srcds_cygwin" [$CYGWIN && $DEDICATED]
|
||||
$Include "$SRCDIR\vpc_scripts\source_exe_base.vpc"
|
||||
|
||||
$Configuration
|
||||
{
|
||||
$Linker
|
||||
{
|
||||
$AdditionalDependencies "$BASE Advapi32.lib" [$WINDOWS]
|
||||
}
|
||||
}
|
||||
|
||||
$Project "Dedicated_main"
|
||||
{
|
||||
$Folder "Source Files"
|
||||
{
|
||||
$File "main.cpp"
|
||||
$File "$SRCDIR\common\SteamAppStartup.cpp"
|
||||
$File "$SRCDIR\common\SteamAppStartup.h"
|
||||
-$File "$SRCDIR\public\tier0\memoverride.cpp"
|
||||
}
|
||||
|
||||
$Folder "Resources"
|
||||
{
|
||||
$File "$SRCDIR\launcher\res\launcher.ico"
|
||||
$File "dedicated_main.rc"
|
||||
}
|
||||
|
||||
$Folder "Link Libraries"
|
||||
{
|
||||
-$Implib "$LIBPUBLIC\tier0"
|
||||
-$Lib "$LIBPUBLIC\tier1"
|
||||
-$Lib "$LIBPUBLIC\interfaces"
|
||||
-$Implib "$LIBPUBLIC\vstdlib"
|
||||
$Lib "$SRCDIR/thirdparty/telemetry/lib/libtelemetryx86.link" [$LINUX]
|
||||
}
|
||||
}
|
||||
13
dedicated_main/dedicated_main.vpc.vpc_cache
Normal file
13
dedicated_main/dedicated_main.vpc.vpc_cache
Normal file
@@ -0,0 +1,13 @@
|
||||
"vpc_cache"
|
||||
{
|
||||
"CacheVersion" "1"
|
||||
"win32"
|
||||
{
|
||||
"CRCFile" "dedicated_main.vcxproj.vpc_crc"
|
||||
"OutputFiles"
|
||||
{
|
||||
"0" "dedicated_main.vcxproj"
|
||||
"1" "dedicated_main.vcxproj.filters"
|
||||
}
|
||||
}
|
||||
}
|
||||
174
dedicated_main/main.cpp
Normal file
174
dedicated_main/main.cpp
Normal file
@@ -0,0 +1,174 @@
|
||||
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This is just a little redirection tool so I can get all the dlls in bin
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <assert.h>
|
||||
#include <direct.h>
|
||||
#elif POSIX
|
||||
#include <stdlib.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#define MAX_PATH PATH_MAX
|
||||
#endif
|
||||
|
||||
#include "tier0/basetypes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef int (*DedicatedMain_t)( HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, int nCmdShow );
|
||||
#elif POSIX
|
||||
typedef int (*DedicatedMain_t)( int argc, char *argv[] );
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Return the directory where this .exe is running from
|
||||
// Output : char
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static char *GetBaseDir( const char *pszBuffer )
|
||||
{
|
||||
static char basedir[ MAX_PATH ];
|
||||
char szBuffer[ MAX_PATH ];
|
||||
size_t j;
|
||||
char *pBuffer = NULL;
|
||||
|
||||
strcpy( szBuffer, pszBuffer );
|
||||
|
||||
pBuffer = strrchr( szBuffer,'\\' );
|
||||
if ( pBuffer )
|
||||
{
|
||||
*(pBuffer+1) = '\0';
|
||||
}
|
||||
|
||||
strcpy( basedir, szBuffer );
|
||||
|
||||
j = strlen( basedir );
|
||||
if (j > 0)
|
||||
{
|
||||
if ( ( basedir[ j-1 ] == '\\' ) ||
|
||||
( basedir[ j-1 ] == '/' ) )
|
||||
{
|
||||
basedir[ j-1 ] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return basedir;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
|
||||
{
|
||||
// Must add 'bin' to the path....
|
||||
char* pPath = getenv("PATH");
|
||||
|
||||
// Use the .EXE name to determine the root directory
|
||||
char moduleName[ MAX_PATH ];
|
||||
char szBuffer[ 4096 ];
|
||||
if ( !GetModuleFileName( hInstance, moduleName, MAX_PATH ) )
|
||||
{
|
||||
MessageBox( 0, "Failed calling GetModuleFileName", "Launcher Error", MB_OK );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the root directory the .exe is in
|
||||
char* pRootDir = GetBaseDir( moduleName );
|
||||
|
||||
#ifdef _DEBUG
|
||||
int len =
|
||||
#endif
|
||||
_snprintf( szBuffer, sizeof( szBuffer ) - 1, "PATH=%s\\bin\\;%s", pRootDir, pPath );
|
||||
szBuffer[ sizeof(szBuffer) - 1 ] = 0;
|
||||
assert( len < 4096 );
|
||||
_putenv( szBuffer );
|
||||
|
||||
HINSTANCE launcher = LoadLibrary( "bin\\dedicated" DLL_EXT_STRING ); // STEAM OK ... filesystem not mounted yet
|
||||
if (!launcher)
|
||||
{
|
||||
char *pszError;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&pszError, 0, NULL);
|
||||
|
||||
char szBuf[1024];
|
||||
_snprintf(szBuf, sizeof( szBuf ) - 1, "Failed to load the launcher DLL:\n\n%s", pszError);
|
||||
szBuf[ sizeof(szBuf) - 1 ] = 0;
|
||||
MessageBox( 0, szBuf, "Launcher Error", MB_OK );
|
||||
|
||||
LocalFree(pszError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DedicatedMain_t main = (DedicatedMain_t)GetProcAddress( launcher, "DedicatedMain" );
|
||||
return main( hInstance, hPrevInstance, lpCmdLine, nCmdShow );
|
||||
}
|
||||
|
||||
#elif defined(POSIX)
|
||||
#define stringize(a) #a
|
||||
#define dedicated_binary(a,b,c) a stringize(b) c
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
// Must add 'bin' to the path....
|
||||
char* pPath = getenv("LD_LIBRARY_PATH");
|
||||
char szBuffer[4096];
|
||||
char cwd[ MAX_PATH ];
|
||||
if ( !getcwd( cwd, sizeof(cwd)) )
|
||||
{
|
||||
printf( "getcwd failed (%s)", strerror(errno));
|
||||
}
|
||||
|
||||
snprintf( szBuffer, sizeof( szBuffer ) - 1, "LD_LIBRARY_PATH=%s/bin:%s", cwd, pPath );
|
||||
printf( "%s\n", szBuffer );
|
||||
int ret = putenv( szBuffer );
|
||||
if ( ret )
|
||||
{
|
||||
printf( "%s\n", strerror(errno) );
|
||||
}
|
||||
|
||||
void *tier0 = dlopen( "libtier0" DLL_EXT_STRING, RTLD_NOW );
|
||||
if ( !tier0 )
|
||||
{
|
||||
printf( "Failed to open %s (%s)\n", "libtier0" DLL_EXT_STRING, dlerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
void *vstdlib = dlopen( "libvstdlib" DLL_EXT_STRING, RTLD_NOW );
|
||||
if ( !vstdlib )
|
||||
{
|
||||
printf( "Failed to open %s (%s)\n", "libvstdlib" DLL_EXT_STRING, dlerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *pBinaryName = "dedicated" DLL_EXT_STRING;
|
||||
|
||||
void *dedicated = dlopen( pBinaryName, RTLD_NOW );
|
||||
if ( !dedicated )
|
||||
{
|
||||
printf( "Failed to open %s (%s)\n", pBinaryName, dlerror());
|
||||
return -1;
|
||||
}
|
||||
DedicatedMain_t main = (DedicatedMain_t)dlsym( dedicated, "DedicatedMain" );
|
||||
if ( !main )
|
||||
{
|
||||
printf( "Failed to find dedicated server entry point (%s)\n", dlerror() );
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = main( argc,argv );
|
||||
dlclose( dedicated );
|
||||
dlclose( vstdlib );
|
||||
dlclose( tier0 );
|
||||
}
|
||||
#endif
|
||||
23
dedicated_main/resource.h
Normal file
23
dedicated_main/resource.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by launcher_main.rc
|
||||
//
|
||||
#define IDI_LAUNCHER 128
|
||||
#define IDI_LAUNCHER2 101
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user