Fixed issues with "Developer - release" configuration; implementation of AvHTunnelToServer.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@26 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
XP-Cagey 2005-04-03 22:38:16 +00:00
parent f812ccf0c2
commit 43a20ad0c5
14 changed files with 145 additions and 35 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -26,7 +26,7 @@
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="0"
AdditionalIncludeDirectories=""$(SolutionDir)";U:\inlcude\stlport;U:\include\vgui;U:\include\libpng;U:\include\fmod;U:\include\lua;U:\include\particle;U:\include\zlib"
AdditionalIncludeDirectories=""$(SolutionDir)";U:\inlcude\stlport;U:\include\vgui;U:\include\nexus;U:\include\libpng;U:\include\fmod;U:\include\lua;U:\include\particle;U:\include\zlib"
PreprocessorDefinitions="_DEBUG;_MBCS;DEBUG;WIN32;_WINDOWS;AVH_CLIENT;$(NoInherit)"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@ -65,8 +65,8 @@
OptimizeReferences="1"
EnableCOMDATFolding="1"
OptimizeForWindows98="1"
BaseAddress="0x01900000"
ImportLibrary="$(IntDir)/cl_dll.lib"
BaseAddress=""
ImportLibrary="$(IntDir)cl_dll.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -99,28 +99,29 @@
</Configuration>
<Configuration
Name="Developer - release|Win32"
OutputDirectory="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)"
OutputDirectory="V:\temp\$(ProjectName)\$(ConfigurationName)"
IntermediateDirectory="V:\temp\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
DeleteExtensionsOnClean="$(TargetPath);*.obj;*.ilk;*.pdb;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.bat">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
OptimizeForProcessor="0"
AdditionalIncludeDirectories="$(SolutionDir);$(SolutionDir)engine;$(SolutionDir)common;$(SolutionDir)pm_shared;$(SolutionDir)dlls;$(SolutionDir)game_shared;$(SolutionDir)fmod\inc;$(SolutionDir)utils\vgui\include"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;U:\inlcude\stlport;U:\include\vgui;U:\include\nexus;U:\include\libpng;U:\include\fmod;U:\include\lua;U:\include\particle;U:\include\zlib"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;$(NOINHERIT)"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=""
AssemblerListingLocation="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
ObjectFile="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
ProgramDataBaseFileName="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
@ -130,18 +131,15 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib particles.lib textrep.lib util.lib $(SolutionDir)\utils\vgui\lib\win32_vc6\vgui.lib"
AdditionalDependencies="winmm.lib ws2_32.lib particles.lib vgui.lib liblua.lib liblualib.lib libpng.lib zlib.lib"
OutputFile="$(SolutionDir)..\cl_dlls\client.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(SolutionDir)lib\$(ConfigurationName)"
AdditionalLibraryDirectories="U:\release"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="FALSE"
ProgramDatabaseFile=""
GenerateMapFile="FALSE"
MapFileName=""
SubSystem="2"
ImportLibrary="$(SolutionDir)\temp\$(ProjectName)\$(ConfigurationName)/cl_dll.lib"
ImportLibrary="$(IntDir)cl_dll.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"

View file

@ -15,26 +15,29 @@
<Configurations>
<Configuration
Name="Developer - release|Win32"
OutputDirectory="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
IntermediateDirectory="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
OutputDirectory="V:\temp\$(ProjectName)\$(ConfigurationName)/"
IntermediateDirectory="V:\temp\$(ProjectName)\$(ConfigurationName)/"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories="$(SolutionDir);$(SolutionDir)\dlls;$(SolutionDir)\engine;$(SolutionDir)\common;$(SolutionDir)\pm_shared;$(SolutionDir)\game_shared;$(SolutionDir)\lua\include"
EnableIntrinsicFunctions="TRUE"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;U:\include\stlport;U:\include\nexus;U:\include\lua;U:\include\particle"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;QUIVER;VOXEL;QUAKE2;VALVE_DLL;AVH_SERVER;$(NOINHERIT)"
StringPooling="TRUE"
MinimalRebuild="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Releasehl/hl.pch"
AssemblerListingLocation="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
ObjectFile="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
ProgramDataBaseFileName="$(SolutionDir)temp\$(ProjectName)\$(ConfigurationName)/"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
@ -43,17 +46,16 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib ws2_32.lib curl.lib particles.lib textrep.lib util.lib"
AdditionalDependencies="winmm.lib ws2_32.lib particles.lib liblua.lib liblualib.lib nexus_server.lib ssleay32.lib libeay32.lib"
OutputFile="$(SolutionDir)\..\dlls\ns.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(SolutionDir)\lib\$(ConfigurationName)"
IgnoreDefaultLibraryNames=""
AdditionalLibraryDirectories="U:\release"
IgnoreDefaultLibraryNames="gdi32.lib user32.lib"
ModuleDefinitionFile=".\hl.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=""
SubSystem="2"
ImportLibrary="$(SolutionDir)\temp\$(ProjectName)\$(ConfigurationName)/ns.lib"
ImportLibrary="$(OutDir)ns.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -127,7 +129,9 @@
MapFileName="$(OutDir)/ns.map"
MapExports="TRUE"
SubSystem="2"
ImportLibrary="$(OutDir)\ns.lib"
OptimizeReferences="1"
EnableCOMDATFolding="1"
ImportLibrary="$(OutDir)ns.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"

View file

@ -0,0 +1,7 @@
#include <NexusClientInterface.h>
#include "AvHNexusClient.h"
bool AvHNexus::send(const unsigned char* data, const size_t length)
{
return false;
}

View file

@ -0,0 +1,16 @@
#ifndef AVHNEXUSCLIENT_H
#define AVHNEXUSCLIENT_H
namespace AvHNexus
{
bool send(const unsigned char* data, const size_t length);
bool recv(const char* data, const size_t length);
void startup(void);
void shutdown(void);
bool login(const string& name, const string& password);
bool logout(void);
}
#endif

View file

@ -8,7 +8,7 @@ extern int g_msgNexusBytes;
byte_string BASE64Decode(const string& input);
Nexus::ServerInfo createServerInfo(void);
//note: we place this here so that we have the possibility of giving out AvHNetworkMessages.
//note: we place this here so that we have the possibility of giving out AvHNetworkMessages.cpp
bool AvHNexus::send(entvars_t* const pev, const unsigned char* data, const unsigned int length)
{
if( !pev ) { return false; }

View file

@ -8,8 +8,8 @@ typedef struct entvars_s entvars_t;
namespace AvHNexus
{
bool send(entvars_t* const pev, const unsigned char* data, const unsigned int length);
bool recv(entvars_t* const pev, const char* data, const unsigned int length);
bool send(entvars_t* const pev, const unsigned char* data, const size_t length);
bool recv(entvars_t* const pev, const char* data, const size_t length);
void handleUnauthorizedJoinTeamAttempt(const edict_t* edict, const unsigned char team_index);
string getNetworkID(const edict_t* edict);

View file

@ -4,16 +4,22 @@
#include "dlls/extdll.h"
#include "dlls/util.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AvHNexus::TunnelToClient::TunnelToClient(void) {}
AvHNexus::TunnelToClient::~TunnelToClient(void) {}
Nexus::TunnelToClient* AvHNexus::TunnelToClient::clone(void) const { return new TunnelToClient(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AvHNexus::TunnelToClient* AvHNexus::TunnelToClient::getInstance(void)
{
static std::auto_ptr<AvHNexus::TunnelToClient> ptr(new AvHNexus::TunnelToClient());
return ptr.get();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToClient::insertMessage(const Nexus::ClientID local_id, const byte_string& message)
{
std::pair<const Nexus::ClientID,const byte_string> item(local_id,message);
@ -21,6 +27,8 @@ bool AvHNexus::TunnelToClient::insertMessage(const Nexus::ClientID local_id, con
return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const Nexus::ClientID AvHNexus::TunnelToClient::poll(void) const
{
Nexus::ClientID result = 0;
@ -29,6 +37,8 @@ const Nexus::ClientID AvHNexus::TunnelToClient::poll(void) const
return result;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToClient::recv(const Nexus::ClientID local_id, byte_string& data)
{
std::pair<const Nexus::ClientID,const byte_string> item = messages.front();
@ -39,7 +49,11 @@ bool AvHNexus::TunnelToClient::recv(const Nexus::ClientID local_id, byte_string&
return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToClient::send(const Nexus::ClientID local_id, const byte_string& data)
{
return AvHNexus::send( VARS(local_id), data.c_str(), data.length() );
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -19,7 +19,7 @@ namespace AvHNexus
virtual bool send(const Nexus::ClientID local_id, const byte_string& data);
virtual bool recv(const Nexus::ClientID local_id, byte_string& data);
virtual bool insertMessage(const Nexus::ClientID local_id, const byte_string& message);
virtual bool insertMessage(const Nexus::ClientID local_id, const byte_string& message); //inserted into queue of messages from clients
private:
TunnelToClient(void);

View file

@ -0,0 +1,45 @@
#include <NexusClientInterface.h>
#include "AvHNexusClient.h"
#include "AvHNexusTunnelToServer.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AvHNexus::TunnelToServer::TunnelToServer(void) {}
AvHNexus::TunnelToServer::~TunnelToServer(void) {}
Nexus::TunnelToServer* AvHNexus::TunnelToServer::clone(void) const { return new TunnelToServer(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AvHNexus::TunnelToServer* AvHNexus::TunnelToServer::getInstance(void)
{
static std::auto_ptr<AvHNexus::TunnelToServer> ptr(new AvHNexus::TunnelToServer());
return ptr.get();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToServer::insertMessage(const byte_string& message)
{
messages.push_back(message);
return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToServer::recv(byte_string& data)
{
if( messages.empty() )
{ return false; }
data.assign(messages.front());
messages.pop_front();
return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool AvHNexus::TunnelToServer::send(const byte_string& data)
{
return AvHNexus::send( data.c_str(), data.length() );
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -0,0 +1,26 @@
#ifndef AVHNEXUSTUNNELTOSERVER_H
#define AVHNEXUSTUNNELTOSERVER_H
#include <queue>
namespace AvHNexus
{
class TunnelToServer : public Nexus::TunnelToServer
{
public:
static TunnelToServer* getInstance(void);
virtual ~TunnelToServer(void);
virtual Nexus::TunnelToServer* clone(void) const;
virtual bool send(const byte_string& data);
virtual bool recv(byte_string& data);
virtual bool insertMessage(const byte_string& message); //inserted into queue of messages from server
private:
TunnelToServer(void);
std::deque<const byte_string> messages;
};
}
#endif