mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-02 02:15:58 -04:00
possibly controversial commit: remove all windows sources, keeping only the windows cmake so that we can generate an sln to edit the code
This commit is contained in:
-42
@@ -1,42 +0,0 @@
|
||||
#ifndef BASE_WIN32_ARCHIVE_H
|
||||
#define BASE_WIN32_ARCHIVE_H
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
{
|
||||
|
||||
#endif
|
||||
namespace Base
|
||||
{
|
||||
|
||||
|
||||
#ifdef PACK_BIG_ENDIAN
|
||||
|
||||
inline double byteSwap(double value) { byteReverse64(&value); return value; }
|
||||
inline float byteSwap(float value) { byteReverse32(&value); return value; }
|
||||
inline uint64 byteSwap(uint64 value) { byteReverse64(&value); return value; }
|
||||
inline int64 byteSwap(int64 value) { byteReverse64(&value); return value; }
|
||||
inline uint32 byteSwap(uint32 value) { byteReverse32(&value); return value; }
|
||||
inline int32 byteSwap(int32 value) { byteReverse32(&value); return value; }
|
||||
inline uint16 byteSwap(uint16 value) { byteReverse16(&value); return value; }
|
||||
inline int16 byteSwap(int16 value) { byteReverse16(&value); return value; }
|
||||
|
||||
#else
|
||||
|
||||
inline double byteSwap(double value) { return value; }
|
||||
inline float byteSwap(float value) { return value; }
|
||||
inline uint64 byteSwap(uint64 value) { return value; }
|
||||
inline int64 byteSwap(int64 value) { return value; }
|
||||
inline uint32 byteSwap(uint32 value) { return value; }
|
||||
inline int32 byteSwap(int32 value) { return value; }
|
||||
inline uint16 byteSwap(uint16 value) { return value; }
|
||||
inline int16 byteSwap(int16 value) { return value; }
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
////////////////////////////////////////
|
||||
// Platform.cpp
|
||||
//
|
||||
// Purpose:
|
||||
// 1. Implementation of the global functionality declaired in Platform.h.
|
||||
//
|
||||
// Revisions:
|
||||
// 07/10/2001 Created
|
||||
//
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
{
|
||||
|
||||
#endif
|
||||
namespace Base
|
||||
{
|
||||
|
||||
|
||||
CTimer::CTimer() :
|
||||
mTimer(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
};
|
||||
#endif
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
////////////////////////////////////////
|
||||
// Platform.h
|
||||
//
|
||||
// Purpose:
|
||||
// 1. Include relevent system headers that are platform specific.
|
||||
// 2. Declair global platform specific functionality.
|
||||
// 3. Include primative type definitions
|
||||
//
|
||||
// Global Functions:
|
||||
// getTimer() : Return the current high resolution clock count.
|
||||
// getTimerFrequency() : Return the frequency of the high resolution clock.
|
||||
// sleep() : Voluntarily relinquish timeslice of the calling thread for a
|
||||
// specified number of milliseconds.
|
||||
//
|
||||
// Revisions:
|
||||
// 07/10/2001 Created
|
||||
//
|
||||
|
||||
#ifndef BASE_WIN32_PLATFORM_H
|
||||
#define BASE_WIN32_PLATFORM_H
|
||||
|
||||
#include <memory.h>
|
||||
#include <winsock2.h>
|
||||
#include <time.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include <direct.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "Types.h"
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
{
|
||||
|
||||
#endif
|
||||
namespace Base
|
||||
{
|
||||
|
||||
uint64 getTimer(void);
|
||||
uint64 getTimerFrequency(void);
|
||||
|
||||
inline uint64 getTimer(void)
|
||||
{
|
||||
uint64 result;
|
||||
if (!QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER *>(&result)))
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
inline uint64 getTimerFrequency(void)
|
||||
{
|
||||
uint64 result;
|
||||
if (!QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER *>(&result)))
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void sleep(uint32 ms)
|
||||
{
|
||||
Sleep(ms);
|
||||
}
|
||||
|
||||
|
||||
class CTimer
|
||||
{
|
||||
public:
|
||||
CTimer();
|
||||
|
||||
void Set(uint32 seconds);
|
||||
void Signal();
|
||||
bool Expired();
|
||||
|
||||
private:
|
||||
uint32 mTimer;
|
||||
};
|
||||
|
||||
inline void CTimer::Set(uint32 interval)
|
||||
{
|
||||
mTimer = (uint32)time(0) + interval;
|
||||
}
|
||||
|
||||
inline void CTimer::Signal()
|
||||
{
|
||||
mTimer = 0;
|
||||
}
|
||||
|
||||
inline bool CTimer::Expired()
|
||||
{
|
||||
return (mTimer <= (uint32)time(0));
|
||||
}
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#endif BASE_WIN32_PLATFORM_H
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
////////////////////////////////////////
|
||||
// Types.h
|
||||
//
|
||||
// Purpose:
|
||||
// 1. Define integer types that are unambiguous with respect to size
|
||||
//
|
||||
// Revisions:
|
||||
// 07/10/2001 Created
|
||||
//
|
||||
|
||||
#ifndef BASE_WIN32_TYPES_H
|
||||
#define BASE_WIN32_TYPES_H
|
||||
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
namespace NAMESPACE
|
||||
{
|
||||
|
||||
#endif
|
||||
namespace Base
|
||||
{
|
||||
|
||||
#define INT32_MAX 0x7FFFFFFF
|
||||
#define INT32_MIN 0x80000000
|
||||
#define UINT32_MAX 0xFFFFFFFF
|
||||
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
|
||||
typedef int int32;
|
||||
typedef unsigned uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
};
|
||||
#ifdef EXTERNAL_DISTRO
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // BASE_WIN32_TYPES_H
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// CentralServerPrecompiledHeader.cpp
|
||||
// copyright 2001 Verant Interactive
|
||||
// Author: Justin Randall
|
||||
|
||||
#include "FirstCentralServer.h"
|
||||
@@ -1,84 +0,0 @@
|
||||
#include "FirstCentralServer.h"
|
||||
#include "ConfigCentralServer.h"
|
||||
#include "CentralServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
#include <string>
|
||||
#include <time.h>
|
||||
|
||||
//_____________________________________________________________________
|
||||
/*
|
||||
int WINAPI WinMain(
|
||||
HINSTANCE hInstance, // handle to current instance
|
||||
HINSTANCE hPrevInstance, // handle to previous instance
|
||||
LPSTR lpCmdLine, // pointer to command line
|
||||
int nCmdShow // show state of window
|
||||
)
|
||||
*/
|
||||
int main(int argc, char ** argv)
|
||||
{ //lint !e1065 //WinMain conflicts with clib
|
||||
int i = 0;
|
||||
|
||||
// UNREF(hPrevInstance);
|
||||
// UNREF(nCmdShow);
|
||||
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
// command line hack
|
||||
std::string cmdLine;
|
||||
for(i = 1; i < argc; ++i)
|
||||
{
|
||||
cmdLine += argv[i];
|
||||
if(i + 1 < argc)
|
||||
{
|
||||
cmdLine += " ";
|
||||
}
|
||||
}
|
||||
// setupFoundationData.hInstance = hInstance;
|
||||
setupFoundationData.commandLine = cmdLine.c_str();
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
|
||||
SetupSharedFile::install(false);
|
||||
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
ConfigCentralServer::install();
|
||||
|
||||
cmdLine.clear();
|
||||
// now, the real command line
|
||||
for(i = 0; i < argc; ++i)
|
||||
{
|
||||
cmdLine += argv[i];
|
||||
if(i + 1 < argc)
|
||||
{
|
||||
cmdLine += " ";
|
||||
}
|
||||
}
|
||||
|
||||
CentralServer::getInstance().setCommandLine(cmdLine);
|
||||
|
||||
//-- run game
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(CentralServer::run);
|
||||
|
||||
SetupSharedFoundation::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________
|
||||
@@ -1,42 +0,0 @@
|
||||
#include "FirstChatServer.h"
|
||||
#include "ConfigChatServer.h"
|
||||
#include "ChatServer.h"
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
#include <string>
|
||||
#include <time.h>
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
//setupFoundationData.hInstance = hInstance;
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
//-- setup game server
|
||||
ConfigChatServer::install ();
|
||||
|
||||
//-- run game
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(ChatServer::run);
|
||||
|
||||
SetupSharedFoundation::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
#include "FirstCommodityServer.h"
|
||||
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/TreeFile.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/ConfigFile.h"
|
||||
#include "sharedFoundation/ExitChain.h"
|
||||
#include "sharedFoundation/Os.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedGame/CommoditiesAdvancedSearchAttribute.h"
|
||||
#include "sharedGame/ConfigSharedGame.h"
|
||||
#include "sharedNetwork/SetupSharedNetwork.h"
|
||||
#include "sharedNetwork/NetworkHandler.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
#include "sharedUtility/DataTableManager.h"
|
||||
#include "CommodityServer.h"
|
||||
#include "ConfigCommodityServer.h"
|
||||
#include "LocalizationManager.h"
|
||||
#include "UnicodeUtils.h"
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
ConfigSharedGame::install();
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
SetupSharedNetwork::SetupData networkSetupData;
|
||||
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
|
||||
SetupSharedNetwork::install(networkSetupData);
|
||||
NetworkHandler::install();
|
||||
|
||||
ConfigCommodityServer::install();
|
||||
|
||||
const bool displayBadStringIds = ConfigSharedGame::getDisplayBadStringIds ();
|
||||
const bool debugStringIds = ConfigSharedGame::getDebugStringIds ();
|
||||
Unicode::NarrowString defaultLocale(ConfigSharedGame::getDefaultLocale ());
|
||||
Unicode::UnicodeNarrowStringVector localeVector;
|
||||
localeVector.push_back(defaultLocale);
|
||||
|
||||
LocalizationManager::install (new TreeFile::TreeFileFactory, localeVector, debugStringIds, NULL, displayBadStringIds);
|
||||
ExitChain::add(LocalizationManager::remove, "LocalizationManager::remove");
|
||||
|
||||
DataTableManager::install();
|
||||
CommoditiesAdvancedSearchAttribute::install();
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(CommodityServer::run);
|
||||
|
||||
SetupSharedFoundation::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -1 +0,0 @@
|
||||
#include "FirstConnectionServer.h"
|
||||
@@ -1,58 +0,0 @@
|
||||
#include "FirstConnectionServer.h"
|
||||
#include "ConfigConnectionServer.h"
|
||||
#include "ConnectionServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/PerThreadData.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
// command line hack
|
||||
std::string cmdLine;
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
cmdLine += argv[i];
|
||||
if(i + 1 < argc)
|
||||
{
|
||||
cmdLine += " ";
|
||||
}
|
||||
}
|
||||
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
// setupFoundationData.hInstance = hInstance;
|
||||
setupFoundationData.commandLine = cmdLine.c_str();
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedCompression::install();
|
||||
|
||||
SetupSharedNetworkMessages::install();
|
||||
SetupSharedRandom::install(int(time(NULL)));
|
||||
|
||||
//-- setup game server
|
||||
ConfigConnectionServer::install ();
|
||||
|
||||
ConnectionServer::install();
|
||||
//-- run game
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(ConnectionServer::run);
|
||||
ConnectionServer::remove();
|
||||
ConfigConnectionServer::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
PerThreadData::threadRemove();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// LoggingServerApiWrapper.cpp
|
||||
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
|
||||
// Author: Justin Randall
|
||||
|
||||
// This is a wrapper cpp to workaround PCH and RSP's. While a DSP
|
||||
// may exclude a single file from using precompiled headers, the
|
||||
// dsp builder has no way (I know of) to honor this behavior.
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "FirstLogServer.h"
|
||||
//#include "LoggingServerApi.cpp"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// ======================================================================
|
||||
//
|
||||
// WinMain.cpp
|
||||
//
|
||||
// Copyright 2002 Sony Online Entertainment
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#include "FirstLogServer.h"
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "LogServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
// ======================================================================
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install(setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
//-- setup server
|
||||
LogServer::install();
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(LogServer::run);
|
||||
|
||||
LogServer::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
SetupSharedThread::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -1 +0,0 @@
|
||||
#include "FirstLoginServer.h"
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "FirstLoginServer.h"
|
||||
#include "ConfigLoginServer.h"
|
||||
#include "LoginServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
SetupSharedCompression::install();
|
||||
|
||||
SetupSharedFile::install(false);
|
||||
|
||||
SetupSharedRandom::install(time(NULL));
|
||||
|
||||
//-- setup game server
|
||||
ConfigLoginServer::install ();
|
||||
|
||||
//-- run game
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(LoginServer::run);
|
||||
|
||||
SetupSharedFoundation::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
|
||||
#include "ConfigMetricsServer.h"
|
||||
#include "MetricsServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/Os.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetwork/NetworkHandler.h"
|
||||
#include "sharedNetwork/SetupSharedNetwork.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
// command line hack
|
||||
std::string cmdLine;
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
cmdLine += argv[i];
|
||||
if(i + 1 < argc)
|
||||
{
|
||||
cmdLine += " ";
|
||||
}
|
||||
}
|
||||
|
||||
setupFoundationData.commandLine = cmdLine.c_str();
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
{
|
||||
//SetupSharedObject::Data data;
|
||||
//SetupSharedObject::setupDefaultGameData(data);
|
||||
//SetupSharedObject::install(data);
|
||||
}
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(true, 32);
|
||||
|
||||
SetupSharedNetwork::SetupData networkSetupData;
|
||||
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
|
||||
SetupSharedNetwork::install(networkSetupData);
|
||||
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
|
||||
|
||||
//Os::setProgramName("MetricsServer");
|
||||
//setup the server
|
||||
ConfigMetricsServer::install();
|
||||
|
||||
//set command line
|
||||
cmdLine = setupFoundationData.commandLine;
|
||||
size_t firstArg = cmdLine.find(" ", 0);
|
||||
size_t lastSlash = 0;
|
||||
size_t nextSlash = 0;
|
||||
while(nextSlash < firstArg)
|
||||
{
|
||||
nextSlash = cmdLine.find("/", lastSlash);
|
||||
if(nextSlash == cmdLine.npos || nextSlash >= firstArg) //lint !e1705 static class members may be accessed by the scoping operator (huh?)
|
||||
break;
|
||||
lastSlash = nextSlash + 1;
|
||||
}
|
||||
cmdLine = cmdLine.substr(lastSlash);
|
||||
MetricsServer::setCommandLine(cmdLine);
|
||||
|
||||
|
||||
//-- run game
|
||||
NetworkHandler::install();
|
||||
MetricsServer::install();
|
||||
MetricsServer::run();
|
||||
MetricsServer::remove();
|
||||
NetworkHandler::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// ======================================================================
|
||||
//
|
||||
// FirstPlanetServer.cpp
|
||||
// copyright (c) 2001 Sony Online Entertainment
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#include "FirstPlanetServer.h"
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "FirstPlanetServer.h"
|
||||
#include "ConfigPlanetServer.h"
|
||||
#include "PlanetServer.h"
|
||||
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/Os.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedLog/SetupSharedLog.h"
|
||||
#include "sharedNetwork/SetupSharedNetwork.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
#include "sharedUtility/SetupSharedUtility.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
//_____________________________________________________________________
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(false);
|
||||
|
||||
SetupSharedNetwork::SetupData networkSetupData;
|
||||
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
|
||||
SetupSharedNetwork::install(networkSetupData);
|
||||
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
SetupSharedRandom::install(int(time(NULL)));
|
||||
|
||||
SetupSharedUtility::Data sharedUtilityData;
|
||||
SetupSharedUtility::setupGameData (sharedUtilityData);
|
||||
SetupSharedUtility::install (sharedUtilityData);
|
||||
|
||||
//-- setup server
|
||||
ConfigPlanetServer::install ();
|
||||
|
||||
char tmp[92];
|
||||
sprintf(tmp, "PlanetServer:%d", Os::getProcessId());
|
||||
SetupSharedLog::install(tmp);
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(PlanetServer::run);
|
||||
|
||||
SetupSharedLog::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
SetupSharedThread::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________
|
||||
@@ -1,59 +0,0 @@
|
||||
// main.cpp
|
||||
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
|
||||
// Author: Justin Randall
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "FirstServerConsole.h"
|
||||
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/ConfigFile.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetwork/SetupSharedNetwork.h"
|
||||
#include "sharedNetwork/NetworkHandler.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
#include "ServerConsole.h"
|
||||
#include "ConfigServerConsole.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
setupFoundationData.createWindow = false;
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
SetupSharedNetwork::SetupData networkSetupData;
|
||||
SetupSharedNetwork::getDefaultClientSetupData(networkSetupData);
|
||||
SetupSharedNetwork::install(networkSetupData);
|
||||
NetworkHandler::install();
|
||||
|
||||
ConfigServerConsole::install();
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(ServerConsole::run);
|
||||
|
||||
NetworkHandler::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
SetupSharedThread::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// ConsoleInput.cpp
|
||||
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
|
||||
// Author: Justin Randall
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "FirstTaskManager.h"
|
||||
#include "Console.h"
|
||||
#include <conio.h>
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
const char Console::getNextChar()
|
||||
{
|
||||
char result = 0;
|
||||
if(_kbhit())
|
||||
result = static_cast<char>(_getche());
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#include "FirstTaskManager.h"
|
||||
|
||||
namespace EnvironmentVariable
|
||||
{
|
||||
bool addToEnvironmentVariable(const char* key, const char* value)
|
||||
{
|
||||
bool retval = false;
|
||||
char oldValue[256];
|
||||
DWORD tmp = GetEnvironmentVariable(key, oldValue, sizeof(oldValue));
|
||||
if (tmp != 0)
|
||||
{
|
||||
std::string s(oldValue);
|
||||
s += ";";
|
||||
s += value;
|
||||
|
||||
//Bad things happen if the first character happens to be ; (ie from an empty environment string)
|
||||
const char* newValue = s.c_str();
|
||||
if (newValue[0] == ';')
|
||||
++newValue;
|
||||
|
||||
retval = (SetEnvironmentVariable(key, newValue) != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = (SetEnvironmentVariable(key, value) != 0);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
bool setEnvironmentVariable(const char* key, const char* value)
|
||||
{
|
||||
return (SetEnvironmentVariable(key, value) != 0);
|
||||
}
|
||||
};
|
||||
@@ -1,153 +0,0 @@
|
||||
#include "FirstTaskManager.h"
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "ProcessSpawner.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "TaskManager.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
uint32 ProcessSpawner::prefix;
|
||||
std::map<uint32, HANDLE> procById;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
bool tokenize (const std::string & str, std::vector<std::string> & result)
|
||||
{
|
||||
size_t end_pos = 0;
|
||||
size_t start_pos = 0;
|
||||
|
||||
result.clear ();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (end_pos >= str.size ())
|
||||
break;
|
||||
|
||||
start_pos = str.find_first_not_of (' ', end_pos);
|
||||
|
||||
if (start_pos == str.npos)
|
||||
break;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
if (str [start_pos] == '\"')
|
||||
{
|
||||
if (++start_pos >= str.size ())
|
||||
break;
|
||||
end_pos = str.find_first_of ('\"', start_pos);
|
||||
}
|
||||
else
|
||||
end_pos = str.find_first_of (' ', start_pos);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
if (start_pos == end_pos)
|
||||
break;
|
||||
|
||||
if (end_pos == str.npos)
|
||||
{
|
||||
result.push_back (str.substr (start_pos));
|
||||
break;
|
||||
}
|
||||
else
|
||||
result.push_back (str.substr (start_pos, end_pos - start_pos));
|
||||
|
||||
++start_pos;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 ProcessSpawner::execute(const std::string & processName, const std::vector<std::string> & parameters)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
char cmd[1024] = {"\0"};
|
||||
std::string cmdLine;
|
||||
|
||||
cmdLine = processName.c_str();
|
||||
cmdLine += " ";
|
||||
std::vector<std::string>::const_iterator i;
|
||||
for(i = parameters.begin(); i != parameters.end(); ++i)
|
||||
{
|
||||
cmdLine += (*i).c_str();
|
||||
cmdLine += " ";
|
||||
}
|
||||
|
||||
_snprintf(cmd, 1024, "%s.exe", processName.c_str());
|
||||
// _snprintf(cmd, 1024, "%s", processName.c_str());
|
||||
memset(&si, 0, sizeof(si));
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
|
||||
si.cb = sizeof(si);
|
||||
|
||||
const int result = CreateProcess(cmd, const_cast<char *>(cmdLine.c_str()), NULL, NULL, false, 0, 0, 0, &si, &pi);
|
||||
UNREF (result);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (!result)
|
||||
{
|
||||
DWORD iErr = GetLastError();
|
||||
char * errStr = strerror(iErr);
|
||||
DEBUG_REPORT_LOG(true, ("ProcessSpawner: %s - %s\n", cmd, errStr));
|
||||
}
|
||||
#endif
|
||||
|
||||
procById.insert(std::pair<uint32, HANDLE>(pi.dwProcessId, pi.hProcess));
|
||||
return pi.dwProcessId;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
uint32 ProcessSpawner::execute(const std::string & cmd)
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
size_t firstArg = cmd.find_first_of(" ");
|
||||
std::string processName;
|
||||
if(firstArg < cmd.size())
|
||||
{
|
||||
std::string a = cmd.substr(firstArg + 1);
|
||||
tokenize(a, args);
|
||||
processName = cmd.substr(0, firstArg);
|
||||
}
|
||||
else
|
||||
{
|
||||
processName = cmd;
|
||||
}
|
||||
return execute(processName, args);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
bool ProcessSpawner::isProcessActive(uint32 pid)
|
||||
{
|
||||
bool result = false;
|
||||
std::map<uint32, HANDLE>::const_iterator f = procById.find(pid);
|
||||
if(f != procById.end())
|
||||
{
|
||||
DWORD exitCode;
|
||||
GetExitCodeProcess((*f).second, &exitCode);
|
||||
result = (exitCode == STILL_ACTIVE);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ProcessSpawner::kill(uint32 pid)
|
||||
{
|
||||
HANDLE p = OpenProcess(PROCESS_TERMINATE, false, (DWORD)pid);
|
||||
if(p)
|
||||
TerminateProcess(p, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void ProcessSpawner::forceCore(const unsigned long pid)
|
||||
{
|
||||
ProcessSpawner::kill(pid);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
// TaskManagerSysInfo.cpp
|
||||
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
|
||||
// Author: Justin Randall
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "FirstTaskManager.h"
|
||||
#include "TaskManagerSysInfo.h"
|
||||
#pragma warning ( disable : 4201)
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskManagerSysInfo::TaskManagerSysInfo() :
|
||||
averageScore()
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskManagerSysInfo::TaskManagerSysInfo(const TaskManagerSysInfo &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskManagerSysInfo::~TaskManagerSysInfo()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskManagerSysInfo & TaskManagerSysInfo::operator = (const TaskManagerSysInfo & rhs)
|
||||
{
|
||||
if(this != &rhs)
|
||||
{
|
||||
// make assignments if right hand side is not this instance
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
const float TaskManagerSysInfo::getScore() const
|
||||
{
|
||||
std::list<float>::const_iterator i;
|
||||
float avg = 0.0f;
|
||||
for(i = averageScore.begin(); i != averageScore.end(); ++i)
|
||||
{
|
||||
avg += (*i);
|
||||
}
|
||||
avg = avg / averageScore.size();
|
||||
return avg;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void TaskManagerSysInfo::update()
|
||||
{
|
||||
static int64 activeTime[2] = {0};
|
||||
static int64 currentTime[2] = {0};
|
||||
|
||||
float currentScore = 0.0f;
|
||||
activeTime[0] = activeTime[1];
|
||||
currentTime[0] = currentTime[1];
|
||||
activeTime[1] = 0;
|
||||
|
||||
HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
|
||||
double procAvg = 0.0f;
|
||||
|
||||
MEMORYSTATUS memStat;
|
||||
GlobalMemoryStatus(&memStat);
|
||||
|
||||
currentScore = static_cast<float>(static_cast<float>(memStat.dwMemoryLoad) * 0.005f);
|
||||
if(hProcessSnap != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
PROCESSENTRY32 pe32 = {0};
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
if (Process32First(hProcessSnap, &pe32))
|
||||
{
|
||||
do
|
||||
{
|
||||
HANDLE proc = OpenProcess(PROCESS_QUERY_INFORMATION, false, pe32.th32ProcessID);
|
||||
// some stuf with the enumerated processes
|
||||
FILETIME createTime = {0};
|
||||
FILETIME exitTime = {0};
|
||||
FILETIME kernelTime = {0};
|
||||
FILETIME userTime = {0};
|
||||
GetProcessTimes(proc, &createTime, &exitTime, &kernelTime, &userTime);
|
||||
int64 totals;
|
||||
|
||||
// SDK docs say:
|
||||
// It is not recommended that you add and subtract values
|
||||
// from the FILETIME structure to obtain relative times. Instead, you should
|
||||
// Copy the resulting FILETIME structure to a ULARGE_INTEGER structure.
|
||||
// Use normal 64-bit arithmetic on the ULARGE_INTEGER value.
|
||||
int64 c;
|
||||
int64 e;
|
||||
int64 k;
|
||||
int64 u;
|
||||
memcpy(&c, &createTime, sizeof(int64));
|
||||
memcpy(&e, &exitTime, sizeof(int64));
|
||||
memcpy(&k, &kernelTime, sizeof(int64));
|
||||
memcpy(&u, &userTime, sizeof(int64));
|
||||
|
||||
totals = k + u;
|
||||
|
||||
FILETIME fst;
|
||||
SYSTEMTIME st;
|
||||
GetSystemTime(&st);
|
||||
SystemTimeToFileTime(&st, &fst);
|
||||
|
||||
int64 runTime;
|
||||
memcpy(&runTime, &fst, sizeof(int64));
|
||||
runTime = runTime - c;
|
||||
|
||||
if(c || e || k || u)
|
||||
{
|
||||
activeTime[1] += k + e;
|
||||
}
|
||||
|
||||
}
|
||||
while (Process32Next(hProcessSnap, &pe32));
|
||||
}
|
||||
}
|
||||
|
||||
FILETIME fst;
|
||||
SYSTEMTIME st;
|
||||
GetSystemTime(&st);
|
||||
SystemTimeToFileTime(&st, &fst);
|
||||
memcpy(¤tTime[1], &fst, sizeof(int64));
|
||||
int64 timeSlice = currentTime[1] - currentTime[0];
|
||||
int64 activeSlice = activeTime[1] - activeTime[0];
|
||||
procAvg = static_cast<double>(static_cast<double>(activeSlice) / timeSlice);
|
||||
//REPORT_LOG(true, ("%f\n", procAvg));
|
||||
currentScore = currentScore + static_cast<float>(procAvg * 0.5);
|
||||
|
||||
averageScore.insert(averageScore.end(), currentScore);
|
||||
|
||||
if(averageScore.size() > 100)
|
||||
averageScore.erase(averageScore.begin());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#include "FirstTaskManager.h"
|
||||
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/ConfigFile.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedRandom/SetupSharedRandom.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
#include "TaskManager.h"
|
||||
#include "ConfigTaskManager.h"
|
||||
|
||||
//=====================================================================
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = false;
|
||||
setupFoundationData.clockUsesSleep = true;
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedNetworkMessages::install();
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
|
||||
|
||||
ConfigTaskManager::install();
|
||||
|
||||
TaskManager::install();
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(TaskManager::run);
|
||||
|
||||
TaskManager::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
SetupSharedThread::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=====================================================================
|
||||
@@ -1,60 +0,0 @@
|
||||
// main.cpp
|
||||
// Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved.
|
||||
// Author: Justin Randall
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "FirstTransferServer.h"
|
||||
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "sharedCompression/SetupSharedCompression.h"
|
||||
#include "sharedDebug/SetupSharedDebug.h"
|
||||
#include "sharedFile/SetupSharedFile.h"
|
||||
#include "sharedFoundation/Os.h"
|
||||
#include "sharedFoundation/SetupSharedFoundation.h"
|
||||
#include "sharedNetwork/SetupSharedNetwork.h"
|
||||
#include "sharedNetwork/NetworkHandler.h"
|
||||
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
|
||||
#include "sharedThread/SetupSharedThread.h"
|
||||
#include "TransferServer.h"
|
||||
#include "ConfigTransferServer.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
SetupSharedThread::install();
|
||||
SetupSharedDebug::install(1024);
|
||||
|
||||
//-- setup foundation
|
||||
SetupSharedFoundation::Data setupFoundationData(SetupSharedFoundation::Data::D_game);
|
||||
|
||||
setupFoundationData.argc = argc;
|
||||
setupFoundationData.argv = argv;
|
||||
setupFoundationData.createWindow = true;
|
||||
SetupSharedFoundation::install (setupFoundationData);
|
||||
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedNetworkMessages::install();
|
||||
|
||||
SetupSharedNetwork::SetupData networkSetupData;
|
||||
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
|
||||
SetupSharedNetwork::install(networkSetupData);
|
||||
NetworkHandler::install();
|
||||
|
||||
//Os::setProgramName("TransferServer");
|
||||
ConfigTransferServer::install();
|
||||
|
||||
//-- run server
|
||||
SetupSharedFoundation::callbackWithExceptionHandling(TransferServer::run);
|
||||
|
||||
NetworkHandler::remove();
|
||||
SetupSharedFoundation::remove();
|
||||
SetupSharedThread::remove();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user