File tree Expand file tree Collapse file tree 11 files changed +151
-8
lines changed
decompile/General/AltMods/OnlineCTR
mods/Windows/OnlineCTR/Network_PC/Client Expand file tree Collapse file tree 11 files changed +151
-8
lines changed Original file line number Diff line number Diff line change 3838 run : nix build -L --no-link --keep-going '.?submodules=1#online-server.release.arm32.gcc'
3939 - name : Build Server Release Mingw2 GCC
4040 run : nix build -L --keep-going '.?submodules=1#online-server.release.mingw32.gcc' -o ${{ runner.temp }}/result/online-server.release.mingw32.gcc
41+ - name : Build Client Release MingwW64 GCC
42+ run : nix build -L --keep-going '.?submodules=1#online-client.release.mingwW64.gcc' -o ${{ runner.temp }}/result/online-client.release.mingwW64.gcc
4143 - name : Upload artifact
4244 uses : actions/upload-artifact@v4
4345 with :
4446 name : online-server-windows
4547 path : |
4648 ${{ runner.temp }}/result/online-server.release.mingw32.gcc/bin
49+ - name : Upload client artifact
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : online-client-windows
53+ path : |
54+ ${{ runner.temp }}/result/online-client.release.mingwW64.gcc/bin
Original file line number Diff line number Diff line change 1919[submodule "externals/json "]
2020 path = externals/json
2121 url = https://github.com/nlohmann/json
22- [submodule "externals/HTTPRequest "]
23- path = externals/HTTPRequest
24- url = https://github.com/elnormous/HTTPRequest
2522[submodule "externals/cpp-httplib "]
2623 path = externals/cpp-httplib
2724 url = https://github.com/yhirose/cpp-httplib
Original file line number Diff line number Diff line change 1414 #include <unistd.h> // for the 'usleep()' function
1515 #endif
1616
17- #define STATIC_ASSERT2 (test_for_true , message ) _Static_assert((test_for_true), message)
17+ #ifdef WINDOWS_INCLUDE
18+ #define STATIC_ASSERT2 static_assert
19+ #else
20+ #define STATIC_ASSERT2 (test_for_true , message ) _Static_assert((test_for_true), message)
21+ #endif
1822
1923#else // MSVC (Visual Studio)
2024
Original file line number Diff line number Diff line change 3939 clang = callPackage ./mods/Windows/OnlineCTR/Network_PC/Server { ctrModSDK = self ; stdenv = clangStdenv ; trustCompiler = true ; inherit withDebug ; } ;
4040 } ;
4141 } ;
42+ mkOnlineClient = withDebug : {
43+ mingw32 = with pkgsCross . mingw32 ; {
44+ gcc = callPackage ./mods/Windows/OnlineCTR/Network_PC/Client { ctrModSDK = self ; inherit withDebug ; } ;
45+ clang = callPackage ./mods/Windows/OnlineCTR/Network_PC/Client { ctrModSDK = self ; stdenv = clangStdenv ; inherit withDebug ; } ;
46+ } ;
47+ mingwW64 = with pkgsCross . mingwW64 ; {
48+ gcc = callPackage ./mods/Windows/OnlineCTR/Network_PC/Client { ctrModSDK = self ; inherit withDebug ; } ;
49+ clang = callPackage ./mods/Windows/OnlineCTR/Network_PC/Client { ctrModSDK = self ; stdenv = clangStdenv ; inherit withDebug ; } ;
50+ } ;
51+ } ;
4252 in
4353 rec {
4454 retail = {
5363 release = mkOnline false ;
5464 debug = mkOnline true ;
5565 } ;
66+ online-client = {
67+ release = mkOnlineClient false ;
68+ debug = mkOnlineClient true ;
69+ } ;
5670 } ;
5771 } )
5872 { } ;
Original file line number Diff line number Diff line change 44#include < stdio.h>
55#include < stdlib.h>
66#include < string.h>
7- #include < Psapi .h>
7+ #include < psapi .h>
88#include < chrono>
99#include < thread>
1010
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.20)
2+ project (OnlineCTR-Client CXX C)
3+
4+ set (CMAKE_C_STANDARD 99)
5+
6+ set (CMAKE_CXX_STANDARD 17)
7+ set (CMAKE_CXX_STANDARD_REQUIRED True )
8+
9+ # Include directories
10+ include_directories (${PROJECT_SOURCE_DIR} /../../../../../externals/enet/include )
11+
12+ # Add the path to the enet library
13+ link_directories (${PROJECT_SOURCE_DIR} /../../../../../externals/enet/lib)
14+
15+ # Source files
16+ set (SOURCES CL_main.cpp DeferredMem.cpp Util.cpp)
17+
18+ # Create the executable
19+ add_executable (ctr_cl ${SOURCES} )
20+
21+ # Link with the enet library
22+ if (WIN32 )
23+ target_link_libraries (ctr_cl enet winmm ws2_32 psapi wsock32 advapi32)
24+ else ()
25+ target_link_libraries (ctr_cl enet)
26+ endif ()
27+
28+ # Compiler options
29+ if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
30+ target_compile_options (ctr_cl PRIVATE -Wno-int-conversion -Wno-return-type )
31+ else ()
32+ # Assume GCC
33+ target_compile_options (ctr_cl PRIVATE )
34+ endif ()
35+
36+ # Debug options
37+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
38+ target_compile_options (ctr_cl PRIVATE -g -gdwarf-2 -O0)
39+ else ()
40+ target_compile_options (ctr_cl PRIVATE -O2)
41+ endif ()
Original file line number Diff line number Diff line change 11#ifdef _WIN64 // windows
2- #include < WinSock2 .h>
2+ #include < winsock2 .h>
33#include < windows.h>
44#include < ws2tcpip.h>
55
2020#include < condition_variable>
2121#include < map>
2222#include < vector>
23+ #include < cstdio>
2324
2425void recvThread ();
2526typedef unsigned long long internalPineApiID;
Original file line number Diff line number Diff line change 33#define DEF_MEM
44
55#ifdef _WIN64 // windows
6- #include < WinSock2 .h>
6+ #include < winsock2 .h>
77#include < windows.h>
88#include < ws2tcpip.h>
99#else // assume posix
Original file line number Diff line number Diff line change 44#include < stdio.h>
55#include < stdlib.h>
66#include < thread>
7+ #include < process.h>
78
89const char * exitReasons[] =
910{
Original file line number Diff line number Diff line change 11#pragma once //why doesn't this work
22
3- const char * exitReasons [];
3+ extern const char * exitReasons [];
44extern char * progName ;
55
66void exit_execv (int code );
You can’t perform that action at this time.
0 commit comments