Compare commits
12 Commits
852a7c9a15
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fb2868cb13 | |||
| 5865f75186 | |||
| 7609059efa | |||
| ccf69e5641 | |||
| 295fdcd247 | |||
| 219fcf4719 | |||
| ecd57bd967 | |||
| f1a5856c3e | |||
| 1a2a872d85 | |||
| 1caea4c7ab | |||
| 9f0813c464 | |||
| d6bc4267ff |
@@ -25,4 +25,7 @@ RUN apt-get update && apt-get upgrade -y
|
|||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
zlib1g-dev
|
zlib1g-dev
|
||||||
COPY --from=builder /usr/local/pvpgn /usr/local/pvpgn
|
COPY --from=builder /usr/local/pvpgn /usr/local/pvpgn
|
||||||
ENTRYPOINT ["/usr/local/pvpgn/sbin/bnetd", "-D"]
|
COPY --from=builder /usr/local/pvpgn/etc /usr/local/pvpgn-backup/etc
|
||||||
|
COPY --from=builder /usr/local/pvpgn/var /usr/local/pvpgn-backup/var
|
||||||
|
COPY launch.sh /
|
||||||
|
ENTRYPOINT ["/launch.sh"]
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
PVPGN_VERSION=1.99.7.2.1
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
wget https://github.com/pvpgn/pvpgn-server/archive/refs/tags/$PVPGN_VERSION.tar.gz .
|
||||||
|
tar xvf $PVPGN_VERSION.tar.gz
|
||||||
|
cd pvpgn-server-$PVPGN_VERSION
|
||||||
|
|
||||||
|
cmake -D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn -Bbuild
|
||||||
|
make -Cbuild -j$(grep -c ^processor /proc/cpuinfo)
|
||||||
|
make -Cbuild install
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
pvpgn:
|
||||||
|
#network_mode: "host"
|
||||||
|
ports:
|
||||||
|
- "6112:6112/tcp"
|
||||||
|
- "6112:6112/udp"
|
||||||
|
volumes:
|
||||||
|
#- ./config:/usr/local/pvpgn/etc/
|
||||||
|
- ./data:/usr/local/pvpgn/var/
|
||||||
|
#- ./tos.txt:/usr/local/pvpgn/etc/pvpgn/i18n/termsofservice.txt
|
||||||
|
#- ./newaccount.txt:/usr/local/pvpgn/etc/pvpgn/i18n/newaccount.txt
|
||||||
|
|
||||||
@@ -2,8 +2,4 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
pvpgn:
|
pvpgn:
|
||||||
build:
|
build:
|
||||||
context: ./pvpgn
|
|
||||||
dockerfile: Dockerfile.bullseye-slim
|
dockerfile: Dockerfile.bullseye-slim
|
||||||
ports:
|
|
||||||
- "6112:6112"
|
|
||||||
- "6200:6200"
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# If config directory is mounted to an empty volume,
|
||||||
|
# copy in the default configuration
|
||||||
|
if [ ! "$(ls -A /usr/local/pvpgn/etc)" ]; then
|
||||||
|
echo "Copying in default configuration"
|
||||||
|
cp -r /usr/local/pvpgn-backup/etc/* /usr/local/pvpgn/etc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! "$(ls -A /usr/local/pvpgn/var)" ]; then
|
||||||
|
echo "Copying in default data directory"
|
||||||
|
cp -r /usr/local/pvpgn-backup/var/* /usr/local/pvpgn/var
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
/usr/local/pvpgn/sbin/bnetd -D
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<script>
|
||||||
|
function toHex(num) {
|
||||||
|
num = num.toString(16);
|
||||||
|
while (num.length < 2) num = "0" + num;
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertToHex(str) {
|
||||||
|
hexstring = "";
|
||||||
|
for (var n = 0; n < str.length; n++) {
|
||||||
|
let hex = Number(str.charCodeAt(n)).toString(16);
|
||||||
|
hexstring = hexstring.concat(toHex(hex), ",");
|
||||||
|
}
|
||||||
|
return hexstring + "00";
|
||||||
|
}
|
||||||
|
|
||||||
|
function generate() {
|
||||||
|
let base0 = "1001";
|
||||||
|
let base1 = "00";
|
||||||
|
let name = document.getElementById("fname").value;
|
||||||
|
let region = "1";
|
||||||
|
let url = document.getElementById("furl").value;
|
||||||
|
|
||||||
|
let hexstring = convertToHex(base0);
|
||||||
|
hexstring = hexstring + "," + convertToHex(base1);
|
||||||
|
hexstring = hexstring + "," + convertToHex(name);
|
||||||
|
hexstring = hexstring + "," + convertToHex(region);
|
||||||
|
hexstring = hexstring + "," + convertToHex(url);
|
||||||
|
hexstring = hexstring + "," + "00";
|
||||||
|
|
||||||
|
let regscript =
|
||||||
|
`REGEDIT4
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Warcraft III]
|
||||||
|
"Battle.net Gateways"=hex(7):${hexstring}
|
||||||
|
`;
|
||||||
|
|
||||||
|
document.getElementById("regscript").value = regscript;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function downloadReg() {
|
||||||
|
let filename = "wc3.reg";
|
||||||
|
let data = document.getElementById("regscript").value;
|
||||||
|
|
||||||
|
var element = document.createElement('a');
|
||||||
|
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(data));
|
||||||
|
element.setAttribute('download', filename);
|
||||||
|
|
||||||
|
element.style.display = 'none';
|
||||||
|
document.body.appendChild(element);
|
||||||
|
|
||||||
|
element.click();
|
||||||
|
|
||||||
|
document.body.removeChild(element);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<label for="fname">Gateway Name (Nickname): </label><br>
|
||||||
|
<input type="text" id="fname" name="fname">
|
||||||
|
<br><br>
|
||||||
|
<label for="furl">PvPGN Server URL:</label><br>
|
||||||
|
<input type="text" id="furl" name="furl">
|
||||||
|
<br><br>
|
||||||
|
<form onclick="return generate();" class="my-form">
|
||||||
|
<input type="button" value="Generate">
|
||||||
|
</form>
|
||||||
|
<form onclick="return downloadReg();" class="my-form">
|
||||||
|
<input type="button" value="Download">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<label for="regscript">Registry Script:</label><br>
|
||||||
|
<textarea id="regscript" name="regscript" rows="10" cols="200"></textarea>
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
to_hex () {
|
||||||
|
echo $1 | while read -n 1 char; do
|
||||||
|
echo -n $char | xxd -p | tr '\n' ','
|
||||||
|
done
|
||||||
|
echo -n '00'
|
||||||
|
}
|
||||||
|
|
||||||
|
base0='1001'
|
||||||
|
base1='00'
|
||||||
|
servername=$1
|
||||||
|
region='1'
|
||||||
|
url=$2
|
||||||
|
|
||||||
|
echo "REGEDIT4
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III]
|
||||||
|
\"Battle.net Gateways\"=hex(7):$(to_hex $base0),$(to_hex $base1),$(to_hex $servername),$(to_hex $region),$(to_hex $url),00"
|
||||||
Reference in New Issue
Block a user