Skip to content

Commit

Permalink
Merge branch 'master' into gcc11
Browse files Browse the repository at this point in the history
  • Loading branch information
proxict authored Sep 19, 2023
2 parents e8273b5 + b876404 commit 4013101
Show file tree
Hide file tree
Showing 34 changed files with 240 additions and 360 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
run: |
sudo apt-get install g++-multilib gcc-multilib
sudo dpkg --add-architecture i386
sudo apt-get install nasm:i386 libtommath-dev:i386 libtommath1:i386 libc6:i386 libgcc-s1:i386
sudo apt-get update
sudo apt-get install nasm:i386
- name: Build server
run: make
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# CoD4x Server [![build](https://github.com/callofduty4x/CoD4x_Server/actions/workflows/build.yml/badge.svg)](https://github.com/callofduty4x/CoD4x_Server/actions/workflows/build.yml)
<p align="center">
<img src="assets/github/banner.png?raw=true" />
</p>

CoD4x is a modification of the Call of Duty 4 - Modern Warfare server. It fixes several bugs in the original binaries and allows developers to extend server functionality with additional variables and plugins. When using the CoD4x server, the clients invoke installation of the proprietary CoD4x client to players joining the server using the CoD4x servers, which fixes several known base game bugs in the client, and in combination with the server allows for extra features.
A compatible client modification can be found here: [CoD4x_Client_pub](https://github.com/callofduty4x/CoD4x_Client_pub)

[Website](http://cod4x.ovh/) - [Forums](https://cod4x.ovh/index.php?/forums/) - [Documentation](http://docs.cod4x.ovh/) - [Masterserver](http://cod4master.cod4x.ovh/)
[Forums](https://cod4x.ovh) - [Masterserver](http://cod4master.cod4x.ovh/)

## The most prominent features are:
* Administration commands
Expand Down Expand Up @@ -36,16 +40,21 @@ To compile CoD4x from source, you need to install the following prerequisites:
- gcc
- make

RHEL/CentOS/Rocky Linux 32-bit:
```
sudo yum install -y glibc-devel glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 nasm
```

Debian/Ubuntu 32-bit:
```
sudo apt install nasm build-essential
sudo apt install nasm make git
```

Debian/Ubuntu 64-bit:
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install nasm:i386 build-essential gcc-multilib g++-multilib
sudo apt-get install nasm:i386 make gcc-multilib g++-multilib git
```

openSUSE 32-bit:
Expand Down Expand Up @@ -75,7 +84,7 @@ If compilation was successful the binary will be placed in the `/bin/` folder.
## Contributing
CoD4x is licensed under the AGPL3 license. We welcome anybody to fork this project and submit a pull request.

Plugins can be written in C/C++ and we also provide language bindings for D. The `/plugins` directory contains some example plugins. You can contribute to the project by developing plugins and create a pull request for them and/or uploading and promoting them on the [forums](https://cod4x.ovh/index.php?/forums/forum/5-server-plugins-and-management-tools/).
Plugins can be written in C/C++ and we also provide language bindings for D. The `/plugins` directory contains some example plugins. You can contribute to the project by developing plugins and create a pull request for them and/or uploading and promoting them on the [forums](https://cod4x.ovh/c/server-plugins-management-tools/8).

If you want to contribute to the core project check the issue tracker for todos. We will try our best to keep the issue tracker filled with new bits.
If you would like to work on a completely new feature, we would appreciate if you contact us first on the forums or on Github to discuss the idea.
Expand All @@ -90,7 +99,7 @@ Aside from agreeing to the license, by making any use of CoD4x18 server you agre
2. The developers reserve the right to reuse your content as long as it is not used commercially. You have a right for your name/clan/website getting mentioned if this is going to happen.
They can also use it on their own servers.

3. Maps you have installed on a server have to be either available on the internet already, or be made available to the community at the [CoD4x forums](https://cod4x.ovh/index.php?/forums/), with all required assets, like scripts, within 20 weeks of installation. You have to annouce your map on the [forums](https://cod4x.ovh/index.php?/forums/) on the same day you have installed it to gain the 20 weeks grace period. Not announced maps will have to be made available within 1 week.
3. Maps you have installed on a server have to be either available on the internet already, or be made available to the community at the [CoD4x forums](https://cod4x.ovh), with all required assets, like scripts, within 20 weeks of installation. You have to annouce your map on the [CoD4x forums](https://cod4x.ovh) on the same day you have installed it to gain the 20 weeks grace period. Not announced maps will have to be made available within 1 week.

4. Plugins have to be made available as sourcecode so the user can interact with it

Expand Down
64 changes: 0 additions & 64 deletions README.txt

This file was deleted.

Binary file added assets/github/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 0 additions & 47 deletions changelog.txt

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CC=gcc
CPP=g++
WIN_DEFINES=WINVER=0x501
LINUX_DEFINES=_GNU_SOURCE
CFLAGS=-m32 -msse2 -mfpmath=sse -Wall -fno-omit-frame-pointer -fmax-errors=15
CFLAGS=-m32 -msse2 -mfpmath=sse -Wall -fno-omit-frame-pointer -fmax-errors=15 -fcommon

ifeq ($(DEBUG), true)
DCFLAGS=-fno-pie -O0 -g
Expand All @@ -55,7 +55,7 @@ endif

WIN_LFLAGS=-m32 -g -Wl,--nxcompat,--stack,0x800000 -mwindows -static-libgcc -static -lm
WIN_LLIBS=tomcrypt mbedtls mbedcrypto mbedx509 ws2_32 wsock32 iphlpapi gdi32 winmm crypt32 stdc++
LINUX_LFLAGS=-m32 -g -static-libgcc -rdynamic -Wl,-rpath=./
LINUX_LFLAGS=-m32 -g -static-libgcc -rdynamic -Wl,-rpath=./ -fcommon
LINUX_LLIBS=tomcrypt mbedtls mbedcrypto mbedx509 dl pthread m stdc++
BSD_LLIBS=tomcrypt mbedtls mbedcrypto mbedx509 pthread m execinfo stdc++
COD4X_DEFINES=COD4X18UPDATE BUILD_NUMBER=$(BUILD_NUMBER) BUILD_BRANCH=$(BUILD_BRANCH) BUILD_REVISION=$(BUILD_REVISION)
Expand Down
4 changes: 4 additions & 0 deletions plugins/callback_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
PCL void OnPreFastRestart();
PCL void OnExitLevel();
PCL void OnPostFastRestart();
PCL void OnPreGameRestart(int savepersist);
PCL void OnPostGameRestart(int savepersist);
PCL void OnSpawnServer();
PCL void OnFrame();
PCL void OnOneSecond();
Expand All @@ -52,6 +54,8 @@
PCL void OnPlayerWantReservedSlot(netadr_t* from, char* pbguid, char* userinfo, int authstate, qboolean *isallowed);
PCL void OnModuleLoaded(client_t* client, char* fullpath, long checksum);
PCL void OnScreenshotArrived(client_t* client, const char* path);
PCL void OnScrUsercallFunction(const char* function_name);
PCL void OnScrUsercallMethod(const char* method_name, int clientnum);

//Following function gets called when the player has basic authentication completed. Here we got a pbguid, the uid which is a short steamid, rejectmsg can be written a text to but never exceed 1023 characters, returnNow will keep the client idle when set to true, client_t*
PCL void OnPlayerGotAuthInfo(netadr_t* from, uint64_t* playerid, uint64_t *steamid, char *rejectmsg /*never exceed a limit of 1023 chars*/, qboolean *returnNow, client_t* cl); //an unverified playerid, SteamID "steamIdPending" and "clanIdPending" is not getting verified yet at all - you can get this info from client_t* structure
Expand Down
140 changes: 1 addition & 139 deletions src/asmsource/_g_hudelem.asm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
extern Scr_SetString
extern HECmd_SetText
extern HECmd_ScaleOverTime
extern HECmd_SetPulseFX

;Exports of g_hudelem:
global HECmd_ClearAllTextAfterHudElem
Expand All @@ -61,7 +62,6 @@
global HECmd_MoveOverTime
global HECmd_Reset
global HECmd_Destroy
global HECmd_SetPulseFX
global HECmd_SetPlayerNameString
global HECmd_SetMapNameString
global HECmd_SetGameTypeString
Expand Down Expand Up @@ -763,144 +763,6 @@ HECmd_Destroy_10:
ret


;HECmd_SetPulseFX(scr_entref_t)
HECmd_SetPulseFX:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov ebx, [ebp+0x8]
call Scr_GetNumParam
cmp eax, 0x3
jz HECmd_SetPulseFX_10
mov dword [esp], _cstring_usage_hudelem_se1
call Scr_Error
HECmd_SetPulseFX_10:
mov eax, ebx
shr ebx, 0x10
sub bx, 0x1
jz HECmd_SetPulseFX_20
mov dword [esp], _cstring_not_a_hud_elemen
call Scr_ObjectError
xor esi, esi
mov edi, level
mov eax, [edi+0x1ec]
mov [esi+0x88], eax
mov dword [esp], 0x0
call Scr_GetInt
mov ebx, eax
test eax, eax
js HECmd_SetPulseFX_30
HECmd_SetPulseFX_70:
mov [esi+0x8c], ebx
mov dword [esp], 0x1
call Scr_GetInt
mov ebx, eax
test eax, eax
js HECmd_SetPulseFX_40
HECmd_SetPulseFX_80:
mov [esi+0x90], ebx
mov dword [esp], 0x2
call Scr_GetInt
mov ebx, eax
test eax, eax
js HECmd_SetPulseFX_50
HECmd_SetPulseFX_90:
mov [esi+0x94], ebx
mov ecx, [esi+0xa0]
lea eax, [ecx+ecx*2]
mov edx, eax
shl edx, 0x6
add eax, edx
mov edx, eax
shl edx, 0x6
add eax, edx
lea ecx, [eax+ecx]
add ecx, [edi]
mov eax, [ecx+0x658]
add eax, 0x1
mov [ecx+0x658], eax
mov edx, eax
and edx, 0x8000001f
js HECmd_SetPulseFX_60
mov eax, 0x1
test edx, edx
cmovnz eax, edx
mov [ecx+0x658], eax
mov [esi+0x98], eax
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
HECmd_SetPulseFX_20:
movzx edx, ax
lea eax, [edx+edx*4]
lea eax, [edx+eax*4]
lea eax, [edx+eax*2]
lea esi, [eax*4+g_hudelems]
mov edi, level
mov eax, [edi+0x1ec]
mov [esi+0x88], eax
mov dword [esp], 0x0
call Scr_GetInt
mov ebx, eax
test eax, eax
jns HECmd_SetPulseFX_70
HECmd_SetPulseFX_30:
mov [esp+0x4], eax
mov dword [esp], _cstring_time_i_must_be_g
call va
mov [esp+0x4], eax
mov dword [esp], 0x0
call Scr_ParamError
mov [esi+0x8c], ebx
mov dword [esp], 0x1
call Scr_GetInt
mov ebx, eax
test eax, eax
jns HECmd_SetPulseFX_80
HECmd_SetPulseFX_40:
mov [esp+0x4], eax
mov dword [esp], _cstring_time_i_must_be_g
call va
mov [esp+0x4], eax
mov dword [esp], 0x1
call Scr_ParamError
mov [esi+0x90], ebx
mov dword [esp], 0x2
call Scr_GetInt
mov ebx, eax
test eax, eax
jns HECmd_SetPulseFX_90
HECmd_SetPulseFX_50:
mov [esp+0x4], eax
mov dword [esp], _cstring_time_i_must_be_g
call va
mov [esp+0x4], eax
mov dword [esp], 0x2
call Scr_ParamError
jmp HECmd_SetPulseFX_90
HECmd_SetPulseFX_60:
sub edx, 0x1
or edx, 0xffffffe0
add edx, 0x1
mov eax, 0x1
test edx, edx
cmovnz eax, edx
mov [ecx+0x658], eax
mov [esi+0x98], eax
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret


;HECmd_SetPlayerNameString(scr_entref_t)
HECmd_SetPlayerNameString:
push ebp
Expand Down
Loading

0 comments on commit 4013101

Please sign in to comment.