mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-15 11:14:20 +00:00
Remove old files
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
# Shared
|
||||
|
||||
[profile.dev]
|
||||
lto = "off"
|
||||
|
||||
[profile.release]
|
||||
lto = "thin"
|
||||
|
||||
# Windows
|
||||
|
||||
[target.'cfg(target_os = "windows")']
|
||||
rustflags = ["-C", "target-feature=+crt-static"]
|
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,34 +1,16 @@
|
||||
.metals/
|
||||
.vs/
|
||||
.vscode/
|
||||
bin/
|
||||
binaries/
|
||||
build/
|
||||
obj/
|
||||
saved/
|
||||
target/
|
||||
|
||||
.DS_Store
|
||||
.env
|
||||
*.crt
|
||||
*.csproj
|
||||
*.filters
|
||||
*.fsproj
|
||||
*.key
|
||||
*.log
|
||||
*.make
|
||||
*.mwb.bak
|
||||
*.pem
|
||||
*.sln
|
||||
*.user
|
||||
*.vcxproj
|
||||
*.vpp.*
|
||||
*.wasm
|
||||
*.xcodeproj
|
||||
*.xcworkspace
|
||||
Cargo.lock
|
||||
desktop.ini
|
||||
keystore.jks
|
||||
local.properties
|
||||
Makefile
|
||||
next-env.d.ts
|
||||
|
5
.openapi-generator-ignore
Normal file
5
.openapi-generator-ignore
Normal file
@ -0,0 +1,5 @@
|
||||
docs/
|
||||
|
||||
.gitignore
|
||||
git_push.sh
|
||||
README.md
|
107
.openapi-generator/FILES
Normal file
107
.openapi-generator/FILES
Normal file
@ -0,0 +1,107 @@
|
||||
CMakeLists.txt
|
||||
Config.cmake.in
|
||||
include/tribufu/AnyType.h
|
||||
include/tribufu/ApiClient.h
|
||||
include/tribufu/ApiConfiguration.h
|
||||
include/tribufu/ApiException.h
|
||||
include/tribufu/HttpContent.h
|
||||
include/tribufu/IHttpBody.h
|
||||
include/tribufu/JsonBody.h
|
||||
include/tribufu/ModelBase.h
|
||||
include/tribufu/MultipartFormData.h
|
||||
include/tribufu/Object.h
|
||||
include/tribufu/api/TribufuGeneratedApi.h
|
||||
include/tribufu/model/Account.h
|
||||
include/tribufu/model/Application.h
|
||||
include/tribufu/model/ApplicationType.h
|
||||
include/tribufu/model/AuthorizeRequest.h
|
||||
include/tribufu/model/CodeChallengeMethod.h
|
||||
include/tribufu/model/CryptoViewModel.h
|
||||
include/tribufu/model/Game.h
|
||||
include/tribufu/model/GameServer.h
|
||||
include/tribufu/model/GameServerCluster.h
|
||||
include/tribufu/model/GrantType.h
|
||||
include/tribufu/model/Group.h
|
||||
include/tribufu/model/GroupGame.h
|
||||
include/tribufu/model/GroupMember.h
|
||||
include/tribufu/model/GroupRank.h
|
||||
include/tribufu/model/HashViewModel.h
|
||||
include/tribufu/model/IntrospectRequest.h
|
||||
include/tribufu/model/IpAddress.h
|
||||
include/tribufu/model/LeaderboardItem.h
|
||||
include/tribufu/model/LeaderboardOrder.h
|
||||
include/tribufu/model/LoginProvider.h
|
||||
include/tribufu/model/LoginRequest.h
|
||||
include/tribufu/model/LoginResponse.h
|
||||
include/tribufu/model/Package.h
|
||||
include/tribufu/model/Profile.h
|
||||
include/tribufu/model/ProfileGame.h
|
||||
include/tribufu/model/ProfileGroup.h
|
||||
include/tribufu/model/RefreshRequest.h
|
||||
include/tribufu/model/RegisterRequest.h
|
||||
include/tribufu/model/ResponseType.h
|
||||
include/tribufu/model/RevokeRequest.h
|
||||
include/tribufu/model/SearchRequest.h
|
||||
include/tribufu/model/SearchType.h
|
||||
include/tribufu/model/ServerMetrics.h
|
||||
include/tribufu/model/ServerStatus.h
|
||||
include/tribufu/model/Subscription.h
|
||||
include/tribufu/model/TokenHintType.h
|
||||
include/tribufu/model/TokenRequest.h
|
||||
include/tribufu/model/TokenResponse.h
|
||||
include/tribufu/model/TokenType.h
|
||||
include/tribufu/model/UpdateProfile.h
|
||||
include/tribufu/model/UserInfo.h
|
||||
include/tribufu/model/UserType.h
|
||||
src/AnyType.cpp
|
||||
src/ApiClient.cpp
|
||||
src/ApiConfiguration.cpp
|
||||
src/ApiException.cpp
|
||||
src/HttpContent.cpp
|
||||
src/JsonBody.cpp
|
||||
src/ModelBase.cpp
|
||||
src/MultipartFormData.cpp
|
||||
src/Object.cpp
|
||||
src/api/TribufuGeneratedApi.cpp
|
||||
src/model/Account.cpp
|
||||
src/model/Application.cpp
|
||||
src/model/ApplicationType.cpp
|
||||
src/model/AuthorizeRequest.cpp
|
||||
src/model/CodeChallengeMethod.cpp
|
||||
src/model/CryptoViewModel.cpp
|
||||
src/model/Game.cpp
|
||||
src/model/GameServer.cpp
|
||||
src/model/GameServerCluster.cpp
|
||||
src/model/GrantType.cpp
|
||||
src/model/Group.cpp
|
||||
src/model/GroupGame.cpp
|
||||
src/model/GroupMember.cpp
|
||||
src/model/GroupRank.cpp
|
||||
src/model/HashViewModel.cpp
|
||||
src/model/IntrospectRequest.cpp
|
||||
src/model/IpAddress.cpp
|
||||
src/model/LeaderboardItem.cpp
|
||||
src/model/LeaderboardOrder.cpp
|
||||
src/model/LoginProvider.cpp
|
||||
src/model/LoginRequest.cpp
|
||||
src/model/LoginResponse.cpp
|
||||
src/model/Package.cpp
|
||||
src/model/Profile.cpp
|
||||
src/model/ProfileGame.cpp
|
||||
src/model/ProfileGroup.cpp
|
||||
src/model/RefreshRequest.cpp
|
||||
src/model/RegisterRequest.cpp
|
||||
src/model/ResponseType.cpp
|
||||
src/model/RevokeRequest.cpp
|
||||
src/model/SearchRequest.cpp
|
||||
src/model/SearchType.cpp
|
||||
src/model/ServerMetrics.cpp
|
||||
src/model/ServerStatus.cpp
|
||||
src/model/Subscription.cpp
|
||||
src/model/TokenHintType.cpp
|
||||
src/model/TokenRequest.cpp
|
||||
src/model/TokenResponse.cpp
|
||||
src/model/TokenType.cpp
|
||||
src/model/UpdateProfile.cpp
|
||||
src/model/UserInfo.cpp
|
||||
src/model/UserType.cpp
|
1
.openapi-generator/VERSION
Normal file
1
.openapi-generator/VERSION
Normal file
@ -0,0 +1 @@
|
||||
7.12.0
|
104
CMakeLists.txt
Normal file
104
CMakeLists.txt
Normal file
@ -0,0 +1,104 @@
|
||||
#
|
||||
# Tribufu API
|
||||
# REST API to access Tribufu services.
|
||||
#
|
||||
# The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
# https://openapi-generator.tech
|
||||
#
|
||||
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
|
||||
project(tribufu CXX)
|
||||
|
||||
# Force -fPIC even if the project is configured for building a static library.
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(CXX_STANDARD_REQUIRED ON)
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
if(DEFINED CMAKE_CXX20_STANDARD_COMPILE_OPTION OR
|
||||
DEFINED CMAKE_CXX20_EXTENSION_COMPILE_OPTION)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
elseif(DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION OR
|
||||
DEFINED CMAKE_CXX17_EXTENSION_COMPILE_OPTION)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
elseif(DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION OR
|
||||
DEFINED CMAKE_CXX14_EXTENSION_COMPILE_OPTION)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
find_package(cpprestsdk REQUIRED)
|
||||
find_package(Boost REQUIRED)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
file(GLOB_RECURSE HEADER_FILES "include/*.h")
|
||||
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
|
||||
|
||||
add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})
|
||||
|
||||
target_compile_options(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
|
||||
-Wall -Wno-unused-variable -Wno-unused-lambda-capture>
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
message(STATUS "Building client library for Linux/Unix")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest)
|
||||
else()
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest crypto)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Building client library for Windows")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest)
|
||||
else()
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest bcrypt)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS ${PROJECT_NAME}
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
)
|
16
Cargo.toml
16
Cargo.toml
@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "tribufu-native"
|
||||
version = "0.0.4"
|
||||
description = "Tribufu Native"
|
||||
repository = "https://github.com/Tribufu/TribufuNative"
|
||||
authors = ["Tribufu <contact@tribufu.com>"]
|
||||
license = "Apache-2.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
name = "tribufu_native"
|
||||
crate-type = ["staticlib"]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
5
Config.cmake.in
Normal file
5
Config.cmake.in
Normal file
@ -0,0 +1,5 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake)
|
||||
|
||||
check_required_components("@PROJECT_NAME@")
|
@ -1,157 +0,0 @@
|
||||
language = "C"
|
||||
header = "// Copyright (c) Tribufu. All Rights Reserved."
|
||||
pragma_once = true
|
||||
include_version = false
|
||||
namespaces = []
|
||||
using_namespaces = []
|
||||
sys_includes = ["tribufu/prelude.h"]
|
||||
includes = []
|
||||
no_includes = true
|
||||
cpp_compat = false
|
||||
braces = "NextLine"
|
||||
line_length = 100
|
||||
tab_width = 4
|
||||
documentation = true
|
||||
documentation_style = "doxy"
|
||||
style = "tag"
|
||||
|
||||
[defines]
|
||||
"debug_assertions" = "TRIBUFU_DEVEL"
|
||||
"not(debug_assertions)" = "TRIBUFU_RETAIL"
|
||||
"panic = abort" = "TRIBUFU_PANIC_ABORT"
|
||||
"panic = unwind" = "TRIBUFU_PANIC_UNWIND"
|
||||
"proc_macro" = "TRIBUFU_PROC_MACRO"
|
||||
"target_arch = aarch64" = "TRIBUFU_AARCH64"
|
||||
"target_arch = arm" = "TRIBUFU_ARM"
|
||||
"target_arch = armV7" = "TRIBUFU_ARMV7"
|
||||
"target_arch = armv4t" = "TRIBUFU_ARMV4T"
|
||||
"target_arch = armv6" = "TRIBUFU_ARMV6"
|
||||
"target_arch = armv7a" = "TRIBUFU_ARMV7A"
|
||||
"target_arch = armv7s" = "TRIBUFU_ARMV7S"
|
||||
"target_arch = avr" = "TRIBUFU_AVR"
|
||||
"target_arch = bpfeb" = "TRIBUFU_BPFEB"
|
||||
"target_arch = bpfel" = "TRIBUFU_BPFEL"
|
||||
"target_arch = hexagon" = "TRIBUFU_HEXAGON"
|
||||
"target_arch = i386" = "TRIBUFU_I386"
|
||||
"target_arch = i586" = "TRIBUFU_I586"
|
||||
"target_arch = i686" = "TRIBUFU_I686"
|
||||
"target_arch = m68k" = "TRIBUFU_M68K"
|
||||
"target_arch = mips" = "TRIBUFU_MIPS"
|
||||
"target_arch = mipsel" = "TRIBUFU_MIPSEL"
|
||||
"target_arch = msp430" = "TRIBUFU_MSP430"
|
||||
"target_arch = powerpc" = "TRIBUFU_POWERPC"
|
||||
"target_arch = powerpc64" = "TRIBUFU_POWERPC64"
|
||||
"target_arch = powerpc64l" = "TRIBUFU_POWERPC64L"
|
||||
"target_arch = riscv32gc" = "TRIBUFU_RISCV32GC"
|
||||
"target_arch = s390x" = "TRIBUFU_S390X"
|
||||
"target_arch = sparc" = "TRIBUFU_SPARC"
|
||||
"target_arch = sparc64" = "TRIBUFU_SPARC64"
|
||||
"target_arch = thumbv4t" = "TRIBUFU_THUMBV4T"
|
||||
"target_arch = thumbv7a" = "TRIBUFU_THUMBV7A"
|
||||
"target_arch = thumbv7neon" = "TRIBUFU_THUMBV7NEON"
|
||||
"target_arch = wasm32" = "TRIBUFU_WASM32"
|
||||
"target_arch = wasm64" = "TRIBUFU_WASM64"
|
||||
"target_arch = x86" = "TRIBUFU_X86"
|
||||
"target_arch = x86_64" = "TRIBUFU_X86_64"
|
||||
"target_endian = big" = "TRIBUFU_BIG_ENDIAN"
|
||||
"target_endian = little" = "TRIBUFU_LITTLE_ENDIAN"
|
||||
"target_env = gnu" = "TRIBUFU_GNU"
|
||||
"target_env = msvc" = "TRIBUFU_MSVC"
|
||||
"target_env = musl" = "TRIBUFU_MUSL"
|
||||
"target_env = sgx" = "TRIBUFU_SGX"
|
||||
"target_family = unix" = "TRIBUFU_UNIX"
|
||||
"target_family = wasm" = "TRIBUFU_WASM"
|
||||
"target_family = windows" = "TRIBUFU_MICROSOFT"
|
||||
"target_feature = avx" = "TRIBUFU_AVX"
|
||||
"target_feature = avx2" = "TRIBUFU_AVX2"
|
||||
"target_feature = crt-static" = "TRIBUFU_CRTSTATIC"
|
||||
"target_feature = rdrand" = "TRIBUFU_RDRAND"
|
||||
"target_feature = sse" = "TRIBUFU_SSE"
|
||||
"target_feature = sse2" = "TRIBUFU_SSE2"
|
||||
"target_feature = sse4.1" = "TRIBUFU_SSE41"
|
||||
"target_has_atomic = 128" = "TRIBUFU_ATOMIC_128"
|
||||
"target_has_atomic = 16" = "TRIBUFU_ATOMIC_16"
|
||||
"target_has_atomic = 32" = "TRIBUFU_ATOMIC_32"
|
||||
"target_has_atomic = 64" = "TRIBUFU_ATOMIC_64"
|
||||
"target_has_atomic = 8" = "TRIBUFU_ATOMIC_8"
|
||||
"target_has_atomic = ptr" = "TRIBUFU_ATOMIC_PTR"
|
||||
"target_os = android" = "TRIBUFU_ANDROID"
|
||||
"target_os = dragonfly" = "TRIBUFU_DRAGONFLY"
|
||||
"target_os = freebsd" = "TRIBUFU_FREEBSD"
|
||||
"target_os = ios" = "TRIBUFU_IOS"
|
||||
"target_os = linux" = "TRIBUFU_LINUX"
|
||||
"target_os = macos" = "TRIBUFU_MACOS"
|
||||
"target_os = netbsd" = "TRIBUFU_NETBSD"
|
||||
"target_os = openbsd" = "TRIBUFU_OPENBSD"
|
||||
"target_os = windows" = "TRIBUFU_WINDOWS"
|
||||
"target_pointer_width = 16" = "TRIBUFU_POINTER_16"
|
||||
"target_pointer_width = 32" = "TRIBUFU_POINTER_32"
|
||||
"target_pointer_width = 64" = "TRIBUFU_POINTER_64"
|
||||
"target_vendor = apple" = "TRIBUFU_APPLE"
|
||||
"target_vendor = fortanix" = "TRIBUFU_FORTANIX"
|
||||
"target_vendor = pc" = "TRIBUFU_MICROSOFT"
|
||||
"target_vendor = unknown" = "TRIBUFU_UNKNOWN"
|
||||
|
||||
[export]
|
||||
include = []
|
||||
exclude = []
|
||||
item_types = ["enums", "structs", "typedefs", "functions"]
|
||||
renaming_overrides_prefixing = false
|
||||
|
||||
[layout]
|
||||
packed = "PACKED"
|
||||
aligned_n = "ALIGNED"
|
||||
|
||||
[fn]
|
||||
prefix = "NATIVE_API"
|
||||
args = "horizontal"
|
||||
must_use = "MUST_USE_FUNC"
|
||||
no_return = "NO_RETURN"
|
||||
rename_args = "None"
|
||||
sort_by = "Name"
|
||||
|
||||
[struct]
|
||||
rename_fields = "None"
|
||||
must_use = "MUST_USE_STRUCT"
|
||||
derive_constructor = true
|
||||
derive_eq = false
|
||||
derive_neq = false
|
||||
derive_lt = false
|
||||
derive_lte = false
|
||||
derive_gt = false
|
||||
derive_gte = false
|
||||
|
||||
[enum]
|
||||
rename_variants = "None"
|
||||
add_sentinel = false
|
||||
prefix_with_name = false
|
||||
enum_class = false
|
||||
derive_helper_methods = false
|
||||
derive_const_casts = false
|
||||
derive_mut_casts = false
|
||||
must_use = "MUST_USE_ENUM"
|
||||
derive_tagged_enum_destructor = false
|
||||
derive_tagged_enum_copy_constructor = false
|
||||
derive_tagged_enum_copy_assignment = false
|
||||
private_default_tagged_enum_constructor = false
|
||||
|
||||
[const]
|
||||
allow_static_const = true
|
||||
allow_constexpr = false
|
||||
sort_by = "Name"
|
||||
|
||||
[macro_expansion]
|
||||
bitflags = true
|
||||
|
||||
[parse]
|
||||
parse_deps = true
|
||||
include = []
|
||||
exclude = []
|
||||
clean = false
|
||||
extra_bindings = []
|
||||
|
||||
[parse.expand]
|
||||
crates = []
|
||||
all_features = true
|
||||
default_features = true
|
||||
features = []
|
@ -1,6 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/client.h>
|
||||
#include <tribufu/json.h>
|
@ -1,27 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/options.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
static const char *VERSION = "0.0.4";
|
||||
static const char *API_URL = "https://api.tribufu.com";
|
||||
|
||||
class TRIBUFU_API TribufuApi
|
||||
{
|
||||
private:
|
||||
std::string base_url;
|
||||
TribufuApiOptions options;
|
||||
|
||||
public:
|
||||
TribufuApi();
|
||||
TribufuApi(std::string api_key);
|
||||
TribufuApi(TribufuApiOptions options);
|
||||
~TribufuApi();
|
||||
static TribufuApi from_env();
|
||||
static TribufuApi from_env(std::string prefix);
|
||||
};
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/api.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
class TRIBUFU_API TribufuClient : public TribufuApi
|
||||
{
|
||||
private:
|
||||
uint64_t client_id;
|
||||
std::string client_secret;
|
||||
|
||||
public:
|
||||
TribufuClient(uint64_t id, const std::string &secret);
|
||||
~TribufuClient();
|
||||
uint64_t &get_client_id();
|
||||
};
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/native.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
#ifdef TRIBUFU_CPP
|
||||
#include <nlohmann/json.hpp>
|
||||
using json = nlohmann::json;
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define TRIBUFU_CPP
|
||||
#endif
|
||||
|
||||
#ifdef TRIBUFU_LIBRARY
|
||||
#define TRIBUFU_API DLLEXPORT
|
||||
#else
|
||||
#define TRIBUFU_API DLLIMPORT
|
||||
#endif
|
||||
|
||||
// Macros Utils
|
||||
|
||||
#define TRIBUFU_EXPAND_MACRO(x) x
|
||||
#define TRIBUFU_STRINGIFY_MACRO(x) #x
|
@ -1,5 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
@ -1,133 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
enum class TRIBUFU_API OAuth2ResponseType
|
||||
{
|
||||
Code,
|
||||
Token,
|
||||
};
|
||||
|
||||
enum class TRIBUFU_API OAuth2ClientType
|
||||
{
|
||||
Confidential,
|
||||
Public,
|
||||
};
|
||||
|
||||
enum class TRIBUFU_API OAuth2TokenHintType
|
||||
{
|
||||
AccessToken,
|
||||
RefreshToken,
|
||||
};
|
||||
|
||||
enum class TRIBUFU_API OAuth2GrantType
|
||||
{
|
||||
AuthorizationCode,
|
||||
ClientCredentials,
|
||||
DeviceCode,
|
||||
Password,
|
||||
RefreshToken,
|
||||
};
|
||||
|
||||
enum class TRIBUFU_API OAuth2AuthorizeError
|
||||
{
|
||||
AccessDenied,
|
||||
InvalidRequest,
|
||||
InvalidScope,
|
||||
ServerError,
|
||||
TemporarilyUnavailable,
|
||||
UnauthorizedClient,
|
||||
UnsupportedResponseType,
|
||||
};
|
||||
|
||||
enum class TRIBUFU_API OAuth2TokenType
|
||||
{
|
||||
Bearer,
|
||||
};
|
||||
|
||||
class TRIBUFU_API OAuth2AuthorizeRequest
|
||||
{
|
||||
private:
|
||||
OAuth2ResponseType response_type;
|
||||
uint64_t client_id;
|
||||
std::string client_secret;
|
||||
std::string redirect_uri;
|
||||
std::string scope;
|
||||
std::string state;
|
||||
|
||||
public:
|
||||
OAuth2AuthorizeRequest();
|
||||
OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret,
|
||||
const std::string &redirect_uri, const std::string &scope, const std::string &state);
|
||||
~OAuth2AuthorizeRequest();
|
||||
};
|
||||
|
||||
class TRIBUFU_API OAuth2CodeResponse
|
||||
{
|
||||
private:
|
||||
std::string code;
|
||||
std::string state;
|
||||
|
||||
public:
|
||||
OAuth2CodeResponse();
|
||||
OAuth2CodeResponse(const std::string &code, const std::string &state);
|
||||
~OAuth2CodeResponse();
|
||||
};
|
||||
|
||||
class TRIBUFU_API OAuth2ErrorResponse
|
||||
{
|
||||
private:
|
||||
OAuth2AuthorizeError error;
|
||||
std::string error_description;
|
||||
std::string error_uri;
|
||||
std::string state;
|
||||
|
||||
public:
|
||||
OAuth2ErrorResponse();
|
||||
OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description,
|
||||
const std::string &error_uri, const std::string &state);
|
||||
~OAuth2ErrorResponse();
|
||||
};
|
||||
|
||||
class TRIBUFU_API OAuth2TokenRequest
|
||||
{
|
||||
private:
|
||||
OAuth2GrantType grant_type;
|
||||
uint64_t client_id;
|
||||
std::string client_secret;
|
||||
std::string redirect_uri;
|
||||
std::string code;
|
||||
std::string refresh_token;
|
||||
std::string username;
|
||||
std::string password;
|
||||
|
||||
public:
|
||||
OAuth2TokenRequest();
|
||||
OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret,
|
||||
const std::string &redirect_uri, const std::string &code, const std::string &refresh_token,
|
||||
const std::string &username, const std::string &password);
|
||||
~OAuth2TokenRequest();
|
||||
};
|
||||
|
||||
class TRIBUFU_API OAuth2TokenResponse
|
||||
{
|
||||
private:
|
||||
OAuth2TokenType token_type;
|
||||
std::string access_token;
|
||||
std::string refresh_token;
|
||||
std::string scope;
|
||||
std::string state;
|
||||
uint64_t expires_in;
|
||||
|
||||
public:
|
||||
OAuth2TokenResponse();
|
||||
OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token,
|
||||
const std::string &refresh_token, const std::string &scope, const std::string &state,
|
||||
uint64_t expires_in);
|
||||
~OAuth2TokenResponse();
|
||||
};
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
class TRIBUFU_API TribufuApiOptions
|
||||
{
|
||||
public:
|
||||
std::string api_key;
|
||||
std::string access_token;
|
||||
std::string refresh_token;
|
||||
float expires_in;
|
||||
|
||||
public:
|
||||
TribufuApiOptions();
|
||||
TribufuApiOptions(std::string api_key);
|
||||
TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in);
|
||||
TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token, float expires_in);
|
||||
~TribufuApiOptions();
|
||||
};
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef DLLEXPORT
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#endif
|
||||
#ifndef DLLIMPORT
|
||||
#define DLLIMPORT __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __MACH__ || __APPLE__ || __linux__ || __FreeBSD__ || __ANDROID__
|
||||
#ifndef DLLEXPORT
|
||||
#define DLLEXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#ifndef DLLIMPORT
|
||||
#define DLLIMPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#endif
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/macros.h>
|
||||
#include <tribufu/native.h>
|
||||
#include <tribufu/platform.h>
|
||||
#include <tribufu/std.h>
|
@ -1,20 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/client.h>
|
||||
#include <tribufu/prelude.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
class TRIBUFU_API TribufuServer : public TribufuClient
|
||||
{
|
||||
private:
|
||||
uint64_t server_id;
|
||||
|
||||
public:
|
||||
TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret);
|
||||
~TribufuServer();
|
||||
uint64_t &get_server_id();
|
||||
};
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
#include <tribufu/json.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
class TRIBUFU_API Server
|
||||
{
|
||||
private:
|
||||
uint64_t id;
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string address;
|
||||
uint16_t game_port;
|
||||
uint16_t query_port;
|
||||
uint64_t package_id;
|
||||
|
||||
public:
|
||||
Server();
|
||||
Server(json data);
|
||||
~Server();
|
||||
|
||||
json to_json();
|
||||
};
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef TRIBUFU_CPP
|
||||
#include <algorithm>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#endif
|
@ -1,47 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tribufu/prelude.h>
|
||||
#include <tribufu/json.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
enum class UserType
|
||||
{
|
||||
User,
|
||||
Bot,
|
||||
Org,
|
||||
};
|
||||
|
||||
class TRIBUFU_API Profile
|
||||
{
|
||||
private:
|
||||
uint64_t id;
|
||||
std::string uuid;
|
||||
std::string name;
|
||||
std::string display_name;
|
||||
UserType type;
|
||||
uint64_t public_flags;
|
||||
bool verified;
|
||||
uint32_t level;
|
||||
double experience;
|
||||
bool public_birthday;
|
||||
double points;
|
||||
std::string location;
|
||||
std::string photo_url;
|
||||
std::string banner_url;
|
||||
std::string last_online;
|
||||
std::string biography;
|
||||
uint32_t view_count;
|
||||
std::string created;
|
||||
std::string updated;
|
||||
|
||||
public:
|
||||
Profile();
|
||||
Profile(json data);
|
||||
~Profile();
|
||||
|
||||
json to_json();
|
||||
};
|
||||
}
|
18
premake5.lua
18
premake5.lua
@ -6,26 +6,26 @@ workspace "tribufu"
|
||||
|
||||
if _ACTION == "vs2022" then
|
||||
platforms {
|
||||
"windows-aarch64",
|
||||
"windows-i686",
|
||||
"windows-x86_64",
|
||||
"win-arm64",
|
||||
"win-x64",
|
||||
"win-x86",
|
||||
}
|
||||
end
|
||||
|
||||
if _ACTION == "gmake2" then
|
||||
platforms {
|
||||
"linux-aarch64",
|
||||
"linux-i686",
|
||||
"linux-x86_64",
|
||||
"linux-arm64",
|
||||
"linux-x64",
|
||||
"linux-x86",
|
||||
}
|
||||
end
|
||||
|
||||
if _ACTION == "xcode4" then
|
||||
platforms {
|
||||
"mac-aarch64",
|
||||
"mac-x86_64",
|
||||
"osx-arm64",
|
||||
"osx-x64",
|
||||
}
|
||||
end
|
||||
|
||||
include "src"
|
||||
include "examples"
|
||||
-- include "examples"
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
cbindgen --config ./config/cbindgen.toml --crate tribufu-native --output ./include/tribufu/native.h
|
10
scripts/generate.ps1
Normal file
10
scripts/generate.ps1
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
|
||||
-i https://api.tribufu.com/openapi.json `
|
||||
-g cpp-restsdk `
|
||||
-o . `
|
||||
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
|
||||
--additional-properties=packageName=tribufu,apiPackage=tribufu::api,modelPackage=tribufu::models `
|
||||
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
|
||||
--skip-validate-spec
|
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Linux (x86_64)
|
||||
make config=debug_linux-x86_64
|
||||
# Linux (x64)
|
||||
make config=debug_linux-x64
|
||||
|
||||
# Linux (i686)
|
||||
make config=debug_linux-i686
|
||||
# Linux (x86)
|
||||
make config=debug_linux-x86
|
||||
|
||||
# Linux (aarch64)
|
||||
make config=debug_linux-aarch64
|
||||
# Linux (arm64)
|
||||
make config=debug_linux-arm64
|
||||
|
@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
echo "Building for windows-x86_64"
|
||||
cargo build --package tribufu-native --target x86_64-pc-windows-msvc
|
||||
New-Item "bin/windows/x86_64" -ItemType Directory -Force
|
||||
Remove-Item -Path "bin/windows/x86_64/*" -Force
|
||||
Copy-Item -Path "target/x86_64-pc-windows-msvc/debug/tribufu_native.lib" -Destination "bin/windows/x86_64" -Force
|
||||
msbuild /p:Configuration="debug" /p:Platform="windows-x86_64"
|
||||
echo "Building for win-x64"
|
||||
New-Item "bin/win-x64" -ItemType Directory -Force
|
||||
Remove-Item -Path "bin/win-x64/*" -Force
|
||||
msbuild /p:Configuration="debug" /p:Platform="win-x64"
|
||||
|
@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
|
||||
call .\vendor\MintakaCpp\vendor\premake-core\windows\premake5.exe vs2022
|
||||
call .\vendor\premake-core\windows\premake5.exe vs2022
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
|
||||
then
|
||||
./vendor/MintakaCpp/vendor/premake-core/linux/premake5 gmake2
|
||||
./vendor/premake-core/linux/premake5 gmake2
|
||||
|
||||
elif [ "$(uname)" = "Darwin" ]
|
||||
then
|
||||
./vendor/MintakaCpp/vendor/premake-core/mac/premake5 xcode4
|
||||
./vendor/premake-core/mac/premake5 xcode4
|
||||
fi
|
||||
|
51
src/api.cpp
51
src/api.cpp
@ -1,51 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/api.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
TribufuApi::TribufuApi()
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApi::TribufuApi(std::string api_key)
|
||||
{
|
||||
this->options.api_key = api_key;
|
||||
}
|
||||
|
||||
TribufuApi::TribufuApi(TribufuApiOptions options)
|
||||
{
|
||||
this->options = options;
|
||||
}
|
||||
|
||||
TribufuApi::~TribufuApi()
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApi TribufuApi::from_env()
|
||||
{
|
||||
return TribufuApi::from_env("");
|
||||
}
|
||||
|
||||
TribufuApi TribufuApi::from_env(std::string prefix)
|
||||
{
|
||||
std::string env_prefix = "";
|
||||
|
||||
if (prefix != "")
|
||||
{
|
||||
env_prefix = prefix + "_";
|
||||
}
|
||||
|
||||
size_t required_size;
|
||||
char api_key[64];
|
||||
|
||||
auto response = getenv_s(&required_size, api_key, sizeof(api_key), (env_prefix + "API_KEY").c_str());
|
||||
|
||||
if (response == 0 && required_size > 0)
|
||||
{
|
||||
return TribufuApi(api_key);
|
||||
}
|
||||
|
||||
return TribufuApi();
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/client.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
TribufuClient::TribufuClient(uint64_t client_id, const std::string &client_secret) : TribufuApi()
|
||||
{
|
||||
this->client_id = client_id;
|
||||
this->client_secret = client_secret;
|
||||
}
|
||||
|
||||
TribufuClient::~TribufuClient()
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t &TribufuClient::get_client_id()
|
||||
{
|
||||
return this->client_id;
|
||||
}
|
||||
|
||||
/*
|
||||
void TribufuClient::get_token()
|
||||
{
|
||||
try
|
||||
{
|
||||
std::string url = "https://api.tribufu.com/v1/servers";
|
||||
FHttpResponse response = this->http.get(url);
|
||||
std::cout << "status_code: " << response.status_code << std::endl;
|
||||
|
||||
if (response.body != nullptr)
|
||||
{
|
||||
json response_body = json::parse(response.body);
|
||||
std::string json_str = response_body.dump(4);
|
||||
std::cout << json_str << std::endl;
|
||||
}
|
||||
|
||||
mintaka_http_free_response(response);
|
||||
}
|
||||
catch (std::exception &e)
|
||||
{
|
||||
std::cout << "exception: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
@ -1 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
100
src/oauth2.cpp
100
src/oauth2.cpp
@ -1,100 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/oauth2.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
OAuth2AuthorizeRequest::OAuth2AuthorizeRequest()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2AuthorizeRequest::OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id,
|
||||
const std::string &client_secret, const std::string &redirect_uri,
|
||||
const std::string &scope, const std::string &state)
|
||||
{
|
||||
this->response_type = response_type;
|
||||
this->client_id = client_id;
|
||||
this->client_secret = client_secret;
|
||||
this->redirect_uri = redirect_uri;
|
||||
this->scope = scope;
|
||||
this->state = state;
|
||||
}
|
||||
|
||||
OAuth2AuthorizeRequest::~OAuth2AuthorizeRequest()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2CodeResponse::OAuth2CodeResponse()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2CodeResponse::OAuth2CodeResponse(const std::string &code, const std::string &state)
|
||||
{
|
||||
this->code = code;
|
||||
this->state = state;
|
||||
}
|
||||
|
||||
OAuth2CodeResponse::~OAuth2CodeResponse()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2ErrorResponse::OAuth2ErrorResponse()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2ErrorResponse::OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description,
|
||||
const std::string &error_uri, const std::string &state)
|
||||
{
|
||||
this->error = error;
|
||||
this->error_description = error_description;
|
||||
this->error_uri = error_uri;
|
||||
this->state = state;
|
||||
}
|
||||
|
||||
OAuth2ErrorResponse::~OAuth2ErrorResponse()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenRequest::OAuth2TokenRequest()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenRequest::OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id,
|
||||
const std::string &client_secret, const std::string &redirect_uri,
|
||||
const std::string &code, const std::string &refresh_token,
|
||||
const std::string &username, const std::string &password)
|
||||
{
|
||||
this->grant_type = grant_type;
|
||||
this->client_id = client_id;
|
||||
this->client_secret = client_secret;
|
||||
this->redirect_uri = redirect_uri;
|
||||
this->code = code;
|
||||
this->refresh_token = refresh_token;
|
||||
this->username = username;
|
||||
this->password = password;
|
||||
}
|
||||
|
||||
OAuth2TokenRequest::~OAuth2TokenRequest()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenResponse::OAuth2TokenResponse()
|
||||
{
|
||||
}
|
||||
|
||||
OAuth2TokenResponse::OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token,
|
||||
const std::string &refresh_token, const std::string &scope,
|
||||
const std::string &state, uint64_t expires_in)
|
||||
{
|
||||
this->token_type = token_type;
|
||||
this->access_token = access_token;
|
||||
this->refresh_token = refresh_token;
|
||||
this->scope = scope;
|
||||
this->state = state;
|
||||
this->expires_in = expires_in;
|
||||
}
|
||||
|
||||
OAuth2TokenResponse::~OAuth2TokenResponse()
|
||||
{
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/options.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
TribufuApiOptions::TribufuApiOptions() : TribufuApiOptions(nullptr, nullptr, nullptr, 0.0f)
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApiOptions::TribufuApiOptions(std::string api_key) : TribufuApiOptions(api_key, nullptr, nullptr, 0.0f)
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApiOptions::TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in)
|
||||
: TribufuApiOptions(nullptr, access_token, refresh_token, expires_in)
|
||||
{
|
||||
}
|
||||
|
||||
TribufuApiOptions::TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token,
|
||||
float expires_in)
|
||||
{
|
||||
this->api_key = api_key;
|
||||
this->access_token = access_token;
|
||||
this->refresh_token = refresh_token;
|
||||
this->expires_in = expires_in;
|
||||
}
|
||||
|
||||
TribufuApiOptions::~TribufuApiOptions()
|
||||
{
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
--- @diagnostic disable: undefined-global
|
||||
|
||||
project "tribufu_cpp"
|
||||
project "tribufu"
|
||||
location "."
|
||||
language "C++"
|
||||
|
||||
@ -31,8 +31,8 @@ project "tribufu_cpp"
|
||||
|
||||
libdirs
|
||||
{
|
||||
"../bin/%{cfg.platform:gsub('-', '/')}",
|
||||
"../vendor/*/lib/%{cfg.platform:gsub('-', '/')}",
|
||||
"../bin/%{cfg.platform}",
|
||||
"../vendor/*/lib/%{cfg.platform}",
|
||||
}
|
||||
|
||||
-- Profile
|
||||
@ -61,7 +61,7 @@ project "tribufu_cpp"
|
||||
|
||||
-- Platform
|
||||
|
||||
filter { "platforms:windows-*" }
|
||||
filter { "platforms:win-*" }
|
||||
kind "SharedLib"
|
||||
system "windows"
|
||||
systemversion "latest"
|
||||
@ -79,7 +79,6 @@ project "tribufu_cpp"
|
||||
|
||||
links
|
||||
{
|
||||
"tribufu_native.lib",
|
||||
}
|
||||
|
||||
prelinkcommands
|
||||
@ -90,7 +89,7 @@ project "tribufu_cpp"
|
||||
{
|
||||
}
|
||||
|
||||
filter { "platforms:mac-*" }
|
||||
filter { "platforms:osx-*" }
|
||||
kind "SharedLib"
|
||||
system "macosx"
|
||||
systemversion "10.15"
|
||||
@ -108,7 +107,6 @@ project "tribufu_cpp"
|
||||
|
||||
links
|
||||
{
|
||||
"tribufu_native",
|
||||
}
|
||||
|
||||
prelinkcommands
|
||||
@ -136,7 +134,6 @@ project "tribufu_cpp"
|
||||
|
||||
links
|
||||
{
|
||||
"tribufu_native",
|
||||
}
|
||||
|
||||
prelinkcommands
|
||||
@ -164,7 +161,6 @@ project "tribufu_cpp"
|
||||
|
||||
links
|
||||
{
|
||||
"tribufu_native",
|
||||
}
|
||||
|
||||
prelinkcommands
|
||||
@ -193,7 +189,6 @@ project "tribufu_cpp"
|
||||
|
||||
links
|
||||
{
|
||||
"tribufu_native",
|
||||
}
|
||||
|
||||
prelinkcommands
|
||||
@ -206,29 +201,29 @@ project "tribufu_cpp"
|
||||
|
||||
-- Architecture
|
||||
|
||||
filter { "platforms:*-i686" }
|
||||
filter { "platforms:*-x86" }
|
||||
architecture "x32"
|
||||
|
||||
defines
|
||||
{
|
||||
"TRIBUFU_I686",
|
||||
"TRIBUFU_X86",
|
||||
"TRIBUFU_32BITS",
|
||||
}
|
||||
|
||||
filter { "platforms:*-x86_64" }
|
||||
filter { "platforms:*-x64" }
|
||||
architecture "x64"
|
||||
|
||||
defines
|
||||
{
|
||||
"TRIBUFU_X8664",
|
||||
"TRIBUFU_X64",
|
||||
"TRIBUFU_64BITS",
|
||||
}
|
||||
|
||||
filter { "platforms:*-aarch64" }
|
||||
filter { "platforms:*-arm64" }
|
||||
architecture "ARM64"
|
||||
|
||||
defines
|
||||
{
|
||||
"TRIBUFU_AARCH64",
|
||||
"TRIBUFU_ARM64",
|
||||
"TRIBUFU_64BITS",
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/server.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
TribufuServer::TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret)
|
||||
: TribufuClient(client_id, client_secret)
|
||||
{
|
||||
this->server_id = server_id;
|
||||
}
|
||||
|
||||
TribufuServer::~TribufuServer()
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t &TribufuServer::get_server_id()
|
||||
{
|
||||
return this->server_id;
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/servers/server.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
Server::Server()
|
||||
{
|
||||
}
|
||||
|
||||
Server::Server(json data)
|
||||
{
|
||||
this->id = data["id"];
|
||||
this->name = data["name"];
|
||||
this->description = data["description"];
|
||||
this->address = data["address"];
|
||||
this->game_port = data["game_port"];
|
||||
this->query_port = data["query_port"];
|
||||
this->package_id = data["package_id"];
|
||||
}
|
||||
|
||||
Server::~Server()
|
||||
{
|
||||
}
|
||||
|
||||
json Server::to_json()
|
||||
{
|
||||
json data;
|
||||
data["id"] = this->id;
|
||||
data["name"] = this->name;
|
||||
data["description"] = this->description;
|
||||
data["address"] = this->address;
|
||||
data["game_port"] = this->game_port;
|
||||
data["query_port"] = this->query_port;
|
||||
data["package_id"] = this->package_id;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
#include <tribufu/users/profile.h>
|
||||
|
||||
namespace tribufu
|
||||
{
|
||||
Profile::Profile()
|
||||
{
|
||||
}
|
||||
|
||||
Profile::Profile(json data)
|
||||
{
|
||||
this->id = data["id"];
|
||||
this->uuid = data["uuid"];
|
||||
this->name = data["name"];
|
||||
this->display_name = data["display_name"];
|
||||
this->type = data["type"];
|
||||
this->public_flags = data["public_flags"];
|
||||
this->verified = data["verified"];
|
||||
this->level = data["level"];
|
||||
this->experience = data["experience"];
|
||||
this->public_birthday = data["public_birthday"];
|
||||
this->points = data["points"];
|
||||
this->location = data["location"];
|
||||
this->photo_url = data["photo_url"];
|
||||
this->banner_url = data["banner_url"];
|
||||
this->last_online = data["last_online"];
|
||||
this->biography = data["biography"];
|
||||
this->view_count = data["view_count"];
|
||||
this->created = data["created"];
|
||||
this->updated = data["updated"];
|
||||
}
|
||||
|
||||
Profile::~Profile()
|
||||
{
|
||||
}
|
||||
|
||||
json Profile::to_json()
|
||||
{
|
||||
json data;
|
||||
data["id"] = this->id;
|
||||
data["uuid"] = this->uuid;
|
||||
data["name"] = this->name;
|
||||
data["display_name"] = this->display_name;
|
||||
data["type"] = this->type;
|
||||
data["public_flags"] = this->public_flags;
|
||||
data["verified"] = this->verified;
|
||||
data["level"] = this->level;
|
||||
data["experience"] = this->experience;
|
||||
data["public_birthday"] = this->public_birthday;
|
||||
data["points"] = this->points;
|
||||
data["location"] = this->location;
|
||||
data["photo_url"] = this->photo_url;
|
||||
data["banner_url"] = this->banner_url;
|
||||
data["last_online"] = this->last_online;
|
||||
data["biography"] = this->biography;
|
||||
data["view_count"] = this->view_count;
|
||||
data["created"] = this->created;
|
||||
data["updated"] = this->updated;
|
||||
return data;
|
||||
}
|
||||
}
|
202
vendor/openapi-generator/LICENSE
vendored
Normal file
202
vendor/openapi-generator/LICENSE
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
Copyright 2018 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
BIN
vendor/openapi-generator/openapi-generator-cli.jar
vendored
Normal file
BIN
vendor/openapi-generator/openapi-generator-cli.jar
vendored
Normal file
Binary file not shown.
27
vendor/premake-core/LICENSE.txt
vendored
Normal file
27
vendor/premake-core/LICENSE.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2003-2022 Jason Perkins and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Premake nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
BIN
vendor/premake-core/linux/libluasocket.so
vendored
Normal file
BIN
vendor/premake-core/linux/libluasocket.so
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/linux/premake5
vendored
Normal file
BIN
vendor/premake-core/linux/premake5
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/mac/libluasocket.dylib
vendored
Normal file
BIN
vendor/premake-core/mac/libluasocket.dylib
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/mac/premake5
vendored
Normal file
BIN
vendor/premake-core/mac/premake5
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/luasocket.dll
vendored
Normal file
BIN
vendor/premake-core/windows/luasocket.dll
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/luasocket.exp
vendored
Normal file
BIN
vendor/premake-core/windows/luasocket.exp
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/luasocket.lib
vendored
Normal file
BIN
vendor/premake-core/windows/luasocket.lib
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/luasocket.pdb
vendored
Normal file
BIN
vendor/premake-core/windows/luasocket.pdb
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/premake5.exe
vendored
Normal file
BIN
vendor/premake-core/windows/premake5.exe
vendored
Normal file
Binary file not shown.
BIN
vendor/premake-core/windows/premake5.pdb
vendored
Normal file
BIN
vendor/premake-core/windows/premake5.pdb
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user