Skip to content

Commit

Permalink
Adds CnCNet build target.
Browse files Browse the repository at this point in the history
  • Loading branch information
CCHyper committed Jul 22, 2024
1 parent 4974d94 commit ae7887d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ jobs:
- name: Clone Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 1

- name: Clone CnCNet Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: CnCNet/ts-patches-private
path: 'cncnet'
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}

- name: Get Branch Name
id: branch-name
Expand Down Expand Up @@ -92,6 +100,17 @@ jobs:
gmake -j8 ${{ matrix.type }}=1 VINIFERA=1
Move-Item -Path 'game.exe' -Destination 'build\vinifera\game.exe'
# Only build the CnCNet binaries for TSCLIENT
if ("${{ matrix.type }}" -eq "TSCLIENT") {
New-Item -Path 'build\cncnet' -ItemType Directory
gmake clean
gmake -j8 ${{ matrix.type }}=1 CNCNET=1
Move-Item -Path 'game.exe' -Destination 'build\cncnet\game.exe'
Get-ChildItem -Path 'build\cncnet'
}
Get-ChildItem -Path 'build\release'
# Get-ChildItem -Path 'build\debug'
Get-ChildItem -Path 'build\vinifera'
Expand All @@ -106,6 +125,13 @@ jobs:
# Move-Item -Path 'build\debug\game.exe' -Destination 'artifact\debug\game.exe'
Move-Item -Path 'build\vinifera\game.exe' -Destination 'artifact\vinifera\game.exe'
# Only pack the CnCNet binaries for TSCLIENT
if ("${{ matrix.type }}" -eq "TSCLIENT") {
New-Item -Path 'artifact\cncnet' -ItemType Directory
Move-Item -Path 'build\cncnet\game.exe' -Destination 'artifact\cncnet\game.dat'
Get-ChildItem -Path 'artifact\cncnet'
}
Get-ChildItem -Path 'artifact\release'
# Get-ChildItem -Path 'artifact\debug'
Get-ChildItem -Path 'artifact\vinifera'
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ NFLAGS += -DWWDEBUG
CFLAGS += -DWWDEBUG
endif

ifdef CNCNET
$(info CNCNET defined)
NFLAGS += -DCNCNET
CFLAGS += -DCNCNET
endif


# =========================================================
# Source files
Expand Down Expand Up @@ -417,6 +423,22 @@ OBJS += src/spawner/spectators.o
OBJS += src/spawner/statistics.o


# =========================================================
# CnCNet sources.
# =========================================================
ifdef CNCNET

include cncnet/makefile.mk
OBJS += $(CNCNET_OBJS)

# Not to be included in Vinifera builds.
ifndef VINIFERA
#OBJS += src/xyz.o
endif

endif


# =========================================================
# Experimental feature sources.
# =========================================================
Expand Down
2 changes: 2 additions & 0 deletions src/spawner/nethack.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ uint16_t TunnelId;
uint32_t TunnelIp;
uint16_t TunnelPort;
int PortHack;
int NetKey = 0;
int StartNetKey = 0;

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

0 comments on commit ae7887d

Please sign in to comment.