Skip to content

Commit 3334ab7

Browse files
authored
HTTP functionality
To be used with JSON format, all JSON encoding/decoding must be done in Lua.
1 parent 837c792 commit 3334ab7

8 files changed

Lines changed: 1534 additions & 1025 deletions

File tree

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
linux:
13+
name: Linux
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- name: Checkout server
18+
uses: actions/checkout@v2
19+
with:
20+
repository: callofduty4x/CoD4x_Server
21+
path: server
22+
23+
- name: Set up needed libs
24+
run: |
25+
sudo apt-get install g++-multilib gcc-multilib
26+
sudo dpkg --add-architecture i386
27+
sudo apt-get install nasm:i386 paxctl:i386 libtommath-dev:i386
28+
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
29+
sudo tar -zxvf libiconv-1.16.tar.gz
30+
cd libiconv-1.16
31+
sudo ./configure --prefix=/usr/local --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
32+
sudo make
33+
sudo make install
34+
sudo ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
35+
sudo ldconfig
36+
37+
- name: Checkout plugin
38+
uses: actions/checkout@v2
39+
with:
40+
repository: leiizko/cod4x_lua_plugin
41+
path: server/plugins/lua
42+
43+
- name: Build plugin
44+
run: |
45+
cd server/plugins/lua
46+
make ICONV=true
47+
48+
windows:
49+
name: Windows
50+
runs-on: windows-latest
51+
52+
steps:
53+
- name: Get MinGW (i686-8.1.0-release-posix-dwarf)
54+
run: |
55+
$Uri = "https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
56+
$filename = "mingw32.7z"
57+
cd C:/
58+
Start-BitsTransfer -Source $Uri -Destination $filename
59+
7z x $filename
60+
61+
- name: Get NASM
62+
uses: ilammy/setup-nasm@v1
63+
64+
- name: Checkout server
65+
uses: actions/checkout@v2
66+
with:
67+
repository: callofduty4x/CoD4x_Server
68+
path: server
69+
70+
- name: Get pexports
71+
run: |
72+
cd server
73+
Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz"
74+
7z x pexports.tar.xz
75+
7z x pexports.tar
76+
77+
- name: Build server
78+
run: |
79+
$path = $env:Path
80+
$env:Path = "C:\mingw32\bin;"
81+
$env:Path += $path
82+
cd server
83+
mingw32-make
84+
85+
- name: Checkout plugin
86+
uses: actions/checkout@v2
87+
with:
88+
repository: leiizko/cod4x_lua_plugin
89+
path: server/plugins/lua
90+
91+
- name: Build plugin
92+
run: |
93+
$path = $env:Path
94+
$env:Path = "C:\mingw32\bin;"
95+
$env:Path += $path
96+
cd server/plugins/lua
97+
mingw32-make ICONV=true

.github/workflows/release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
linux:
9+
name: Linux
10+
runs-on: ubuntu-18.04
11+
12+
steps:
13+
- name: Checkout server
14+
uses: actions/checkout@v2
15+
with:
16+
repository: callofduty4x/CoD4x_Server
17+
path: server
18+
19+
- name: Set up needed libs
20+
run: |
21+
sudo apt-get install g++-multilib gcc-multilib
22+
sudo dpkg --add-architecture i386
23+
sudo apt-get install nasm:i386 paxctl:i386 libtommath-dev:i386
24+
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
25+
sudo tar -zxvf libiconv-1.16.tar.gz
26+
cd libiconv-1.16
27+
sudo ./configure --prefix=/usr/local --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
28+
sudo make
29+
sudo make install
30+
sudo ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
31+
sudo ldconfig
32+
33+
- name: Checkout plugin
34+
uses: actions/checkout@v2
35+
with:
36+
repository: leiizko/cod4x_lua_plugin
37+
path: server/plugins/lua
38+
39+
- name: Build plugin
40+
run: |
41+
cd server/plugins/lua
42+
make ICONV=true
43+
44+
- name: Publish
45+
uses: ncipollo/release-action@v1
46+
with:
47+
allowUpdates: true
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
artifacts: "server/plugins/lua/lua.so"
50+
51+
windows:
52+
name: Windows
53+
runs-on: windows-latest
54+
55+
steps:
56+
- name: Get MinGW (i686-8.1.0-release-posix-dwarf)
57+
run: |
58+
$Uri = "https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
59+
$filename = "mingw32.7z"
60+
cd C:/
61+
Start-BitsTransfer -Source $Uri -Destination $filename
62+
7z x $filename
63+
64+
- name: Get NASM
65+
uses: ilammy/setup-nasm@v1
66+
67+
- name: Checkout server
68+
uses: actions/checkout@v2
69+
with:
70+
repository: callofduty4x/CoD4x_Server
71+
path: server
72+
73+
- name: Get pexports
74+
run: |
75+
cd server
76+
Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz"
77+
7z x pexports.tar.xz
78+
7z x pexports.tar
79+
80+
- name: Build server
81+
run: |
82+
$path = $env:Path
83+
$env:Path = "C:\mingw32\bin;"
84+
$env:Path += $path
85+
cd server
86+
mingw32-make
87+
88+
- name: Checkout plugin
89+
uses: actions/checkout@v2
90+
with:
91+
repository: leiizko/cod4x_lua_plugin
92+
path: server/plugins/lua
93+
94+
- name: Build plugin
95+
run: |
96+
$path = $env:Path
97+
$env:Path = "C:\mingw32\bin;"
98+
$env:Path += $path
99+
cd server/plugins/lua
100+
mingw32-make ICONV=true
101+
102+
- name: Publish
103+
uses: ncipollo/release-action@v1
104+
with:
105+
allowUpdates: true
106+
token: ${{ secrets.GITHUB_TOKEN }}
107+
artifacts: "server/plugins/lua/lua.dll"

0 commit comments

Comments
 (0)