Skip to content

Commit ae7887d

Browse files
committed
Adds CnCNet build target.
1 parent 4974d94 commit ae7887d

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.github/workflows/windows.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ jobs:
3535
- name: Clone Repository
3636
uses: actions/checkout@v3
3737
with:
38-
fetch-depth: 0
38+
fetch-depth: 1
39+
40+
- name: Clone CnCNet Repository
41+
uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 1
44+
repository: CnCNet/ts-patches-private
45+
path: 'cncnet'
46+
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}
3947

4048
- name: Get Branch Name
4149
id: branch-name
@@ -92,6 +100,17 @@ jobs:
92100
gmake -j8 ${{ matrix.type }}=1 VINIFERA=1
93101
Move-Item -Path 'game.exe' -Destination 'build\vinifera\game.exe'
94102
103+
# Only build the CnCNet binaries for TSCLIENT
104+
if ("${{ matrix.type }}" -eq "TSCLIENT") {
105+
New-Item -Path 'build\cncnet' -ItemType Directory
106+
107+
gmake clean
108+
gmake -j8 ${{ matrix.type }}=1 CNCNET=1
109+
Move-Item -Path 'game.exe' -Destination 'build\cncnet\game.exe'
110+
111+
Get-ChildItem -Path 'build\cncnet'
112+
}
113+
95114
Get-ChildItem -Path 'build\release'
96115
# Get-ChildItem -Path 'build\debug'
97116
Get-ChildItem -Path 'build\vinifera'
@@ -106,6 +125,13 @@ jobs:
106125
# Move-Item -Path 'build\debug\game.exe' -Destination 'artifact\debug\game.exe'
107126
Move-Item -Path 'build\vinifera\game.exe' -Destination 'artifact\vinifera\game.exe'
108127
128+
# Only pack the CnCNet binaries for TSCLIENT
129+
if ("${{ matrix.type }}" -eq "TSCLIENT") {
130+
New-Item -Path 'artifact\cncnet' -ItemType Directory
131+
Move-Item -Path 'build\cncnet\game.exe' -Destination 'artifact\cncnet\game.dat'
132+
Get-ChildItem -Path 'artifact\cncnet'
133+
}
134+
109135
Get-ChildItem -Path 'artifact\release'
110136
# Get-ChildItem -Path 'artifact\debug'
111137
Get-ChildItem -Path 'artifact\vinifera'

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ NFLAGS += -DWWDEBUG
117117
CFLAGS += -DWWDEBUG
118118
endif
119119

120+
ifdef CNCNET
121+
$(info CNCNET defined)
122+
NFLAGS += -DCNCNET
123+
CFLAGS += -DCNCNET
124+
endif
125+
120126

121127
# =========================================================
122128
# Source files
@@ -417,6 +423,22 @@ OBJS += src/spawner/spectators.o
417423
OBJS += src/spawner/statistics.o
418424

419425

426+
# =========================================================
427+
# CnCNet sources.
428+
# =========================================================
429+
ifdef CNCNET
430+
431+
include cncnet/makefile.mk
432+
OBJS += $(CNCNET_OBJS)
433+
434+
# Not to be included in Vinifera builds.
435+
ifndef VINIFERA
436+
#OBJS += src/xyz.o
437+
endif
438+
439+
endif
440+
441+
420442
# =========================================================
421443
# Experimental feature sources.
422444
# =========================================================

src/spawner/nethack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ uint16_t TunnelId;
3535
uint32_t TunnelIp;
3636
uint16_t TunnelPort;
3737
int PortHack;
38+
int NetKey = 0;
39+
int StartNetKey = 0;
3840

3941
WINAPI int Tunnel_SendTo(int sockfd, const void *buf, size_t len, int flags, struct sockaddr_in *dest_addr, int addrlen)
4042
{

0 commit comments

Comments
 (0)