Add containerization and make this bad boy work on Windows and MacOS

This commit is contained in:
omer
2024-02-28 19:08:07 -06:00
parent d58a0543eb
commit df7a63e047
557 changed files with 6647 additions and 5493 deletions
+88 -29
View File
@@ -1,61 +1,97 @@
# # Hearthmod Anvil
Hearthmod anvil is a software stack that allows you to Mod Hearthstone. If you intend to run it, it's recommended that you run a linux OS, preferably debian or ubuntu distribution.
# # hearthmod
Make HS fun again
## Components
[hm_lobbyserver](https://github.com/WatermelonModders/hm_lobbyserver) - hearthmod lobby server
[hm_gameserver](https://github.com/WatermelonModders/hm_gameserver) - hearthmod game server
[hm_lobbyserver](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_lobbyserver) - hearthmod lobby server
[hm_base](https://github.com/WatermelonModders/hm_base) - hearthmod base library
[hm_gameserver](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_gameserver) - hearthmod game server
[hm_client](https://github.com/WatermelonModders/hm_client) - hearthmod client
[hm_base](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_base) - hearthmod base library
[hm_database](https://github.com/WatermelonModders/hm_database) - hearthmod latest database snapshot
[hm_client](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_client) - hearthmod client
[hm_sunwell](https://github.com/WatermelonModders/hm_sunwell) - hearthsim custom card generation
[hm_database](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_database) - hearthmod latest database snapshot
[hm_stud](https://github.com/WatermelonModders/hm_stud) - tls un/wrapper
[hm_sunwell](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_sunwell) - hearthsim custom card generation
[hm_nginx](https://github.com/WatermelonModders/hm_nginx) - nginx web server
[hm_stud](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_stud) - tls un/wrapper
[hm_web](https://github.com/WatermelonModders/hm_web) - hearthmod web interface
[hm_nginx](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_nginx) - nginx web server
[hm_web](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_web) - hearthmod web interface
## Guide
Clone hearthmod software stack
```sh
git clone https://github.com/WatermelonModders/hearthmodanvilnew
git clone https://gitlab.hsmod.xyz/omdagny/hearthmod
```
Run
### Docker container
Run
```sh
cd hearthmodanvilnew/
cd hearthmod/
docker-compose up --build
```
builds and starts the hearthmod container with all of the required dependencies.
```sh
bash docker_ctl.sh bucket_create
```
creates a bucket in couchbase.
```sh
cd hearthmod/
bash docker_ctl.sh bucket_restore
```
restores the latest database snapshot/populates it.
```sh
cd hearthmod/
bash docker_ctl.sh compile
```
compiles and installs the entire hearthmod server stack.
```sh
cd hearthmod/
bash docker_ctl.sh start
```
starts the hearthmod server stack.
```sh
cd hearthmod/
bash docker_ctl.sh stop
```
### Ubuntu
Run
```sh
cd hearthmod/
bash host_ctl_ubuntu.sh uninstalled
```
which compiles and installs the entire hearthmod stack. Also, it doesn't check for you local couchbase, nginx or stud instances. If you don't want to mess them, consider using virtual environment or modify installation script. If you don't run ubuntu or debian, please consider installation script alteration that suits your distro and creating an upstream pull request. Script host_ctl_ubuntu.sh was only tested on Ububtu 16.04.
Once compiled, run:
```sh
bash host_ctl_ubuntu.sh start [ip]
```
```
where IP is address of your gameserver (your current IP in most cases) and you can play.
Then run clients:
```sh
hearthmod/hs_client1/hearthmod_client/linux
```
and
```sh
hearthmod/hs_client2/hearthmod_client/linux
```
By running two instances of hearthstone you can play by yourself and develop or test stuff.
To create or modify cards, accounts, decks; go to http://localhost/ .
## Hosts file:
If you don't want your hearthstone client to connect to hearthmod.com you must edit your hosts file by adding the following line:
@@ -67,26 +103,49 @@ If you don't want your hearthstone client to connect to hearthmod.com you must e
Hosts file location varies depending on OS.
Linux:
```sh
/etc/hosts
```
Windows:
```sh
c:\Windows\System32\Drivers\etc\hosts
```
## Running the clients:
```sh
cd hearthmod/hs_client1/hearthmod_client/linux
./hearthmod
```
and
```sh
cd hearthmod/hs_client2/hearthmod_client/linux
./hearthmod
```
By running two instances of hearthstone you can play by yourself and develop or test stuff.
To create or modify cards, accounts, decks; go to http://localhost/ .
## Troubleshooting:
TODO: Edit this to accommodate docker changes
web server error log file:
```sh
tail -f /usr/local/nginx/logs/error.log
```
gameserver and lobbyserver log files:
```sh
./hearthmod/hm_log/*
```
Pull requests are more than welcome.