Skip to content

Commit

Permalink
Merge pull request #21 from BranDougherty/rework-archive-format-and-s…
Browse files Browse the repository at this point in the history
…cripts

Rework archive format and scripts
  • Loading branch information
BranDougherty authored Jul 3, 2022
2 parents 6c74d76 + 074f9bc commit 5b4a302
Show file tree
Hide file tree
Showing 219 changed files with 111,764 additions and 112,035 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.txt text eol=lf
*.poa text eol=lf
*.po text eol=lf
*.ini text eol=lf
*.cfg text eol=lf
*.sh text eol=lf
*.bot text eol=lf
*.py text eol=lf
server/serverscript text eol=lf
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Workflow to build and upload archives to GitHub release. Triggered by pushing
# a new tag.
name: Release

on:
push:
tags:
- "v*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@add3486cc3b55d4a5e11c8045058cef96538edc7

- name: Build release files
run: |
python3 create_smod.py
- name: Upload release
uses: softprops/action-gh-release@fe9a9bd3295828558c7a3c004f23f3bf77d155b2
with:
files: |
soldat.smod
play-regular.ttf
body: Soldat assets.
name: Soldat assets ${{ github.ref_name }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/soldat.smod
/client.zip
/server.zip
File renamed without changes.
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
<div align="center">
<img src="https://i.imgur.com/HrYPYjh.png" />
<h2>Soldat</h2>
<h2>opensoldat</h2>
<p>Base game content</p>
<a href="https://discord.soldat.pl"><img src="https://img.shields.io/discord/234733999879094272.svg" /></a>
</div>

### Instructions

The content of this repository is meant to be bundled into an archive file, called *soldat.smod*. We provide scripts to help you with this process.
- For Linux we have create_smod.sh script, that you can run with ```bash create_smod.sh```.
- For Windows, we provide create_smod.cmd script.
The contents of this repository are meant to be compiled into an archive *soldat.smod*. To learn more about *.smod* files, refer to [this post on Soldat forums](https://forums.soldat.pl/index.php?topic=44917.0). The recommended way to get the files is to download them from the [latest release](https://github.com/opensoldat/base/releases/latest). This way, your *soldat.smod* is guaranteed to have the same SHA1 as the version used by official soldatserver releases (which is required to join servers with `sv_pure` set).

Both scripts rely on ```zip``` command internally. On Linux, ```zip``` command is most likely available out of the box, depending on your Linux distribution. On Windows, ```zip``` command should be available after installing [FreePascal](https://www.freepascal.org/) (make sure you tick the "Free Pascal Utilities" box during installation) and adding FreePascal's path to your PATH environment variable. If this approach doesn't work for you, you can also get the ```zip``` command by installing [MSYS2](https://www.msys2.org/) or [Cygwin](https://www.cygwin.com/).
If you wish to create your own *soldat.smod* file, run the following commands from the root of this repository:
```bash
rm -rf server client shared
git checkout server client shared
python3 create_smod.py
```
The script attempts to produce the same byte-for-byte archive file regardless of what operating system it is run on, but it is potentially fragile due to its reliance on Python's shipped implementation of zip.

To learn more about *.smod* files, refer to [this post on Soldat forums](https://forums.soldat.pl/index.php?topic=44917.0).

### Notes
Generating a new *soldat.smod* file on every Soldat build is not recommended. Internally, Soldat relies on file checksum to make sure client and server have the same *soldat.smod* file. However, archives created with ```zip``` command have a different checksum every time you recreate the *.smod* bundle. This is related to metadata (such as last modification date) being stored in archive files.

Theoretically, this could be solved by passing some flags (like ```-X```) to ```zip``` command, so that we strip unnecessary data. Other approaches include using a different archive format that would produce more reliable outputs. Such solutions might work on the same platform, but I was unable to get it to work properly on both Windows and Linux at the same time.

So, in order to prevent checksum mismatches across different builds, we provide a *soldat.smod* file that can be shared across multiple platforms. You can download latest version in *Releases* section of this repository.

To learn more about these issues, refer to [this explanation](https://reproducible-builds.org/docs/archives/).

### Contributions

TBD


### Licensing

[CC BY 4.0](LICENSE.md)
[CC BY 4.0](LICENSE.txt)

*Soldat and all the file formats the program produces are Copyright © 2001-2018 Michal Marcinkowski. All rights reserved.*
114 changes: 56 additions & 58 deletions client/configs/client.cfg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,58 +1,56 @@
// First unbind every key
unbindall
// Set default binds
bind "A" "+left"
bind "D" "+right"
bind "W" "+jump"
bind "S" "+crouch"
bind "X" "+prone"
bind "MOUSE1" "+fire"
bind "MOUSE3" "+jet"
bind "Q" "+changeweapon"
bind "R" "+reload"
bind "F" "+dropweapon"
bind "E" "+throwgrenade"
bind "T" "+chat"
bind "Y" "+teamchat"
bind "V" "+radio"
bind "TAB" "+weapons"
bind "F1" "+fragslist"
bind "F2" "+statsmenu"
bind "F3" "+minimap"
bind "F4" "screenshot"
bind "/" "+cmd"
bind "ALT+F3" "+gamestats"
// Taunt test bind
// Available modifiers: ALT, CTRL, SHIFT (can be used together like CTRL+ALT+KEY)
// List of key names: https://wiki.libsdl.org/SDL_Keycode
bind "ALT+B" "say ""Test"""
// Toggle test
bind "F5" "toggle r_renderui 1 0"
// Alias test
alias "ctf1" "echo ""Connecting to ZAB CTF #1"";connect 138.201.55.232 25140"
bind "F6" "ctf1"

// Set in-game nick and gostek settings
cl_player_name "Major"
cl_player_skin "$008f8f8f"
cl_player_shirt "$008f8f8f"
cl_player_pants "$008f8f8f"
cl_player_jet "$008f8f8f"
cl_player_hairstyle "1"
cl_player_headstyle "1"
cl_player_chainstyle "1"
cl_player_secwep "1"

// Set window mode (0 = window, 1 = fullscreen, 2 = fullscreen window)
r_fullscreen 0
// Set window width & height - Change it to own dimensions (only r_screen* cvars)
r_renderwidth "0"
r_renderheight "0"
r_screenwidth "0"
r_screenheight "0"

// sound volume %
snd_volume 50
// Load config with taunts
exec taunts.cfg

// First unbind every key
unbindall
// Set default binds
bind "A" "+left"
bind "D" "+right"
bind "W" "+jump"
bind "S" "+crouch"
bind "X" "+prone"
bind "MOUSE1" "+fire"
bind "MOUSE3" "+jet"
bind "Q" "+changeweapon"
bind "R" "+reload"
bind "F" "+dropweapon"
bind "E" "+throwgrenade"
bind "T" "+chat"
bind "Y" "+teamchat"
bind "V" "+radio"
bind "TAB" "+weapons"
bind "F1" "+fragslist"
bind "F2" "+statsmenu"
bind "F3" "+minimap"
bind "F4" "screenshot"
bind "/" "+cmd"
// Available modifiers: ALT, CTRL, SHIFT (can be used together like CTRL+ALT+KEY)
// List of key names: https://wiki.libsdl.org/SDL_Keycode
bind "ALT+F3" "+gamestats"
// Toggle test
bind "F5" "toggle r_renderui 1 0"
// Alias test
alias "ctf1" "echo ""Connecting to ZAB CTF #1"";connect 138.201.55.232 25140"
bind "F6" "ctf1"

// Set in-game nick and gostek settings
cl_player_name "Major"
cl_player_skin "$008f8f8f"
cl_player_shirt "$008f8f8f"
cl_player_pants "$008f8f8f"
cl_player_jet "$008f8f8f"
cl_player_hairstyle "1"
cl_player_headstyle "1"
cl_player_chainstyle "1"
cl_player_secwep "1"

// Set window mode (0 = window, 1 = fullscreen, 2 = fullscreen window)
r_fullscreen 0
// Set window width & height - Change it to own dimensions (only r_screen* cvars)
r_renderwidth "0"
r_renderheight "0"
r_screenwidth "0"
r_screenheight "0"

// sound volume %
snd_volume 50
// Load config with taunts
exec taunts.cfg

72 changes: 36 additions & 36 deletions client/configs/taunts.cfg
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
bind "ALT+0" "say ""Stick around!"""
bind "ALT+1" "smoke"
bind "ALT+2" "tabac"
bind "ALT+3" "takeoff"
bind "ALT+4" "victory"
bind "ALT+5" "say ""What the hell are you?"""
bind "ALT+6" "say ""If it bleeds, we can kill it """
bind "ALT+7" "say ""I'm gonna have me some fun!"""
bind "ALT+8" "say ""Bleed, bastard."""
bind "ALT+9" "say ""Medic!"""
bind "ALT+A" "say ""Die!"""
bind "ALT+B" "say ""Son of a bitch!"""
bind "ALT+C" "say ""It's over Johnny"""
bind "ALT+D" "say ""Anytime..."""
bind "ALT+E" "say ""No!"""
bind "ALT+F" "say ""Yes, Sir!"""
bind "ALT+G" "say ""I'll be back!"""
bind "ALT+H" "say ""Get the flag!"""
bind "ALT+I" "say ""OK"""
bind "ALT+J" "say ""Help!"""
bind "ALT+K" "say ""Sniper!"""
bind "ALT+L" "say ""Heavy Machine Gun ahead!"""
bind "ALT+M" "say ""Take Cover!"""
bind "ALT+N" "say ""I need backup!"""
bind "ALT+O" "say ""Follow me!"""
bind "ALT+P" "say ""Kiss the ground soldier!"""
bind "ALT+Q" "say ""On your feet soldier!"""
bind "ALT+R" "say ""Come on!"""
bind "ALT+S" "say ""Yeah"""
bind "ALT+T" "say ""Return the flag!"""
bind "ALT+U" "say ""Hurraaaa!!!"""
bind "ALT+V" "say ""I am the law!"""
bind "ALT+W" "say ""Engage at will!!!"""
bind "ALT+X" "say ""I ain't got time to bleed!"""
bind "ALT+Y" "say ""You're one ugly mother fu**er!"""
bind "ALT+Z" "say ""Got it!"""
bind "ALT+0" "say ""Stick around!"""
bind "ALT+1" "smoke"
bind "ALT+2" "tabac"
bind "ALT+3" "takeoff"
bind "ALT+4" "victory"
bind "ALT+5" "say ""What the hell are you?"""
bind "ALT+6" "say ""If it bleeds, we can kill it """
bind "ALT+7" "say ""I'm gonna have me some fun!"""
bind "ALT+8" "say ""Bleed, bastard."""
bind "ALT+9" "say ""Medic!"""
bind "ALT+A" "say ""Die!"""
bind "ALT+B" "say ""Son of a bitch!"""
bind "ALT+C" "say ""It's over Johnny"""
bind "ALT+D" "say ""Anytime..."""
bind "ALT+E" "say ""No!"""
bind "ALT+F" "say ""Yes, Sir!"""
bind "ALT+G" "say ""I'll be back!"""
bind "ALT+H" "say ""Get the flag!"""
bind "ALT+I" "say ""OK"""
bind "ALT+J" "say ""Help!"""
bind "ALT+K" "say ""Sniper!"""
bind "ALT+L" "say ""Heavy Machine Gun ahead!"""
bind "ALT+M" "say ""Take Cover!"""
bind "ALT+N" "say ""I need backup!"""
bind "ALT+O" "say ""Follow me!"""
bind "ALT+P" "say ""Kiss the ground soldier!"""
bind "ALT+Q" "say ""On your feet soldier!"""
bind "ALT+R" "say ""Come on!"""
bind "ALT+S" "say ""Yeah"""
bind "ALT+T" "say ""Return the flag!"""
bind "ALT+U" "say ""Hurraaaa!!!"""
bind "ALT+V" "say ""I am the law!"""
bind "ALT+W" "say ""Engage at will!!!"""
bind "ALT+X" "say ""I ain't got time to bleed!"""
bind "ALT+Y" "say ""You're one ugly mother fu**er!"""
bind "ALT+Z" "say ""Got it!"""
Empty file added client/demos/.keep
Empty file.
Empty file added client/logs/kills/.keep
Empty file.
Empty file added client/maps/.keep
Empty file.
Empty file modified client/mods/classic.smod
100755 → 100644
Empty file.
60 changes: 0 additions & 60 deletions client/readme.txt

This file was deleted.

Binary file removed client/win32_dlls/SDL2.dll
Binary file not shown.
Binary file removed client/win32_dlls/freetype.dll
Binary file not shown.
Binary file removed client/win32_dlls/openal32.dll
Binary file not shown.
Binary file removed client/win32_dlls/physfs.dll
Binary file not shown.
Binary file removed client/win32_dlls/stb.dll
Binary file not shown.
31 changes: 0 additions & 31 deletions create_smod.cmd

This file was deleted.

Loading

0 comments on commit 5b4a302

Please sign in to comment.