Skip to content

Commit 8798780

Browse files
committed
Merge branch 'develop'
2 parents d305026 + ba83598 commit 8798780

34 files changed

+504
-397
lines changed

.conan/patches/CMakeLists.txt.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16.0)
2-
project(CGSC VERSION 1.1.0 LANGUAGES C)
2+
project(CGSC VERSION 1.2.0 LANGUAGES C)
33
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
44
set(CMAKE_C_STANDARD 11)
55
set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -33,16 +33,32 @@ if(ENABLE_TESTING)
3333
endif()
3434

3535
# Build
36-
add_library(CGSC)
37-
add_subdirectory(api)
38-
add_subdirectory(asm)
39-
add_subdirectory(extensions)
36+
if(PLUGIN)
37+
add_library(CGSC INTERFACE CGSC/cgsc.h CGSC/plugin.h)
38+
target_include_directories(CGSC INTERFACE . cod4x/plugins)
39+
else()
40+
add_library(CGSC STATIC cgsc.h cod4x.h)
41+
42+
add_subdirectory(asm)
43+
add_subdirectory(extensions)
44+
add_subdirectory(sys)
45+
add_subdirectory(utils)
46+
add_subdirectory(versions)
47+
48+
target_link_libraries(CGSC PUBLIC ${CONAN_LIBS})
49+
target_compile_definitions(CGSC PUBLIC COD4X18UPDATE)
50+
target_include_directories(CGSC PUBLIC . .. ../version ../../plugins)
51+
set_target_properties(CGSC PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ../../../lib)
4052

41-
target_compile_definitions(CGSC PUBLIC COD4X18UPDATE)
42-
target_include_directories(CGSC PUBLIC . .. ../version ../../plugins)
43-
target_sources(CGSC PRIVATE cgsc.h)
53+
set(STATIC_DEPENDENCIES
54+
${CONAN_LIB_DIRS_LIBUV}/libuv_a.a)
55+
56+
foreach(dependency ${STATIC_DEPENDENCIES})
57+
add_custom_command(TARGET CGSC POST_BUILD
58+
COMMAND ${CMAKE_COMMAND} -E copy ${dependency} ../../../lib)
59+
endforeach()
60+
endif()
4461

45-
set_target_properties(CGSC PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ../../../lib)
4662
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
4763

4864
# Pack

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![CodeFactor](https://img.shields.io/codefactor/grade/github/Iswenzz/CGSC?label=codefactor&logo=codefactor)](https://www.codefactor.io/repository/github/iswenzz/CGSC)
66
[![License](https://img.shields.io/github/license/Iswenzz/CGSC?color=blue&logo=gitbook&logoColor=white)](https://github.com/Iswenzz/CGSC/blob/master/LICENSE)
77

8-
This Call of Duty 4X source extension adds new utilities for use in the creation of new plugins. Such things include new functions to get data types that the original source doesn't offer and adds the ability to call functions defined in GSC from the C files. To use this extension you must add the CGSC files included in the release section to the `/src/CGSC` folder, and then compile the CoD4X server source. More detailed instructions can be found towards the bottom of this document.
8+
This Call of Duty 4X source extension adds new utilities to extend the server and the creation of new plugins. Such things include new functions to get data types that the original source doesn't offer, the ability to call functions defined in GSC from the C files and async workers for expensive operations on the server. To use this extension you must add the CGSC files included in the release section to the `/src/CGSC` folder, and then compile the CoD4X server source. More detailed instructions can be found towards the bottom of this document.
99

1010
``Note: Depending on the version of Call of Duty 4X that you're running, some features of CGSC may not be available.``
1111

@@ -15,7 +15,7 @@ This Call of Duty 4X source extension adds new utilities for use in the creation
1515

1616
## Instructions
1717
In order to use this extension, just download the archived file down below, and extract it to the cod4x server's ``src/CGSC`` directory, then copy the makefile snippet below and paste it before the default rule.
18-
Then simply build the cod4x source with ``make``.
18+
Then simply build the library with the build instructions and recompile the cod4x source with ``make``.
1919

2020
### **[Download](https://github.com/Iswenzz/CGSC/releases)**
2121

@@ -24,9 +24,9 @@ Then simply build the cod4x source with ``make``.
2424
##################################
2525
# CGSC
2626
CGSC_DIR=$(SRC_DIR)/CGSC
27-
WIN_LLIBS:=$(WIN_LLIBS) CGSC
28-
LINUX_LLIBS:=$(LINUX_LLIBS) CGSC
29-
BSD_LLIBS:=$(BSD_LLIBS) CGSC
27+
WIN_LLIBS:=$(WIN_LLIBS) CGSC uv_a iphlpapi psapi userenv ws2_32
28+
LINUX_LLIBS:=$(LINUX_LLIBS) CGSC uv_a dl pthread rt
29+
BSD_LLIBS:=$(BSD_LLIBS) CGSC uv_a dl pthread rt
3030

3131
WIN_LFLAGS:=$(WIN_LFLAGS) -mconsole
3232

api/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

api/cod4x.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

api/sys/compatibility.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

api/utils/utils.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

api/versions/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

asm/cgsc_export.asm

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
p%2 dd %2
2727
%endmacro
2828

29-
; CGSC
29+
; Rename
3030
ralias Plugin_Scr_GetFunction, Scr_GetFunc
3131

32+
; Plugin export
3233
pexport Scr_ReturnResult
3334
pexport Scr_AddFunc
3435
pexport Scr_AddVariable
@@ -45,4 +46,12 @@ pexport Scr_GetTop
4546
pexport Sys_GetCommonVersion
4647
pexport Scr_SelectParamOrDefault
4748
pexport Scr_SelectParam
48-
pexport Scr_SetParamGeneric
49+
pexport Scr_SetParamGeneric
50+
pexport AsyncShutdown
51+
pexport AsyncCall
52+
pexport AsyncNull
53+
pexport AsyncFree
54+
pexport CGSC_Version
55+
pexport CGSC_Unsupported
56+
pexport CGSC_UnsupportedMessage
57+
pexport CGSC_SupportIndexedString

asm/cgsc_function.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
SECTION .text
1616

17-
; Scr_ExecThreadResult(int, unsigned int)
17+
; Scr_ExecThreadResult(int threadId, unsigned int argsCount)
1818
Scr_ExecThreadResult:
1919
push ebp
2020
mov ebp, esp

0 commit comments

Comments
 (0)