123
This commit is contained in:
163
Ubisoft.com/CDKey/CDKey.vcproj
Normal file
163
Ubisoft.com/CDKey/CDKey.vcproj
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding = "Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.00"
|
||||
Name="CDKeyValidation"
|
||||
ProjectGUID="{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/include,.\..\..\ubisoft.com\GSServices\sdks/gs-sdk-cdkey/include,.\..\..\ubisoft.com\ConsoleImplementation\src"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libgsconnect_debug.lib libgsutility_debug.lib libgssocket_debug.lib libgscrypto_debug.lib libgscdkey_debug.lib ws2_32.lib"
|
||||
OutputFile="$(OutDir)/CDKey.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32,.\..\..\ubisoft.com\GSServices\sdks/gs-sdk-cdkey/lib_win32"
|
||||
IgnoreDefaultLibraryNames="LIBCMTD"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/CDKey.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
AdditionalIncludeDirectories=".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/include,.\..\..\ubisoft.com\GSServices\sdks/gs-sdk-cdkey/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libgsconnect.lib libgsutility.lib libgssocket.lib libgscrypto.lib libgscdkey.lib ws2_32.lib"
|
||||
OutputFile="$(OutDir)/CDKey.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32,.\..\..\ubisoft.com\GSServices\sdks/gs-sdk-cdkey/lib_win32"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Implementation Files"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="src\CdKeyValidation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\GSTypes.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="src\CdKeyValidation.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ConsoleImplementation\src\UbisoftMemory.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="main.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ubi Source Files"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-cdkey\include\GSCDKeyCallbacks.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-cdkey\include\GSCDKeyDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-cdkey\include\GSCDKeyInterface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ConsoleImplementation\src\UbisoftMemory.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
81
Ubisoft.com/CDKey/src/CdKeyValidation.cpp
Normal file
81
Ubisoft.com/CDKey/src/CdKeyValidation.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
#include "CdKeyValidation.h"
|
||||
#include "GSCDKeyInterface.h"
|
||||
#include "UbisoftMemory.h"
|
||||
#define CD_KEY_VALIDATION_PORT 43421
|
||||
|
||||
CDKeyValidation::CDKeyValidation()
|
||||
{
|
||||
classHandle=0;
|
||||
}
|
||||
|
||||
CDKeyValidation::~CDKeyValidation()
|
||||
{
|
||||
}
|
||||
|
||||
// Server & client
|
||||
void CDKeyValidation::Initialize(void)
|
||||
{
|
||||
classHandle=GSCDKey_Initialize(CD_KEY_VALIDATION_PORT);
|
||||
}
|
||||
|
||||
void CDKeyValidation::Uninitialize(void)
|
||||
{
|
||||
GSCDKey_Uninitialize(classHandle);
|
||||
}
|
||||
|
||||
// ------- SERVER FUNCTIONS ---------------
|
||||
// The server should call this to validate an authorization ID
|
||||
GSCDKeyRequest CDKeyValidation::ValidateUser(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, GSubyte *auhorizationID,GSchar *gameName)
|
||||
{
|
||||
/*
|
||||
* GSCDKeyRequest __stdcall GSCDKey_ValidateUser(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID,GSchar *szGameName,
|
||||
GSushort usTimeout = 3);
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Server should call this everytime a player quits or for every player when the game ends. That way that
|
||||
// client can use their cd key in other games
|
||||
// Yes I know it's a bad design :(
|
||||
GSCDKeyRequest CDKeyValidation::ServerDisconnectUser(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, GSubyte *authorizationID)
|
||||
{
|
||||
/*
|
||||
GSCDKeyRequest __stdcall GSCDKey_DisconnectUser(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID);
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------- CLIENT FUNCTIONS ---------------
|
||||
// Client needs to call this once to get an Activation ID. You never need to call this more than once.
|
||||
// The activation ID will be stored in the registry
|
||||
GSCDKeyRequest CDKeyValidation::ActivateCDKey(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, PACTIVATION_INFO activationInfo)
|
||||
{
|
||||
/*
|
||||
* GSCDKeyRequest __stdcall GSCDKey_RequestActivation(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
PACTIVATION_INFO psActivationInfo,
|
||||
GSushort usTimeout = 6);
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This uses the activation ID to get an AUTHORIZATION ID for a game server. You need to call this
|
||||
// before each time you play. You then send the AUTHORIZATION ID internally to the server
|
||||
GSCDKeyRequest CDKeyValidation::AuthorizeActivationID(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort,PVALIDATION_INFO validationInfo)
|
||||
{
|
||||
/*
|
||||
GSCDKeyRequest __stdcall GSCDKey_RequestAuthorization(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
PVALIDATION_INFO psValidationInfo,
|
||||
GSushort usTimeout = 3);
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
49
Ubisoft.com/CDKey/src/CdKeyValidation.h
Normal file
49
Ubisoft.com/CDKey/src/CdKeyValidation.h
Normal file
@@ -0,0 +1,49 @@
|
||||
// Check this in OnConnect in XServerSlot
|
||||
|
||||
#if defined(WIN32)
|
||||
# define GS_WIN32
|
||||
#else
|
||||
# define GS_LINUX
|
||||
#endif
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "define.h"
|
||||
#include "GSCDKeyDefines.h"
|
||||
|
||||
#ifndef __CD_KEY_VALIDATION__
|
||||
#define __CD_KEY_VALIDATION__
|
||||
|
||||
class CDKeyValidation
|
||||
{
|
||||
public:
|
||||
CDKeyValidation();
|
||||
~CDKeyValidation();
|
||||
|
||||
// Server & client
|
||||
void Initialize(void);
|
||||
void Uninitialize(void);
|
||||
|
||||
// ------- SERVER FUNCTIONS ---------------
|
||||
// The server should call this to validate an authorization ID
|
||||
//GSCDKeyRequest ValidateUser(PVALIDATION_SERVER_INFO validationServerInfo, GSubyte *auhorizationID,GSchar *gameName);
|
||||
GSCDKeyRequest ValidateUser(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, GSubyte *auhorizationID,GSchar *gameName);
|
||||
|
||||
// Server should call this everytime a player quits or for every player when the game ends. That way that
|
||||
// client can use their cd key in other games
|
||||
// Yes I know it's a bad design :(
|
||||
GSCDKeyRequest ServerDisconnectUser(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, GSubyte *authorizationID);
|
||||
|
||||
// ------- CLIENT FUNCTIONS ---------------
|
||||
// Client needs to call this once to get an Activation ID. You never need to call this more than once.
|
||||
// The activation ID will be stored in the registry
|
||||
GSCDKeyRequest ActivateCDKey(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort, PACTIVATION_INFO activationInfo);
|
||||
// This uses the activation ID to get an AUTHORIZATION ID for a game server. You need to call this
|
||||
// before each time you play. You then send the AUTHORIZATION ID internally to the server
|
||||
GSCDKeyRequest AuthorizeActivationID(GSchar szIPAddress[IPADDRESSLENGTH], GSushort usPort,PVALIDATION_INFO validationInfo);
|
||||
|
||||
private:
|
||||
void Update(void);
|
||||
GShandle classHandle;
|
||||
};
|
||||
|
||||
#endif
|
||||
3
Ubisoft.com/CDKey/src/main.cpp
Normal file
3
Ubisoft.com/CDKey/src/main.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
void main(void)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user