-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for 1.148.5 (while implementing 1.150.0)
- Loading branch information
1 parent
84b7cf8
commit a7a16d6
Showing
32 changed files
with
7,043 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#include <GalaxyDLL.hxx> | ||
|
||
namespace galaxy::api { | ||
GALAXY_DLL_EXPORT void GALAXY_CALLTYPE Init(struct InitOptions const& initOptions) | ||
{ | ||
return universelan::client::Init(initOptions); | ||
} | ||
|
||
GALAXY_DLL_EXPORT void GALAXY_CALLTYPE ProcessData(void) | ||
{ | ||
universelan::client::ProcessData(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT void GALAXY_CALLTYPE Shutdown(void) | ||
{ | ||
universelan::client::Shutdown(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IApps* GALAXY_CALLTYPE Apps(void) | ||
{ | ||
return universelan::client::Apps(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IChat* GALAXY_CALLTYPE Chat(void) | ||
{ | ||
return universelan::client::Chat(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT ICustomNetworking* GALAXY_CALLTYPE CustomNetworking(void) | ||
{ | ||
return universelan::client::CustomNetworking(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IFriends* GALAXY_CALLTYPE Friends(void) | ||
{ | ||
return universelan::client::Friends(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IError const* GALAXY_CALLTYPE GetError(void) | ||
{ | ||
return universelan::client::GetError(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IListenerRegistrar* GALAXY_CALLTYPE ListenerRegistrar(void) | ||
{ | ||
return universelan::client::ListenerRegistrar(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT ILogger* GALAXY_CALLTYPE Logger(void) | ||
{ | ||
return universelan::client::Logger(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IMatchmaking* GALAXY_CALLTYPE Matchmaking(void) | ||
{ | ||
return universelan::client::Matchmaking(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT INetworking* GALAXY_CALLTYPE Networking(void) | ||
{ | ||
return universelan::client::Networking(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT INetworking* GALAXY_CALLTYPE ServerNetworking(void) | ||
{ | ||
return universelan::client::ServerNetworking(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT ITelemetry* GALAXY_CALLTYPE Telemetry(void) { | ||
return universelan::client::Telemetry(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IStats* GALAXY_CALLTYPE Stats(void) | ||
{ | ||
return universelan::client::Stats(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IStorage* GALAXY_CALLTYPE Storage(void) | ||
{ | ||
return universelan::client::Storage(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IUser* GALAXY_CALLTYPE User(void) | ||
{ | ||
return universelan::client::User(); | ||
} | ||
|
||
GALAXY_DLL_EXPORT IUtils* GALAXY_CALLTYPE Utils(void) | ||
{ | ||
return universelan::client::Utils(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <GalaxyApi.h> | ||
|
||
#include <chrono> | ||
#include <thread> | ||
|
||
using namespace galaxy::api; | ||
using namespace std::chrono; | ||
|
||
int main() | ||
{ | ||
InitOptions options("", ""); | ||
|
||
Init(options); | ||
|
||
while (true) | ||
{ | ||
ProcessData(); | ||
std::this_thread::sleep_for(milliseconds(5)); | ||
} | ||
return 0; | ||
} | ||
|
||
#ifdef _WIN32 | ||
#include <windows.h> | ||
|
||
int | ||
#ifndef _WIN64 | ||
__stdcall | ||
#endif | ||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) | ||
{ | ||
return main(); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#ifndef GALAXY_ERRORS_H | ||
#define GALAXY_ERRORS_H | ||
|
||
/** | ||
* @file | ||
* Contains classes representing exceptions. | ||
*/ | ||
|
||
#include "GalaxyExport.h" | ||
|
||
namespace galaxy | ||
{ | ||
namespace api | ||
{ | ||
/** | ||
* @addtogroup api | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* Base interface for exceptions. | ||
*/ | ||
class IError | ||
{ | ||
public: | ||
|
||
virtual ~IError() | ||
{ | ||
} | ||
|
||
/** | ||
* Returns the name of the error. | ||
* | ||
* @return The name of the error. | ||
*/ | ||
virtual const char* GetName() const = 0; | ||
|
||
/** | ||
* Returns the error message. | ||
* | ||
* @return The error message. | ||
*/ | ||
virtual const char* GetMsg() const = 0; | ||
|
||
/** | ||
* Type of error. | ||
*/ | ||
enum Type | ||
{ | ||
UNAUTHORIZED_ACCESS, | ||
INVALID_ARGUMENT, | ||
INVALID_STATE, | ||
RUNTIME_ERROR | ||
}; | ||
|
||
/** | ||
* Returns the type of the error. | ||
* | ||
* @return The type of the error. | ||
*/ | ||
virtual Type GetType() const = 0; | ||
}; | ||
|
||
/** | ||
* The exception thrown when calling Galaxy interfaces while | ||
* the user is not signed in and thus not authorized for any interaction. | ||
*/ | ||
class IUnauthorizedAccessError : public IError | ||
{ | ||
}; | ||
|
||
/** | ||
* The exception thrown to report that a method was called with an invalid argument. | ||
*/ | ||
class IInvalidArgumentError : public IError | ||
{ | ||
}; | ||
|
||
/** | ||
* The exception thrown to report that a method was called while the callee is in | ||
* an invalid state, i.e. should not have been called the way it was at that time. | ||
*/ | ||
class IInvalidStateError : public IError | ||
{ | ||
}; | ||
|
||
/** | ||
* The exception thrown to report errors that can only be detected during runtime. | ||
*/ | ||
class IRuntimeError : public IError | ||
{ | ||
}; | ||
|
||
/** | ||
* Retrieves error connected with the last API call on the local thread. | ||
* | ||
* @return Either the last API call error or NULL if there was no error. | ||
*/ | ||
GALAXY_DLL_EXPORT const IError* GALAXY_CALLTYPE GetError(); | ||
|
||
/** @} */ | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#ifndef GALAXY_I_ALLOCATOR_H | ||
#define GALAXY_I_ALLOCATOR_H | ||
|
||
/** | ||
* @file | ||
* Contains definition of custom memory allocator. | ||
*/ | ||
|
||
#include "stdint.h" | ||
#include <cstddef> | ||
|
||
namespace galaxy | ||
{ | ||
namespace api | ||
{ | ||
/** | ||
* @addtogroup api | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* Allocate function. | ||
* | ||
* @param [in] size Requested size of allocation. | ||
* @param [in] typeName String which identifies the type of allocation. | ||
* @return Pointer to memory block or NULL if it goes out of memory. | ||
*/ | ||
typedef void* (*GalaxyMalloc)(uint32_t size, const char* typeName); | ||
|
||
/** | ||
* Reallocate function. | ||
* | ||
* @param [in] ptr Pointer to the memory block to be reallocated. | ||
* @param [in] newSize New, requested size of allocation. | ||
* @param [in] typeName String which identifies the type of allocation. | ||
* @return Pointer to memory block or NULL if it goes out of memory. | ||
*/ | ||
typedef void* (*GalaxyRealloc)(void* ptr, uint32_t newSize, const char* typeName); | ||
|
||
/** | ||
* Free function. | ||
* | ||
* @param [in] ptr Pointer to memory block requested to be freed. | ||
*/ | ||
typedef void (*GalaxyFree)(void* ptr); | ||
|
||
/** | ||
* Custom memory allocator for GOG Galaxy SDK. | ||
*/ | ||
struct GalaxyAllocator | ||
{ | ||
/** | ||
* GalaxyAllocator default constructor. | ||
*/ | ||
GalaxyAllocator() | ||
: galaxyMalloc(NULL) | ||
, galaxyRealloc(NULL) | ||
, galaxyFree(NULL) | ||
{} | ||
|
||
/** | ||
* GalaxyAllocator constructor. | ||
* | ||
* @param [in] _galaxyMalloc Allocation function. | ||
* @param [in] _galaxyRealloc Reallocation function. | ||
* @param [in] _galaxyFree Free function. | ||
*/ | ||
GalaxyAllocator(GalaxyMalloc _galaxyMalloc, GalaxyRealloc _galaxyRealloc, GalaxyFree _galaxyFree) | ||
: galaxyMalloc(_galaxyMalloc) | ||
, galaxyRealloc(_galaxyRealloc) | ||
, galaxyFree(_galaxyFree) | ||
{} | ||
|
||
GalaxyMalloc galaxyMalloc; ///< Allocation function. | ||
GalaxyRealloc galaxyRealloc; ///< Reallocation function. | ||
GalaxyFree galaxyFree; ///< Free function. | ||
}; | ||
|
||
/** @} */ | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.