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)
|
||||
{
|
||||
}
|
||||
27
Ubisoft.com/ConsoleImplementation/ConsoleImplementation.sln
Normal file
27
Ubisoft.com/ConsoleImplementation/ConsoleImplementation.sln
Normal file
@@ -0,0 +1,27 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 7.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleImplementation", "ConsoleImplementation.vcproj", "{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CDKey", "..\CDKey\CDKey.vcproj", "{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
ConfigName.0 = Debug
|
||||
ConfigName.1 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}.Debug.ActiveCfg = Debug|Win32
|
||||
{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}.Debug.Build.0 = Debug|Win32
|
||||
{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}.Release.ActiveCfg = Release|Win32
|
||||
{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}.Release.Build.0 = Release|Win32
|
||||
{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}.Debug.ActiveCfg = Debug|Win32
|
||||
{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}.Debug.Build.0 = Debug|Win32
|
||||
{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}.Release.ActiveCfg = Release|Win32
|
||||
{139D67B2-5379-429E-BBD4-F1E6D64C6C4D}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
241
Ubisoft.com/ConsoleImplementation/ConsoleImplementation.vcproj
Normal file
241
Ubisoft.com/ConsoleImplementation/ConsoleImplementation.vcproj
Normal file
@@ -0,0 +1,241 @@
|
||||
<?xml version="1.0" encoding = "Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.00"
|
||||
Name="Ubi.com"
|
||||
ProjectGUID="{9C9E19C4-AC32-4D92-B50E-401D5A0FBC39}"
|
||||
SccProjectName=""$/Game01", GBOAAAAA"
|
||||
SccAuxPath=""
|
||||
SccLocalPath="..\.."
|
||||
SccProvider="MSSCCI:Microsoft Visual SourceSafe"
|
||||
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-msclient\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-base\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include""
|
||||
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="libgsclient_debug.lib libgsmsclient_debug.lib libgsregserver_debug.lib libgsconnect_debug.lib libgscrypto_debug.lib libgsutility_debug.lib libgssocket_debug.lib libgsproxyclient_debug.lib libgsresult_debug.lib Wininet.lib Ws2_32.lib"
|
||||
OutputFile="$(OutDir)/ConsoleImplementation.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32""
|
||||
IgnoreDefaultLibraryNames="LIBCMTD"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/ConsoleImplementation.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="GS_WIN32"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=""C:\ubisoft\GSServices\sdks\gs-sdk-common\include";"C:\ubisoft\GSServices\sdks\gs-sdk-base\include""
|
||||
ShowProgress="TRUE"/>
|
||||
<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-msclient\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-base\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include";".\..\..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\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="libgsclient.lib libgsmsclient.lib libgsregserver.lib libgsconnect.lib libgscrypto.lib libgsutility.lib libgssocket.lib libgsproxyclient.lib libgsresult.lib Wininet.lib Ws2_32.lib"
|
||||
OutputFile="$(OutDir)/ConsoleImplementation.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32";".\..\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32""
|
||||
IgnoreDefaultLibraryNames="LIBCMT"
|
||||
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="Ubi Source Files"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter=".h">
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-cdkey\include\CDKeyDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-chat\include\GLIRCCallbacks.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-chat\include\GLIRCLibrary.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSClientClass.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSClientLibrary.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\GSCryptoDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\GSCryptoInterface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\GSErrors.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSFriendsCB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-http\include\GSHttpCallbacks.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-http\include\GSHttpDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-http\include\GSHttpInterface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSLobbyCB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSLoginCB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSPersistentCB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\GSSessionCB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\GSTypes.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\InitSockets.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-base\include\LobbyDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\NetInterface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\SimpleConnect.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\GSServices\sdks\gs-sdk-common\include\define.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter=".cpp">
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Implementation Files"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<File
|
||||
RelativePath="src\CommonDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\ErrorSrings.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\NewUbisoftClient.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\UbisoftMemory.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\stdafx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="src\NewUbisoftClient.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\NewUbisoftMSClient.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\NewUbisoftRegServer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\UbisoftMemory.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\main.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = "relative:ubisoft.com\\ConsoleImplementation"
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
|
||||
}
|
||||
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/GS Architecture diagram.vsd
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/GS Architecture diagram.vsd
Normal file
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/GS Architecture.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/GS Architecture.doc
Normal file
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/GS Outage Support.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/GS Outage Support.doc
Normal file
Binary file not shown.
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/Game Service Check List.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/Game Service Check List.doc
Normal file
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/Game Service Overview.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/Game Service Overview.doc
Normal file
Binary file not shown.
BIN
Ubisoft.com/DevelopersDocumentation/GameService SDK List.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/GameService SDK List.doc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
We don't have any tools for getting around Firewalls or NATs but we can offer some suggestions. The only way guaranteed to work is to have the ports that need to be opened listed in the Game Docs so the user can read them and open the ports on their firewall or setup Port forwarding in the case of a NAT.
|
||||
|
||||
Lets assume that the Client opens UDP port 2000 and the Server opens port 3000.
|
||||
|
||||
If we assume that most personal Firewalls and NATs allow all outgoing connections then you can try to get around them. When it comes to UDP, Firewalls/NATS will generally only allow incoming UDP packets from an IP and Port that an outgoing UDP packet had been recently sent to.
|
||||
|
||||
If there is a firewall in front of the Client there isn't a problem. The Client starts send UDP packets from port 2000 to the Servers port 3000. The firewall sends these packets to the Server and starts to allow incoming UDP packets from the Servers port 3000. The Server receives the packets from the Client and starts sending UDP packets back from port 3000 to the Clients port 2000. The firewall sees these incoming packets and sends them to the Client because it has sent some UDP packets to that Servers Port recently.
|
||||
|
||||
If there were a firewall in front of the Server this wouldn't work because the Servers firewall wouldn't allow the incoming UDP packets since there weren't any outgoing packets to match. To get around this the Server should also be sending UDP packets to the Client in order to open its own firewall. The server knows the IP address of the client from the CBRegServerRcv_LobbyServerMemberNew or CBLobbyRcv_MemberJoined callbacks.
|
||||
|
||||
If the game requires a TCP connection things are even more difficult because Firewalls generally never allow incoming TCP connections. If there is only one firewall then a connection can be established. The side that has the firewall opens the connection to the other side. So if the client has a firewall it has to open the TCP connection to the Servers TCP Port. If the Server has a firewall then it has to open a TCP connection to the Client. If both the server and the client have a firewall then there is no way to establish a TCP connection with out changing at least one of the firewalls.
|
||||
BIN
Ubisoft.com/DevelopersDocumentation/Online Terminology.doc
Normal file
BIN
Ubisoft.com/DevelopersDocumentation/Online Terminology.doc
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,169 @@
|
||||
#ifndef _GSCLIENCLASS_H_
|
||||
#define _GSCLIENCLASS_H_
|
||||
|
||||
#include "GSErrors.h"
|
||||
#include "GSLoginCB.h"
|
||||
#include "GSFriendsCB.h"
|
||||
#include "GSLobbyCB.h"
|
||||
#include "GSPersistentCB.h"
|
||||
#include "GSLadderQueryCB.h"
|
||||
#include "GSRemoteAlgorithmCB.h"
|
||||
#include "LadderDefines.h"
|
||||
#include "RemoteAlgorithmDefines.h"
|
||||
|
||||
class CGLClientLIB;
|
||||
|
||||
class clGLClient : public clLoginCallbacks, public clFriendsCallbacks,
|
||||
public clLobbyCallbacks, public clPersistentCallbacks,
|
||||
public clLadderQueryCallbacks
|
||||
{
|
||||
public:
|
||||
clGLClient();
|
||||
virtual ~clGLClient();
|
||||
|
||||
GSbool GL_AddRouterPing(GSint lID, GSchar *szIPAddress, GSint lPort);
|
||||
GSbool GL_GetFirstPing(GSint *plID);
|
||||
GSbool GL_ClearRouterPing();
|
||||
|
||||
//Login Messages
|
||||
GSbool Login_Engine(GSuint uiMaxPostingDelay = 500, GSuint uiMaxsOperationalDelay = 800);
|
||||
GSbool LoginSend_Connect(const GSchar* szAddress, GSushort lPort);
|
||||
GSbool LoginSend_Disconnect();
|
||||
GSbool LoginSend_LoginRouter(const GSchar* szAlias, const GSchar* szPassword,
|
||||
const GSchar* szVersion, GSbool bPublicIP = GS_TRUE);
|
||||
GSbool LoginSend_LoginWaitModule(const GSchar* szAlias);
|
||||
GSbool LoginSend_JoinWaitModule();
|
||||
GSbool LoginSend_PlayerInfo(const GSchar* szAlias);
|
||||
GSbool LoginSend_Sleep();
|
||||
GSbool LoginSend_WakeUp();
|
||||
GSbool LoginSend_ModifyAccount(const GSchar* szPassword, const GSchar* szFirstName,
|
||||
const GSchar* szLastName, const GSchar* szEmail, const GSchar* szCountry);
|
||||
GSbool LoginSend_CreateAccount(const GSchar* szVersion, const GSchar* szNickName, const GSchar* szPassword, const GSchar* szFirstName,
|
||||
const GSchar* szLastName, const GSchar* szEmail, const GSchar* szCountry);
|
||||
GSbool LoginSend_RequestMOTD(const GSchar *szLanguage);
|
||||
|
||||
//Friends Messages
|
||||
GSbool Friends_Engine(GSuint uiMaxPostingDelay = 500, GSuint uiMaxsOperationalDelay = 800);
|
||||
GSbool FriendsSend_Connect();
|
||||
GSbool FriendsSend_Disconnect();
|
||||
GSbool FriendsSend_Login(GSint lStatus = 0, GSint lMood = 0);
|
||||
GSbool FriendsSend_AddFriend(const GSchar* szFriend, const GSchar* szGroup, GSint lOptions);
|
||||
GSbool FriendsSend_DelFriend (const GSchar* szFriend);
|
||||
GSbool FriendsSend_FriendList();
|
||||
|
||||
GSRESULT FriendsSend_IgnorePlayer( const GSchar * szPlayer );
|
||||
GSRESULT FriendsSend_UnignorePlayer( const GSchar * szPlayer);
|
||||
GSRESULT FriendsSend_ListIgnoredPlayers();
|
||||
|
||||
GSbool FriendsSend_PagePlayer(const GSchar* pszAlias, const GSchar* szMessage);
|
||||
GSbool FriendsSend_PeerPlayer(const GSchar* pszAlias, GSvoid *p_Buffer, GSuint uiLength);
|
||||
GSbool FriendsSend_StatusChange(GSint lStatus, GSint lMood);
|
||||
GSbool FriendsSend_ChangeFriend(const GSchar* szFriend, const GSchar* szGroup, GSint lOptions);
|
||||
GSbool FriendsSend_SearchPlayer(const GSchar* pszAlias, const GSchar* pszSurName, const GSchar* pszFirstName, const GSchar* pszCountry, const GSchar* pszEmail, GSint lSex, const GSchar* pszGame);
|
||||
GSbool FriendsSend_GetPlayerScores(const GSchar* pszAlias);
|
||||
|
||||
//Lobby messages
|
||||
GSbool Lobby_Engine(GSuint uiMaxPostingDelay = 500, GSuint uiMaxsOperationalDelay = 800);
|
||||
GSbool LobbySend_Connect();
|
||||
GSbool LobbySend_Login(const GSchar* szGames, GSbool bPublicIP = GS_TRUE, GSushort usPlayerStatus = 0 );
|
||||
GSbool LobbySend_Disconnect(GSint iLobbyServerID);
|
||||
GSbool LobbySend_DisconnectAll();
|
||||
|
||||
GSbool LobbySend_CreateRoom(GSint iParentGroupID, GSint iLobbyServerID, const GSchar *szRoomName,
|
||||
const GSchar *szGames, GSushort usRoomType, GSushort usMaxPlayers, GSushort usMaxVisitors,
|
||||
const GSvoid *vpData, GSint iSize, const GSvoid* vpAltGroupInfo, GSint iAltGroupInfoSize,
|
||||
const GSchar *szPassword, const GSchar *szGameVersion, const GSchar *szGSVersion);
|
||||
|
||||
GSbool LobbySend_JoinLobby(GSint iGroupID, GSint iLobbyServerID,
|
||||
const GSchar *szPassword, GSint iConfig = 0);
|
||||
GSbool LobbySend_JoinRoom(GSint iGroupID, GSint iLobbyServerID, const GSchar *szPassword,
|
||||
GSbool bVisitor, const GSchar *szVersion, GSint iConfig = 0);
|
||||
GSbool LobbySend_LeaveGroup(GSint iGroupID, GSint iLobbyServerID);
|
||||
|
||||
GSbool LobbySend_GetGroupInfo(GSint iGroupID, GSint iLobbyServerID, GSint iconfig);
|
||||
GSbool LobbySend_GetAlternateGroupInfo(GSint iGroupID, GSint iLobbyServerID );
|
||||
|
||||
GSbool LobbySend_InitMatchResults(GSuint uiMatchID);
|
||||
GSbool LobbySend_SetMatchResult(GSchar *szAlias, GSuint uiFieldID, GSint iFieldValue);
|
||||
GSbool LobbySend_SubmitMatchResult(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_ClearMatchResult();
|
||||
|
||||
GSbool LobbySend_StartMatch(GSint iGroupID, GSint iLobbyServerID, GSuint uiMode = 0 );
|
||||
GSbool LobbySend_MatchFinish(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_PlayerMatchStarted(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_PlayerMatchFinished(GSint iGroupID, GSint iLobbyServerID);
|
||||
|
||||
GSbool LobbySend_NewMaster(GSint iGroupID, GSint iLobbyServerID, GSchar *szAlias);
|
||||
GSbool LobbySend_PlayerKick(GSint iGroupID, GSint iLobbyServerID, GSchar *szAlias, GSchar *szReason);
|
||||
GSbool LobbySend_GetParentGroupID(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_UpdateRoomConfig(GSint iGroupID, GSint iLobbyServerID, GSbyte bDedicatedServer,
|
||||
GSbyte bOpen, GSbyte bScore_Submission, GSint iMaxPlayers,
|
||||
GSint iMaxVisitors, const GSchar* szPassword, const GSvoid* vpData,
|
||||
GSint iSize, const GSvoid* vpAltGroupInfo, GSint iGroupInfoSize );
|
||||
|
||||
GSbool LobbySend_GameStart(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_GameReady(GSint iGroupID, GSint iLobbyServerID, GSvoid* vpGameData, GSint iSize,
|
||||
GSushort usPort = 0, GSchar *szIPAddress = 0);
|
||||
GSbool LobbySend_GameFinish(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_GameConnected(GSint iGroupID, GSint iLobbyServerID);
|
||||
|
||||
GSbool LobbySend_UpdateGameInfo(GSint iGroupID, GSint iLobbyServerID, GSvoid* vpGameData, GSint iSize,
|
||||
GSushort usPort = 0, GSchar *szIPAddress = 0);
|
||||
GSbool LobbySend_PlayerBan(GSint iGroupID, GSint iLobbyServerID, GSchar *szAlias, GSchar *szReason);
|
||||
GSbool LobbySend_PlayerUnBan(GSint iGroupID, GSint iLobbyServerID, GSchar *szAlias);
|
||||
GSbool LobbySend_GetPlayerBannedList(GSint iGroupID, GSint iLobbyServerID);
|
||||
GSbool LobbySend_SetPlayerInfo(GSvoid *vpPlayerData, GSint iPlayerDataSize);
|
||||
GSbool LobbySend_GetPlayerGroups(GSchar *szAlias);
|
||||
GSbool LobbySend_ChangeRequestedLobbies(const GSchar* szGames);
|
||||
|
||||
GSbool PS_Engine(GSuint uiMaxPostingDelay = 500, GSuint uiMaxsOperationalDelay = 800);
|
||||
GSbool PSSend_Login();
|
||||
GSbool PSSend_Disconnect();
|
||||
GSuint PSSend_GetPrivateData(const GSchar *szGame, GSint iEventID,
|
||||
GSint iRecordID);
|
||||
GSuint PSSend_SetPrivateData(const GSchar *szGame, GSint iEventID,
|
||||
GSint iRecordID, const GSvoid *vpData, GSint iSize);
|
||||
GSuint PSSend_GetPublicData(const GSchar *szGame, GSint iEventID,
|
||||
GSint iRecordID, const GSchar *szPlayerAlias = 0);
|
||||
GSuint PSSend_SetPublicData(const GSchar *szGame, GSint iEventID,
|
||||
GSint iRecordID, const GSvoid *vpData, GSint iSize);
|
||||
|
||||
GSbool LadderQuery_Initialize(GSchar *szLocale);
|
||||
GSbool LadderQuery_Uninitialize();
|
||||
GSbool LadderQuery_Engine(GSuint uiMaxPostingDelay = 500,GSuint uiMaxsOperationalDelay = 800);
|
||||
GSuint LadderQuery_SendRequest();
|
||||
|
||||
GSbool LadderQuery_CreateRequest(GSchar *szGameName, GSuint uiEvent = 0, GSuint uiMode = 0);
|
||||
GSbool LadderQuery_RequestPivotUser(const GSchar *pszEntry, GSuint uiNumberOfEntries);
|
||||
GSbool LadderQuery_RequestPivotRow(GSuint uiEntry, GSuint uiNumberOfEntries);
|
||||
GSbool LadderQuery_RequestSet(const GSchar *pszEntries[], GSuint uiNumberOfEntries);
|
||||
GSbool LadderQuery_RequestOrderedList(GSuint uiFirstEntry, GSuint uiNumberOfEntries);
|
||||
|
||||
GSbool LadderQuery_AddSortConstraint(const GSchar *pszField, GSbool bSortDirection);
|
||||
GSbool LadderQuery_AddFilterConstraint(const LADDER_FILTER *pLadderFilter[], GSuint uiListOfFilters);
|
||||
GSbool LadderQuery_AddDisplayConstraint(const GSchar *pszFields[], GSuint uiNumberOfFields);
|
||||
|
||||
GSbool LadderQuery_GetResultSearchCount(GSuint uiRequestID, GSuint & uiCount);
|
||||
GSbool LadderQuery_GetResultEntryCount(GSuint uiRequestID, GSuint & uiCount);
|
||||
GSbool LadderQuery_GetResultFieldCaption(GSuint uiRequestID, const GSchar *pszField, GSchar * pszCaption);
|
||||
GSbool LadderQuery_StartResultEntryEnumeration(GSuint uiRequestID, GSuint uiStartEntry);
|
||||
GSbool LadderQuery_NextResultEntry(GSuint uiRequestID);
|
||||
GSbool LadderQuery_GetCurrentEntryField(GSuint uiRequestID, const GSchar *pszField, GSint & iValue);
|
||||
GSbool LadderQuery_GetCurrentEntryFieldAsString(GSuint uiRequestID, const GSchar *pszField, GSchar * pszValue);
|
||||
GSvoid LadderQuery_ReleaseResult(GSuint uiRequestID);
|
||||
|
||||
GSRESULT RemoteAlgorithm_Initialise(const GSchar * szGameName);
|
||||
GSRESULT RemoteAlgorithm_Uninitialise();
|
||||
GSRESULT RemoteAlgorithm_Engine(GSuint uiMaxPostingDelay = 500,
|
||||
GSuint uiMaxsOperationalDelay = 800);
|
||||
GSRESULT RemoteAlgorithm_Execute(GSuint uiAlgoId,
|
||||
RAE_VALUE * pInput, GSuint uiNumInput,
|
||||
RemoteAlgorithm_OutputCB fOutput,
|
||||
GSvoid * pData, GSuint & uiRequest);
|
||||
|
||||
private:
|
||||
CGLClientLIB *m_pClientLIB;
|
||||
|
||||
};
|
||||
|
||||
#endif //_GSCLIENCLASS_H_
|
||||
4512
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSClientLibrary.h
Normal file
4512
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSClientLibrary.h
Normal file
File diff suppressed because it is too large
Load Diff
438
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSFriendsCB.h
Normal file
438
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSFriendsCB.h
Normal file
@@ -0,0 +1,438 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante <gsdevteam@ubisoft.com>
|
||||
//* Date: 5/16/01 9:43:49 AM
|
||||
/*! \file GSFriendsCB.h
|
||||
* \brief Callback functions for the <b><i>friends service</i></b>.
|
||||
*
|
||||
* This file contains all callback functions declaration for the friend
|
||||
* service.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
#ifndef _GSFRIENDSCB_H_
|
||||
#define _GSFRIENDSCB_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "GSErrors.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
class clFriendsCallbacks
|
||||
{
|
||||
public:
|
||||
virtual GSvoid FriendsRcv_LoginResult(GSubyte ubType, GSint iReason) = 0;
|
||||
virtual GSvoid FriendsRcv_AddFriend(GSubyte ubType, GSint iReason,
|
||||
GSchar* szFriend) = 0;
|
||||
virtual GSvoid FriendsRcv_DelFriend(GSubyte ubType, GSint iReason,
|
||||
GSchar* szFriend) = 0;
|
||||
virtual GSvoid FriendsRcv_IgnorePlayer( GSRESULT rCode,
|
||||
const GSchar * szPlayer ) = 0;
|
||||
virtual GSvoid FriendsRcv_UnignorePlayer( GSRESULT rCode,
|
||||
const GSchar * szPlayer ) = 0;
|
||||
virtual GSvoid FriendsRcv_ListIgnoredPlayers( GSRESULT rCode ) = 0;
|
||||
virtual GSvoid FriendsRcv_IgnoredPlayer( const GSchar * szPlayer ) = 0;
|
||||
virtual GSvoid FriendsRcv_Page(GSchar* szUsername, GSchar* szMessage,
|
||||
GSchar* szTimeStamp) = 0;
|
||||
virtual GSvoid FriendsRcv_PagePlayer(GSubyte ubType, GSint iReason,
|
||||
GSchar* szUsername) = 0;
|
||||
virtual GSvoid FriendsRcv_PeerMsg(GSchar* szUsername, GSvoid* p_Buffer,
|
||||
GSuint uiLength) = 0;
|
||||
virtual GSvoid FriendsRcv_PeerPlayer(GSubyte ubType, GSint iReason,
|
||||
GSchar* szUsername) = 0;
|
||||
virtual GSvoid FriendsRcv_ChangeFriend(GSubyte ubType, GSint iReason) = 0;
|
||||
virtual GSvoid FriendsRcv_StatusChange(GSubyte ubType, GSint iReason) = 0;
|
||||
virtual GSvoid FriendsRcv_UpdateFriend(GSchar* szUsername, GSint iReason,
|
||||
GSchar* szGroup, GSint iMood, GSint iOptions, GSchar *szGameName) = 0;
|
||||
virtual GSvoid FriendsRcv_SearchPlayer(GSubyte ubType, GSint iReason,
|
||||
GSchar* szUsername, GSint iStatus, GSchar *szGameName) = 0;
|
||||
virtual GSvoid FriendsRcv_ScoreCard(GSubyte ubType, GSint iReason,
|
||||
GSchar* szPlayer,GSchar* szGame, GSchar* szScore) = 0;
|
||||
};
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
/*! @addtogroup group_FriendCB
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_LoginResult
|
||||
/*!
|
||||
\brief Receive friends service login result
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after asking to log into the friend service
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_Login()
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_LoginResult)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_AddFriend
|
||||
/*!
|
||||
\brief Receive the status of the friend addition request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after adding a friend to his friend list
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_AddFriend()
|
||||
|
||||
\par Errors:
|
||||
ERRORROUTER_DBPROBLEM: There is a problem with the database<br>
|
||||
ERRORFRIENDS_FRIENDNOTEXIST: The username didn't exist.
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szFriend The alias of the newly added friend
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_AddFriend)(GSubyte ubType,
|
||||
GSint iReason, GSchar* szUsername);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_DelFriend
|
||||
/*!
|
||||
\brief Receive the status of the remove friend request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after removing a friend from the friend list.
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_DelFriend()
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szUsername The alias of the newly deleted friend
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_DelFriend)(GSubyte ubType,
|
||||
GSint iReason, GSchar* szUsername);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_IgnorePlayer
|
||||
|
||||
/*!
|
||||
\brief Result of an ignore player request
|
||||
\par Description:
|
||||
This callback will be called with the results of a previous ignore
|
||||
player request.
|
||||
|
||||
<BR>
|
||||
Related function : FriendsSend_IgnorePlayer()
|
||||
|
||||
\param szPlayer The ubi.com username of the player that was ignored
|
||||
\param rCode Result code of the request. Possible values are:
|
||||
<UL>
|
||||
<LI>GSS_OK<BR>
|
||||
There was no error
|
||||
<LI>GSE_INVALIDUSER<BR>
|
||||
The username to ignore is not a valid ubi.com user.
|
||||
<LI>GSE_DBFAILURE<BR>
|
||||
An error occured on the DB while processing
|
||||
the request.
|
||||
<LI>GSE_FAIL<BR>
|
||||
An unsuspected error occured most likely due to a bug
|
||||
on ubi.com
|
||||
</UL>
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_IgnorePlayer)( GSRESULT rCode,
|
||||
const GSchar * szPlayer );
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_UnignorePlayer
|
||||
|
||||
/*!
|
||||
\brief Result of an unignore player request
|
||||
\par Description:
|
||||
This callback will be called with the results of a previous unignore
|
||||
player request.
|
||||
|
||||
<BR>
|
||||
Related function : FriendsSend_UnignorePlayer()
|
||||
|
||||
\param szPlayer The ubi.com username of the player that was removed from
|
||||
the ignore-list
|
||||
\param rCode Result code of the request. Possible values are:
|
||||
<UL>
|
||||
<LI>GSS_OK<BR>
|
||||
There was no error
|
||||
<LI>GSE_DBFAILURE<BR>
|
||||
An error occured on the DB while processing
|
||||
the request.
|
||||
<LI>GSE_FAIL<BR>
|
||||
An unsuspected error occured most likely due to a bug
|
||||
on ubi.com
|
||||
</UL>
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_UnignorePlayer)(
|
||||
GSRESULT rCode, const GSchar * szPlayer );
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_ListIgnoredPlayers
|
||||
|
||||
/*!
|
||||
\brief Result of a request to get the ignore-list
|
||||
\par Description:
|
||||
This callback will be called with the results of a previous ignore-list
|
||||
retrieval request.
|
||||
|
||||
<BR>
|
||||
Related function : FriendsSend_ListIgnoredPlayers()
|
||||
|
||||
\param rCode Result code of the request. Possible values are:
|
||||
<UL>
|
||||
<LI>GSS_OK<BR>
|
||||
There was no error
|
||||
<LI>GSE_DBFAILURE<BR>
|
||||
An error occured on the DB while processing
|
||||
the request.
|
||||
<LI>GSE_FAIL<BR>
|
||||
An unsuspected error occured most likely due to a bug
|
||||
on ubi.com
|
||||
</UL>
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_ListIgnoredPlayers)( GSRESULT rCode );
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_IgnoredPlayer
|
||||
|
||||
/*!
|
||||
\brief Enumeration of the ignored players
|
||||
\par Description:
|
||||
This callback will be called for each player in a ignore-list following
|
||||
a ignore-list retrieval request. The end of list is notified by the
|
||||
CBFriendsRcv_ListIgnoredPlayers callback.
|
||||
|
||||
<BR>
|
||||
Related function : FriendsSend_ListIgnoredPlayers()
|
||||
|
||||
\param szPlayer The ubi.com username of a ignored player
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_IgnoredPlayer)(
|
||||
const GSchar * szPlayer );
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_Page
|
||||
/*!
|
||||
\brief Receive a page message
|
||||
\par Description:
|
||||
This callback will be called when the client receives a page message
|
||||
from another player
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_PagePlayer()
|
||||
|
||||
\param szUsername the username of the sender
|
||||
\param szMessage Message
|
||||
\param szTimeStamp The server timestamp of when the page message was sent
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_Page)(GSchar* szUsername,
|
||||
GSchar* pszMessage, GSchar* szTimeStamp);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_PagePlayer
|
||||
/*!
|
||||
\brief Receive the status of send page request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after sending a page to another player
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_PagePlayer()
|
||||
|
||||
\par Errors:
|
||||
ERRORROUTER_UNKNOWNERROR: The page message was not sent.
|
||||
ERRORFRIENDS_PLAYERSTATUSCOREONLINE: The player can't receive page messages.
|
||||
ERRORFRIENDS_PLAYERIGNORE: The player has ignored the sender
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szUsername The username of the recipient
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_PagePlayer)(GSubyte ubType,
|
||||
GSint iReason, GSchar* szUsername);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_PeerMsg
|
||||
/*!
|
||||
\brief Receive a peer message
|
||||
\par Description:
|
||||
This callback will be called when the client receives a peer message from
|
||||
another player
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_PeerPlayer()
|
||||
|
||||
\param szUsername Username of the sender
|
||||
\param p_Buffer Data buffer
|
||||
\param uiLength Length of the buffer
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_PeerMsg)(GSchar* szUsername,
|
||||
GSvoid* p_Buffer, GSuint uiLength);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_PeerPlayer
|
||||
/*!
|
||||
\brief Receive the status of the send peer message request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after sending a peer player message
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_PeerPlayer()
|
||||
|
||||
\par Errors:
|
||||
ERRORFRIENDS_PLAYERSTATUSCOREONLINE: The player can't receive peer messages.
|
||||
ERRORROUTER_CLIENTINCOMPATIBLE: The other player doesn't have the same client
|
||||
version as you.
|
||||
ERRORFRIENDS_PLAYERNOTONLINE: The player is not online.
|
||||
ERRORFRIENDS_PLAYERIGNORE: The player has ignored the sender
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szUsername Username of the receiver of the message
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_PeerPlayer)(GSubyte ubType,
|
||||
GSint iReason, GSchar* szUsername);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_ChangeFriend
|
||||
/*!
|
||||
\brief Receive the status of change friend request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the
|
||||
router after sending a change friend request.
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_StatusChange()
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_ChangeFriend)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_StatusChange
|
||||
/*!
|
||||
\brief Receive the status of a change status request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after the player as changed his status
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_StatusChange()
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_StatusChange)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_UpdateFriend
|
||||
/*!
|
||||
\brief Receive information about a friend
|
||||
\par Description:
|
||||
This callback will be called when the client receives information about
|
||||
a friend that is in his friend list. This will be called on friend service
|
||||
loging and each time a friend is added to the friend list.
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_ChangeFriend()
|
||||
FriendsSend_Login()
|
||||
|
||||
\param szUsername The username of the friend
|
||||
\param iStatus Current status of the friend
|
||||
\param szGroup Group of the friend
|
||||
\param iMood Current mood of the friend
|
||||
\param iOptions Friend options
|
||||
\param szGameName The GameName when the status is PLAYERINLOBBY,
|
||||
PLAYERINROOMOPEN,PLAYERINROOMCLOSE can be up to GAMELENGTH*4 in size.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_UpdateFriend)(GSchar* szUsername,
|
||||
GSint iStatus, GSchar* szGroup, GSint iMood, GSint iOptions,
|
||||
GSchar *szGameName);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_SearchPlayer
|
||||
/*!
|
||||
\brief Receive the status of search player request
|
||||
\par Description:
|
||||
This callback will be called when the client receives response from the router
|
||||
after calling for a search of all the player that match a pattern. For each
|
||||
player found, this will be called.
|
||||
|
||||
\par Related Function:
|
||||
FriendsSend_SearchPlayer()
|
||||
|
||||
\par Errors:
|
||||
ERRORFRIENDS_FRIENDNOTEXIST: No more players found.
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szUsername Username of the player that was found
|
||||
\param iStatus Status of the player that was found
|
||||
\param szGameName The GameName when the status is PLAYERINLOBBY,
|
||||
PLAYERINROOMOPEN,PLAYERINROOMCLOSE can be up to GAMELENGTH*4 in size
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_SearchPlayer)(GSubyte ubType,
|
||||
GSint iReason,GSchar* szUsername, GSint iStatus, GSchar *szGameName);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBFriendsRcv_ScoreCard
|
||||
/*!
|
||||
\brief Receive score card information for a player
|
||||
\par Description:
|
||||
DEPRECATED: This callback has been replaced by the Ladder Query Service
|
||||
\par Related Function:
|
||||
FriendsSend_GetPlayerScores()
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
\param szUsername the username of the player
|
||||
\param szGame Game name (ugly)
|
||||
\param szScore Scoree of the player
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBFriendsRcv_ScoreCard)(GSubyte ubType,
|
||||
GSint iReason,GSchar* szUsername,GSchar* szGame, GSchar* szScore);
|
||||
|
||||
/*! @} end of group_FriendCB */
|
||||
|
||||
|
||||
|
||||
#endif //_GSFRIENDSCB_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante <gsdevelopers@ubisoft.com>
|
||||
//* Date: 2003-07-14
|
||||
/*! \file GSLadderQueryCB.h
|
||||
* \brief Callback functions for the <b><i>ladder query service</i></b>.
|
||||
*
|
||||
* This file contains all callback functions declaration for the ladder query
|
||||
* service.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef __GSLADDERQUERYCB_H__
|
||||
#define __GSLADDERQUERYCB_H__
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
class clLadderQueryCallbacks
|
||||
{
|
||||
public:
|
||||
virtual GSvoid LadderQueryRcv_RequestReply(GSubyte ucType, GSint iReason, GSuint uiRequestId) = 0;
|
||||
};
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
/*! @addtogroup group_LadderQuery
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLadderQueryRcv_RequestReply
|
||||
|
||||
/*!
|
||||
\brief Receive the result of a ladder query to the ubi.com servers.
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the ubi.com data provider
|
||||
after asking a ladder data request.
|
||||
\par Related functions
|
||||
LadderQuery_SendRequest()
|
||||
|
||||
\param ucType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ucType is GSFAIL
|
||||
\param uiRequestId The id of the request from wich we received results
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLadderQueryRcv_RequestReply)(GSubyte ucType, GSint iReason, GSuint uiRequestId);
|
||||
|
||||
|
||||
/*! @} end of group_LadderQuery */
|
||||
|
||||
#endif //__GSLADDERQUERYCB_H__
|
||||
1248
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSLobbyCB.h
Normal file
1248
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSLobbyCB.h
Normal file
File diff suppressed because it is too large
Load Diff
286
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSLoginCB.h
Normal file
286
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/GSLoginCB.h
Normal file
@@ -0,0 +1,286 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante <gsdevteam@ubisoft.com>
|
||||
//* Date: 5/16/01 9:20:13 AM
|
||||
/*! \file GSLoginCB.h
|
||||
* \brief Callback functions for the Login service
|
||||
*
|
||||
* This file contains all callback functions declaration for the<b><i>login
|
||||
* service</i></b>.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
#ifndef __GSLOGINCB_H_
|
||||
#define __GSLOGINCB_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
class clLoginCallbacks
|
||||
{
|
||||
public:
|
||||
virtual GSvoid LoginRcv_PlayerInfo(GSubyte ubType, GSchar * pszNickName,
|
||||
GSchar * pszSurName, GSchar * pszFirstName, GSchar * pszCountry,
|
||||
GSchar * pszEmail, GSchar * szIRCID, GSchar * szIPAddress,
|
||||
GSint iReason ) = 0;
|
||||
virtual GSvoid LoginRcv_JoinWaitModuleResult(GSubyte ubType,
|
||||
GSchar * pszAddress, GSushort lPort, GSint iReason) = 0;
|
||||
virtual GSvoid LoginRcv_LoginRouterResult(GSubyte ubType, GSint iReason) = 0;
|
||||
virtual GSvoid LoginRcv_LoginWaitModuleResult(GSubyte ubType,
|
||||
GSint iReason) = 0;
|
||||
virtual GSvoid LoginRcv_SystemPage(GSint lSubType, GSchar * pszText) = 0;
|
||||
virtual GSvoid LoginRcv_LoginDisconnection() = 0;
|
||||
virtual GSvoid LoginRcv_AccountCreationResult(GSubyte ubType,
|
||||
GSint iReason) = 0;
|
||||
virtual GSvoid LoginRcv_ModifyUserResult(GSubyte ubType, GSint iReason) = 0;
|
||||
virtual GSvoid LoginRcv_RequestMOTD(GSubyte ubType, GSchar *szUbiMOTD,
|
||||
GSchar *szGameMOTD, GSint iReason)=0;
|
||||
};
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
/*! @addtogroup group_LoginCB
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_PlayerInfo
|
||||
/*!
|
||||
\brief Receive information on a player
|
||||
\par Description:
|
||||
This callback will be called when the client requests information on a player
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_PlayerInfo()
|
||||
|
||||
\par Errors:
|
||||
ERRORROUTER_DBPROBLEM: There is a problem with the database.<br>
|
||||
ERRORROUTER_NOTREGISTERED: The username doesn't exist.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param szUsername The username of the player in the correct case
|
||||
\param szSurName The last name of a player
|
||||
\param szFirstName The first name of the player
|
||||
\param szCountry The country of the player
|
||||
\param szEmail Email address of the player
|
||||
\param szIRCID Player's IRC ID
|
||||
\param szIPAddress Player's ip address
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_PlayerInfo)(GSubyte ubType,
|
||||
GSchar *szUsername, GSchar *szSurName, GSchar *szFirstName,
|
||||
GSchar *szCountry, GSchar *szEmail,GSchar *szIRCID, GSchar *szIPAddress,
|
||||
GSint iReason);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_JoinWaitModuleResult
|
||||
/*!
|
||||
\brief Receive status of the join wait module request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after asking to join the wait module. The client should then call
|
||||
LoginSend_Connect() with this szAddress and usPort.
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_JoinWaitModule()<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param szAddress IP address of the wait module
|
||||
\param usPort The port of the wait module
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_JoinWaitModuleResult)(GSubyte ubType,
|
||||
GSchar *szAddress, GSushort usPort, GSint iReason);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_LoginRouterResult
|
||||
|
||||
/*!
|
||||
\brief Receive status of the login request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after asking to log into the router. If you reveive a GSSCUCCESS you
|
||||
can then call LoginSend_JoinWaitModule().
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_LoginRouter()<br>
|
||||
|
||||
\par Errors:
|
||||
ERRORSECURE_DATABASEFAILED: There is a problem with the Database.<br>
|
||||
ERRORROUTER_NOTDISCONNECTED: The player is already logged in.<br>
|
||||
ERRORSECURE_INVALIDPASSWORD: The password is not correct.<br>
|
||||
ERRORSECURE_LOCKEDACCOUNT: The account has been locked.<br>
|
||||
ERRORSECURE_INVALIDACCOUNT: The username doesn't exist.<br>
|
||||
ERRORSECURE_BANNEDACCOUNT: The account has been banned.<br>
|
||||
ERRORSECURE_BLOCKEDACCOUNT: The account has been blocked.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_LoginRouterResult)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_LoginWaitModuleResult
|
||||
|
||||
/*!
|
||||
\brief Receive status of the login wait module request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after asking to login to the wait module. After receving this callback
|
||||
you will be fully connected to the Game Service. It's recommened that the
|
||||
client now call LoginSend_PlayerInfo() with the players username to get his
|
||||
szIRCID and the correct case of his username.
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_LoginWaitModule()<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_LoginWaitModuleResult)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_SystemPage
|
||||
|
||||
/*!
|
||||
\brief Received a system page
|
||||
\par Description:
|
||||
This callback will be called when the client received a system
|
||||
page wich is usually called by a administrator or when another
|
||||
player adds the client to his friend list.
|
||||
|
||||
\param iSubType The type of message. The possibilities are:
|
||||
<UL>
|
||||
<LI>ADDEDASFRIEND<BR>
|
||||
The player was added to the friend list of the other
|
||||
player who's name is in the szText parameter
|
||||
<LI>ADDEDASIGNOREE<BR>
|
||||
The player was added to the ignore list of the other
|
||||
player who's name is in the szText parameter
|
||||
<LI>REMOVEDASIGNOREE<BR>
|
||||
The player was removed from the ignore list of the other
|
||||
player who's name is in the szText parameter
|
||||
</UL>
|
||||
\param szText The actual message
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_SystemPage)(GSint iSubType,
|
||||
GSchar *szText);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_LoginDisconnection
|
||||
|
||||
/*!
|
||||
\brief Disconnection from router
|
||||
\par Description:
|
||||
This callback will be called when the client is disconnected
|
||||
from the router
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_LoginDisconnection)();
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_AccountCreationResult
|
||||
|
||||
/*!
|
||||
\brief Receive the status of the account creation request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after sending a account creation request
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_Disconnect()
|
||||
|
||||
\par Errors:
|
||||
ERRORSECURE_USERNAMEEXISTS: The account name already exists.<br>
|
||||
ERRORSECURE_USERNAMEMALFORMED: The account name does not match the format
|
||||
rules <code>^[a-zA-Z][a-zA-Z0-9_\.-]{2,14}$</code>.<br>
|
||||
ERRORSECURE_USERNAMEFORBIDDEN: The account name contains forbidden
|
||||
substrings (e.g. smut)<br>
|
||||
ERRORSECURE_USERNAMERESERVED: The account name is reserved<br>
|
||||
ERRORSECURE_PASSWORDMALFORMED: The password does not match the format
|
||||
rules <code>^.{2,16}$</code>.<br>
|
||||
ERRORSECURE_PASSWORDFORBIDDEN: The password contains the username<br>
|
||||
ERRORSECURE_DATABASEFAILED: There is a problem with the database.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_AccountCreationResult)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback CBLoginRcv_ModifyUserResult
|
||||
|
||||
/*!
|
||||
\brief Receive the status of the user modifycation request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after sending a user info modification request
|
||||
|
||||
\par Related Function:
|
||||
LoginSend_ModifyAccount()
|
||||
|
||||
\par Errors:
|
||||
ERRORSECURE_PASSWORDMALFORMED: The password does not match the format
|
||||
rules <code>^.{2,16}$</code>.<br>
|
||||
ERRORSECURE_PASSWORDFORBIDDEN: The password contains the username<br>
|
||||
ERRORSECURE_DATABASEFAILED: There is a problem with the database.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_ModifyUserResult)(GSubyte ubType,
|
||||
GSint iReason);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback DBLoginRcv_RequestMOTD
|
||||
|
||||
/*!
|
||||
\brief Receive the message of the day
|
||||
\par Description:
|
||||
This callback will be called when the client receives the MOTDs from the
|
||||
server. The messages will never be greater the MOTDLENGTH.
|
||||
|
||||
\par Related function:
|
||||
LoginSend_RequestMOTD()
|
||||
|
||||
\par Errors:
|
||||
ERRORROUTER_DBPROBLEM: There is a problem with the database.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param szUbiMOTD The message of the day for the Ubi.com Game Service
|
||||
\param szGameMOTD The message of the day for the game.
|
||||
\param iReason The reason for the failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBLoginRcv_RequestMOTD)(GSubyte ubType,
|
||||
GSchar *szUbiMOTD, GSchar *szGameMOTD, GSint iReason);
|
||||
|
||||
/*! @} end of group_LoginCB */
|
||||
|
||||
#endif //__GSLOGINCB_H_
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante <gsdevelopers@ubisoft.com>
|
||||
//* Date: 2001-09-20
|
||||
/*! \file GSPersistentCB.h
|
||||
* \brief Callback functions for the <b><i>persistent storage service</i></b>.
|
||||
*
|
||||
* This file contains all callback functions declaration for the persistent
|
||||
* storage service.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef _GSPersistentCB_H_
|
||||
#define _GSPersistentCB_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
class clPersistentCallbacks
|
||||
{
|
||||
public:
|
||||
|
||||
virtual GSvoid PSRcv_LoginResult(GSubyte ucType, GSint iReason) = 0;
|
||||
virtual GSvoid PSRcv_Disconnection() = 0;
|
||||
virtual GSvoid PSRcv_GetDataReply(GSubyte ucType, GSint iReason,GSuint iID,
|
||||
GSvoid *pData,GSint iSize) = 0;
|
||||
virtual GSvoid PSRcv_SetDataReply(GSubyte ucType, GSint iReason,
|
||||
GSuint iID) = 0;
|
||||
};
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
/*! @addtogroup group_PSCB Persistent
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBPSRcv_LoginResult
|
||||
|
||||
/*!
|
||||
\brief Receive status of the Persistent data storage login request
|
||||
\par Description:
|
||||
This callback will be called when the client receive a response from the
|
||||
router after asking to join the Persistent storage server
|
||||
\par Related Function:
|
||||
PSSend_Login()
|
||||
|
||||
\param ucType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param lReason The reason of failure if ucType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBPSRcv_LoginResult)(GSubyte ucType, GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBPSRcv_Disconnection
|
||||
/*!
|
||||
\brief Client as been disconnected from the Persistent storage service
|
||||
\par Description:
|
||||
This callback will be called when the client has been disconnected from the
|
||||
Persistent storage service
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBPSRcv_Disconnection)();
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBPSRcv_SetDataReply
|
||||
|
||||
/*!
|
||||
\brief Proxy reply on client request to set persistent data
|
||||
\par Description:
|
||||
This callback will be called when the client has set data using
|
||||
Persistent storage service
|
||||
|
||||
\param ucType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ucType is GSFAIL
|
||||
\param iID The id of the request
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBPSRcv_SetDataReply)(GSubyte ucType, GSint iReason,
|
||||
GSuint iID);
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBPSRcv_GetDataReply
|
||||
|
||||
/*!
|
||||
\brief Proxy reply on client request to get persistent data
|
||||
\par Description:
|
||||
This callback will be called when the client ask for persistent
|
||||
data using the Persistent storage service
|
||||
|
||||
\param ucType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param iReason The reason of failure if ucType is GSFAIL
|
||||
\param iID The id of the request
|
||||
\param pData Pointer to the data buffer
|
||||
\param iSize Size of the data buffer
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBPSRcv_GetDataReply)(GSubyte ucType, GSint iReason,
|
||||
GSuint iID,GSvoid *pData,GSint iSize);
|
||||
|
||||
#endif //_GSPersistentCB_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef __GSREMOTEALGORITHMCB_H__
|
||||
#define __GSREMOTEALGORITHMCB_H__
|
||||
|
||||
// remote algorithm execution service definitions
|
||||
#include "RemoteAlgorithmDefines.h"
|
||||
|
||||
// error code system
|
||||
#include "GSErrors.h"
|
||||
|
||||
/*! @addtogroup group_RAECB
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Callback RemoteAlgorithm_OutputCB
|
||||
|
||||
/*!
|
||||
\brief Callback that will receive the output of an algorithm
|
||||
\par Description:
|
||||
This callback will be called with the output of a previously called
|
||||
remote algorithm.
|
||||
<BR>
|
||||
Related function : RemoteAlgorithm_Execute()
|
||||
|
||||
\param pData Custom data passed at the RemoteAlgorithm_Execute()
|
||||
call
|
||||
\param uiRequestId Identifier of the request being replied
|
||||
\param rResult Result code of the execution. Possible values are:
|
||||
<UL>
|
||||
<LI>GSS_OK
|
||||
<BR>There was no error
|
||||
<LI>GSE_DBFAILURE
|
||||
<BR>An error occured on the DB while processing
|
||||
the algorithm. The ubi.com server logs will
|
||||
contain the exact nature of the error.
|
||||
<LI>GSE_UNEXPECTED
|
||||
<BR>This is an internal error meaning that either
|
||||
the request or the reply was in a format that
|
||||
could not be decoded.
|
||||
<LI>GSE_HOSTUNREACHABLE
|
||||
<BR>The remote algorithm execution service is
|
||||
not available.
|
||||
</UL>
|
||||
\param pOutput An array of output values from the algorithm.
|
||||
You do not have ownership of this array. The
|
||||
memory will be freed when the callback function
|
||||
returns.
|
||||
\param uiNumOutput The number of values in the output array
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *RemoteAlgorithm_OutputCB)(
|
||||
const GSvoid * pData, GSuint uiRequestId, GSRESULT rResult,
|
||||
const RAE_VALUE * pOutput, GSuint uiNumOutput);
|
||||
|
||||
/*! @} end of group_RAECB */
|
||||
|
||||
#endif // __GSREMOTEALGORITHMCB_H__
|
||||
@@ -0,0 +1,67 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante
|
||||
/*! \file LadderDefines.h
|
||||
* \brief Definitions for the ladder query service
|
||||
*
|
||||
* This file defines global values and structures for the ladder query service.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
#ifndef __LADDERDEFINES_H__
|
||||
#define __LADDERDEFINES_H__
|
||||
|
||||
#include "define.h"
|
||||
#include "GSTypes.h"
|
||||
|
||||
#define LADDER_QUERY_VERSION 1 //!< Version of the ladder query service.
|
||||
|
||||
#define LADDER_NAME_LENGTH 1025 //!< Length of a string representing the ladder name.
|
||||
#define LADDER_FIELDNAME_LENGTH 129 //!< Length of a string representing a field name in the ladder.
|
||||
#define LADDER_FIELDCAPTION_LENGTH 33 //!< Length of a string representing a ladder field name.
|
||||
#define LADDER_FIELDVALUE_LENGTH 129 //!< Length of a string representing a ladder field value.
|
||||
|
||||
/*!
|
||||
\enum E_FILTER_OPERATOR
|
||||
\brief Filter operator enumeration.
|
||||
|
||||
This enumeration contains the valid operators that are used in the LADDER_FILTER structure.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FILTER_EQUAL,
|
||||
FILTER_ABOVE,
|
||||
FILTER_BELOW
|
||||
} E_FILTER_OPERATOR;
|
||||
|
||||
/*!
|
||||
\struct LADDER_FILTER
|
||||
\brief Ladder filter structure.
|
||||
|
||||
This structure defines a ladder filter that can be used with the fonction LadderQuery_AddFilterConstraint() .
|
||||
It is used to filter results based on a numeric value using the operators EQUAL,ABOVE or BELOW defined in the
|
||||
E_FILTER_OPERATOR enumeration.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
GSchar szFieldName[LADDER_FIELDNAME_LENGTH]; //!< Name of the field that need to be compared against reference value.
|
||||
E_FILTER_OPERATOR eOperator; //!< Logical operator to do comparison.
|
||||
GSint iValue; //!< Reference value used to filter.
|
||||
} LADDER_FILTER;
|
||||
|
||||
|
||||
/*!
|
||||
\struct LADDER_ROW
|
||||
\brief Ladder row representation
|
||||
|
||||
This structure defines the representation of a row of ladder values. It is used
|
||||
by the LobbyRcv_MatchFinalResult callback.
|
||||
*/
|
||||
struct LADDER_ROW
|
||||
{
|
||||
GSchar player[NAMELENGTH];
|
||||
GSushort valueCount;
|
||||
GSint * values;
|
||||
};
|
||||
|
||||
#endif //__LADDERDEFINES_H__
|
||||
109
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/LobbyDefines.h
Normal file
109
Ubisoft.com/GSServices/SDKS64/gs-sdk-base/include/LobbyDefines.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
* UbiSoft Network Development
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: LobbyDefines.h
|
||||
* CREATION....: October 2001
|
||||
* AUTHOR......: GS Dev
|
||||
*
|
||||
* DESCRIPTION.: Miscelleanous definitions for the Lobby server
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
#ifndef __LOBBYDEFINES_H__
|
||||
#define __LOBBYDEFINES_H__
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
|
||||
//-------------------- Group Type ------------------------------
|
||||
// Constant ----> Name in gslobbyserver.conf
|
||||
const GSushort LOBBY = 0; //"LOBBY"
|
||||
const GSushort ROOM_DIRECTPLAY_CLIENTSERVER = 1; //"DIRECTPLAY_CLIENTSERVER"
|
||||
const GSushort ROOM_DIRECTPLAY_P2P = 2; //"DIRECTPLAY_P2P"
|
||||
const GSushort ROOM_HYBRID = 3; //"HYBRID"
|
||||
const GSushort ROOM_HYBRID_REGSERVER = 4; //"HYBRID_REGSERVER"
|
||||
const GSushort ROOM_UBI_CLIENTHOST = 5; //"UBI_CLIENTHOST"
|
||||
const GSushort ROOM_UBI_CLIENTHOST_REGSERVER = 6; //"UBI_CLIENTHOST_REGSERVER"
|
||||
const GSushort ROOM_UBI_P2P = 7; //"UBI_P2P"
|
||||
const GSushort ROOM_UBI_GAMESERVER = 8; //"UBI_GAMESERVER"
|
||||
const GSushort ROOM_UBI_GAMESERVER_REGSERVER = 9; //"UBI_GAMESERVER_REGSERVER"
|
||||
const GSushort ROOM_REGSERVER = 10; //"REGISTER_SERVER"
|
||||
|
||||
//------------------------ Group and Game Masks ------------------------------
|
||||
const GSuint LSM_PRIVATE = 1 << 0; //The group is protected by a password
|
||||
const GSuint LSM_NEEDMASTER = 1 << 1; //The group need a master
|
||||
const GSuint LSM_ETERNEL = 1 << 2; //The group is eternel ie when no player is on the group it is not deleted
|
||||
const GSuint LSM_ACTIVE = 1 << 3; //The game is started
|
||||
const GSuint LSM_OPEN = 1 << 4; //The group is open
|
||||
const GSuint LSM_STARTABLE = 1 << 5; //The group can be started
|
||||
const GSuint LSM_MATCHACTIVE = 1 << 12; //The match is started
|
||||
|
||||
const GSuint LSM_CREATE_SUBLOBBY = 1 << 9; //Allow to create sublobby
|
||||
const GSuint LSM_OPEN_WHEN_ACTIVE = 1 << 10; //When the game is started the group is still open
|
||||
const GSuint LSM_SCORES_SUBMISSION = 1 << 11; //Allow score submission
|
||||
const GSuint LSM_DEDICATEDSERVER = 1 << 14; //The group represent a dedicated server
|
||||
const GSuint LSM_REGISTERSERVER = 1 << 13;
|
||||
const GSuint LSM_JOINRULE = 1 << 15; //The access to the group is protected by a rule ( use with passport )
|
||||
const GSuint LSM_CREATERULE = 1 << 16; //The group caretion is restricted by a rule ( use with passport )
|
||||
|
||||
|
||||
//--------------- Join info Masks ----------------------------------------------------
|
||||
const GSuint LSM_GROUPINFO = 1 << 6; //Get the group info
|
||||
const GSuint LSM_GROUPMEMBERS = 1 << 7; //Get the group members
|
||||
const GSuint LSM_CHILDGROUPINFO = 1 << 8; //Get the childs group info
|
||||
|
||||
const GSuint LSM_ALLINFO = LSM_GROUPINFO | LSM_GROUPMEMBERS | LSM_CHILDGROUPINFO;
|
||||
|
||||
//------------------- Player Status ----------------------------
|
||||
const GSushort PS_SILENT = 1 << 0; //The player is limited ( doesn't access to chat, page, etc ... )
|
||||
const GSushort PS_GAMECONNECTED = 1 << 1; //The player is playing a game
|
||||
const GSushort PS_GAMEREADY = 1 << 2; //not implemented yet
|
||||
const GSushort PS_MATCHREADY = 1 << 3; //not implemented yet
|
||||
const GSushort PS_MATCHPLAYING = 1 << 4; //The player is playing a match
|
||||
|
||||
//-------------------- error messages -------------------------
|
||||
const GSushort ERRORLOBBYSRV_UNKNOWNERROR = 0;
|
||||
const GSushort ERRORLOBBYSRV_GROUPNOTEXIST = 1;
|
||||
const GSushort ERRORLOBBYSRV_GAMENOTALLOWED = 2;
|
||||
const GSushort ERRORLOBBYSRV_SPECTATORNOTALLOWED = 4;
|
||||
const GSushort ERRORLOBBYSRV_NOMOREPLAYERS = 5;
|
||||
const GSushort ERRORLOBBYSRV_NOMORESPECTATORS = 6;
|
||||
const GSushort ERRORLOBBYSRV_NOMOREMEMBERS = 7;
|
||||
const GSushort ERRORLOBBYSRV_MEMBERNOTREGISTERED = 8;
|
||||
const GSushort ERRORLOBBYSRV_GAMEINPROGRESS = 9;
|
||||
const GSushort ERRORLOBBYSRV_WRONGGAMEVERSION = 10;
|
||||
const GSushort ERRORLOBBYSRV_PASSWORDNOTCORRECT = 11;
|
||||
const GSushort ERRORLOBBYSRV_ALREADYINGROUP = 12;
|
||||
const GSushort ERRORLOBBYSRV_NOTMASTER = 13;
|
||||
const GSushort ERRORLOBBYSRV_NOTINGROUP = 14;
|
||||
const GSushort ERRORLOBBYSRV_MINPLAYERSNOTREACH = 15;
|
||||
const GSushort ERRORLOBBYSRV_CONNECTADDCONNECTION = 16;
|
||||
const GSushort ERRORLOBBYSRV_CONNECTSENDLOGINMSG = 17;
|
||||
const GSushort ERRORLOBBYSRV_ERRORLOGINMESSAGE = 18;
|
||||
const GSushort ERRORLOBBYSRV_NOHOSTLOBBYSERVER = 19;
|
||||
const GSushort ERRORLOBBYSRV_LOBBYSRVDISCONNECTED = 20;
|
||||
const GSushort ERRORLOBBYSRV_INVALIDGROUPNAME = 21;
|
||||
const GSushort ERRORLOBBYSRV_INVALIDGAMETYPE = 22;
|
||||
const GSushort ERRORLOBBYSRV_NOMOREGAMEMODULE = 23;
|
||||
const GSushort ERRORLOBBYSRV_CREATENOTALLOWED = 24;
|
||||
const GSushort ERRORLOBBYSRV_GROUPCLOSE = 25;
|
||||
const GSushort ERRORLOBBYSRV_WRONGGROUPTYPE = 26;
|
||||
const GSushort ERRORLOBBYSRV_MEMBERNOTFOUND = 27;
|
||||
const GSushort ERRORLOBBYSRV_MATCHNOTEXIST = 30;
|
||||
const GSushort ERRORLOBBYSRV_MATCHNOTFINISHED = 31;
|
||||
const GSushort ERRORLOBBYSRV_GAMENOTINITIATED = 32;
|
||||
const GSushort ERRORLOBBYSRV_BEGINALREADYDONE = 33;
|
||||
const GSushort ERRORLOBBYSRV_MATCHALREADYFINISHEDFORYOU = 34;
|
||||
const GSushort ERRORLOBBYSRV_MATCHSCORESSUBMISSIONEVENTFAIL = 35;
|
||||
const GSushort ERRORLOBBYSRV_MATCHSCORESSUBMISSIONALREDYSENT = 36;
|
||||
const GSushort ERRORLOBBYSRV_MATCHRESULTSPROCESSNOTFINISHED = 37;
|
||||
const GSushort ERRORLOBBYSRV_MEMBERBANNED = 38;
|
||||
const GSushort ERRORLOBBYSRV_PASSPORTFAIL = 39;
|
||||
const GSushort ERRORLOBBYSRV_NOTCREATOR = 40;
|
||||
const GSushort ERRORLOBBYSRV_GAMENOTFINISHED = 41;
|
||||
const GSushort ERRORLOBBYSRV_PASSPORTTIMEOUT = 42;
|
||||
const GSushort ERRORLOBBYSRV_PASSPORTNOTFOUND = 43;
|
||||
const GSushort ERRORLOBBYSRV_GROUPALREADYEXIST = 44;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef __REMOTEALGORITHMDEFINES_H__
|
||||
#define __REMOTEALGORITHMDEFINES_H__
|
||||
|
||||
/*!
|
||||
\struct
|
||||
\brief INPUT/OUTPUT Supported Data Types
|
||||
|
||||
This structure defines the data types that are supported as inputs and outputs
|
||||
by remote algorithms.
|
||||
*/
|
||||
enum RAE_DATATYPE {
|
||||
RAE_INTEGER //!< Any integer value (char, short, int, etc)
|
||||
};
|
||||
|
||||
/*!
|
||||
\struct RAE_VALUE
|
||||
\brief INPUT/OUTPUT Element
|
||||
|
||||
This structure defines the value elements that are to be used as inputs and
|
||||
outputs to the executed algorithm. This allows to create arrays of multiple
|
||||
different type of data (once the structure handles more than just integers).
|
||||
*/
|
||||
struct RAE_VALUE
|
||||
{
|
||||
RAE_DATATYPE dataType; //!< The type of data this node contains
|
||||
union
|
||||
{
|
||||
GSint intValue; //!< Field for an integer value
|
||||
};
|
||||
};
|
||||
|
||||
#endif // __REMOTEALGORITHMDEFINES_H__
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
/***SDOC*******************************************************************************************
|
||||
* UbiSoft Network Development
|
||||
* ---------------------------
|
||||
*
|
||||
* FILE........: CDKeyDefines.h
|
||||
* CREATION....: May 2002
|
||||
* AUTHOR......: Guillaume Plante
|
||||
*
|
||||
* DESCRIPTION.: This file contains numeric definition for the CDKey-system size and error #
|
||||
*
|
||||
**************************************************************************************************
|
||||
* FILE HISTORY
|
||||
**************************************************************************************************
|
||||
*
|
||||
* DATE........:
|
||||
* AUTHOR......:
|
||||
* DESCRIPTION.:
|
||||
*
|
||||
******************************************************************************************EDOC***/
|
||||
|
||||
|
||||
#ifndef _CDKEY_DEFINES_H_
|
||||
#define _CDKEY_DEFINES_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
//-------------------- player status ------------------------------
|
||||
|
||||
enum CDKEY_PLAYER_STATUS
|
||||
{
|
||||
E_PLAYER_UNKNOWN,
|
||||
E_PLAYER_INVALID,
|
||||
E_PLAYER_VALID
|
||||
};
|
||||
|
||||
//-------------------- defined sizes ------------------------------
|
||||
|
||||
const GSuint ACTIVATION_ID_SIZE = 16;
|
||||
const GSuint AUTHORIZATION_ID_SIZE = 20;
|
||||
const GSuint CDKEY_SIZE = 23;
|
||||
const GSuint CDKEY_ID_SIZE = 20;
|
||||
const GSuint CHALLENGE_SIZE = 5;
|
||||
const GSuint VALIDATION_KEY_SIZE = 20;
|
||||
const GSuint GLOBAL_ID_SIZE = 16;
|
||||
|
||||
//-------------------- error codes --------------------------------
|
||||
|
||||
const GSushort ERRORCDKEY_SUCCESS = 0;
|
||||
const GSushort ERRORCDKEY_TIMEOUT = 1;
|
||||
const GSushort ERRORCDKEY_INVALID_CDKEY = 2;
|
||||
const GSushort ERRORCDKEY_NOT_CHALLENGED = 3;
|
||||
const GSushort ERRORCDKEY_ALREADY_ONLINE = 4;
|
||||
const GSushort ERRORCDKEY_INTERNAL_ERROR = 5;
|
||||
|
||||
#endif //_CDKEY_DEFINES_H_
|
||||
@@ -0,0 +1,239 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
//* Date: 2002-06-06 15:47:17
|
||||
/*! \file GSCDKeyCallbacks.h
|
||||
* \brief Callback definitions and register functionalities
|
||||
*
|
||||
* This file contains the callback definitions and register functionalities
|
||||
* for the cd key interface
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef _GSCDKEYCALLBACKS_H_
|
||||
#define _GSCDKEYCALLBACKS_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "GSCDKeyDefines.h"
|
||||
|
||||
|
||||
/*! @defgroup group4 Game client callback
|
||||
\brief Game client callback
|
||||
|
||||
These callback function are used by the game client to
|
||||
process response to queries sent to the validation server
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBCDKey_RcvActivationID
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:34:14
|
||||
/*!
|
||||
\brief Received a activation id request response from the validation server
|
||||
\par Description:
|
||||
This callback will be called whenever the game client receive a response
|
||||
after requesting the validation server for a activation id.
|
||||
|
||||
\param psReplyInfo Pointer to a reply information structure that contains
|
||||
request id and status
|
||||
\param psValidationServerInfo Validation server information from where the
|
||||
response came
|
||||
\param pucActivationID The activation id in case the request succedded
|
||||
\param pucGlobalID The unique global identifier of the CDKey
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBCDKey_RcvActivationID)(PREPLY_INFORMATION psReplyInfo,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,GSubyte *pucActivationID,GSubyte *pucGlobalID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBCDKey_RcvAuthorizationID
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:38:23
|
||||
/*!
|
||||
\brief Received a authorization id request response from the validation server
|
||||
\par Description:
|
||||
This callback will be called whenever the game client receive a response
|
||||
after requesting the validation server for a authorization id.
|
||||
|
||||
\param psReplyInfo Pointer to a reply information structure that contains
|
||||
request id and status
|
||||
\param psValidationServerInfo Validation server information from where the
|
||||
response came
|
||||
\param pucAuhorizationID The authorization id in case the request succedded
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBCDKey_RcvAuthorizationID)(PREPLY_INFORMATION psReplyInfo,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,GSubyte *pucAuhorizationID);
|
||||
|
||||
/*! @} end of group4 */
|
||||
|
||||
/*! @defgroup group5 Game server callback
|
||||
\brief Game server callback
|
||||
|
||||
These callback function are used by the game server to
|
||||
process response to queries sent to or by the validation server
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBCDKey_RcvValidationResponse
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:44:57
|
||||
/*!
|
||||
\brief Received a validation status for a player from the validation server
|
||||
\par Description:
|
||||
This callback will be called whenever the game server receives a validation
|
||||
status for a player after having sent a validation status query to the
|
||||
validation server. It will inform the game server of the player validation status
|
||||
so that the game server can choose to keep or disconnect the user.
|
||||
|
||||
\param psReplyInfo Pointer to a reply information structure that contains
|
||||
request id and status
|
||||
\param psValidationServerInfo Validation server information from where the
|
||||
response came
|
||||
\param pucAuhorizationID The authorization id in the query
|
||||
\param eStatus The validation status of the player
|
||||
\param pucGlobalID The unique global identifier of the CDKey
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBCDKey_RcvValidationResponse)(PREPLY_INFORMATION psReplyInfo,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,GSubyte *pucAuhorizationID,CDKEY_PLAYER_STATUS eStatus,GSubyte *pucGlobalID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBCDKey_RcvPlayerStatusRequest
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:49:13
|
||||
/*!
|
||||
\brief Receive a player status request from the validation server
|
||||
\par Description:
|
||||
This callback will be called whenever the game server receives a player
|
||||
status request from the validation server. The game server should then
|
||||
respond to this query with the function GSCDKey_PlayerStatusReply
|
||||
to inform the validation server of the player status. The status
|
||||
should be E_PLAYER_UNKNOWN if the player is not on the game server
|
||||
at the moment of the request.
|
||||
|
||||
\param psValidationServerInfo Validation server information from where the
|
||||
response came
|
||||
\param pucAuhorizationID The authorization id of the concerned player
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBCDKey_RcvPlayerStatusRequest)(PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID);
|
||||
|
||||
|
||||
/*! @} end of group5 */
|
||||
|
||||
/*! @defgroup group6 Callback register functions
|
||||
\brief Callback register functions
|
||||
These functions are used to register the callback for a created cd key module
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_FixRcvActivationID
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:56:15
|
||||
/*!
|
||||
\brief Register the callback
|
||||
\par Description:
|
||||
This function is used to register the callback CBCDKey_RcvActivationID
|
||||
in the library. If this is not correctly called, the callback will
|
||||
nerver be triggered.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param fRcvActivationID Function of type CBCDKey_RcvActivationID
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GSCDKey_FixRcvActivationID(GShandle pGSCDKeyHandle,CBCDKey_RcvActivationID fRcvActivationID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_FixRcvAuthorizationID
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:58:29
|
||||
/*!
|
||||
\brief Register the callback
|
||||
\par Description:
|
||||
This function is used to register the callback CBCDKey_RcvAuthorizationID
|
||||
in the library. If this is not correctly called, the callback will
|
||||
nerver be triggered.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param fRcvAuthorizationID Function of type CBCDKey_RcvAuthorizationID
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GSCDKey_FixRcvAuthorizationID(GShandle pGSCDKeyHandle,CBCDKey_RcvAuthorizationID fRcvAuthorizationID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_FixRcvValidationResponse
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:58:37
|
||||
/*!
|
||||
\brief Register the callback
|
||||
\par Description:
|
||||
This function is used to register the callback CBCDKey_RcvValidationResponse
|
||||
in the library. If this is not correctly called, the callback will
|
||||
nerver be triggered.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param fRcvValidationResponse Function of type CBCDKey_RcvValidationResponse
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GSCDKey_FixRcvValidationResponse(GShandle pGSCDKeyHandle,CBCDKey_RcvValidationResponse fRcvValidationResponse);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_FixRcvPlayerStatusRequest
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:58:50
|
||||
/*!
|
||||
\brief Register the callback
|
||||
\par Description:
|
||||
This function is used to register the callback CBCDKey_RcvPlayerStatusRequest
|
||||
in the library. If this is not correctly called, the callback will
|
||||
nerver be triggered.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param fRcvPlayerStatusRequest Function of type CBCDKey_RcvPlayerStatusRequest
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GSCDKey_FixRcvPlayerStatusRequest(GShandle pGSCDKeyHandle,CBCDKey_RcvPlayerStatusRequest fRcvPlayerStatusRequest);
|
||||
|
||||
/*! @} end of group6 */
|
||||
|
||||
#endif //_GSCDKEYCALLBACKS_H_
|
||||
@@ -0,0 +1,68 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
//* Date: 2002-06-06 15:20:01
|
||||
/*! \file GSCDKeyDefines.h
|
||||
* \brief Structure definitions used in the cd key interface
|
||||
*
|
||||
* This file contains the different structure definitions used in the
|
||||
* cd key interface
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef _GSCDKEYDEFINES_H_
|
||||
#define _GSCDKEYDEFINES_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "define.h"
|
||||
#include "CDKeyDefines.h"
|
||||
|
||||
typedef GSuint GSCDKeyRequest; //!< Request identifier
|
||||
|
||||
|
||||
/*!
|
||||
\brief Reply information structure (callback usage)
|
||||
|
||||
This structure contains the data associated with a response to a request sent to the validation server
|
||||
*/
|
||||
typedef struct _REPLY_INFORMATION
|
||||
{
|
||||
GSCDKeyRequest CDKeyRequest; //!< The cd key request id
|
||||
GSbool bSucceeded; //!< GS_TRUE is the request is a success, GS_FALSE else
|
||||
GSushort usErrorID; //!< The error id in case of failure (0 in case of success)
|
||||
} REPLY_INFORMATION,*PREPLY_INFORMATION;
|
||||
|
||||
/*!
|
||||
\brief Validation server information structure
|
||||
|
||||
This structure contains the validation server information that is used when sending data
|
||||
*/
|
||||
typedef struct _VALIDATION_SERVER_INFO
|
||||
{
|
||||
GSchar szIPAddress[IPADDRESSLENGTH]; //!< The ipaddress of the validation server
|
||||
GSushort usPort; //!< The port the validation server will listen to
|
||||
} VALIDATION_SERVER_INFO,*PVALIDATION_SERVER_INFO;
|
||||
|
||||
|
||||
/*!
|
||||
\brief Activation information structure
|
||||
|
||||
This structure contains the activation information needed when requesting for a activation id
|
||||
*/
|
||||
typedef struct _ACTIVATION_INFO
|
||||
{
|
||||
GSchar szGameName[GAMELENGTH]; //!< The name of the game
|
||||
GSchar szCDKey[CDKEY_SIZE + 1]; //!< The user's cd key
|
||||
} ACTIVATION_INFO,*PACTIVATION_INFO;
|
||||
|
||||
/*!
|
||||
\brief Validation information structure
|
||||
|
||||
This structure contains the validation information needed when requesting for cd key validation
|
||||
*/
|
||||
typedef struct _VALIDATION_INFO
|
||||
{
|
||||
GSubyte ucActivationID[ACTIVATION_ID_SIZE]; //!< The activation id associated with a cd key
|
||||
GSchar szCDKey[CDKEY_SIZE + 1]; //!< The user's cd key
|
||||
} VALIDATION_INFO,*PVALIDATION_INFO;
|
||||
|
||||
#endif //_GSCDKEYDEFINES_H_
|
||||
@@ -0,0 +1,327 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
//* Date: 2002-06-06 10:49:52
|
||||
/*! \file GSCDKeyInterface.h
|
||||
* \brief Interface ubi.com's cd key validation library.
|
||||
*
|
||||
* This interface provides game server and game client functionality
|
||||
* to activate and validate a user's cd key.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
/*!
|
||||
\mainpage gs-sdk-cdkey
|
||||
\section intro Introduction
|
||||
ubi.com cd key validation system interface
|
||||
|
||||
|
||||
\section description Description
|
||||
This sdk provides functionalities for a game developper to add a cd key validation
|
||||
mechanism in his project. This system works along the ubi.com validation server.
|
||||
|
||||
It includes game server side functionalities:
|
||||
- Get a player validation status
|
||||
- Inform the validation server of the player status
|
||||
|
||||
and game client side functionalities:
|
||||
- Request cd key activation (once)
|
||||
- Request cd key validation
|
||||
|
||||
<b>Note for game client side:</b><br>
|
||||
The cd key activation is done once before the first cd key athorization request.
|
||||
After requesting for a cd key activation , the user will receive a activation id
|
||||
that should be kept safely to be use in all futur authorization request before joining
|
||||
a game server.
|
||||
|
||||
<b>Note for game server side:</b><br>
|
||||
The game server will need to ask the validation server for a player
|
||||
validation status (VALID or INVALID) before choosing to disconnect or to keep the player,
|
||||
this is done after the game server has received the authorization id of the game client
|
||||
that want to join.
|
||||
|
||||
These are the chronological steps needed to be accomplish in a client validation
|
||||
from a game server and game client point of view. The first step(1) must be accomplish
|
||||
only once, when the game client does not possess his ACTIVATION ID.
|
||||
|
||||
1. The game client get his ACTIVATION ID from the validation server using the
|
||||
GSCDKey_RequestActivation() function call. <b>This is done once</b> or
|
||||
if the client does not possess a ACTIVATION ID. The ACTIVATION ID should be
|
||||
kept localy in a file or in the registry for further access.
|
||||
|
||||
2. The game client get his AUTHORIZATION ID from the validation server using the
|
||||
GSCDKey_RequestAuthorization() function call. This step will be done every time
|
||||
a client want to join a game server, the client needs a new authorization id
|
||||
each time he want to join a game server. If this call fails the client has 2 choice:
|
||||
- send the request again using GSCDKey_RequestAuthorization() using a bigger timeout
|
||||
value (if the error was caused by a timeout)
|
||||
- use the last authorization id received the last time the user joined a game server.
|
||||
(there is a chance that the validation of this old authorization id will fail
|
||||
if the latter has timed-out on the validation server side)
|
||||
|
||||
3. After connecting to the game server, the game client send his AUTHORIZATION ID to the game server.
|
||||
|
||||
4. After the game server have received a client connection and AUTHORIZATION ID,
|
||||
he validate the client using the GSCDKey_ValidateUser() function call. The
|
||||
status of the player (CDKEY_PLAYER_STATUS) will be returned via the callback
|
||||
CBCDKey_RcvValidationResponse(). If this request does not succeed, and that the error
|
||||
code is ERRORCDKEY_TIMEOUT it is recommended that the request be sent again
|
||||
with a bigger timeout value. If a ERRORCDKEY_TIMEOUT error still occurs after that,
|
||||
the ubi.com network may have problems. It is however recommended that the game server
|
||||
does not let the player connect. Otherwise, it may lead to :
|
||||
- hacks in the game to force a timeout
|
||||
- attacks on ubi.com server to have request time out
|
||||
|
||||
Recommendations after the game server has receive the player status via the
|
||||
GSCDKey_ValidateUser() callback:
|
||||
- if the player status is E_PLAYER_UNKNOWN or E_PLAYER_INVALID the game server should
|
||||
disconnect the player.
|
||||
- if the player status is E_PLAYER_VALID the game server should keep the player.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _GSCDKEYINTERFACE_H_
|
||||
#define _GSCDKEYINTERFACE_H_
|
||||
|
||||
#include "GSCDKeyDefines.h"
|
||||
#include "GSCDKeyCallbacks.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*! @defgroup group1 General functionalities
|
||||
\brief General functionalities
|
||||
|
||||
These functions are used both by the game client and game server.
|
||||
They are use to initialize, uninitialize the library and process
|
||||
incomming/outgoing messages.
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_Initialize
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 10:51:55
|
||||
/*!
|
||||
\brief Initialize the cd key library
|
||||
\par Description:
|
||||
This function will initialize the cd key library, on success
|
||||
it will return a handle that can be use for futur calls on this service.
|
||||
The provided port will be reserved for library communication and will be
|
||||
freed once the library is uninitialized, if the supplied port is not available
|
||||
(already binded) on the local machine, the initialization will fail.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval Handle on the created cd key module
|
||||
\retval 0 if the operation failed
|
||||
|
||||
\param usPort The port on wich the client will listen to.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GShandle __stdcall GSCDKey_Initialize(GSushort usPort);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_Uninitialize
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 10:58:49
|
||||
/*!
|
||||
\brief Uinitialize a cd key handle or the whole library
|
||||
\par Description:
|
||||
This function will uninitialize a provided cd key handle or
|
||||
it will uninitialize all cd key handle if no argument are supplied.
|
||||
|
||||
\return void
|
||||
|
||||
\param pGSCDKeyHandle Handle on the cd key module
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall GSCDKey_Uninitialize(GShandle pGSCDKeyHandle = 0);
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_Engine
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 11:06:12
|
||||
/*!
|
||||
\brief Message pump
|
||||
\par Description:
|
||||
This function send outgoing messages and process incomming messages.
|
||||
To insure smooth operation of the library, this function should be called
|
||||
at least 10 time a second. It will return GS_FALSE if the provided
|
||||
cd key handle is not valid.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param pGSCDKeyHandle Handle on the cd key module
|
||||
\param uiMaxDelay Maximum number of milisecond spent on processing messages
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GSCDKey_Engine(GShandle pGSCDKeyHandle,GSuint uiMaxDelay = 500);
|
||||
|
||||
/*! @} end of group1 */
|
||||
|
||||
/*! @defgroup group2 Game server functionalities
|
||||
\brief Game server functionalities
|
||||
|
||||
These functions are used by the game server to
|
||||
ask the validation status of a player, inform the
|
||||
validation server of a player status and disconnection.
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_ValidateUser
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 13:23:34
|
||||
/*!
|
||||
\brief Ask the validation server for a validation status of a player
|
||||
\par Description:
|
||||
This function is used to ask the validation server for a validation status
|
||||
of a player after the latter has connected on the game server. The game server
|
||||
will received the result via the CBCDKey_RcvValidationResponse callback.
|
||||
|
||||
\return The id of the request
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param psValidationServerInfo Validation server information
|
||||
\param pucAuhorizationID Authorization id sent by the game client
|
||||
\param szGameName Name of the game on the game server
|
||||
\param usTimeout Number of second before the request is considered timed out
|
||||
default for this request is 3. 0 means a unlimited timeout value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSCDKeyRequest __stdcall GSCDKey_ValidateUser(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID,GSchar *szGameName,
|
||||
GSushort usTimeout = 3);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_DisconnectUser
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 13:57:12
|
||||
/*!
|
||||
\brief Inform the validation server that a player has disconnected
|
||||
\par Description:
|
||||
This function is used to inform the validation server that a player
|
||||
has disconnected from the game server. This must be called whenever a game
|
||||
server detects a client disconnection.
|
||||
|
||||
\return The id of the request
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param psValidationServerInfo Validation server information
|
||||
\param pucAuhorizationID Authorization id of the game client
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSCDKeyRequest __stdcall GSCDKey_DisconnectUser(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_PlayerStatusReply
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 13:59:14
|
||||
/*!
|
||||
\brief Inform the validation server of a player status
|
||||
\par Description:
|
||||
This function is used to inform the validation server of a player status.
|
||||
This must be called with the correct status for a player whenever the game server
|
||||
receive a status request from the validation server via the
|
||||
CBCDKey_RcvPlayerStatusRequest callback.
|
||||
|
||||
\return The id of the request
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param psValidationServerInfo Validation server information
|
||||
\param pucAuhorizationID Authorization id of the game client
|
||||
\param eStatus Status of the player
|
||||
*/
|
||||
//============================================================================
|
||||
GSCDKeyRequest __stdcall GSCDKey_PlayerStatusReply(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
GSubyte *pucAuhorizationID,CDKEY_PLAYER_STATUS eStatus);
|
||||
|
||||
/*! @} end of group2 */
|
||||
/*! @defgroup group3 Game client functionalities
|
||||
\brief Game client functionalities
|
||||
|
||||
These functions are used by the game client to
|
||||
request a activation and validation information
|
||||
from the validation server.
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_RequestActivation
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:05:39
|
||||
/*!
|
||||
\brief Request cd key activation id for futur authorization request (called once)
|
||||
\par Description:
|
||||
This function is used to get the activation id that will be use in
|
||||
futur client authentication. This function should be called the first
|
||||
time a cd key authentication is needed (i.g. the first time a user plays
|
||||
online after the game installation). The activation id should be safely
|
||||
kept so that each subsequent authorization request use that activation id.
|
||||
After calling this request, the result will be returned via the
|
||||
CBCDKey_RcvActivationID callback. 0 means a unlimited timeout value.
|
||||
|
||||
\return The id of the request
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param psValidationServerInfo Validation server information
|
||||
\param psActivationInfo Validation information
|
||||
\param usTimeout Number of second before the request is considered timed out
|
||||
default for this request is 6. 0 means a unlimited timeout value.
|
||||
*/
|
||||
//============================================================================
|
||||
GSCDKeyRequest __stdcall GSCDKey_RequestActivation(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
PACTIVATION_INFO psActivationInfo,
|
||||
GSushort usTimeout = 6);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GSCDKey_RequestAuthorization
|
||||
// Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
// Date: 2002-06-06 14:16:15
|
||||
/*!
|
||||
\brief Send a authorization request to the validation server
|
||||
\par Description:
|
||||
This function is used to validate a cd key before joining a game server.
|
||||
The validation information structure contains the activation id and
|
||||
the cd key. After having receive the result from this request via the
|
||||
CBCDKey_RcvAuthorizationID callback, the user can join a game server
|
||||
wich will ask the validation server for the player status (authenticated or not)
|
||||
|
||||
\return The id of the request
|
||||
|
||||
\param pGSCDKeyHandle Handle on the created cd key module
|
||||
\param psValidationServerInfo Validation server information
|
||||
\param psValidationInfo Validation information
|
||||
\param usTimeout Number of second before the request is considered timed out
|
||||
default for this request is 3. 0 means a unlimited timeout value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSCDKeyRequest __stdcall GSCDKey_RequestAuthorization(GShandle pGSCDKeyHandle,
|
||||
PVALIDATION_SERVER_INFO psValidationServerInfo,
|
||||
PVALIDATION_INFO psValidationInfo,
|
||||
GSushort usTimeout = 3);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
/*! @} end of group3 */
|
||||
#endif //_GSCDKEYINTERFACE_H_
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,369 @@
|
||||
//****************************************************************************
|
||||
//* Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
//* Date: 5/15/01 3:36:04 PM
|
||||
/*! \file GLIRCCallbacks.h
|
||||
* \brief Defines the callback types used by the library
|
||||
*
|
||||
* This file describes the callback types when by the library.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef __GLIRCCALLBACKS_H__
|
||||
#ifndef DOX_SKIP_THIS
|
||||
# define __GLIRCCALLBACKS_H__
|
||||
#endif // DOX_SKIP_THIS
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
/*! @defgroup group_callback_misc Callbacks: Miscellaneous
|
||||
\brief Miscellaneous callbacks
|
||||
|
||||
These callbacks are not classified and may be used by several functions or as
|
||||
for debugging purposes.
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_Empty
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:44:14 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback used by message with no parameters. The callbacks
|
||||
for _Welcome, _SetAwayResult, and _RemoveAwayResult are of this
|
||||
type.
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_Empty)(GSvoid);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_Error
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:46:40 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback used mainly for debugging. The callbacks for
|
||||
_OnError and _Debug are of this type.
|
||||
|
||||
\param szErrorMsg Error message description
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_Error)(GSchar *szErrorMsg);
|
||||
|
||||
/*! @} enf og group_callback_misc */
|
||||
|
||||
/*! @defgroup group_callback_player Callbacks: Player
|
||||
\brief Player Related Callbacks
|
||||
|
||||
These callbacks are used by functions reporting information about other players
|
||||
status in joined channels.
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerQuit
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:48:00 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user sees another quit IRC.
|
||||
|
||||
\param szPlayer The IRC nickname of the user that quits
|
||||
\param szQuitMsg The quit message
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerQuit)(GSchar * szPlayer, GSchar * szQuitMsg);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerJoinChannel
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:10 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user seers himself or another
|
||||
enter a channel.
|
||||
|
||||
\param szPlayer The IRC nickname of the joining player
|
||||
\param lGroupID The session ID chat being joined
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerJoinChannel)(GSchar * szPlayer, GSint lGroupID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerJoinChannel2
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 12/10/01 9:52:09 AM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user seers himself or another
|
||||
enter a channel.
|
||||
|
||||
\param szPlayer The IRC nickname of the joining player
|
||||
\param iGroupID The group ID chat being joined
|
||||
\param iLobbyID The ID of the lobby of the chat group
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerJoinChannel2)(GSchar * szPlayer, GSint iLobbyID, GSint iGroupID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerLeaveChannel
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:13 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user sees himself or another
|
||||
leave a channel.
|
||||
|
||||
\param szPlayer The IRC nickname of the leaving player
|
||||
\param lGroupID The session ID chat being left
|
||||
\param szLeaveMsg Leave message
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerLeaveChannel)(GSchar * szPlayer, GSint lGroupID, GSchar * szLeaveMsg);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerLeaveChannel2
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:13 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user sees himself or another
|
||||
leave a channel.
|
||||
|
||||
\param szPlayer The IRC nickname of the leaving player
|
||||
\param lGroupID The group ID chat being left
|
||||
\param iLobbyID The ID of the lobby of the chat group
|
||||
\param szLeaveMsg Leave message
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerLeaveChannel2)(GSchar * szPlayer, GSint iLobbyID, GSint lGroupID, GSchar * szLeaveMsg);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PlayerAway
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:18 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when the user sends a private message to
|
||||
a user that is in away mode.
|
||||
|
||||
\param szPlayer The IRC nickname of the away player
|
||||
\param szAwayMsg Away message
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PlayerAway)(GSchar * szPlayer, GSchar * szAwayMsg);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_ChannelNameList
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:20 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called after a player joins a channel. It is used
|
||||
to tell to the user about the users in the channel he joins. This
|
||||
list will contain is own name. They may be more than one calls to
|
||||
this callback per channel join. The size of the member names is
|
||||
IRCIDLENGTH which is defined in define.h
|
||||
|
||||
\param lGroupID The session ID chat that was joined
|
||||
\param pszMembers Array of IRC nickname present in the room
|
||||
\param wCount The number of element in pszMembers
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_ChannelNameList)(GSint lGroupID, GSchar ** pszMembers, GSshort wCount);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_ChannelNameList2
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:20 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called after a player joins a channel. It is used
|
||||
to tell to the user about the users in the channel he joins. This
|
||||
list will contain is own name. They may be more than one calls to
|
||||
this callback per channel join. The size of the member names is
|
||||
IRCIDLENGTH which is defined in define.h
|
||||
|
||||
\param lGroupID The group ID chat that was joined
|
||||
\param iLobbyID The ID of the lobby of the group
|
||||
\param pszMembers Array of IRC nickname present in the room
|
||||
\param wCount The number of element in pszMembers
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_ChannelNameList2)(GSint iLobbyID, GSint lGroupID, GSchar ** pszMembers, GSshort wCount);
|
||||
|
||||
/*! @} end of group_callback_player */
|
||||
|
||||
/*! @defgroup group_callback_message Callbacks: Messaging
|
||||
\brief Messaging Callbacks
|
||||
|
||||
These callbacks are used by messaging functions that are called when users are
|
||||
chatting.
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PublicMessage
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:25 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a public message is sent to a channel.
|
||||
Note that the user will not receive his own messages back from the
|
||||
server.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param lGroupID The session ID when the message was sent
|
||||
\param szMsg The message that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PublicMessage)(GSchar * szPlayer, GSchar * szUserName, GSint lGroupID,
|
||||
GSchar * szMsg, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PublicMessage2
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:25 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a public message is sent to a channel.
|
||||
Note that the user will not receive his own messages back from the
|
||||
server.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param lGroupID The group ID where the message was sent
|
||||
\param iLobbyID The ID of the lobby of the group
|
||||
\param szMsg The message that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PublicMessage2)(GSchar * szPlayer, GSchar * szUserName, GSint iLobbyID, GSint lGroupID,
|
||||
GSchar * szMsg, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PrivateMessage
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 3:04:44 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a private message is sent to the user.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param szMsg The message that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PrivateMessage)(GSchar * szPlayer, GSchar * szUserName,
|
||||
GSchar * szMsg, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PublicAction
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:43 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a public action is sent to a channel.
|
||||
Note that the user will not receive his own messages back from the
|
||||
server.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param lGroupID The session ID when the message was sent
|
||||
\param szAction The action that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PublicAction)(GSchar * szPlayer, GSchar * szUserName, GSint lGroupID,
|
||||
GSchar * szAction, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PublicAction2
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 2:50:43 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a public action is sent to a channel.
|
||||
Note that the user will not receive his own messages back from the
|
||||
server.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param lGroupID The group ID when the message was sent
|
||||
\param iLobbyID The ID of the lobby if the group
|
||||
\param szAction The action that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PublicAction2)(GSchar * szPlayer, GSchar * szUserName, GSint iLobbyID, GSint lGroupID,
|
||||
GSchar * szAction, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack CBIRCRcv_PrivateAction
|
||||
// Author: Philippe Lalande [gsdevelopers@ubisoft.com]
|
||||
// Date: 5/15/01 3:05:58 PM
|
||||
/*!
|
||||
\par Description:
|
||||
Type of callback called when a private action is sent to the user.
|
||||
|
||||
\param szPlayer The IRC nickname of the source of the message
|
||||
\param szUserName The GS username of the source of the message
|
||||
\param szAction The action that was sent
|
||||
\param lFontColor Color of the font used by the source
|
||||
\param iFontSize Size of the font used by the source
|
||||
\param FontStyle Style of the font used by the source
|
||||
\param iFontSet Set of the font used by the source
|
||||
\param szFontFamily Family of the font used by the source
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *CBIRCRcv_PrivateAction)(GSchar * szPlayer, GSchar * szUserName,
|
||||
GSchar * szAction, GSint lFontColor, GSint iFontSize,
|
||||
GSint FontStyle, GSint iFontSet, GSchar * szFontFamily);
|
||||
|
||||
/*! @} end of group_callback_messaging */
|
||||
|
||||
#endif // __GLIRCCALLBACKS_H__
|
||||
1284
Ubisoft.com/GSServices/SDKS64/gs-sdk-chat/include/GLIRCLibrary.h
Normal file
1284
Ubisoft.com/GSServices/SDKS64/gs-sdk-chat/include/GLIRCLibrary.h
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
#ifndef __CONFIGFILEPARSER_H__
|
||||
#define __CONFIGFILEPARSER_H__
|
||||
|
||||
#include "define.h"
|
||||
#include "GSTypes.h"
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Referrer string used in the config file parsing
|
||||
|
||||
// SERVER SECTION NAME
|
||||
#define SERVER_SECTION_NAME "Servers"
|
||||
|
||||
// ROUTER KEYNAME
|
||||
#define ROUTER_ADDRESS_REFERRER "RouterIP%d"
|
||||
#define ROUTER_PORT_REFERRER "RouterPort%d"
|
||||
|
||||
// CDKEY SERVER KEYNAME
|
||||
#define CDKEY_ADDRESS_REFERRER "CDKeyServerIP%d"
|
||||
#define CDKEY_PORT_REFERRER "CDKeyServerPort%d"
|
||||
|
||||
// PROXY SERVER KEYNAME
|
||||
#define PROXY_ADDRESS_REFERRER "ProxyIP%d"
|
||||
#define PROXY_PORT_REFERRER "ProxyPort%d"
|
||||
|
||||
// NAT SERVER KEYNAME
|
||||
#define NAT_ADDRESS_REFERRER "NATServerIP%d"
|
||||
#define NAT_PORT_REFERRER "NATServerPort%d"
|
||||
|
||||
// CHAT SERVER KEYNAME
|
||||
#define CHAT_ADDRESS_REFERRER "IRCIP%d"
|
||||
#define CHAT_PORT_REFERRER "IRCPort%d"
|
||||
|
||||
// SERVER TYPES
|
||||
enum SERVER_TYPE {
|
||||
SRV_ROUTER,
|
||||
SRV_CDKEY,
|
||||
SRV_PROXY,
|
||||
SRV_NAT,
|
||||
SRV_CHAT
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
GSbool __stdcall InitializeFileParser(const GSchar *szConfigFilePath);
|
||||
GSbool __stdcall InitializeStreamParser(GSchar **pszStream);
|
||||
|
||||
GSbool __stdcall GetServerAddress(SERVER_TYPE eServerType,GSuint uiIndex, GSchar *szAddress, GSushort *usPort);
|
||||
|
||||
GSbool __stdcall GetConfigStringValue(GSchar *szSectionName, GSchar *szKeyName, GSchar *szDefaultValue, GSchar *szBuffer, GSint iSize);
|
||||
GSint __stdcall GetConfigNumericValue(GSchar *szSectionName, GSchar *szKeyName, GSint iDefaultValue);
|
||||
|
||||
GSvoid __stdcall UninitializeParser();
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif //__CONFIGFILEPARSER_H__
|
||||
@@ -0,0 +1,124 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante gsdevelopers@ubisoft.com
|
||||
//* Date: 2002-06-10 10:11:16
|
||||
/*! \file GSCryptoDefines.h
|
||||
* \brief Cryptographic sdk variable definitions
|
||||
*
|
||||
* This file defines all the global values and structures used by the
|
||||
* gs-sdk-crypto.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef __GSCRYPTODEFINES_H__
|
||||
#define __GSCRYPTODEFINES_H__
|
||||
|
||||
/*!
|
||||
\brief Cryptographic hash algorithms enumeration
|
||||
|
||||
This structure contains the valid hash algorithms that can be used with this sdk.
|
||||
E_MD5 represent the MD5 algorithm and E_SHA1 represent the Secure Hash Algorithm .
|
||||
*/
|
||||
enum GSCRYPTO_HASH_ALGO {
|
||||
E_MD5,
|
||||
E_SHA1
|
||||
};
|
||||
|
||||
#define MD5_DIGESTSIZE 16 //!< One-way hash digest size (MD5)
|
||||
#define SHA1_DIGESTSIZE 20 //!< One-way hash digest size (SHA1)
|
||||
|
||||
#define MD5_HEXASIZE (2 * MD5_DIGESTSIZE) //!< One-way hash hexadecimal output size (MD5)
|
||||
#define SHA1_HEXASIZE (2 * SHA1_DIGESTSIZE) //!< One-way hash hexadecimal output size (SHA1)
|
||||
|
||||
/*!
|
||||
\brief Symmetric cryptographic algorithms enumeration
|
||||
|
||||
This structure contains the valid cipher algorithms that can be used with this sdk.
|
||||
E_BLOWFISH represent the blowfish algorithm and E_GSXOR represent the
|
||||
bitshift algorithm use by the the ubi.com gs-client.
|
||||
*/
|
||||
enum GSCRYPTO_CIPHER_ALGO {
|
||||
E_BLOWFISH,
|
||||
E_GSXOR
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Asymmetric cryptographic algorithms enumeration
|
||||
|
||||
This structure contains the valid public/private key algorithms that can be used with this sdk.
|
||||
E_RSA represent the RSA algorithm.
|
||||
*/
|
||||
enum GSCRYPTO_PKC_ALGO {
|
||||
E_RSA
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Pseudo-Random Number Generator algorithms enumeration
|
||||
|
||||
This structure contains the valid PRNG algorithms that can be used with this sdk.
|
||||
E_MGF1 represent the Mask Generation Function algorithm.
|
||||
*/
|
||||
enum GSCRYPTO_PRNG_ALGO {
|
||||
E_MGF1
|
||||
};
|
||||
|
||||
#define MGF1_HASHMULTIPLES 500 //!< Multiples of <HASH>_DIGESTSIZE for byte string size
|
||||
|
||||
|
||||
///// BEGIN RSA CHANGES /////
|
||||
|
||||
|
||||
/* RSA key lengths.
|
||||
*/
|
||||
#define MIN_RSA_MODULUS_BITS 508 //!< Minimum length in bits of the modulus used in the RSA algorithm
|
||||
#define MAX_RSA_MODULUS_BITS 1024 //!< Maximum length in bits of the modulus used in the RSA algorithm
|
||||
#define MAX_RSA_MODULUS_LEN ((MAX_RSA_MODULUS_BITS + 7) / 8) //!< Maximum length in bytes of the modulus used in the RSA algorithm
|
||||
#define MAX_RSA_PRIME_BITS ((MAX_RSA_MODULUS_BITS + 1) / 2) //!< Maximum length in bits of a prime
|
||||
#define MAX_RSA_PRIME_LEN ((MAX_RSA_PRIME_BITS + 7) / 8)
|
||||
|
||||
/* Maximum lengths of encoded and encrypted content, as a function of
|
||||
content length len. Also, inverse functions.
|
||||
*/
|
||||
#define ENCODED_CONTENT_LEN(len) (4*(len)/3 + 3)
|
||||
#define ENCRYPTED_CONTENT_LEN(len) ENCODED_CONTENT_LEN ((len)+8)
|
||||
#define DECODED_CONTENT_LEN(len) (3*(len)/4 + 1)
|
||||
#define DECRYPTED_CONTENT_LEN(len) DECODED_CONTENT_LEN ((len)-1)
|
||||
|
||||
|
||||
|
||||
/* Random structure.
|
||||
*/
|
||||
typedef struct {
|
||||
GSuint bytesNeeded;
|
||||
GSubyte state[16];
|
||||
GSuint outputAvailable;
|
||||
GSubyte output[16];
|
||||
} RANDOM_STRUCT;
|
||||
|
||||
/* RSA public and private key.
|
||||
*/
|
||||
typedef struct {
|
||||
GSuint bits; /* length in bits of modulus */
|
||||
GSubyte modulus[MAX_RSA_MODULUS_LEN]; /* modulus */
|
||||
GSubyte exponent[MAX_RSA_MODULUS_LEN]; /* public exponent */
|
||||
} RSA_PUBLIC_KEY;
|
||||
|
||||
typedef struct {
|
||||
GSuint bits; /* length in bits of modulus */
|
||||
GSubyte modulus[MAX_RSA_MODULUS_LEN]; /* modulus */
|
||||
GSubyte publicExponent[MAX_RSA_MODULUS_LEN]; /* public exponent */
|
||||
GSubyte exponent[MAX_RSA_MODULUS_LEN]; /* private exponent */
|
||||
GSubyte prime[2][MAX_RSA_PRIME_LEN]; /* prime factors */
|
||||
GSubyte primeExponent[2][MAX_RSA_PRIME_LEN]; /* exponents for CRT */
|
||||
GSubyte coefficient[MAX_RSA_PRIME_LEN]; /* CRT coefficient */
|
||||
} RSA_PRIVATE_KEY;
|
||||
|
||||
/* RSA prototype key.
|
||||
*/
|
||||
typedef struct {
|
||||
GSuint bits; /* length in bits of modulus */
|
||||
GSint useFormat4; /* public exponent (1 = F4, 0 = 3) */
|
||||
} RSA_PROTO_KEY;
|
||||
|
||||
///// END RSA CHANGES /////
|
||||
|
||||
#endif // __GSCRYPTODEFINES_H__
|
||||
@@ -0,0 +1,629 @@
|
||||
//****************************************************************************
|
||||
//* Author: Guillaume Plante, Philippe Lalande gsdevelopers@ubisoft.com
|
||||
//* Date: 2002-05-07 16:18:32
|
||||
/*! \file GSCryptoInterface.h
|
||||
* \brief Interface ubi.com's cryptographic library.
|
||||
*
|
||||
* This interface provides one-way hash,
|
||||
* synchronous block cipher and pseudo-random number generator
|
||||
* functionality to be use along with the ubi.com crypto interface.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
/*!
|
||||
\mainpage gs-sdk-crypto
|
||||
\section intro Introduction
|
||||
ubi.com's cryptographic interface.
|
||||
|
||||
\section description Description
|
||||
The cryptographic interface contains one-way hash,
|
||||
synchronous block cipher and pseudo-random number generator
|
||||
functionality to be use along with the ubi.com interface.
|
||||
*/
|
||||
|
||||
#ifndef __GSCRYPTOINTERFACE_H__
|
||||
#define __GSCRYPTOINTERFACE_H__
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
#include "GSCryptoDefines.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeCrypto
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 15:49:51
|
||||
/*!
|
||||
\brief Initialize library
|
||||
\par Description:
|
||||
Initialize library
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
// plalande (01/2004)
|
||||
// Not necessary. Does no do anything
|
||||
//GSbool __stdcall InitializeCrypto();
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeCrypto
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 15:49:52
|
||||
/*!
|
||||
\brief Uninitialize library
|
||||
\par Description:
|
||||
Uninitialize library
|
||||
|
||||
\return void
|
||||
*/
|
||||
//============================================================================
|
||||
// plalande (01/2004)
|
||||
// Very dangerous to use these functions since they affect all of the
|
||||
// cryptographic handles existing in the library
|
||||
//GSvoid __stdcall UninitializeCrypto();
|
||||
|
||||
/*! @defgroup groupcrypto1 One-way hash functions
|
||||
\brief One-way hash functions
|
||||
|
||||
These functions are used to get cryptographic checksums
|
||||
from supplied input buffers.
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateRawHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 15:49:53
|
||||
/*!
|
||||
\brief Generate binary hash
|
||||
\par Description:
|
||||
This function generate a hash in binary form
|
||||
from a supplied input value. The output buffer must be at
|
||||
least (SHA1_DIGESTSIZE) byte long for the SHA1 (E_SHA1) algorithm
|
||||
and at leat (MD5_DIGESTSIZE) byte long for the MD5 (E_MD5) algorithm.
|
||||
The number of iteration can be modified to change the hashed
|
||||
output value, it represent the number of passed the input value
|
||||
is put through the hash algorithm.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param IN eAlgo The type of hash algorithm to use.
|
||||
\param IN pucInBuffer The input buffer to be hashed.
|
||||
\param IN uiBufferSize The lenght of the input buffer.
|
||||
\param OUT pucOutBuffer Binary output of the generated hashed value.
|
||||
\param IN uiIterations Nuber of time to hash the input value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GenerateRawHash(GSCRYPTO_HASH_ALGO eAlgo,
|
||||
const GSubyte* pucInBuffer,
|
||||
GSuint uiBufferSize,
|
||||
GSubyte* pucOutBuffer,
|
||||
GSuint uiIterations = 1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateHexaHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 15:49:53
|
||||
/*!
|
||||
\brief Generate hexadecimal hash
|
||||
\par Description:
|
||||
This function generate a hash in hexadecimal form
|
||||
from a supplied input value. The output buffer must be at
|
||||
least (SHA1_HEXASIZE) byte long for the SHA1 (E_SHA1) algorithm
|
||||
and at leat (MD5_HEXASIZE) byte long for the MD5 (E_MD5) algorithm.
|
||||
It is important to note that this function does not put a \0 at the end
|
||||
of the output buffer, so the programmer will have to terminate the output
|
||||
string once he gets it.
|
||||
The number of iteration can be modified to change the hashed
|
||||
output value, it represent the number of passed the input value
|
||||
is put through the hash algorithm.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param IN eAlgo The type of hash algorithm to use.
|
||||
\param IN pucInBuffer The input buffer to be hashed.
|
||||
\param IN uiBufferSize The lenght of the input buffer.
|
||||
\param OUT pszOutBuffer Hexadecimal output of the generated hashed value.
|
||||
\param IN uiIterations = 1 Nuber of time to hash the input value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall GenerateHexaHash(GSCRYPTO_HASH_ALGO eAlgo,
|
||||
const GSubyte* pucInBuffer,
|
||||
GSuint uiBufferSize,
|
||||
GSchar* pszOutBuffer,
|
||||
GSuint uiIterations = 1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 16:27:15
|
||||
/*!
|
||||
\brief Initialize the hash context
|
||||
\par Description:
|
||||
This function will initialize the hash context. This must be called before
|
||||
any call to the UpdateHash() function. This function will return GS_FALSE
|
||||
if the hash context is not yet terminated.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval Identification of the hash algorithm created
|
||||
\retval NULL if the operation failed
|
||||
|
||||
\param IN eAlgo The type of hash algorithm to use.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GShandle __stdcall InitializeHash(GSCRYPTO_HASH_ALGO eAlgo);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function UpdateHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 16:37:38
|
||||
/*!
|
||||
\brief Update the internal hash context
|
||||
\par Description:
|
||||
Update the internal hash context with the input value,
|
||||
the number of iteration can be modified to change the hashed
|
||||
output value, it represent the number of passed the input value
|
||||
is put through the hash algorithm.
|
||||
This function will return GS_FALSE if the hash context is already terminated.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param IN hHash Handle to the hash to be updated
|
||||
\param IN pucInBuffer The input buffer to be hashed.
|
||||
\param IN uiBufferSize The lenght of the input buffer.
|
||||
\param IN uiIterations Nuber of time to hash the input value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall UpdateHash(GShandle hHash, const GSubyte* pucInBuffer, GSuint uiBufferSize,GSuint uiIterations = 1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function TerminateRawHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 16:46:15
|
||||
/*!
|
||||
\brief Terminate the hash context, output binary hashed result
|
||||
\par Description:
|
||||
This function terminate the hash context and output the hashed
|
||||
result in binary form. The output buffer must be at
|
||||
least (SHA1_DIGESTSIZE) byte long for the SHA1 (E_SHA1) algorithm
|
||||
and at leat (MD5_DIGESTSIZE) byte long for the MD5 (E_MD5) algorithm.
|
||||
This function will return GS_FALSE if the hash context is already terminated.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param IN hHash Handle to the hash to be terminated
|
||||
\param OUT pucOutBuffer Binary output of the generated hashed value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall TerminateRawHash(GShandle hHash, GSubyte* pucOutBuffer);
|
||||
|
||||
//============================================================================
|
||||
// Function TerminateRawHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 16:46:15
|
||||
/*!
|
||||
\brief Terminate the hash context, output hexadecimal hashed result
|
||||
\par Description:
|
||||
This function terminate the hash context and output the hashed
|
||||
result in hexadecimal form. The output buffer must be at
|
||||
least (SHA1_HEXASIZE) byte long for the SHA1 (E_SHA1) algorithm
|
||||
and at leat (MD5_HEXASIZE) byte long for the MD5 (E_MD5) algorithm.
|
||||
It is important to note that this function does not put a \0 at the end
|
||||
of the output buffer, so the programmer will have to terminate the output
|
||||
string once he gets it.
|
||||
This function will return GS_FALSE if the hash context is already terminated.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param IN hHash Handle to the hash to be terminated
|
||||
\param OUT pszOutBuffer Hexadecimal output of the generated hashed value.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall TerminateHexaHash(GShandle hHash, GSchar* pszOutBuffer);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function ResetHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 17:05:49
|
||||
/*!
|
||||
\brief Reset the hash module
|
||||
\par Description:
|
||||
Reset the hash module
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param hHash Handle on the hash module
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall ResetHash(GShandle hHash);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 17:05:49
|
||||
/*!
|
||||
\brief Uninitiaze the hash module
|
||||
\par Description:
|
||||
Uninitiaze the hash module
|
||||
|
||||
\return void
|
||||
|
||||
\param hHash Handle on the hash module
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall UninitializeHash(GShandle hHash);
|
||||
|
||||
/*! @} end of groupcrypto1 */
|
||||
|
||||
/*! @defgroup groupcrypto2 Pseudo random number generator functions
|
||||
\brief PRNG functions
|
||||
|
||||
These functions are used to get random pseudo-generated numbers
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function StartNumberGenerator
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 16:35:30
|
||||
/*!
|
||||
\brief Initialize the pseudo-random number generator
|
||||
\par Description:
|
||||
Initialize the pseudo-random number generator
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval Identification of the PRNG algorithm created
|
||||
\retval NULL if the operation failed
|
||||
|
||||
\param eAlgo The algo to use for the pseudo-random number generator
|
||||
\param eHash The algo to use for the hash algorithm in the prng
|
||||
\param pucSeed The seed value
|
||||
\param uiSeedSize The size of the seed
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GShandle __stdcall StartNumberGenerator(GSCRYPTO_PRNG_ALGO eAlgo,
|
||||
GSCRYPTO_HASH_ALGO eHash,
|
||||
const GSubyte *pucSeed,
|
||||
GSuint uiSeedSize);
|
||||
|
||||
//============================================================================
|
||||
// Function StopNumberGenerator
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 17:03:37
|
||||
/*!
|
||||
\brief Uninitiaze the pseudo-random number generator
|
||||
\par Description:
|
||||
Uninitiaze the pseudo-random number generator
|
||||
|
||||
\return void
|
||||
|
||||
\param hPRNG Handle on the PRNG object
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall StopNumberGenerator(GShandle hPRNG);
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateBit
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 16:35:36
|
||||
/*!
|
||||
\brief Generate random bit
|
||||
\par Description:
|
||||
This function is used to generate a random bit
|
||||
|
||||
\return Generated bit
|
||||
|
||||
\param hPRNG Handle on the PRNG object
|
||||
*/
|
||||
//============================================================================
|
||||
GSubyte __stdcall GenerateBit(GShandle hPRNG);
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateBit
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 16:35:36
|
||||
/*!
|
||||
\brief Generate random byte
|
||||
\par Description:
|
||||
This function is used to generate a random byte
|
||||
|
||||
\return Generated byte
|
||||
|
||||
\param hPRNG Handle on the PRNG object
|
||||
*/
|
||||
//============================================================================
|
||||
GSubyte __stdcall GenerateByte(GShandle hPRNG);
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateNumber
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 16:35:36
|
||||
/*!
|
||||
\brief Generate random number
|
||||
\par Description:
|
||||
This function is used to generate a random number
|
||||
|
||||
\return Generated number
|
||||
|
||||
\param hPRNG Handle on the PRNG object
|
||||
\param ulMax Highest possible number that can be generated
|
||||
\param ulMin Lowest possible number that can be generated
|
||||
*/
|
||||
//============================================================================
|
||||
GSulong __stdcall GenerateNumber(GShandle hPRNG, GSulong ulMax = (GSulong)-1,GSulong ulMin = 0);
|
||||
|
||||
//============================================================================
|
||||
// Function GenerateBlock
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 16:35:37
|
||||
/*!
|
||||
\brief Generate random array of bytes
|
||||
\par Description:
|
||||
This function is used to generate a random array of bytes
|
||||
|
||||
\return void
|
||||
|
||||
\param hPRNG Handle on the PRNG object
|
||||
\param pucBlock Pointer to a block of byte to fill
|
||||
\param uiBlockSize Block size
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall GenerateBlock(GShandle hPRNG, GSubyte *pucBlock,GSuint uiBlockSize);
|
||||
|
||||
/*! @} end of groupcrypto2 */
|
||||
|
||||
/*! @defgroup groupcrypto3 Data encryption functions
|
||||
\brief Data encryption functions
|
||||
|
||||
These functions are used to the encrypt data using symmetric encryption algorithms.
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeCipher
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-06 09:25:38
|
||||
/*!
|
||||
\brief Initialize the encryption module
|
||||
\par Description:
|
||||
Initialize the encryption module
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval Identification of the cipher algorithm created
|
||||
\retval 0 if the operation failed
|
||||
|
||||
\param eAlgo Encryption algorithm to be used
|
||||
\param ucKey The key to be use for encryption and decryption
|
||||
\param uiKeyLength Lentgh of the key
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GShandle __stdcall InitializeCipher(GSCRYPTO_CIPHER_ALGO eAlgo,
|
||||
const GSubyte* ucKey, GSuint uiKeyLength);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function UnitializeCipher
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-06 09:30:12
|
||||
/*!
|
||||
\brief Uninitialize the encryption module
|
||||
\par Description:
|
||||
Uninitialize the encryption module
|
||||
|
||||
\return void
|
||||
|
||||
\param hCipher handle on the cipher algorithm
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall UninitializeCipher(GShandle hCipher);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function ResetKey
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-06 09:31:48
|
||||
/*!
|
||||
\brief Reset the encryption key
|
||||
\par Description:
|
||||
Reset the encryption key without having to reinitialize the module
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param hCipher Handle on the cipher algorithm
|
||||
\param ucKey The key to be use for encryption and decryption
|
||||
\param uiKeyLength Lentgh of the key
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall ResetKey(GShandle hCipher,const GSubyte* ucKey, GSuint uiKeyLength);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function Encrypt
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-06 09:34:15
|
||||
/*!
|
||||
\brief Encrypt a data buffer
|
||||
\par Description:
|
||||
This function encrypt a data buffer, and gives back the result in
|
||||
the output buffer, if you pass NULL as the output buffer, the function
|
||||
will return GS_FALSE and will give the predicted output buffer length.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param hCipher Handle on the cipher algorithm
|
||||
\param pInputBuffer Input buffer to be encrypted
|
||||
\param uiInBufferLength Input buffer length in bytes
|
||||
\param pOutputBuffer Output buffer (encrypted data)
|
||||
\param puiOutBufferLength Output buffer length in bytes
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall Encrypt(GShandle hCipher,const GSvoid* pInputBuffer, GSuint uiInBufferLength,
|
||||
GSvoid* pOutputBuffer, GSuint* puiOutBufferLength);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function Decrypt
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-06 09:51:10
|
||||
/*!
|
||||
\brief Decrypt a data buffer
|
||||
\par Description:
|
||||
This function decrypt a data buffer, and gives back the result in
|
||||
the output buffer, if you pass NULL as the output buffer, the function
|
||||
will return GS_FALSE and will give the predicted output buffer length.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE the operation suceeded.
|
||||
\retval GS_FALSE the operation failed.
|
||||
|
||||
\param hCipher Handle on the cipher algorithm
|
||||
\param pInputBuffer Input buffer to be decrypted
|
||||
\param uiInBufferLength Input buffer length in bytes
|
||||
\param pOutputBuffer Output buffer (decrypted data)
|
||||
\param puiOutBufferLength Output buffer length in bytes
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall Decrypt(GShandle hCipher,const GSvoid* pInputBuffer, GSuint uiInBufferLength,
|
||||
GSvoid* pOutputBuffer, GSuint* puiOutBufferLength);
|
||||
|
||||
|
||||
/*! @} end of groupcrypto3 */
|
||||
|
||||
|
||||
/*! @defgroup groupcrypto4 Public key cryptography
|
||||
\brief Asymetric cryptosystem interface
|
||||
|
||||
These functions are used to the encrypt data using public key encryption algorithms.
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function InitializePKC
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-05-07 16:27:15
|
||||
/*!
|
||||
\brief Initialize the hash context
|
||||
\par Description:
|
||||
This function will initialize the hash context. This must be called before
|
||||
any call to the UpdateHash() function. This function will return GS_FALSE
|
||||
if the hash context is not yet terminated.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval Identification of the hash algorithm created
|
||||
\retval NULL if the operation failed
|
||||
|
||||
\param IN eAlgo The type of hash algorithm to use.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GShandle __stdcall InitializePKC(GSCRYPTO_PKC_ALGO eAlgo);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeHash
|
||||
// Author: Guillaume Plante gplante@ubisoft.com
|
||||
// Date: 2002-06-03 17:05:49
|
||||
/*!
|
||||
\brief Uninitiaze the hash module
|
||||
\par Description:
|
||||
Uninitiaze the hash module
|
||||
|
||||
\return void
|
||||
|
||||
\param hHash Handle on the hash module
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSvoid __stdcall UninitializePKC(GShandle hPKC);
|
||||
|
||||
|
||||
GSbool __stdcall RandomInit(GShandle hPKC,RANDOM_STRUCT *pRandomData);
|
||||
GSbool __stdcall RandomUpdate (GShandle hPKC,RANDOM_STRUCT *pRandomData, GSubyte *block, GSuint blockLen);
|
||||
GSvoid __stdcall RandomFinal(GShandle hPKC,RANDOM_STRUCT *pRandomData);
|
||||
GSint __stdcall GetRandomBytesNeeded(GShandle hPKC,GSuint *bytesNeeded,RANDOM_STRUCT * pRandomData);
|
||||
|
||||
GSbool __stdcall GenerateKeyPair(GShandle hPKC,RSA_PUBLIC_KEY *pPublicKey, RSA_PRIVATE_KEY *pPrivateKey,
|
||||
RSA_PROTO_KEY *pProtoKey,RANDOM_STRUCT *pRandomData);
|
||||
|
||||
GSbool __stdcall PublicEncrypt(GShandle hPKC,GSubyte *pInputBuffer, GSuint uiInputBufferLength,
|
||||
GSubyte *pOutputBuffer, GSuint *pOutputBufferLength,RSA_PUBLIC_KEY * pPublicKey, RANDOM_STRUCT * pRandomData);
|
||||
|
||||
GSbool __stdcall PrivateEncrypt(GShandle hPKC,GSubyte *pInputBuffer, GSuint uiInputBufferLength,
|
||||
GSubyte *pOutputBuffer, GSuint *pOutputBufferLength,RSA_PRIVATE_KEY *pPrivateKey);
|
||||
|
||||
GSbool __stdcall PublicDecrypt(GShandle hPKC,GSubyte *pInputBuffer, GSuint uiInputBufferLength,
|
||||
GSubyte *pOutputBuffer, GSuint *pOutputBufferLength,RSA_PUBLIC_KEY *pPublicKey);
|
||||
|
||||
GSbool __stdcall PrivateDecrypt(GShandle hPKC,GSubyte *pInputBuffer, GSuint uiInputBufferLength,
|
||||
GSubyte *pOutputBuffer, GSuint *pOutputBufferLength,RSA_PRIVATE_KEY *pPrivateKey);
|
||||
|
||||
/*! @} end of groupcrypto4 */
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif // __GSCRYPTOINTERFACE_H__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
#ifndef _GSERRORS_H
|
||||
#define _GSERRORS_H
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// GSRESULT TYPE
|
||||
|
||||
// It is divided in 3 parts:
|
||||
// Severity(bit 31): 1 = error, 0 = success
|
||||
// Facility(bit 16 to 30): identify the system responsible of the error
|
||||
// ID(bit 0 to 15): unique number that represent an error/warning/success
|
||||
typedef GSint GSRESULT;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// MACRO USED TO CHECK GSRESULT
|
||||
|
||||
// Return "TRUE" if the GSRESULT is an error
|
||||
#define GSFAILED(GSR) ((GSRESULT)(GSR)<(GSint)0)
|
||||
// Return "TRUE" if the GSRESULT is a success
|
||||
#define GSSUCCEEDED(GSR) ((GSRESULT)(GSR)>=(GSint)0)
|
||||
// Return the error or success code of a GSRESULT
|
||||
#define GSRESULT_CODE(GSR) ((GSint)(GSR&0x8000FFFFL))
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// SUCCESS CODES
|
||||
#define GSS_OK ((GSint) 0x00000000)
|
||||
#define GSS_FALSE ((GSint) 0x00000001)
|
||||
#define GSS_TIMEOUT ((GSint) 0x00005000)
|
||||
|
||||
#define GSS_KEYBUFFERTOOSMALL ((GSint) 0x00006200)
|
||||
#define GSS_BUFFERTOOSMALL ((GSint) 0x00006201)
|
||||
#define GSS_TRIGGERDETECTED ((GSint) 0x00006202)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// ERROR CODES
|
||||
#define GSE_ACCESSDENIED ((GSint) 0x80070005)
|
||||
#define GSE_HANDLE ((GSint) 0x80070006)
|
||||
#define GSE_OUTOFMEMORY ((GSint) 0x8007000E)
|
||||
#define GSE_INVALIDARG ((GSint) 0x80070057)
|
||||
#define GSE_NOTIMPL ((GSint) 0x80004001)
|
||||
#define GSE_NOINTERFACE ((GSint) 0x80004002)
|
||||
#define GSE_POINTER ((GSint) 0x80004003)
|
||||
#define GSE_ABORT ((GSint) 0x80004004)
|
||||
#define GSE_FAIL ((GSint) 0x80004005)
|
||||
#define GSE_NOTGSMODULE ((GSint) 0x80004FFF)
|
||||
#define GSE_UNEXPECTED ((GSint) 0x8000FFFF)
|
||||
#define GSE_ALREADYINITIALIZED ((GSint) 0x80005000)
|
||||
|
||||
#define GSE_NOTINITIALIZED ((GSint) 0x80005001)
|
||||
#define GSE_CANTFINDAPPLICATION ((GSint) 0x80005002)
|
||||
#define GSE_CANTLOAD ((GSint) 0x80005003)
|
||||
#define GSE_TIMEOUT ((GSint) 0x80005004)
|
||||
|
||||
#define GSE_BADMODE ((GSint) 0x80006000)
|
||||
#define GSE_GSISALREADYUSEDBYOTHERGAME ((GSint) 0x80006001)
|
||||
#define GSE_GAMEALREADYPRELOADED ((GSint) 0x80006100)
|
||||
#define GSE_STATENOTSUPPORTED ((GSint) 0x80006101)
|
||||
#define GSE_INVALIDGAMENAME ((GSint) 0x80006102)
|
||||
#define GSE_NODATACONTAINER ((GSint) 0x80006103)
|
||||
#define GSE_MESSAGENOTSUPPORTEDINCURRENTSTATE ((GSint) 0x80006104)
|
||||
#define GSE_INVALIDKEY ((GSint) 0x80006200)
|
||||
#define GSE_KEYALREADYEXIST ((GSint) 0x80006201)
|
||||
#define GSE_BUFFERNOTVALID ((GSint) 0x80006202)
|
||||
#define GSE_INVALIDINDEX ((GSint) 0x80006203)
|
||||
#define GSE_NOTMASTER ((GSint) 0x80006204)
|
||||
#define GSE_INVALIDEVENT ((GSint) 0x80006205)
|
||||
#define GSE_MATCHNOTSTARTEDBYMASTER ((GSint) 0x80006206)
|
||||
#define GSE_NOREPLY ((GSint) 0x80006207)
|
||||
#define GSE_GAMENOTINITIATED ((GSint) 0x80006208)
|
||||
#define GSE_MATCHNOTFINISHED ((GSint) 0x80006209)
|
||||
#define GSE_MATCHNOTEXIST ((GSint) 0x8000620A)
|
||||
#define GSE_MATCHSCORESSUBMISSIONALREDYSENT ((GSint) 0x8000620B)
|
||||
#define GSE_MATCHSCORESSUBMISSIONFAIL ((GSint) 0x8000620C)
|
||||
#define GSE_DETECTEDNEWVERSION ((GSint) 0x8000620D)
|
||||
#define GSE_OTHERENDOFPIPECLOSED ((GSint) 0x8000620E)
|
||||
#define GSE_SOCKETINVALID ((GSint) 0x8000620F)
|
||||
#define GSE_OPENFILE ((GSint) 0x80006210)
|
||||
#define GSE_CONNECTERROR ((GSint) 0x80006211)
|
||||
#define GSE_CURRENTROOMDESTROYED ((GSint) 0x80006212)
|
||||
#define GSE_SOCKETERROR ((GSint) 0x80006213)
|
||||
#define GSE_HOSTUNREACHABLE ((GSint) 0x80006214)
|
||||
#define GSE_ENDOFSTREAM ((GSint) 0x80006215)
|
||||
#define GSE_ALREADYALLOCATED ((GSint) 0x80006216)
|
||||
#define GSE_NOTALLOCATED ((GSint) 0x80006217)
|
||||
#define GSE_INPROGRESS ((GSint) 0x80006218)
|
||||
#define GSE_DATADOESNTEXIST ((GSint) 0x80006219)
|
||||
#define GSE_INVALIDUSER ((GSint) 0x8000621A)
|
||||
#define GSE_INVALIDPWD ((GSint) 0x8000621B)
|
||||
#define GSE_INVALIDGUID ((GSint) 0x8000621C)
|
||||
#define GSE_INVALIDPACKAGE ((GSint) 0x8000621D)
|
||||
#define GSE_INVALIDXML ((GSint) 0x8000621E)
|
||||
#define GSE_INVALIDCHUNK ((GSint) 0x8000621F)
|
||||
#define GSE_XCEEDZIP ((GSint) 0x80006220)
|
||||
#define GSE_DBFAILURE ((GSint) 0x80006221)
|
||||
#define GSE_OUTOFBOUND ((GSint) 0x80006222)
|
||||
#define GSE_BADARG ((GSint) 0x80006223)
|
||||
|
||||
#endif _GSERRORS_H
|
||||
144
Ubisoft.com/GSServices/SDKS64/gs-sdk-common/include/GSTypes.h
Normal file
144
Ubisoft.com/GSServices/SDKS64/gs-sdk-common/include/GSTypes.h
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef __GSTYPES_H__
|
||||
#define __GSTYPES_H__
|
||||
|
||||
#if defined ( GS_LINUX )
|
||||
|
||||
#include <stdlib.h>
|
||||
// calling methods
|
||||
#define __stdcall
|
||||
#define __cdecl
|
||||
|
||||
// Special types
|
||||
typedef unsigned char GSbool;
|
||||
typedef void GSvoid;
|
||||
typedef size_t GSsize_t;
|
||||
|
||||
// Signed types
|
||||
typedef char GSbyte;
|
||||
typedef char GSchar;
|
||||
typedef short GSshort;
|
||||
typedef int GSint;
|
||||
typedef long long GSlong;
|
||||
typedef float GSfloat;
|
||||
typedef double GSdouble;
|
||||
|
||||
// Unsigned types
|
||||
typedef unsigned char GSubyte;
|
||||
typedef unsigned char GSuchar;
|
||||
typedef unsigned short GSushort;
|
||||
typedef unsigned int GSuint;
|
||||
typedef unsigned long long GSulong;
|
||||
|
||||
#elif defined ( GS_WIN32 )
|
||||
|
||||
// Special types
|
||||
typedef unsigned char GSbool;
|
||||
typedef void GSvoid;
|
||||
typedef size_t GSsize_t;
|
||||
|
||||
// Signed types
|
||||
typedef char GSbyte;
|
||||
typedef char GSchar;
|
||||
typedef short GSshort;
|
||||
typedef int GSint;
|
||||
typedef __int64 GSlong;
|
||||
typedef float GSfloat;
|
||||
typedef double GSdouble;
|
||||
|
||||
// Unsigned types
|
||||
typedef unsigned char GSubyte;
|
||||
typedef unsigned char GSuchar;
|
||||
typedef unsigned short GSushort;
|
||||
typedef unsigned int GSuint;
|
||||
typedef unsigned __int64 GSulong;
|
||||
|
||||
#elif defined ( GS_PSX2 )
|
||||
#include <stdlib.h>
|
||||
// calling methods
|
||||
#define __stdcall
|
||||
#define __cdecl
|
||||
|
||||
// Special types
|
||||
typedef unsigned char GSbool;
|
||||
typedef void GSvoid;
|
||||
typedef size_t GSsize_t;
|
||||
|
||||
// Signed types
|
||||
typedef char GSbyte;
|
||||
typedef char GSchar;
|
||||
typedef short GSshort;
|
||||
typedef int GSint;
|
||||
typedef long GSlong;
|
||||
typedef float GSfloat;
|
||||
typedef double GSdouble;
|
||||
|
||||
// Unsigned types
|
||||
typedef unsigned char GSubyte;
|
||||
typedef unsigned char GSuchar;
|
||||
typedef unsigned short GSushort;
|
||||
typedef unsigned int GSuint;
|
||||
typedef unsigned long GSulong;
|
||||
|
||||
#elif defined ( GS_XBOX )
|
||||
|
||||
// Special types
|
||||
typedef unsigned char GSbool;
|
||||
typedef void GSvoid;
|
||||
typedef size_t GSsize_t;
|
||||
|
||||
// Signed types
|
||||
typedef char GSbyte;
|
||||
typedef char GSchar;
|
||||
typedef short GSshort;
|
||||
typedef int GSint;
|
||||
typedef __int64 GSlong;
|
||||
typedef float GSfloat;
|
||||
typedef double GSdouble;
|
||||
|
||||
// Unsigned types
|
||||
typedef unsigned char GSubyte;
|
||||
typedef unsigned char GSuchar;
|
||||
typedef unsigned short GSushort;
|
||||
typedef unsigned int GSuint;
|
||||
typedef unsigned __int64 GSulong;
|
||||
|
||||
#elif defined ( GS_WIN64 )
|
||||
|
||||
// Special types
|
||||
typedef unsigned char GSbool;
|
||||
typedef void GSvoid;
|
||||
typedef size_t GSsize_t;
|
||||
|
||||
// Signed types
|
||||
typedef char GSbyte;
|
||||
typedef char GSchar;
|
||||
typedef short GSshort;
|
||||
typedef int GSint;
|
||||
typedef __int64 GSlong;
|
||||
typedef float GSfloat;
|
||||
typedef double GSdouble;
|
||||
|
||||
// Unsigned types
|
||||
typedef unsigned char GSubyte;
|
||||
typedef unsigned char GSuchar;
|
||||
typedef unsigned short GSushort;
|
||||
typedef unsigned int GSuint;
|
||||
typedef unsigned __int64 GSulong;
|
||||
|
||||
#endif
|
||||
|
||||
// For GSbool
|
||||
#define GS_TRUE 1
|
||||
#define GS_FALSE 0
|
||||
|
||||
// Special type for instances identification
|
||||
#ifdef GSvoid
|
||||
typedef GSvoid* GShandle;
|
||||
#else
|
||||
typedef void* GShandle;
|
||||
#endif
|
||||
|
||||
#endif // __GSTYPES_H__
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
//****************************************************************************
|
||||
//* Author: Scott Schmeisser gsdevelopers@ubisoft.com
|
||||
//* Date: 5/15/01 10:05:17 AM
|
||||
/*! \file InitSockets.h
|
||||
* \brief Functions used to initialize the socket library in different
|
||||
* platforms
|
||||
* Socket loading/unloading for different platforms.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef _INITSOCKETS_H
|
||||
#ifndef DOX_SKIP_THIS
|
||||
#define _INITSOCKETS_H
|
||||
#endif // DOX_SKIP_THIS
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
#if defined(GS_WIN32) || defined(GS_WIN64)
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:48:06 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX) Initialize the socket library
|
||||
\par Description:
|
||||
Initialize the socket library with an optional IP address to bind to.
|
||||
|
||||
\return The status of the call to the function
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param szIPAddress the IP address to bind to
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets(const GSchar *szIPAddress = NULL);
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets_SetOnConnectTimeout
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 28/08/2002 10:05:51 AM
|
||||
/*!
|
||||
\brief (WIN32) Sets the Timeout value when connecting.
|
||||
\par Description:
|
||||
Set the amount of time to wait for a connection to establish.
|
||||
Defaults to 5 seconds;
|
||||
|
||||
\return The status of the call to the function.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param iTimeOut The number of seconds to wait for the connection.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets_SetOnConnectTimeout(GSint iTimeOut = 5);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:50:18 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX/PSX2) Uninitialize the socket library
|
||||
\par Description:
|
||||
Unload the socket library.
|
||||
|
||||
\return The status of the call to the functions.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall UninitializeSockets();
|
||||
|
||||
#endif //GS_WIN32
|
||||
|
||||
|
||||
#ifdef GS_XBOX
|
||||
//============================================================================
|
||||
// Function InitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:48:06 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX) Initialize the socket library
|
||||
\par Description:
|
||||
Initialize the socket library with an optional IP address to bind to.
|
||||
|
||||
\return The status of the call to the function
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param szIPAddress the IP address to bind to
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets(GSchar *szIPAddress = NULL);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:50:18 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX/PSX2) Uninitialize the socket library
|
||||
\par Description:
|
||||
Unload the socket library.
|
||||
|
||||
\return The status of the call to the functions.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall UninitializeSockets();
|
||||
#endif //GS_XBOX
|
||||
|
||||
#ifdef GS_PSX2
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 10:05:51 AM
|
||||
/*!
|
||||
\brief (PSX2) Initialize the socket library
|
||||
\par Description:
|
||||
This function now longer iInitializes the socket library on PSX2. The game must load all IOP modules
|
||||
and network configuration itself. The ubi.com SDKs are not built using libeenet. See the libeenet
|
||||
documantation in the SONY libraries on how to load and initialize the libeenet.
|
||||
|
||||
\return The status of the call to the function.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param szIPAddress The IP address to bound to.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets(const GSchar *szIPAddress = NULL);
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets_Test
|
||||
// Author: Scott Schmeisser sschmeisser@ubisoft.com
|
||||
// Date: 01/04/2003 10:05:51 AM
|
||||
/*!
|
||||
\brief (PSX2) Initialize the socket library
|
||||
\par Description:
|
||||
Initialize the socket library on PSX2. THIS FUNCTION IS NOT TO BE USED.
|
||||
IT IS FOR TEST PURPOSES ONLY. USE THE ABOVE InitializeSockets() INSTEAD.
|
||||
|
||||
\return The status of the call to the function.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param szIPAddress The IP address to bound to.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets_Test(GSchar *szIPAddress = NULL);
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets_SetOnConnectTimeout
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 28/08/2002 10:05:51 AM
|
||||
/*!
|
||||
\brief (PSX2) Sets the Timeout value when connecting.
|
||||
\par Description:
|
||||
Set the amount of time to wait for a connection to establish.
|
||||
Defaults to 5 seconds;
|
||||
|
||||
\return The status of the call to the function.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param iTimeOut The number of seconds to wait for the connection.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets_SetOnConnectTimeout(GSint iTimeOut = 5);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:50:18 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX/PSX2) Uninitialize the socket library
|
||||
\par Description:
|
||||
Unload the socket library.
|
||||
|
||||
\return The status of the call to the functions.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall UninitializeSockets();
|
||||
#endif GS_PSX2
|
||||
|
||||
#ifdef GS_LINUX
|
||||
//============================================================================
|
||||
// Function InitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:48:06 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX/PSX2) Initialize the socket library
|
||||
\par Description:
|
||||
Initialize the socket library with an optional IP address to bind to.
|
||||
|
||||
\return The status of the call to the function
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param szIPAddress the IP address to bind to
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets(GSchar *szIPAddress = NULL);
|
||||
|
||||
//============================================================================
|
||||
// Function InitializeSockets_SetOnConnectTimeout
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 28/08/2002 10:05:51 AM
|
||||
/*!
|
||||
\brief (LINUX) Sets the Timeout value when connecting.
|
||||
\par Description:
|
||||
Set the amount of time to wait for a connection to establish.
|
||||
Defaults to 5 seconds;
|
||||
|
||||
\return The status of the call to the function.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
|
||||
\param iTimeOut The number of seconds to wait for the connection.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall InitializeSockets_SetOnConnectTimeout(GSint iTimeOut = 5);
|
||||
|
||||
//============================================================================
|
||||
// Function UninitializeSockets
|
||||
// Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
// Date: 14/09/2001 9:50:18 AM
|
||||
/*!
|
||||
\brief (WIN32/XBOX/LINUX/PSX2) Uninitialize the socket library
|
||||
\par Description:
|
||||
Unload the socket library.
|
||||
|
||||
\return The status of the call to the functions.
|
||||
|
||||
\retval GS_TRUE on success
|
||||
\retval GS_FALSE on failure
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall UninitializeSockets();
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif //_INITSOCKETS_H
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef __NETINTERFACE_H__
|
||||
#define __NETINTERFACE_H__
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
enum INTERFACE_TYPE {
|
||||
IT_LAN,
|
||||
IT_INTERNET,
|
||||
IT_ALL
|
||||
};
|
||||
|
||||
//===================================================================================================
|
||||
// MEMBER: GetNetInterface
|
||||
// AUTHOR: Pierre-Luc Rigaux
|
||||
// CREATION: May 2001
|
||||
//
|
||||
// DESCRIPTION: Get the local IP Address and the Net Mask of the first Eternet device
|
||||
//===================================================================================================
|
||||
// INPUT: null
|
||||
// OUPUTS: IP Address and netmask in a string format
|
||||
// RESULT: True on success, false else
|
||||
// known bug: this funtion takes the first ip interface (we don't know if it is the good one)
|
||||
//===================================================================================================
|
||||
GSbool GetNetInterface(GSchar* szIPAddress, GSchar* szNetMask,
|
||||
INTERFACE_TYPE type = IT_ALL, GSuint uiIndex = 0);
|
||||
|
||||
//===================================================================================================
|
||||
// MEMBER: ResolveBroadcast
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: May 2001
|
||||
//
|
||||
// DESCRIPTION: Resolve the broadcast address on the network from the netmask and local ip
|
||||
// that has been specified by the user. If they are valid, the broadcast is resolve
|
||||
// with these ip but if they arent, the function tries to resolve it with the
|
||||
// detected local ip address and net mask, in this case the function return false.
|
||||
//===================================================================================================
|
||||
// INPUT: szLocalAddrees = local address in a string format
|
||||
// INPUT: szNetmask = local netmask in a string format
|
||||
// OUPUTS: szBroadcastAddress : network broadcast ip address in a string format
|
||||
// RESULT: True on success, false else
|
||||
//===================================================================================================
|
||||
GSbool ResolveBroadcast(GSchar *szLocalAddress,GSchar *szNetmask,GSchar *szBroadcastAddress);
|
||||
|
||||
//===================================================================================================
|
||||
// MEMBER: ResolveBroadcast
|
||||
// AUTHOR: Guillaume Plante
|
||||
// CREATION: May 2001
|
||||
//
|
||||
// DESCRIPTION: Check if a ip address is valid by comparing it with each of the detected
|
||||
// address on the local machine.
|
||||
//===================================================================================================
|
||||
// INPUT: szLocalAddrees = local address in a string format
|
||||
// RESULT: True on success, false else
|
||||
//===================================================================================================
|
||||
GSbool IPIsValid(GSchar *szIPAddress);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,110 @@
|
||||
#ifndef _GSSIMPLECONNECT_H
|
||||
#define _GSSIMPLECONNECT_H
|
||||
#include "define.h"
|
||||
|
||||
class clGSConnect;
|
||||
class clConnectElem;
|
||||
class clConnectList;
|
||||
class clTCPClient;
|
||||
class clUNIXClient;
|
||||
|
||||
//===================================================================================================
|
||||
class clSimpleClient
|
||||
{
|
||||
private:
|
||||
clConnectElem* m_pstConnectElem;
|
||||
GSchar m_szAddress[129];
|
||||
|
||||
public:
|
||||
/* Constructor/Destructor */
|
||||
clSimpleClient( GSint lAliveDuring, GSint lRcvTimeout,
|
||||
GSint iUDPSndBuf = 0, GSint iUDPRcvBuf = 0);
|
||||
~clSimpleClient();
|
||||
|
||||
/* To connect on a peer address using TCP */
|
||||
GSbool ConnectHost(GSchar *szHost, GSushort lPort);
|
||||
|
||||
#ifdef LINUX
|
||||
/* To connect to a peer UNIX process */
|
||||
GSbool ConnectUNIXHost(GSchar *sSockPipe);
|
||||
#endif // LINUX
|
||||
|
||||
/* Disconnect from peer address */
|
||||
GSbool Disconnect(GSvoid);
|
||||
|
||||
/* Update messages receive/send */
|
||||
GSbool CheckConnection(GSvoid);
|
||||
|
||||
/* To send a message (put in the send queue) (Priority : 0-31) */
|
||||
GSbool SendGuaranteed( GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
GSbool SendLostable( GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
|
||||
/* To read a message (from the received queue) */
|
||||
GSvoid* ReadGuaranteed( GSubyte& rucType, GSint& rlSize);
|
||||
GSvoid* ReadLostable( GSubyte& rucType, GSint& rlSize);
|
||||
|
||||
/* IP management */
|
||||
GSchar* GetPeerIPAddress(GSvoid);
|
||||
GSchar* GetLocalIPAddress(GSvoid);
|
||||
|
||||
// Checks to see if the UDP connection has been established.
|
||||
// You must call CheckConnection, ReadGuaranteed and ReadLostable
|
||||
// between calls to IsUDPConnected to generate and send internal messages
|
||||
// that establish the UDP connection
|
||||
GSbool IsUDPConnected();
|
||||
};
|
||||
|
||||
//===================================================================================================
|
||||
class clSimpleServer
|
||||
{
|
||||
private:
|
||||
clConnectList* m_pstConnectList;
|
||||
|
||||
GSint m_lConnectedMode;
|
||||
GSint m_lStillAliveDuring;
|
||||
GSint m_lRcvDuring;
|
||||
GSchar m_szAddress[129];
|
||||
|
||||
public:
|
||||
clSimpleServer( GSint lAliveDuring, GSint lRcvTimeout,
|
||||
GSint iUDPSndBuf = 0, GSint iUDPRcvBuf = 0);
|
||||
~clSimpleServer();
|
||||
|
||||
/* Return the port reserved */
|
||||
GSbool ReservePort(GSushort lPort);
|
||||
|
||||
#ifdef LINUX
|
||||
/* Puts the UNIX server into listening mode (UNIX Sockets) */
|
||||
GSbool OpenSocket(GSchar *p_strSockPipe);
|
||||
#endif // LINUX
|
||||
|
||||
/* Return the ID of the new connection */
|
||||
GSint AcceptConnection(GSvoid);
|
||||
|
||||
/* Return the ID of the element disconnected */
|
||||
GSint CheckDisconnection(GSvoid);
|
||||
|
||||
/* To disconnect an element */
|
||||
GSbool DisconnectElement(GSint lId);
|
||||
|
||||
/* To send a message (put in the send queue) (Priority : 0-31) */
|
||||
GSbool SendGuaranteed( GSint lId, GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
GSbool SendLostable( GSint lId, GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
GSbool SendGuaranteedToAll( GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
GSbool SendLostableToAll( GSubyte ucType, GSubyte ucPriority, GSvoid *pvMessage, GSint lMsgSize);
|
||||
|
||||
/* To read a message (from the received queue) */
|
||||
GSvoid* ReadGuaranteed( GSint& rlId, GSubyte& rucType, GSint& rlSize);
|
||||
GSvoid* ReadLostable( GSint& rlId, GSubyte& rucType, GSint& rlSize);
|
||||
|
||||
/* IP management */
|
||||
GSchar* GetPeerIPAddress(GSint lId);
|
||||
|
||||
// Checks to see if the UDP connection has been established for that
|
||||
// connection ID. You must call CheckDisconnection, ReadGuaranteed and
|
||||
// ReadLostable between calls to IsUDPConnected to generate and send internal
|
||||
// messages that establish the UDP connection
|
||||
GSbool IsUDPConnected(GSint iID);
|
||||
};
|
||||
|
||||
#endif // _GSSIMPLECONNECT_H
|
||||
402
Ubisoft.com/GSServices/SDKS64/gs-sdk-common/include/define.h
Normal file
402
Ubisoft.com/GSServices/SDKS64/gs-sdk-common/include/define.h
Normal file
@@ -0,0 +1,402 @@
|
||||
//****************************************************************************
|
||||
//* Author: Luc Bouchard lbouchard@ubisoft.qc.ca
|
||||
//* Date: 16/05/2001 11:23:39 AM
|
||||
/*! \file define.h
|
||||
* \brief Global defines
|
||||
*
|
||||
* This file defines all the global values used by the different
|
||||
* Game Service SDKs.
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*!
|
||||
\mainpage gs-sdk-common
|
||||
\section intro Introduction
|
||||
This SDK contains the basic libraries used by all the Game Service SDKs
|
||||
|
||||
|
||||
\section description Description
|
||||
libgsconnect: connection management<br>
|
||||
libgssocket: socket management<br>
|
||||
libgsutility: message packaging management and other stuff. <br>
|
||||
|
||||
|
||||
\section see_also See Also
|
||||
<a href="../../gs-sdk-base/doc/index.html">gs-sdk-base</a><br>
|
||||
<a href="../../gs-sdk-game/doc/index.html">gs-sdk-game</a><br>
|
||||
<a href="../../gs-sdk-gameserver/doc/index.html">gs-sdk-gameserver</a><br>
|
||||
<a href="../../gs-sdk-chat/doc/index.html">gs-sdk-chat</a><br>
|
||||
*/
|
||||
|
||||
#ifndef _DEFINE_H_
|
||||
#ifndef DOX_SKIP_THIS
|
||||
#define _DEFINE_H_
|
||||
#endif //DOX_SKIP_THIS
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
/*! @defgroup group1 Buffer lenghts
|
||||
\brief The length of the buffer used throughout the SDKs.
|
||||
|
||||
The length of the buffer used throughout the SDKs.
|
||||
@{
|
||||
*/
|
||||
#define STOREDPROCLENGTH 30
|
||||
#define NICKNAMELENGTH 16
|
||||
#define FIRSTNAMELENGTH 33
|
||||
#define SURNAMELENGTH 33
|
||||
#define PASSWORDLENGTH 17
|
||||
#define ADDRESSLENGTH 129
|
||||
#define CITYLENGTH 33
|
||||
#define CODELENGTH 33
|
||||
#define EMAILLENGTH 129
|
||||
#define COMMENTSLENGTH 1025
|
||||
#define WEBPAGELENGTH 129
|
||||
#define GAMELENGTH 33
|
||||
#define IRCIDLENGTH 10
|
||||
#define NAMELENGTH 33
|
||||
#define COUNTRYLENGTH 65
|
||||
#define CHATLENGTH 1025
|
||||
#define IPADDRESSLENGTH 129
|
||||
#define IPDOTADDRESSLENGTH 16
|
||||
#define GAMELENGTH 33
|
||||
#define VERSIONLENGTH 33
|
||||
#define INFOLENGTH 1025
|
||||
#define FILELENGTH 129
|
||||
#define ARENALENGTH 33
|
||||
#define SESSIONLENGTH 33
|
||||
#define SCORELENGTH 129
|
||||
#define REASONLENGTH 129
|
||||
#define URLLENGTH 1025
|
||||
#define YESNOLENGTH 4
|
||||
#define MOTDLENGTH 513
|
||||
#define LANGUAGELENGTH 3
|
||||
/*! @} end of group1 */
|
||||
|
||||
|
||||
/*! @defgroup group2 Error/Success
|
||||
\brief The Error/Success constant
|
||||
|
||||
The Error/Success constant
|
||||
@{
|
||||
*/
|
||||
#ifndef GSSUCCESS
|
||||
#define GSSUCCESS 38 /* c->r */
|
||||
#endif
|
||||
|
||||
#ifndef GSFAIL
|
||||
#define GSFAIL 39 /* r->c */
|
||||
#endif
|
||||
|
||||
#ifndef GSPENDING
|
||||
#define GSPENDING 40
|
||||
#endif
|
||||
/*! @} end of group2 */
|
||||
|
||||
|
||||
#define CHARSIZE 1
|
||||
#define SHORTSIZE 2
|
||||
#define LONGSIZE 4
|
||||
|
||||
/*! @defgroup group3 Player statuses
|
||||
\brief The possible status for a player
|
||||
|
||||
The possible status for a player
|
||||
@{
|
||||
*/
|
||||
#define PLAYERONLINE 0
|
||||
#define PLAYEROFFLINE 1 //Only set by Server
|
||||
#define PLAYERAWAY 2
|
||||
#define PLAYERBRB 3
|
||||
//#define PLAYERSESSIONCANJOIN 4
|
||||
//#define PLAYERSESSIONCANTJOIN 5
|
||||
#define PLAYERINVISIBLE 6
|
||||
#define PLAYERCOREONLINE 7
|
||||
#define PLAYERINLOBBY 8 //Only set by Server
|
||||
#define PLAYERINROOM 9 //Only set by Server
|
||||
#define PLAYERINGAMEOPEN 10 //Only set by Server
|
||||
#define PLAYERINGAMECLOSE 11 //Only set by Server
|
||||
#define PLAYERSTATUSCOUNT 12
|
||||
#define PLAYERCORESTART 3000000
|
||||
#define PLAYERCOREEND 4999999
|
||||
/*! @} end of group3 */
|
||||
|
||||
|
||||
/*! @defgroup group4 Admin page types
|
||||
\brief The possible type of a admin page message
|
||||
|
||||
The possible type of a admin page message
|
||||
@{
|
||||
*/
|
||||
// SYSTEMPAGE subtypes
|
||||
#define ADDEDASFRIEND 0
|
||||
#define ADDEDASIGNOREE 1
|
||||
#define REMOVEDASIGNOREE 2
|
||||
#define ADMINPAGE 185
|
||||
/*! @} end of group4 */
|
||||
|
||||
|
||||
/*! @defgroup group5 Friends options
|
||||
\brief The possible options to set when connecting to the FRIENDS service.
|
||||
|
||||
The possible options to set when connecting to the FRIENDS service.
|
||||
@{
|
||||
*/
|
||||
#define MASK_PAGE (1L<<0)
|
||||
#define MASK_FILES (1L<<1)
|
||||
#define MASK_AUTOFILES (1L<<2)
|
||||
#define MASK_INVISIBLE (1L<<3)
|
||||
#define MASK_AWAY (1L<<4)
|
||||
/*! @} end of group5 */
|
||||
|
||||
/*! @defgroup group6 Masks
|
||||
\brief Masks used throughout the Game Service SDKs.
|
||||
|
||||
Masks used throughout the Game Service SDKs.
|
||||
@{
|
||||
*/
|
||||
|
||||
/*---------------- session and player mask ----------------------*/
|
||||
#define MASKSESSIONNAME (1L<<0)
|
||||
#define MASKSCORE (1L<<2)
|
||||
#define MASKADDRESS (1L<<5)
|
||||
|
||||
const GSuint MASKPRIVATE = 0x00000001; //(1L<<0)
|
||||
const GSuint MASKNEEDMASTER = 0x00000002; //(1L<<1)
|
||||
const GSuint MASKETERNEL = 0x00000004; //(1L<<2)
|
||||
const GSuint MASKACTIVE = 0x00000008; //(1L<<3)
|
||||
const GSuint MASKOPEN = 0x00000010; //(1L<<4)
|
||||
const GSuint STARTABLE = 0x00000020; //(1L<<5)
|
||||
const GSuint MASKVISITOR = 0x00000040; //(1L<<6)
|
||||
const GSuint DEFEREDSTARTGAME = 0x00000080; //(1L<<7)
|
||||
const GSuint MASKPLAYERETERNEL = 0x00000100;
|
||||
const GSuint MASKDEDICATEDSERVER = 0x00080000; //(1L<<19)
|
||||
|
||||
/*! @} end of group6 */
|
||||
|
||||
|
||||
// ERROR CODES IN USE
|
||||
// 0 @ 56
|
||||
// 60 @ 68
|
||||
// -1 @ -3
|
||||
// 100, 501, 502, 512
|
||||
|
||||
/*! @defgroup group7 Error messages
|
||||
\brief The error message returned by the different services.
|
||||
|
||||
The error message returned by the different services.
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
/*! @defgroup group7_1 LOGIN service.
|
||||
\brief Errors returned by the LOGIN service.
|
||||
|
||||
Errors returned by the LOGIN service.
|
||||
@{
|
||||
*/
|
||||
/*! Unknown error. */
|
||||
#define ERRORROUTER_UNKNOWNERROR 0
|
||||
/*! You are not registered, create a new account first. */
|
||||
#define ERRORROUTER_NOTREGISTERED 1
|
||||
/*! Your password is incorrect. */
|
||||
#define ERRORROUTER_PASSWORDNOTCORRECT 2
|
||||
/*! The arena has not yet detected your disconnection. */
|
||||
#define ERRORROUTER_NOTDISCONNECTED 3
|
||||
/*! The arena is not available. */
|
||||
#define ERRORROUTER_ARENANOTAVAILABLE 4
|
||||
/*! The Friends server is not available. */
|
||||
#define ERRORROUTER_FRIENDSNOTAVAILABLE 5
|
||||
/*! A player with the same name as yours is already connected. */
|
||||
#define ERRORROUTER_NAMEALREADYUSED 6
|
||||
/*! This player is not currently connected to the GameService. */
|
||||
#define ERRORROUTER_PLAYERNOTCONNECTED 7
|
||||
/*! This player is not registered on the GameService. */
|
||||
#define ERRORROUTER_PLAYERNOTREGISTERED 8
|
||||
/*! The name you chose is already used by another player. */
|
||||
#define ERRORROUTER_PLAYERCONNECTED 9
|
||||
/*! You are already registered. */
|
||||
#define ERRORROUTER_PLAYERALREADYREGISTERED 10
|
||||
/*! The version of GSClient you are using is too old and can't be upgraded. */
|
||||
#define ERRORROUTER_CLIENTVERSIONTOOOLD 11
|
||||
/*! GS Database problem. Some functions are disabled. */
|
||||
#define ERRORROUTER_DBINBACKUPMODE 12
|
||||
/*! GS Database problem. Please notify the administrator. */
|
||||
#define ERRORROUTER_DBPROBLEM 13
|
||||
/*! The client is incompatible with the server. */
|
||||
#define ERRORROUTER_CLIENTINCOMPATIBLE 50
|
||||
/*! @} end of group7_1 */
|
||||
|
||||
|
||||
|
||||
/*! @defgroup group7_2 FRIENDS service.
|
||||
\brief Errors returned by the FRIENDS service.
|
||||
|
||||
Errors returned by the FRIENDS service.
|
||||
@{
|
||||
*/
|
||||
/*! The Player does not exist. */
|
||||
#define ERRORFRIENDS_FRIENDNOTEXIST 14
|
||||
/*! The Player is not connected to an arena. */
|
||||
#define ERRORFRIENDS_NOTINARENA 15
|
||||
/*! The Player is not online. */
|
||||
#define ERRORFRIENDS_PLAYERNOTONLINE 16
|
||||
/*! The Player is not in a session. */
|
||||
#define ERRORFRIENDS_NOTINSESSION 17
|
||||
/*! The Player is ignoring you */
|
||||
#define ERRORFRIENDS_PLAYERIGNORE 18
|
||||
/*! The Player is already connected. */
|
||||
#define ERRORFRIENDS_ALREADYCONNECTED 19
|
||||
/*! The Friends server cannot accept more players. */
|
||||
#define ERRORFRIENDS_NOMOREPLAYERS 20
|
||||
/*! The Player has no scores in database. */
|
||||
#define ERRORFRIENDS_NOPLAYERSCORE 47
|
||||
/*! Search Player Finished. */
|
||||
#define ERRORFRIENDS_SEARCHPLAYERFINISHED 48
|
||||
/*! The Players status is COREONLINE and is not receiving pages/peer messages */
|
||||
#define ERRORFRIENDS_PLAYERSTATUSCOREONLINE 56
|
||||
|
||||
/*! @} end of group7_2 */
|
||||
|
||||
|
||||
|
||||
/*! @defgroup group7_3 SESSION service.
|
||||
\brief Errors returned by the SESSION service.
|
||||
|
||||
Errors returned by the SESSION service.
|
||||
@{
|
||||
*/
|
||||
#define ERRORARENA_SESSIONEXIST 21
|
||||
#define ERRORARENA_GAMENOTALLOWED 22
|
||||
#define ERRORARENA_NUMBERPLAYER 23
|
||||
#define ERRORARENA_NUMBERSPECTATOR 24
|
||||
#define ERRORARENA_VISITORNOTALLOWED 25
|
||||
#define ERRORARENA_NOTREGISTERED 26
|
||||
#define ERRORARENA_NOMOREPLAYERS 27
|
||||
#define ERRORARENA_NOMORESPECTATORS 28
|
||||
#define ERRORARENA_PLAYERNOTREGISTERED 29
|
||||
#define ERRORARENA_SESSIONNOTAVAILABLE 30
|
||||
#define ERRORARENA_SESSIONINPROCESS 31
|
||||
#define ERRORARENA_BADGAMEVERSION 32
|
||||
#define ERRORARENA_PASSWORDNOTCORRECT 33
|
||||
#define ERRORARENA_ALREADYINSESSION 34
|
||||
#define ERRORARENA_NOTMASTER 35
|
||||
#define ERRORARENA_NOTINSESSION 36
|
||||
#define ERRORARENA_MINPLAYERS 37
|
||||
#define ERRORARENA_ADMINGAMEDOESNOTEXIST 38
|
||||
#define ERRORARENA_ADMINSESSIONDOESNOTEXIST 39
|
||||
#define ERRORARENA_CONNECTADDCONNECTION 40
|
||||
#define ERRORARENA_CONNECTSENDLOGINMSG 41
|
||||
#define ERRORARENA_ERRORLOGINMESSAGE 42
|
||||
#define ERRORARENA_NOHOSTARENA 43
|
||||
#define ERRORARENA_ARENADISCONNECTED 44
|
||||
#define ERRORARENA_INVALIDGROUPNAME 45
|
||||
#define ERRORARENA_INVALIDGAMETYPE 46
|
||||
#define ERRORARENA_NOMOREGAMEMODULE 47
|
||||
#define ERRORARENA_PASSPORTLABELNOTFOUND 48
|
||||
#define ERRORARENA_PASSPORTFAIL 49
|
||||
#define ERRORARENA_CREATENOTALLOWED 50
|
||||
#define ERRORARENA_INVALIDSESSIONTYPE 51
|
||||
#define ERRORARENA_SESSIONCLOSE 52
|
||||
#define ERRORARENA_NOTCREATOR 53
|
||||
#define ERRORARENA_DEDICATEDSERVERONLY 54
|
||||
|
||||
/*! @} end of group7_3 */
|
||||
|
||||
|
||||
/*! @defgroup group7_4 CLANMANAGER service.
|
||||
|
||||
Errors returned by the CLANMANAGER service.
|
||||
@{
|
||||
*/
|
||||
#define ERRORCLAN_INVALIDPROFILE 49
|
||||
/*! @} end of group7_4 */
|
||||
|
||||
|
||||
/*! @defgroup group7_5 DB/Proxy
|
||||
\briefError messages for db/proxy services
|
||||
|
||||
Error messages for db/proxy services
|
||||
@{
|
||||
*/
|
||||
#define ERROR_SERVICENOTAVAILABLE 55
|
||||
|
||||
/*! @defgroup group7_5_1 Ladder Query Service
|
||||
\brief Ladder Query Service Errors
|
||||
Error codes for the proxy's ladder query service
|
||||
@{
|
||||
*/
|
||||
|
||||
#define ERRLQS_DUPLICATEFIELD 60
|
||||
#define ERRLQS_DATABASEFAILURE 61
|
||||
#define ERRLQS_INTERNAL_OUTOFMEMORY 62
|
||||
#define ERRLQS_INTERNAL_WRONGRESULTVERSION 63
|
||||
#define ERRLQS_INTERNAL_BADRESULTFORMAT 64
|
||||
|
||||
/*! @} end of group7_5_1 */
|
||||
|
||||
/*! @defgroup group7_5_2 Score Submission
|
||||
\brief Score Submission Error Codes
|
||||
Error codes for the proxy's score submission
|
||||
@{
|
||||
*/
|
||||
|
||||
#define ERRSS_BADFORMAT 65
|
||||
#define ERRSS_DBFAILURE 66
|
||||
#define ERRSS_SUBMISSIONFAILED 67
|
||||
#define ERRSS_VALIDATIONFAILED 68
|
||||
|
||||
/*! @} end of group7_5_2 */
|
||||
|
||||
/*! @} end of group7_5 */
|
||||
|
||||
|
||||
/*! @defgroup group7_6 Other
|
||||
\brief Other error messages
|
||||
|
||||
Other error messages
|
||||
@{
|
||||
*/
|
||||
#define ERROR_ROUTERCONNECTION -1
|
||||
#define ERROR_ARENACONNECTION -2
|
||||
#define ERROR_LOBBYSRVDISCONNECTED -3
|
||||
/*! @} end of group7_6 */
|
||||
|
||||
/*! @defgroup group7_7 Secure Accounts
|
||||
\brief Errors for Secure Accounts
|
||||
|
||||
These Error messages are for Secure Accounts
|
||||
@{
|
||||
*/
|
||||
// CREATE: The username already exists
|
||||
#define ERRORSECURE_USERNAMEEXISTS 1
|
||||
// CREATE: The username is malformed
|
||||
#define ERRORSECURE_USERNAMEMALFORMED 2
|
||||
// CREATE: The username is not allowed to be used (e.g. contains smut)
|
||||
#define ERRORSECURE_USERNAMEFORBIDDEN 3
|
||||
// LOGIN: The account does not exist
|
||||
#define ERRORSECURE_INVALIDACCOUNT 4
|
||||
// CREATE: The username is reserved (e.g. Ubi_* usernames)
|
||||
#define ERRORSECURE_USERNAMERESERVED 5
|
||||
// CREATE/UPDATE: The password is malformed
|
||||
#define ERRORSECURE_PASSWORDMALFORMED 11
|
||||
// CREATE/UPDATE: The password is not allowed (e.g. contains username)
|
||||
#define ERRORSECURE_PASSWORDFORBIDDEN 13
|
||||
// LOGIN: The password is incorrect
|
||||
#define ERRORSECURE_INVALIDPASSWORD 15
|
||||
// ALL: The database returned an error
|
||||
#define ERRORSECURE_DATABASEFAILED 100
|
||||
// LOGIN: The account has been banned
|
||||
#define ERRORSECURE_BANNEDACCOUNT 501
|
||||
// LOGIN: The account has been blocked
|
||||
#define ERRORSECURE_BLOCKEDACCOUNT 502
|
||||
// LOGIN: The account has been locked
|
||||
#define ERRORSECURE_LOCKEDACCOUNT 512
|
||||
/*! @} end of group7_6 */
|
||||
|
||||
|
||||
/*! @} end of group7 */
|
||||
|
||||
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,311 @@
|
||||
#ifndef _MSCLIENTCLASS_H_
|
||||
#define _MSCLIENTCLASS_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
#include "GSClientClass.h"
|
||||
//#include "GSLobbyCB.h"
|
||||
//#include "GSLoginCB.h"
|
||||
#include "define.h"
|
||||
|
||||
class LobbyInfo;
|
||||
class GameServerMap;
|
||||
class LobbyInfoList;
|
||||
|
||||
#define NOSTATE 0
|
||||
#define LOGIN_MASK (1L<<0)
|
||||
#define LOBBY_MASK (1L<<1)
|
||||
#define JOIN_MASK (1L<<2)
|
||||
#define REFRESH_MASK (1L<<3)
|
||||
#define ALTINFO_MASK (1L<<4)
|
||||
|
||||
class clMSClientClass : private clGLClient
|
||||
{
|
||||
public:
|
||||
clMSClientClass();
|
||||
~clMSClientClass();
|
||||
|
||||
GSbool Initialize(const GSchar *szMasterServerIP,
|
||||
GSushort usMasterServerPort,const GSchar *szUserName,
|
||||
const GSchar *szPassword, const GSchar *szVersion);
|
||||
GSbool Uninitialize();
|
||||
GSbool RequestGameServers(const GSchar *szGameName);
|
||||
GSbool RefreshGameServer(GSint iLobbyID,GSint iRoomID);
|
||||
GSbool RequestAlternateInfo(GSint iLobbyID,GSint iRoomID);
|
||||
GSbool JoinGameServer(GSint iLobbyID,GSint iRoomID,const GSchar *szPassword,
|
||||
const GSchar *szVersion, const GSchar *szGameName,
|
||||
const GSvoid *pvPlayerInfo, GSint iPlayerInfoSize);
|
||||
GSbool LeaveGameServer(GSint iLobbyID,GSint iRoomID);
|
||||
GSbool GameServerConnected(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
GSbool CreateAccount(const GSchar *szMasterServerIP,
|
||||
GSushort usMasterServerPort,const GSchar* szVersion,
|
||||
const GSchar* szNickName,const GSchar* szPassword,
|
||||
const GSchar* szFirstName,const GSchar* szLastName,
|
||||
const GSchar* szEmail,const GSchar* szCountry);
|
||||
GSbool ModifyAccount(const GSchar* szPassword, const GSchar* szFirstName,
|
||||
const GSchar* szLastName, const GSchar* szEmail,
|
||||
const GSchar* szCountry);
|
||||
|
||||
GSbool InitMatchResult(GSuint uiMatchID);
|
||||
GSbool SetMatchResult(GSchar* szAlias,GSuint uiFieldID,GSint iFieldValue);
|
||||
GSbool SubmitMatchResult(GSint iLobbyID,GSint iRoomID);
|
||||
GSbool UninitMatchResult();
|
||||
GSbool MatchStarted(GSint iLobbyID,GSint iRoomID);
|
||||
GSbool MatchFinished(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
GSbool RequestMOTD(const GSchar* szLanguage);
|
||||
|
||||
GSbool Engine(GSuint uiMaxPostingDelay = 500,
|
||||
GSuint uiMaxsOperationalDelay = 800);
|
||||
|
||||
//Callbacks
|
||||
virtual GSvoid GameServerCB(GSint iLobbyID,GSint iRoomID,GSshort siGroupType,
|
||||
GSchar *szGroupName,GSint iConfig,GSchar *szMaster,GSchar *szAllowedGames,
|
||||
GSchar *szGames,GSchar *szGameVersion,GSchar *szGSVersion,GSvoid *vpInfo,
|
||||
GSint iSize,GSuint uiMaxPlayer,GSuint uiNbrPlayer,GSuint uiMaxVisitor,
|
||||
GSuint uiNbrVisitor,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSint iEventID) = 0;
|
||||
virtual GSvoid ErrorCB(GSint iReason,GSint iLobbyID,GSint iRoomID) = 0;
|
||||
virtual GSvoid InitFinishedCB(GSubyte ucType,GSint iError,GSchar *szUserName) = 0;
|
||||
virtual GSvoid LoginDisconnectCB() = 0;
|
||||
virtual GSvoid LobbyDisconnectCB() = 0;
|
||||
virtual GSvoid RequestFinishedCB() = 0;
|
||||
virtual GSvoid JoinFinishedCB(GSint iLobbyID,GSint iRoomID,
|
||||
GSvoid *vpGameData,GSint iSize,GSchar *szIPAddress,
|
||||
GSchar *szAltIPAddress,GSushort usPort) = 0;
|
||||
virtual GSvoid AlternateInfoCB(GSint iLobbyID,GSint iRoomID,
|
||||
const GSvoid* pcAltGroupInfo,GSint iAltGroupInfoSize) = 0;
|
||||
|
||||
|
||||
virtual GSvoid AccountCreationCB(GSubyte ucType, GSint iReason) = 0;
|
||||
virtual GSvoid ModifyAccountCB(GSubyte ucType, GSint iReason) = 0;
|
||||
|
||||
virtual GSvoid MatchStartedCB(GSint iLobbyID,GSint iRoomID,GSuint uiMatchID) = 0;
|
||||
virtual GSvoid SubmitMatchCB(GSubyte ucType,GSint iReason,
|
||||
GSuint uiMatchID) = 0;
|
||||
|
||||
virtual GSvoid RequestMOTDCB(GSubyte ubType, GSchar *szUbiMOTD,
|
||||
GSchar *szGameMOTD, GSint iReason)=0;
|
||||
|
||||
//Ignore the rest of these functions
|
||||
public:
|
||||
GSvoid LobbyRcv_LoginReply(GSubyte ucType, GSint iReason);
|
||||
GSvoid LobbyRcv_LobbyDisconnection(GSint iLobbySrvID);
|
||||
GSvoid LobbyRcv_LobbyDisconnectAll();
|
||||
GSvoid LobbyRcv_CreateRoomReply(GSubyte ucType, GSint iReason,
|
||||
GSchar *pszRoom, GSint iGroupID,GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_JoinLobbyReply(GSubyte ucType, GSint iReason,
|
||||
GSchar *szReason,GSint iGroupID,GSint iLobbySrvID);
|
||||
GSvoid LobbyRcv_JoinRoomReply(GSubyte ucType, GSint iReason,
|
||||
GSchar *szReason,GSint iGroupID,GSint iLobbySrvID);
|
||||
GSvoid LobbyRcv_NewRoom(GSshort siGroupType,GSchar *pszGroupName,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSint iParentID,
|
||||
GSint iConfig, GSshort siGroupLevel,
|
||||
GSchar *pszMaster, GSchar *pszAllowedGames,
|
||||
GSchar *pszGames,GSchar *pszGameVersion,GSchar *pszGSVersion,
|
||||
GSvoid *vpInfo,GSint iSize,
|
||||
GSuint usMaxPlayer, GSuint usNbrPlayer,
|
||||
GSuint usMaxVisitor, GSuint usNbrVisitor,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSint iEventID);
|
||||
GSvoid LobbyRcv_NewLobby(GSshort siGroupType,GSchar *pszGroupName,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSint iParentID,
|
||||
GSint iConfig, GSshort siGroupLevel,
|
||||
GSchar *pszMaster, GSchar *pszAllowedGames,
|
||||
GSchar *pszGames,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint usMaxMember, GSuint usNbrMember,GSint iEventID);
|
||||
GSvoid LobbyRcv_RoomInfo(GSshort siGroupType,GSchar *pszGroupName,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSint iParentID,
|
||||
GSint iConfig, GSshort siGroupLevel,
|
||||
GSchar *pszMaster, GSchar *pszAllowedGames,
|
||||
GSchar *pszGames,GSchar *pszGameVersion,GSchar *pszGSVersion,
|
||||
GSvoid *vpInfo,GSint iSize,
|
||||
GSuint usMaxPlayer, GSuint usNbrPlayer,
|
||||
GSuint usMaxVisitor, GSuint usNbrVisitor,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSint iEventID);
|
||||
GSvoid LobbyRcv_LobbyInfo(GSshort siGroupType,GSchar *pszGroupName,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSint iParentID,
|
||||
GSint iConfig, GSshort siGroupLevel,
|
||||
GSchar *pszMaster, GSchar *pszAllowedGames,
|
||||
GSchar *pszGames,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint usMaxMember, GSuint usNbrMember,GSint iEventID);
|
||||
GSvoid LobbyRcv_GroupInfoGet(GSubyte ucType, GSint iLobbyID,
|
||||
GSint iRoomID);
|
||||
|
||||
GSvoid LobbyRcv_GroupRemove(GSint iGroupID,GSint iLobbySrvID){};
|
||||
|
||||
GSvoid LobbyRcv_MemberJoined(GSchar *szAlias,GSbool bVisitor,
|
||||
GSint* iGroupID,GSushort usNbGroup,GSint iLobbySrvID,
|
||||
GSchar *szIPAddress,GSchar *szAltIPAddress,GSushort usPing,
|
||||
GSvoid *vpPlayerData,GSint iDataSize,GSbool bJoin,
|
||||
GSushort usPlayerStatus){};
|
||||
GSvoid LobbyRcv_MemberLeave(GSchar *szAlias,GSint iGroupID,
|
||||
GSint iLobbySrvID){};
|
||||
|
||||
GSvoid LobbyRcv_StartMatchReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID){};
|
||||
|
||||
GSvoid LobbyRcv_MasterNewReply(GSubyte ucType, GSint iReason,
|
||||
GSchar *szAlias,GSint iGroupID,GSint iLobbyServerID){};
|
||||
GSvoid LobbyRcv_MasterChanged(GSint iGroupID,GSint iLobbySrvID ,
|
||||
GSchar *szAlias,GSchar *szIPAddress,GSchar *szAltIPAddress){};
|
||||
|
||||
GSvoid LobbyRcv_MatchFinishReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID){};
|
||||
|
||||
GSvoid LobbyRcv_KickOut(GSint iGroupID,GSint iLobbySrvID,GSchar *szReason){};
|
||||
GSvoid LobbyRcv_PlayerKickReply(GSubyte ucType, GSint iReason,
|
||||
GSchar *szAlias,GSint iGroupID,GSint iLobbyServerID){};
|
||||
GSvoid LobbyRcv_ParentGroupIDReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID, GSint iParentGroupID){};
|
||||
GSvoid LobbyRcv_GroupLeaveReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_GroupConfigUpdate(GSint iGroupID,GSint iLobbySrvID,
|
||||
GSint iFlags){};
|
||||
GSvoid LobbyRcv_MatchStarted(GSint iGroupID,GSint iLobbyServerID,
|
||||
GSuint uiMatchID);
|
||||
GSvoid LobbyRcv_GroupConfigUpdateReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_SubmitMatchResultReply(GSubyte ucType, GSint iReason,
|
||||
GSint iMatchID);
|
||||
GSvoid LobbyRcv_UpdatePing(GSint iGroupID,GSint iLobbySrvID,GSchar *szAlias,
|
||||
GSushort usPing){};
|
||||
|
||||
GSvoid LobbyRcv_StartGameReply(GSubyte ucType, GSint iReason,GSint iGroupID,
|
||||
GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_GameReadyReply(GSubyte ucType, GSint iReason,GSint iGroupID,
|
||||
GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_GameStarted(GSint iGroupID,GSint iLobbyServerID,
|
||||
GSvoid *vpGameData,GSint iSize,GSchar *szIPAddress,
|
||||
GSchar *szAltIPAddress,GSushort usPort);
|
||||
GSvoid LobbyRcv_NewGameMember(GSint iGroupID,GSint iLobbyServerID,
|
||||
GSchar *szAlias,GSbool bVisitor){};
|
||||
|
||||
GSvoid LobbyRcv_UpdateGameInfoReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_PlayerBanReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSchar *szAlias){};
|
||||
GSvoid LobbyRcv_PlayerUnBanReply(GSubyte ucType, GSint iReason,
|
||||
GSint iGroupID,GSint iLobbySrvID,GSchar *szAlias){};
|
||||
GSvoid LobbyRcv_PlayerBanList(GSint iGroupID,GSint iLobbySrvID,
|
||||
GSchar *szAlias){};
|
||||
GSvoid LobbyRcv_PlayerBanned(GSint iGroupID,GSint iLobbySrvID,
|
||||
GSchar *szReason){};
|
||||
GSvoid LobbyRcv_MatchReady(GSint iGroupID,GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_InfoRefresh(GSint iLobbySrvID){};
|
||||
|
||||
GSvoid LobbyRcv_SetPlayerInfoReply(GSubyte ucType, GSint iReason){};
|
||||
GSvoid LobbyRcv_PlayerInfoUpdate(GSchar *szAlias,GSvoid *vpPlayerData,
|
||||
GSint iPlayerDataSize){};
|
||||
GSvoid LobbyRcv_PlayerGroupList(GSchar *szAlias,GSint iGroupID,
|
||||
GSint iLobbySrvID){};
|
||||
GSvoid LobbyRcv_PlayerUpdateStatus(GSchar* szMember,
|
||||
GSushort usPlayerStatus){};
|
||||
GSvoid LobbyRcv_FinalMatchResults(GSuint uiMatchId, GSubyte ucType, GSint iReason, const LADDER_ROW *pResults, GSuint uiNumResult){};
|
||||
|
||||
GSvoid LobbyRcv_GetAlternateGroupInfoReply(GSubyte ucType, GSint iReason,
|
||||
const GSvoid* pcAltGroupInfo,GSint iAltGroupInfoSize, GSint iGroupID,
|
||||
GSint iLobbyServerID );
|
||||
|
||||
public:
|
||||
|
||||
GSvoid LoginRcv_PlayerInfo(GSubyte ucType, GSchar * pszNickName,
|
||||
GSchar * pszSurName, GSchar * pszFirstName, GSchar * pszCountry,
|
||||
GSchar * pszEmail, GSchar * szIRCID, GSchar * szIPAddress,GSint lReason );
|
||||
GSvoid LoginRcv_JoinWaitModuleResult(GSubyte ucType, GSchar * pszAddress,
|
||||
GSushort lPort, GSint lReason);
|
||||
GSvoid LoginRcv_LoginRouterResult(GSubyte ucType, GSint lReason);
|
||||
GSvoid LoginRcv_LoginWaitModuleResult(GSubyte ucType, GSint lReason);
|
||||
GSvoid LoginRcv_SystemPage(GSint lSubType, GSchar * pszText);
|
||||
GSvoid LoginRcv_LoginDisconnection();
|
||||
GSvoid LoginRcv_AccountCreationResult(GSubyte ucType, GSint lReason);
|
||||
GSvoid LoginRcv_ModifyUserResult(GSubyte ucType, GSint lReason);
|
||||
|
||||
GSvoid LoginRcv_RequestMOTD(GSubyte ubType, GSchar *szUbiMOTD,GSchar *szGameMOTD, GSint iReason);
|
||||
|
||||
public:
|
||||
GSvoid FriendsRcv_LoginResult(GSubyte ucType, GSint lReason){};
|
||||
GSvoid FriendsRcv_AddFriend(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszFriend){};
|
||||
GSvoid FriendsRcv_DelFriend(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszFriend){};
|
||||
GSvoid FriendsRcv_GetSession(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszPlayer,GSchar* pszSession, GSint lGroupID, GSint lParentID,
|
||||
GSint lMaxPlayers, GSint lMaxVisitors,GSint lNbPlayers,
|
||||
GSint lNbVisitors,GSchar* szMaster, GSint lConfig, GSchar* szInfo,
|
||||
GSchar* szGame){};
|
||||
GSvoid FriendsRcv_GetWebBased(GSchar* pszPlayer,
|
||||
GSchar* pszWebBasedURL){};
|
||||
GSvoid FriendsRcv_Page(GSchar* pszAlias, GSchar* pszMessage,
|
||||
GSchar* pszTimeStamp){};
|
||||
GSvoid FriendsRcv_PagePlayer(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszReceiver){};
|
||||
GSvoid FriendsRcv_PeerMsg(GSchar* pszAlias, GSvoid* p_Buffer,
|
||||
GSuint uiLength){};
|
||||
GSvoid FriendsRcv_PeerPlayer(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszReceiver){};
|
||||
GSvoid FriendsRcv_ChangeFriend(GSubyte ucType, GSint lReason){};
|
||||
GSvoid FriendsRcv_StatusChange(GSubyte ucType, GSint lReason){};
|
||||
GSvoid FriendsRcv_UpdateFriend(GSchar* pszFriend, GSint lStatus,
|
||||
GSchar* pszGroup, GSint lMood, GSint lOptions, GSchar *szGameName){};
|
||||
GSvoid FriendsRcv_SearchPlayer(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszAlias, GSint lStatus, GSchar *szGameName){};
|
||||
GSvoid FriendsRcv_ScoreCard(GSubyte ucType, GSint lReason,
|
||||
GSchar* pszPlayer,GSchar* pszGame, GSchar* pszScore){};
|
||||
GSvoid FriendsRcv_IgnorePlayer(GSRESULT rCode,const GSchar * szPlayer){};
|
||||
GSvoid FriendsRcv_UnignorePlayer(GSRESULT rCode,const GSchar * szPlayer){};
|
||||
GSvoid FriendsRcv_IgnoredPlayer( const GSchar * szPlayer ){};
|
||||
GSvoid FriendsRcv_ListIgnoredPlayers( GSRESULT rCode ){};
|
||||
|
||||
public:
|
||||
GSvoid PSRcv_LoginResult(GSubyte, GSint) {}
|
||||
GSvoid PSRcv_Disconnection() {}
|
||||
GSvoid PSRcv_GetDataReply(GSubyte, GSint, GSuint, GSvoid *, GSint) {}
|
||||
GSvoid PSRcv_SetDataReply(GSubyte, GSint, GSuint) {}
|
||||
|
||||
public:
|
||||
GSvoid LadderQueryRcv_RequestReply(GSubyte ucType, GSint iReason,
|
||||
GSuint uiRequestId){};
|
||||
|
||||
private:
|
||||
|
||||
GSbool StartLogin();
|
||||
GSbool LobbyDisconnect();
|
||||
GSbool LobbyConnect();
|
||||
|
||||
GSchar m_szUsername[NICKNAMELENGTH];
|
||||
GSchar m_szPassword[PASSWORDLENGTH];
|
||||
GSchar m_szVersion[VERSIONLENGTH];
|
||||
GSchar m_szRouterIP[IPADDRESSLENGTH];
|
||||
GSushort m_usPort;
|
||||
|
||||
GSchar m_szGameType[GAMELENGTH];
|
||||
|
||||
//GSint m_iState;
|
||||
GSsize_t m_uiTimeOut;
|
||||
|
||||
LobbyInfo *m_pstTargetLobby;
|
||||
GSvoid *m_pvPlayerInfo;
|
||||
GSint m_iPlayerInfoSize;
|
||||
|
||||
//LobbyInfoList *m_pstRequestedRefresh;
|
||||
//LobbyInfoList *m_pstRefreshList;
|
||||
|
||||
//LobbyInfoList *m_pstRequestedAltInfo;
|
||||
//LobbyInfoList *m_pstAltInfoList;
|
||||
|
||||
LobbyInfoList *m_pstBasicGroups;
|
||||
|
||||
//GameServerMap *m_pstGameServers;
|
||||
//GSuint m_uiUniqueID;
|
||||
|
||||
//GSbool m_bJoinLobbyOnce;
|
||||
//GSbool m_bJoinRoomOnce;
|
||||
|
||||
GSbool m_bReqestingServers;
|
||||
//GSbool m_bRefreshingServers;
|
||||
GSbool m_bJoinedServer;
|
||||
GSbool m_bJoiningServer;
|
||||
|
||||
GSbool m_bLobbyConnected;
|
||||
};
|
||||
#endif //_MSCLIENTCLASS_H_
|
||||
@@ -0,0 +1,957 @@
|
||||
|
||||
//****************************************************************************
|
||||
//* Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
//* Date: 4/19/02 1:44:25 PM
|
||||
/*! \file MSClientLibrary.h
|
||||
* \brief The header file for the Master Server Client Library
|
||||
*
|
||||
* This interface provides game client functionality to retrieve a list of
|
||||
* running game servers registered on Ubi.com (Master server list style).
|
||||
*/
|
||||
//****************************************************************************
|
||||
|
||||
#ifndef _MSCLIENTLIBRARY_H_
|
||||
#define _MSCLIENTLIBRARY_H_
|
||||
|
||||
#include "GSTypes.h"
|
||||
|
||||
/*!
|
||||
\mainpage gs-sdk-msclient
|
||||
\section intro Introduction
|
||||
Ubi.com master server list interface
|
||||
|
||||
|
||||
\section description Description
|
||||
This sdk provides functionalities for a game developper to add game server listing
|
||||
mechanism in his project. This system works by connecting on all Ubi.com lobbies
|
||||
and retrieving the list of game servers for the game requested.
|
||||
|
||||
*/
|
||||
|
||||
/*! @defgroup group1 Callback definitions
|
||||
\brief Callback definitions
|
||||
|
||||
These callbacks definitions are used by the game to process response to queries sent to Ubi.com.
|
||||
@{
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_GameServerCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 1:44:16 PM
|
||||
/*!
|
||||
\brief Receivec information on a game server.
|
||||
\par Description:
|
||||
This callback will be called whenever a game server is found for the request the client has made.
|
||||
|
||||
\param iLobbyID The id of the lobby server
|
||||
\param iRoomID The Id of the room.
|
||||
\param siGroupType The type of game server. (ROOM_DIRECTPLAY,ROOM_GAMEMODULE,ROOM_P2P,ROOM_CLIENTHOST)
|
||||
\param szGroupName The name of the game server
|
||||
\param iConfig The game server configuration flag
|
||||
\param szMaster The name of the master of the room.
|
||||
\param szAllowedGames The games allowed in this room.
|
||||
\param szGames The games that can be played in the room.
|
||||
\param szGameVersion The version of the game (information only)
|
||||
\param szGSVersion The version of the gs-game
|
||||
\param vpInfo A pointer to the game data
|
||||
\param iSize The size of the game data structure
|
||||
\param uiMaxPlayer The maximum number of players allowed in that room
|
||||
\param uiNbrPlayer The number of players currently in that room
|
||||
\param uiMaxVisitor The maximum number of visitors allowed in that room
|
||||
\param uiNbrVisitor The number of visitors currently in that room
|
||||
\param szIPAddress The ip address of the host (master) of the room
|
||||
\param szAltIPAddress The alternate ip address of the host (master) of the room
|
||||
\param iEventID The event id for that room
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_GameServerCB)(GSint iLobbyID,GSint iRoomID,
|
||||
GSshort siGroupType,GSchar *szGroupName, GSint iConfig,
|
||||
GSchar *szMaster,GSchar *szAllowedGames,GSchar *szGames,
|
||||
GSchar *szGameVersion,GSchar *szGSVersion,GSvoid *vpInfo,GSint iSize,
|
||||
GSuint uiMaxPlayer,GSuint uiNbrPlayer,GSuint uiMaxVisitor,
|
||||
GSuint uiNbrVisitor,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSint iEventID);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_AlternateInfoCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 8/19/02 1:44:16 PM
|
||||
/*!
|
||||
\brief The Alternate Info of a Game Server
|
||||
\par Description:
|
||||
This called when alternate information on a Game Server is received.
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
\param pcAltGroupInfo The alternate information
|
||||
\param iAltInfoSize The size of the alternate info
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_AlternateInfoCB)(GSint iLobbyID,GSint iRoomID,
|
||||
const GSvoid* pcAlternateInfo, GSint iAltInfoSize);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_ErrorCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:35:34 PM
|
||||
/*!
|
||||
\brief An error occured
|
||||
\par Description:
|
||||
Called when a error occurs. The reason can be looked up in LobbyDefine.h
|
||||
|
||||
\param iReason The reason for the error
|
||||
\param iLobbyID The ID of the lobby. 0 if the error doesn't involve a Lobby
|
||||
\param iRoomID The ID of the room. 0 if the error doesn't involve a Room
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_ErrorCB)(GSint iReason,GSint iLobbyID,
|
||||
GSint iRoomID);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_InitFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:36:34 PM
|
||||
/*!
|
||||
\brief The initialization has finished
|
||||
\par Description:
|
||||
The library has finished initializing and other functions can be called.
|
||||
If an error happened while initializing, the type will be GSFAIL and iError
|
||||
will contain the reason for the error. This value can be looked up in
|
||||
define.h
|
||||
|
||||
\param ucType GSSUCCESS or GSFAIL
|
||||
\param iError The reason for the GSFAIL
|
||||
\param szUserName The correct case of the players username.
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_InitFinishedCB)(GSubyte ucType, GSint iError,
|
||||
GSchar *szUserName);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_LoginDisconnectCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 8/9/02 5:29:53 PM
|
||||
/*!
|
||||
\brief The library has disconnected from the Router
|
||||
\par Description:
|
||||
The library has become disconnected from the Router. The client should
|
||||
uninitialize and then re-initialize the library. If the player was in a Game
|
||||
they will have to call MSClient_JoinGameServerByID and rejoin the GameServer.
|
||||
They do not have to disconnect from the game server, this should not
|
||||
interrupt the player while they play the game.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_LoginDisconnectCB)();
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_LobbyDisconnectCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 8/9/02 5:33:26 PM
|
||||
/*!
|
||||
\brief The library has disconnected from the Lobby
|
||||
\par Description:
|
||||
The library has become disconnected from the Lobby. The client does not need
|
||||
to uninitialize and re-initialize the library. If the player was in a Game
|
||||
they will have to call MSClient_JoinGameServerByID and rejoin the GameServer.
|
||||
They do not have to disconnect from the game server, this should not
|
||||
interrupt the player while they play the game.
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_LobbyDisconnectCB)();
|
||||
//============================================================================
|
||||
// CallBack MSClient_RequestFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:37:41 PM
|
||||
/*!
|
||||
\brief All the Game Servers have been downloaded
|
||||
\par Description:
|
||||
Called when all the Game Servers have been downloaded. This is currently
|
||||
3 seconds after the last Game Server has been received.
|
||||
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_RequestFinishedCB)();
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_JoinFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:41:32 PM
|
||||
/*!
|
||||
\brief Finished joining the game server
|
||||
\par Description:
|
||||
The library has finished joining the game server on the lobby.
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
\param vpGameData The Game data
|
||||
\param iSize The size of the Game Data
|
||||
\param szIPAddress The IP address of the game server
|
||||
\param szAltIPAddress The Alternate address
|
||||
\param usPort The Port of the game server
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_JoinFinishedCB)(GSint iLobbyID,GSint iRoomID,
|
||||
GSvoid *vpGameData,GSint iSize,GSchar *szIPAddress,GSchar *szAltIPAddress,
|
||||
GSushort usPort);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_AccountCreationCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/02 11:03:32 AM
|
||||
/*!
|
||||
\brief Account Creatation callback
|
||||
\par Description:
|
||||
Tells the client if the account creation was successfull.
|
||||
|
||||
\param ucType GSSUCCESS or GSFAIL
|
||||
\param iReason The reason for a GSFAIL.
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_AccountCreationCB)(GSubyte ucType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_ModifyAccountCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/02 11:03:32 AM
|
||||
/*!
|
||||
\brief Account Creatation callback
|
||||
\par Description:
|
||||
Tells the client if the account modification was successfull.
|
||||
|
||||
\param ucType GSSUCCESS or GSFAIL
|
||||
\param iReason The reason for a GSFAIL.
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_ModifyAccountCB)(GSubyte ucType,
|
||||
GSint iReason);
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_MatchStartedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 10:39:51 AM
|
||||
/*!
|
||||
\brief The match has started
|
||||
\par Description:
|
||||
The game server has started the match
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
\param uiMatchID The id of the started match
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_MatchStartedCB)(GSint iLobbyID,GSint iRoomID,
|
||||
GSuint uiMatchID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// CallBack MSClient_SubmitMatchCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 11:16:34 AM
|
||||
/*!
|
||||
\brief The replay to MSClient_SubmitMatchResult
|
||||
\par Description:
|
||||
Informs the program if the SubmitMatch was successful or not
|
||||
|
||||
\param ucType GSSUCCESS or GSFAIL
|
||||
\param iReason if usType is GSFAIL this is the reason. See LobbyDefines.h
|
||||
\param iMatchID The id of the match
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_SubmitMatchCB)(GSubyte ucType,
|
||||
GSint iReason,GSuint iMatchID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Callback MSClient_RequestMOTDCB
|
||||
|
||||
/*!
|
||||
\brief Receive the message of the day
|
||||
\par Description:
|
||||
This callback will be called when the client receives the MOTDs from the
|
||||
server. The messages will never be greater the MOTDLENGTH.
|
||||
|
||||
\par Related function:
|
||||
MSClient_RequestMOTD()
|
||||
|
||||
\par Errors:
|
||||
ERRORROUTER_DBPROBLEM: There is a problem with the database.<br>
|
||||
|
||||
\param ubType The status of the message received back (GSSUCCESS or GSFAIL)
|
||||
\param szUbiMOTD The message of the day for the Ubi.com Game Service
|
||||
\param szGameMOTD The message of the day for the game.
|
||||
\param iReason The reason for the failure if ubType is GSFAIL
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *MSClient_RequestMOTDCB)(GSubyte ubType,
|
||||
GSchar *szUbiMOTD, GSchar *szGameMOTD, GSint iReason);
|
||||
|
||||
/*! @} end of group1 */
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*! @defgroup group2 Master server client functionalities
|
||||
\brief Master server client API
|
||||
|
||||
API for the master server client library.
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_Initialize
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:48:31 PM
|
||||
/*!
|
||||
\brief Initialize the library
|
||||
\par Description:
|
||||
Initializes the library. This function will connect to and log on the Ubi.com network.
|
||||
Since this could take some time, the function returns and MSClient_InitFinishedCB is called to say
|
||||
when the login has finished.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param szMasterServerIP The IP of the GSRouter
|
||||
\param usMasterServerPort The port of the GSRotuer
|
||||
\param szUserName The players username
|
||||
\param szPassword The players password
|
||||
\param szVersion The client version
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_Initialize(const GSchar *szMasterServerIP,
|
||||
GSushort usMasterServerPort,const GSchar *szUserName,
|
||||
const GSchar *szPassword, const GSchar *szVersion);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_Uninitialize
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:58:14 PM
|
||||
/*!
|
||||
\brief Uninitialize the library
|
||||
\par Description:
|
||||
Uninitializes the library and frees all allocated memory
|
||||
|
||||
\return the success of the Function
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_Uninitialize();
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_Engine
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 2:59:11 PM
|
||||
/*!
|
||||
\brief Runs the Library
|
||||
\par Description:
|
||||
Sends and receives library messages
|
||||
|
||||
\return the success of the Function
|
||||
|
||||
\param uiMaxPostingDelay The maximum time to be spent inside the engine to
|
||||
read incomming messages and posting them to the message queue. (Milliseconds)
|
||||
\param uiMaxsOperationalDelay The maximum time to be spent inside the engine to
|
||||
decode message in the queue and calling appropriate callback. (Milliseconds)
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_Engine(GSuint uiMaxPostingDelay = 500,
|
||||
GSuint uiMaxsOperationalDelay = 800);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_RequestMOTD
|
||||
/*!
|
||||
\brief Request the message of the day
|
||||
\par Description:
|
||||
This function asks the server to send the message of the day based the client
|
||||
version and the requested language. If the requested language is not available
|
||||
it will default to english.
|
||||
|
||||
\par Callbacks:
|
||||
::MSClient_RequestMOTDCB
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE Account created successfully
|
||||
\retval GS_FALSE Failure to create account
|
||||
|
||||
\param szLanguage The language to receive the MOTD in.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_RequestMOTD(const GSchar *szLanguage);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_RequestGameServers
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:00:24 PM
|
||||
/*!
|
||||
\brief Request a new list of game servers
|
||||
\par Description:
|
||||
Request a list of Game Servers based on the ugly game name.
|
||||
MSClient_GameServerCB is called for each Game Server received.
|
||||
MSClient_RequestFinishedCB is called when the list is finished. You can call
|
||||
MSClient_JoinGameServer before the list is finished.
|
||||
|
||||
\return the success of the Function
|
||||
|
||||
\param szGameName The game name of the servers to request
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_RequestGameServers(const GSchar *szGameName);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_RefreshGameServers
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 6/12/02 5:25:28 PM
|
||||
/*!
|
||||
\brief Refresh certain Game Servers
|
||||
\par Description:
|
||||
Refresh the given Game Server. MSClient_GameServerCB is called for
|
||||
the Game Server refreshed.
|
||||
|
||||
\return the success of the Function
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_RefreshGameServer(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_RequestAlternateInfo
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 6/12/02 5:25:28 PM
|
||||
/*!
|
||||
\brief Request the alternate info of a game server.
|
||||
\par Description:
|
||||
Request the alternate information for the given Game Server.
|
||||
MSClient_AlternateInfoCB is called for when the request is received.
|
||||
|
||||
\return The success of the Function.
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_RequestAlternateInfo(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_JoinGameServer
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:24:58 PM
|
||||
/*!
|
||||
\brief Tells the library to join a Game Server
|
||||
\par Description:
|
||||
This lets the Lobby Server and GSRouter know what Game Server a player is on.
|
||||
MSClient_JoinFinishedCB is called when the Game Server has been joined.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
\param szPassword The password of the Game Server to join
|
||||
\param szGSVersion The GSVersion of the Game Server.
|
||||
\param szGameName The Game Name of the Ggame Server.
|
||||
\param pvPlayerInfo A buffer to send to the Game Server.
|
||||
\param iPlayerInfoSize The size of the pvPlayerInfo buffer in bytes.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_JoinGameServer(GSint iLobbyID,GSint iRoomID,
|
||||
const GSchar *szPassword,const GSchar *szGSVersion,const GSchar *szGameName,
|
||||
const GSvoid *pvPlayerInfo, GSint iPlayerInfoSize);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_LeaveGameServer
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:31:07 PM
|
||||
/*!
|
||||
\brief Leaves the Game Server
|
||||
\par Description:
|
||||
Tells the Lobby Server and GSRouter that the player has left the GameServer.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_LeaveGameServer(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_GameServerConnected
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 11/20/02 3:31:07 PM
|
||||
/*!
|
||||
\brief Leaves the Game Server
|
||||
\par Description:
|
||||
Tells the Lobby Server and that the player has connected to the GameServer.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_GameServerConnected(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_CreateAccount
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/02 11:31:07 AM
|
||||
/*!
|
||||
\brief Create an account
|
||||
\par Description:
|
||||
Create an account on the Game Service. This function has to be called before
|
||||
calling MSClient_Initialize() since that function requires a valid account.
|
||||
You must call MSClient_Engine() until you receive the callback
|
||||
MSClient_AccountCreationCB. Then you can call MSClient_Uninitialize() followed
|
||||
by MSClient_Initialize() with the created accounts username and password.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param szMasterServerIP The IP of the GSRouter
|
||||
\param usMasterServerPort The port of the GSRotuer
|
||||
\param szVersion Version of the player's client
|
||||
\param szNickName Alias of the player
|
||||
\param szPassword Password of the new player
|
||||
\param szFirstName Player's first name
|
||||
\param szLastName Player's last name
|
||||
\param szEmail Player's email
|
||||
\param szCountry Player's country
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_CreateAccount(const GSchar *szMasterServerIP,
|
||||
GSushort usMasterServerPort,const GSchar* szVersion,
|
||||
const GSchar* szNickName,const GSchar* szPassword,const GSchar* szFirstName,
|
||||
const GSchar* szLastName,const GSchar* szEmail,const GSchar* szCountry);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_ModifyAccount
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/02 11:31:07 AM
|
||||
/*!
|
||||
\brief Create an account
|
||||
\par Description:
|
||||
Modifies an account on the Game Service. The success of the modification is
|
||||
received by the MSClient_ModifyAccountCB callback.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param szPassword Password of the new player
|
||||
\param szFirstName Player's first name
|
||||
\param szLastName Player's last name
|
||||
\param szEmail Player's email
|
||||
\param szCountry Player's country
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_ModifyAccount(const GSchar* szPassword,
|
||||
const GSchar* szFirstName,const GSchar* szLastName, const GSchar* szEmail,
|
||||
const GSchar* szCountry);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_MatchStarted
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 2:00:49 PM
|
||||
/*!
|
||||
\brief Tell the lobby server that the player is starting a match
|
||||
\par Description:
|
||||
Tell the lobby server that the match you are starting a match
|
||||
This should be called after receiving the MSClient_MatchStartedCB callback.
|
||||
Everyone in the room who will be submiting scores for the match has to call
|
||||
this function.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_MatchStarted(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_InitMatchResult
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 1:54:52 PM
|
||||
/*!
|
||||
\brief Initialize the librairie score submission system
|
||||
\par Description:
|
||||
Initialize the librairie score submission system, this has to be called before
|
||||
doing any other score submission-related function call. Note that you must
|
||||
initialise the score submission system prior to any match that will be submitted.
|
||||
This should be call after receiving the MatchStarted message, and the scores
|
||||
should be cleared after being submitted to the lobby server with
|
||||
LobbySend_SubmitMatchResult.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param uiMatchID The match unique id as returned by CBLobbyRcv_MatchStarted
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_InitMatchResult(GSuint uiMatchID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_SetMatchResult
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 1:56:18 PM
|
||||
/*!
|
||||
\brief Set results for a player in a match
|
||||
\par Description:
|
||||
Set the result for a player in a match in the library's score submission
|
||||
system. Each player should set the result for each other player that where
|
||||
in the match including himself. This will insure validity of scores submitted
|
||||
to the LobbyServer.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param szAlias The alias of the player associated with the results
|
||||
\param uiFieldID The result field id
|
||||
\param iFieldValue The actual value that will be set for the specified field
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_SetMatchResult(GSchar* szAlias,
|
||||
GSuint uiFieldID,GSint iFieldValue);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_SubmitMatchResult
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 1:56:56 PM
|
||||
/*!
|
||||
\brief Send the compiled scores of a match to the lobby server
|
||||
\par Description:
|
||||
Send the compiled scores of a match to the lobby server for archiving,
|
||||
this will send a message to the lobby server and set the match result
|
||||
on the server-side. You will receive a confirmation of the message sent
|
||||
with the MSClient_SubmitMatchCB callback.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_SubmitMatchResult(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_UninitMatchResult
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 1:58:22 PM
|
||||
/*!
|
||||
\brief Unload the internal score submission system
|
||||
\par Description:
|
||||
Unload the internal score submission system previously initialized for a specific
|
||||
match. Must be called after scores has been submitted to the lobby server.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_UninitMatchResult();
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_MatchFinished
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 2:00:49 PM
|
||||
/*!
|
||||
\brief Tell the lobby server that a match is finished
|
||||
\par Description:
|
||||
Tell the lobby server that the match you were playing has Finished
|
||||
Everyone in the room has to call this function to confirm the end of the match after
|
||||
submiting the scores
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\param iLobbyID The ID of the Lobby Server
|
||||
\param iRoomID The ID of the Room.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_MatchFinished(GSint iLobbyID,GSint iRoomID);
|
||||
|
||||
/*! @} end of group2 */
|
||||
|
||||
/*! @defgroup group3 Callback registration
|
||||
\brief Register the callbacks function names.
|
||||
|
||||
Theses functions are used to register callbacks of the master server client API.
|
||||
@{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixRequestMOTD
|
||||
/*!
|
||||
\brief Set the function name for the callback.
|
||||
\par Description:
|
||||
This function is used to set the function name for the callback
|
||||
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\retval GS_TRUE Success
|
||||
\retval GS_FALSE Failure
|
||||
|
||||
\param fFunction Name of a function of type
|
||||
::MSClient_RequestMOTDCB
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixRequestMOTD(MSClient_RequestMOTDCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixGameServerCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:32:14 PM
|
||||
/*!
|
||||
\brief Fix the GameServer Callback
|
||||
\par Description:
|
||||
Register the callback function that will be called when information about a game server
|
||||
is received.
|
||||
|
||||
\return Status of the function call
|
||||
|
||||
\param fFunction The function to call.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixGameServerCB(MSClient_GameServerCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixAlternateInfoCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:32:14 PM
|
||||
/*!
|
||||
\brief Fix the AlternateInfo Callback
|
||||
\par Description:
|
||||
Register the callback function that will be called when extrended information about a game server
|
||||
is received.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixAlternateInfoCB(MSClient_AlternateInfoCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixErrorCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:33:20 PM
|
||||
/*!
|
||||
\brief Fix the Error Callback
|
||||
\par Description:
|
||||
Tells the library what function to call when an Error is received
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param fFunction The Function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixErrorCB(MSClient_ErrorCB fFunction);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixInitFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:37:05 PM
|
||||
/*!
|
||||
\brief Fix the InitFinished callback
|
||||
\par Description:
|
||||
Tells the library what function to call when initialization has finish.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixInitFinishedCB(MSClient_InitFinishedCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixLoginDisconnectCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 8/19/02 3:37:05 PM
|
||||
/*!
|
||||
\brief Fix the LoginDisconnect callback
|
||||
\par Description:
|
||||
Register the callback function that will be called when a disconnection
|
||||
from Ubi.com authentication servers is detected.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixLoginDisconnectCB(
|
||||
MSClient_LoginDisconnectCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixLoginDisconnectCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 8/19/02 3:37:05 PM
|
||||
/*!
|
||||
\brief Fix the LobbyDisconnect callback
|
||||
\par Description:
|
||||
Register the callback function that will be called when a disconnection
|
||||
from Ubi.com matchmaking servers is detected.
|
||||
|
||||
\return The success of the Function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixLobbyDisconnectCB(
|
||||
MSClient_LobbyDisconnectCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixRequestFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:40:32 PM
|
||||
/*!
|
||||
\brief Fix the RequestFinished callback
|
||||
\par Description:
|
||||
Register the callback function that will be called when a disconnection
|
||||
from Ubi.com matchmaking servers is detected.
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixRequestFinishedCB(
|
||||
MSClient_RequestFinishedCB fFunction);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixJoinFinishedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 4/19/02 3:42:19 PM
|
||||
/*!
|
||||
\brief Fix the JoinFinished callback
|
||||
\par Description:
|
||||
Tells the library what function to call when the Game Server has been joined.
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixJoinFinishedCB(MSClient_JoinFinishedCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_AccountCreationCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/03 11:15:19 AM
|
||||
/*!
|
||||
\brief Fix the AccountCreation callback
|
||||
\par Description:
|
||||
Tells the library what function to call when the Account Creation has finished.
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixAccountCreationCB(MSClient_AccountCreationCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_ModifyAccountCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 5/30/03 11:15:19 AM
|
||||
/*!
|
||||
\brief Fix the ModifyUser callback
|
||||
\par Description:
|
||||
Tells the library what function to call when the Account Modification has
|
||||
finished.
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixModifyAccountCB(MSClient_ModifyAccountCB fFunction);
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixMatchStartedCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 2:02:01 PM
|
||||
/*!
|
||||
\brief Fix the Match Started callback
|
||||
\par Description:
|
||||
Tells the library what function to call when a match has been started.
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixMatchStartedCB(MSClient_MatchStartedCB fFunction);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Function MSClient_FixSubmitMatchCB
|
||||
// Author: Scott Schmeisser gsdevteam@ubisoft.com
|
||||
// Date: 7/25/02 2:03:13 PM
|
||||
/*!
|
||||
\brief Fix the SubmitMatch callback
|
||||
\par Description:
|
||||
Tells the library what function to call when a SubmitMatch responce has been
|
||||
received
|
||||
|
||||
\return The success of the function
|
||||
|
||||
\param fFunction The function to call
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
GSbool __stdcall MSClient_FixSubmitMatchCB(MSClient_SubmitMatchCB fFunction);
|
||||
|
||||
/*! @} end of group3 */
|
||||
|
||||
|
||||
}
|
||||
#endif _MSCLIENTLIBRARY_H_
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
279
Ubisoft.com/GSServices/SDKS64/gs-sdk-nat/include/NATLibrary.h
Normal file
279
Ubisoft.com/GSServices/SDKS64/gs-sdk-nat/include/NATLibrary.h
Normal file
@@ -0,0 +1,279 @@
|
||||
//============================================================================
|
||||
/*!
|
||||
\file
|
||||
\brief The header file for the NAT Library
|
||||
|
||||
This header file describes the API for the NAT Library
|
||||
*/
|
||||
//============================================================================
|
||||
|
||||
#ifndef _NATLIBRARY_H_
|
||||
#define _NATLIBRARY_H_
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
/*!
|
||||
\mainpage gs-sdk-nat
|
||||
\section intro Introduction
|
||||
This is the NAT Library. It allows a program to find the external IP and port
|
||||
address of a socket.
|
||||
|
||||
|
||||
\section description Description
|
||||
|
||||
Definitions:
|
||||
|
||||
- Game Port: The port that the game wants to find the external address of.
|
||||
- External Address: The Internet IP address and port of the game port.
|
||||
|
||||
Getting started:
|
||||
- The game must only use UDP for its game communication. You can't tunnel NATs
|
||||
using TCP.
|
||||
- The game must have a function that will send a buffer of data as a
|
||||
UDP packet from the game port. See the callback ::GSNAT_SendMessageCB.
|
||||
- The game must have a function that this library can call, that will inform
|
||||
the game of the game ports's external address. See the callback
|
||||
::GSNAT_RequestFinishedCB.
|
||||
|
||||
Using the library:
|
||||
- The game calls GSNAT_Initialize(). If it fails the connection to the NAT
|
||||
Server could not be established. Try a different NAT Server.
|
||||
- Continue calling GSNAT_Engine() in order to process the requests and keep
|
||||
the requested external addresses alive.
|
||||
- Call GSNAT_RequestNATAddress() to request the external address of a game
|
||||
port. Mulitple game ports can have their external addresses reqested at
|
||||
once, but only one request per game port can be sent.
|
||||
- The ::GSNAT_RequestFinishedCB callback will inform the game of requested
|
||||
Game ports external address.
|
||||
|
||||
Distributing the external address:
|
||||
- The Game Server must distribute its external address to all the Game
|
||||
Clients. This can be done using the vpData parameter of
|
||||
LobbySend_CreateRoom() in gs-sdk-base SDK or pstGroupInfo paramter of
|
||||
RegServerSend_RegisterServerOnLobby() in the gs-sdk-regserver SDK.
|
||||
- The Game Client will now get the Game Server's external address with the
|
||||
CBLobbyRcv_NewRoom callback in gs-sdk-base or MSClient_GameServerCB in
|
||||
gs-sdk-msclient.
|
||||
- The Game Client must distribute its external address to the Game Server.
|
||||
This can be done using LobbySend_SetPlayerInfo() in the gs-sdk-base SDK.
|
||||
- The Game Server will now get the Game Client's external address in the
|
||||
CBLobbyRcv_MemberJoined callback of gs-sdk-base or the
|
||||
CBRegServerRcv_LobbyServerMemberNew callback of gs-sdk-regserver
|
||||
|
||||
Tunneling the NAT:
|
||||
- Now that the Game Server and Game Client know each others external address
|
||||
they must start sending "connection" messages to each others external
|
||||
address from their game ports. When both sides receive a connection message
|
||||
their NATs have been tunneled.
|
||||
- This means that a Game Server must start sending messages to a Game Client
|
||||
before it has received any messages from it. If it doesn't, its NAT may not
|
||||
allow message from the Game Client to reach it.
|
||||
|
||||
Problems with NATs:
|
||||
- This won't work with all NATs. Some open up a different external address
|
||||
for every endpoint. This means that the external address when sending
|
||||
messages to the game server will be different then the external address that
|
||||
was opened when sending messages to NAT server. Most NATs don't do this so
|
||||
most will behave properly.
|
||||
- If both NATs don't behave properly their is nothing a game can do. The user
|
||||
will have to setup port forwarding on the Game Server.
|
||||
- If only one of the NATs is behaving properly the Game behind it will notice
|
||||
that it is receiving connection messages from a different port then the one
|
||||
it is sending its connection messages to. For example, it is sending
|
||||
connection messages to 1.1.1.1:1200 but it is receving connection messages
|
||||
from 1.1.1.1:1300. The Game on the other side is not receiving any
|
||||
messages. When this is noticed it should stop sending messages to port 1200
|
||||
and switch to port 1300. The other side should now start receiving them.
|
||||
*/
|
||||
|
||||
/*! \defgroup Structures The Structure Definitions
|
||||
\brief The definitions for the structures
|
||||
|
||||
These strutures are used by the library.
|
||||
\{
|
||||
*/
|
||||
|
||||
/// The Internet Address stored as a character string.
|
||||
struct GSInternetAddress_char
|
||||
{
|
||||
GSchar szIPAddress[IPADDRESSLENGTH]; ///< The IP Address or Domain Name.
|
||||
GSushort usPort; ///< The port in host byte order.
|
||||
};
|
||||
|
||||
/// The Internet Address stored as a unsigned integer.
|
||||
struct GSInternetAddress_uint
|
||||
{
|
||||
GSuint uiIPAddress; ///< The IP Address in host byte order.
|
||||
GSushort usPort; ///< The port in host byte order.
|
||||
};
|
||||
|
||||
/// \}
|
||||
|
||||
|
||||
/*! \defgroup Callbacks The Callback Typedefs
|
||||
\brief The typedefs for the callbacks
|
||||
|
||||
These typedefs describe the callback functions that the game must implement.
|
||||
\{
|
||||
*/
|
||||
|
||||
//============================================================================
|
||||
// CallBack GSNAT_SendMessageCB
|
||||
/*!
|
||||
\brief The callback to send data from the requested game socket.
|
||||
\par Description:
|
||||
In order for the NATServer to know the external address of the
|
||||
Game Socket a message must be received by the NAT Server from it.
|
||||
|
||||
\par
|
||||
The implementation of this function must send the data on the Game Socket
|
||||
that matches the ubRequestID given by GSNAT_RequestNATAddress(). The library
|
||||
will use this function as if it is the BSD Socket function sendto().
|
||||
|
||||
\param ubRequestID The Request ID that was assigned by
|
||||
GSNAT_RequestNATAddress().
|
||||
\param pvSendMessageData The same pointer that was passed to
|
||||
GSNAT_RequestNATAddress().
|
||||
\param pubData The data to send on the Game Socket.
|
||||
\param uiDataSize The size in bytes of the pubData parameter.
|
||||
\param pstNetAddress The Internet Address to send the data to.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *GSNAT_SendMessageCB)(GSubyte ubRequestID,
|
||||
GSvoid *pvSendMessageData, GSubyte *pubData, GSuint uiDataSize,
|
||||
const GSInternetAddress_uint *pstNetAddress);
|
||||
|
||||
//============================================================================
|
||||
// CallBack GSNAT_RequestFinishedCB
|
||||
/*!
|
||||
\brief The callback to inform the client the request has finished.
|
||||
\par Description:
|
||||
This callback tells the client what the External address of the requested socket
|
||||
it. The possibe values for iResult are:
|
||||
- GSS_OK: There was no error.
|
||||
- GSE_CONNECTERROR: The connection to the NAT Server could not be
|
||||
established.
|
||||
- GSE_TIMEOUT: The request timed out.
|
||||
|
||||
\param ubRequestID The Request ID that was assigned by
|
||||
GSNAT_RequestExternalAddress().
|
||||
\param iResult The Result of the Callback.
|
||||
\param pvRequestFinishedData The same pointer that was passed to
|
||||
GSNAT_RequestExternalAddress().
|
||||
\param pstNATAddress The NAT address of the Game Socket. NULL if GSFAIL.
|
||||
|
||||
*/
|
||||
//============================================================================
|
||||
typedef GSvoid (__stdcall *GSNAT_RequestFinishedCB)(GSubyte ubRequestID,
|
||||
GSRESULT iResult, GSvoid *pvRequestFinishedData,
|
||||
const GSInternetAddress_uint *pstExternalAddress);
|
||||
|
||||
/// \}
|
||||
|
||||
|
||||
/*! \defgroup Functions The Functions
|
||||
\brief The Functions in the library
|
||||
|
||||
\{
|
||||
*/
|
||||
//============================================================================
|
||||
// Function GSNAT_Initialize
|
||||
/*!
|
||||
\brief Initializes the library.
|
||||
\par Description:
|
||||
This function initializes the library so it can be used.
|
||||
\par
|
||||
If it fails the connection to the NAT server could not be established and the
|
||||
client should call it again with a different NAT servers address. You do not
|
||||
have to call GSNAT_Uninitialize() if this function fails. Once it returns true
|
||||
the other functions in this library can be used.
|
||||
|
||||
\param pstServerAddress The Internet address NAT Server.
|
||||
\param usLocalPort The local port to reserve for the NAT Server connection.
|
||||
Use 0 for the default value.
|
||||
\param szUsername The username of the client.
|
||||
\param szGameName The game name of the client.
|
||||
\param szVersion The version of the client.
|
||||
|
||||
\retval GSS_OK The connection to the NAT Server was successful.
|
||||
\retval GSE_CONNECTERROR The connection to the NAT Server failed.
|
||||
\retval GSE_ALREADYINITIALIZED The library was already initialized.
|
||||
*/
|
||||
//============================================================================
|
||||
GSRESULT __stdcall GSNAT_Initialize(const GSInternetAddress_char *pstServerAddress,
|
||||
GSushort usLocalPort, const GSchar *szUsername, const GSchar *szGameName,
|
||||
const GSchar *szVersion);
|
||||
|
||||
//============================================================================
|
||||
// Function GSNAT_Uninitialize
|
||||
/*!
|
||||
\brief Uninitializes the library.
|
||||
\par Description:
|
||||
This function uninitializes the library and frees all memory. It should be
|
||||
called only when the game is finished with the sockets it requested the
|
||||
External Addresses of. Don't uninitialize the library after receiving the
|
||||
::GSNAT_RequestFinishedCB as the library must contine to send pings to the NAT
|
||||
Server
|
||||
|
||||
\retval GSS_OK The library was unintialized
|
||||
\retval GSE_NOTINITIALIZED The library wasn't initialized
|
||||
*/
|
||||
//============================================================================
|
||||
GSRESULT __stdcall GSNAT_Uninitialize();
|
||||
|
||||
//============================================================================
|
||||
// Function GSNAT_Engine
|
||||
/*!
|
||||
\brief Runs the library.
|
||||
\par Description:
|
||||
This function must be called repetedly in order to process the requests and
|
||||
keep the NAT Address alive. Even after receiving the responses to the
|
||||
requests, the client must continue to call this function or the NAT may
|
||||
change the Game Sockets NAT Address.
|
||||
|
||||
\retval GSS_OK There was no error
|
||||
\retval GSE_NOTINITIALIZED The library wasn't initialized
|
||||
*/
|
||||
//============================================================================
|
||||
GSRESULT __stdcall GSNAT_Engine();
|
||||
|
||||
//============================================================================
|
||||
// Function NAT_RequestNATAddress
|
||||
/*!
|
||||
\brief Request the External Address of a Game Socket.
|
||||
\par Description:
|
||||
This function requests the External address of a Game Socket. The Game Socket
|
||||
it self is not passed down. Instead a function that can send data on the
|
||||
socket is used instead. See the ::GSNAT_SendMessageCB.
|
||||
\par
|
||||
The pvSendMessageData and pvRequestFinsihedData are pointers that library
|
||||
passes to the callbacks. These could be pointers to structures or objects
|
||||
that the Callbacks can use to identify the Game Socket. These pointers are
|
||||
not used by the library in any way, they are just passed back in the
|
||||
callbacks.
|
||||
|
||||
\param pubRequestID The request ID assigned by the library. This can be used
|
||||
to identify the Game Socket.
|
||||
\param fSendMessageCB The callback to use to send data on the Game Socket.
|
||||
See ::GSNAT_SendMessageCB.
|
||||
\param pvSendMessageData The pointer to pass to the ::GSNAT_SendMessageCB
|
||||
callback.
|
||||
\param fRequestFinishedCB The callback to use to inform the client that the
|
||||
request has finished. See ::GSNAT_RequestFinishedCB
|
||||
\param pvRequestFinishedData The pointer to pass to the
|
||||
::GSNAT_RequestFinishedCB callback.
|
||||
|
||||
\retval GSS_OK There was no error
|
||||
\retval GSE_NOTINITIALIZED The library wasn't initialized
|
||||
*/
|
||||
//============================================================================
|
||||
GSRESULT __stdcall GSNAT_RequestNATAddress(GSubyte *pubRequestID,
|
||||
GSNAT_SendMessageCB fSendMessageCB, GSvoid *pvSendMessageData,
|
||||
GSNAT_RequestFinishedCB fRequestFinishedCB, GSvoid *pvRequestFinishedData);
|
||||
/// \}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif //_NATLIBRARY_H_
|
||||
BIN
Ubisoft.com/GSServices/SDKS64/gs-sdk-nat/lib_amd64/libgsnat.lib
Normal file
BIN
Ubisoft.com/GSServices/SDKS64/gs-sdk-nat/lib_amd64/libgsnat.lib
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user