diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 49599fefe..2b2e8a4fd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,4 +26,5 @@ jobs: ./Erupe/config.json ./Erupe/www/ ./Erupe/savedata/ - ./RoadShopItems.csv + ./Erupe/bin/ + ./Erupe/RoadShopItems.csv diff --git a/.gitignore b/.gitignore index 9f11b755a..38fdf2e18 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,14 @@ .idea/ + +www/jp/ +vendor/ +bin/*.bin +bin/*.bak +bin/quests/*.bin +bin/questlists/*.bin +bin/scenarios/*.bin +bin/debug/*.bin +savedata/*/ +*.exe +*.lnk +*.bat \ No newline at end of file diff --git a/Erupe/.gitignore b/Erupe/.gitignore index 6cf56fb81..38fdf2e18 100644 --- a/Erupe/.gitignore +++ b/Erupe/.gitignore @@ -1,6 +1,6 @@ -www/jp/ - .idea/ + +www/jp/ vendor/ bin/*.bin bin/*.bak @@ -8,7 +8,7 @@ bin/quests/*.bin bin/questlists/*.bin bin/scenarios/*.bin bin/debug/*.bin -savedata/ +savedata/*/ *.exe *.lnk -*.bat +*.bat \ No newline at end of file diff --git a/Erupe/Event List.txt b/Erupe/Event List.txt deleted file mode 100644 index 7c6838e8d..000000000 --- a/Erupe/Event List.txt +++ /dev/null @@ -1 +0,0 @@ - 0 is no event, 1 is "Week 1 Timestamp (broken), 2 is "Week 2 Timestamp (broken), 3 is Diva Defense \ No newline at end of file diff --git a/Erupe/README.md b/Erupe/README.md deleted file mode 100644 index 15a1fca6c..000000000 --- a/Erupe/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# Erupe -## WARNING -This project is in its infancy and has no reliable active developer, no documentation, and no support. - -# General info -Currently allows a JP MHF client (with GameGuard removed) to: -* Login and register an account (registration is automatic if account doesn't exist) -* Create a character -* Get ingame to the main city -* See other players walk around -* Do quests -* Use chat* - -# Installation -## Server -1. Clone the repo with `git clone https://github.com/Andoryuuta/Erupe.git` -2. Install PostgreSQL -3. Launch psql shell, `CREATE DATABASE erupe;`. -4. Setup database with golang-migrate: - - Windows: - ``` - > go get -tags 'postgres' -u github.com/golang-migrate/migrate/v4/cmd/migrate/ - - > set POSTGRESQL_URL=postgres://postgres:password@localhost:5432/erupe?sslmode=disable - - > cd erupe - - > migrate -database %POSTGRESQL_URL% -path migrations up - ``` - - Linux: - ``` - > go get -tags 'postgres' -u github.com/golang-migrate/migrate/v4/cmd/migrate/ - - > export POSTGRESQL_URL=postgres://postgres:password@localhost:5432/erupe?sslmode=disable - - > cd erupe - - > migrate -database $POSTGRESQL_URL -path migrations up - ``` - - (Replacing `postgres:password` with your postgres username and password) - -5. Edit the config.json - - Namely: - * Update the database username and password - * Update the `host_ip` and `ip` fields (there are multiple) to your external IP if you are hosting for multiple clients. - -6. Place quest/scenario binaries. - - The quest and scenario binary files should be placed in `bin/quests/` and `bin/scenarios` respectively. - -## Launcher -Erupe ships with a rudimentary custom launcher, so you don't need to obtain the original TW/JP files to simply get ingame. However, it does still support using the original files if you choose to. To set this up, place a copy of the original launcher html/js/css in `./www/tw/`, and `/www/jp/` for the TW and JP files respectively. - -Then, modify the the `/launcher/js/launcher.js` file as such: -* Find the call to `startUpdateProcess();` in a case statement and replace it with `finishUpdateProcess();`. (This disables the file check and updating) -* (JP ONLY): replace all uses of "https://" with "http://" in the file. - -Finally, edit the config.json and set `UseOriginalLauncherFiles` to `true` under the launcher settings. - -# Usage -### Note: If you are switching to/from the custom launcher html, you will have to clear your IE cache @ `C:\Users\\AppData\Local\Microsoft\Windows\INetCache`. - -## Server -``` -cd Erupe -go run . -``` - -## Client -Add to hosts: -``` -127.0.0.1 mhfg.capcom.com.tw -127.0.0.1 mhf-n.capcom.com.tw -127.0.0.1 cog-members.mhf-z.jp -127.0.0.1 www.capcom-onlinegames.jp -127.0.0.1 srv-mhf.capcom-networks.jp -``` - -Run mhf.exe normally (with locale emulator or appropriate timezone). diff --git a/RoadShopItems.csv b/Erupe/RoadShopItems.csv similarity index 100% rename from RoadShopItems.csv rename to Erupe/RoadShopItems.csv diff --git a/Optional Loading & Title Screens/Just drop in your client dat folder and replace b/Erupe/bin/.gitkeep similarity index 100% rename from Optional Loading & Title Screens/Just drop in your client dat folder and replace rename to Erupe/bin/.gitkeep diff --git a/Erupe/aio-upgrade.sql b/Erupe/patch-schema/aio-upgrade.sql similarity index 100% rename from Erupe/aio-upgrade.sql rename to Erupe/patch-schema/aio-upgrade.sql diff --git a/Erupe/airouv2.sql b/Erupe/patch-schema/airouv2.sql similarity index 100% rename from Erupe/airouv2.sql rename to Erupe/patch-schema/airouv2.sql diff --git a/Erupe/distitem.sql b/Erupe/patch-schema/distitem.sql similarity index 96% rename from Erupe/distitem.sql rename to Erupe/patch-schema/distitem.sql index a72e26fa8..7e64e620c 100644 --- a/Erupe/distitem.sql +++ b/Erupe/patch-schema/distitem.sql @@ -1,26 +1,26 @@ -BEGIN; -CREATE TABLE IF NOT EXISTS public.distribution -( - id serial NOT NULL PRIMARY KEY, - character_id int, - type int NOT NULL, - deadline timestamp without time zone, - event_name text NOT NULL DEFAULT 'GM Gift!', - description text NOT NULL DEFAULT '~C05You received a gift!', - times_acceptable int NOT NULL DEFAULT 1, - min_hr int NOT NULL DEFAULT 65535, - max_hr int NOT NULL DEFAULT 65535, - min_sr int NOT NULL DEFAULT 65535, - max_sr int NOT NULL DEFAULT 65535, - min_gr int NOT NULL DEFAULT 65535, - max_gr int NOT NULL DEFAULT 65535, - data bytea NOT NULL -); - -CREATE TABLE IF NOT EXISTS public.distributions_accepted -( - distribution_id int, - character_id int -); - +BEGIN; +CREATE TABLE IF NOT EXISTS public.distribution +( + id serial NOT NULL PRIMARY KEY, + character_id int, + type int NOT NULL, + deadline timestamp without time zone, + event_name text NOT NULL DEFAULT 'GM Gift!', + description text NOT NULL DEFAULT '~C05You received a gift!', + times_acceptable int NOT NULL DEFAULT 1, + min_hr int NOT NULL DEFAULT 65535, + max_hr int NOT NULL DEFAULT 65535, + min_sr int NOT NULL DEFAULT 65535, + max_sr int NOT NULL DEFAULT 65535, + min_gr int NOT NULL DEFAULT 65535, + max_gr int NOT NULL DEFAULT 65535, + data bytea NOT NULL +); + +CREATE TABLE IF NOT EXISTS public.distributions_accepted +( + distribution_id int, + character_id int +); + END; \ No newline at end of file diff --git a/Erupe/gook.sql b/Erupe/patch-schema/gook.sql similarity index 100% rename from Erupe/gook.sql rename to Erupe/patch-schema/gook.sql diff --git a/Erupe/guild-additions.sql b/Erupe/patch-schema/guild-additions.sql similarity index 100% rename from Erupe/guild-additions.sql rename to Erupe/patch-schema/guild-additions.sql diff --git a/Erupe/houseinterior.sql b/Erupe/patch-schema/houseinterior.sql similarity index 100% rename from Erupe/houseinterior.sql rename to Erupe/patch-schema/houseinterior.sql diff --git a/Erupe/road-shop-rotation.sql b/Erupe/patch-schema/road-shop-rotation.sql similarity index 96% rename from Erupe/road-shop-rotation.sql rename to Erupe/patch-schema/road-shop-rotation.sql index bfd9f9e4e..c4c85482c 100644 --- a/Erupe/road-shop-rotation.sql +++ b/Erupe/patch-schema/road-shop-rotation.sql @@ -1,35 +1,35 @@ -BEGIN; -CREATE TABLE IF NOT EXISTS public.normal_shop_items -( - shoptype integer, - shopid integer, - itemhash integer not null, - itemid integer, - points integer, - tradequantity integer, - rankreqlow integer, - rankreqhigh integer, - rankreqg integer, - storelevelreq integer, - maximumquantity integer, - boughtquantity integer, - roadfloorsrequired integer, - weeklyfataliskills integer, - enable_weeks character varying(8) -); - -ALTER TABLE IF EXISTS public.normal_shop_items - ADD COLUMN IF NOT EXISTS enable_weeks character varying(8); - -CREATE TABLE IF NOT EXISTS public.shop_item_state -( - char_id bigint REFERENCES characters (id), - itemhash int UNIQUE NOT NULL, - usedquantity int, - week int -); - -ALTER TABLE IF EXISTS public.shop_item_state - ADD COLUMN IF NOT EXISTS week int; - +BEGIN; +CREATE TABLE IF NOT EXISTS public.normal_shop_items +( + shoptype integer, + shopid integer, + itemhash integer not null, + itemid integer, + points integer, + tradequantity integer, + rankreqlow integer, + rankreqhigh integer, + rankreqg integer, + storelevelreq integer, + maximumquantity integer, + boughtquantity integer, + roadfloorsrequired integer, + weeklyfataliskills integer, + enable_weeks character varying(8) +); + +ALTER TABLE IF EXISTS public.normal_shop_items + ADD COLUMN IF NOT EXISTS enable_weeks character varying(8); + +CREATE TABLE IF NOT EXISTS public.shop_item_state +( + char_id bigint REFERENCES characters (id), + itemhash int UNIQUE NOT NULL, + usedquantity int, + week int +); + +ALTER TABLE IF EXISTS public.shop_item_state + ADD COLUMN IF NOT EXISTS week int; + END; \ No newline at end of file diff --git a/Erupe/scenariocounter.sql b/Erupe/patch-schema/scenariocounter.sql similarity index 100% rename from Erupe/scenariocounter.sql rename to Erupe/patch-schema/scenariocounter.sql diff --git a/Erupe/tokensessions.sql b/Erupe/patch-schema/tokensessions.sql similarity index 100% rename from Erupe/tokensessions.sql rename to Erupe/patch-schema/tokensessions.sql diff --git a/Optional Loading & Title Screens/demo.txb b/Optional Loading & Title Screens/demo.txb deleted file mode 100644 index 409cdadcf..000000000 Binary files a/Optional Loading & Title Screens/demo.txb and /dev/null differ diff --git a/Optional Loading & Title Screens/title.txb b/Optional Loading & Title Screens/title.txb deleted file mode 100644 index 2a7b041cb..000000000 Binary files a/Optional Loading & Title Screens/title.txb and /dev/null differ diff --git a/migration/README.md b/migration/README.md deleted file mode 100644 index 4fe0bd8d9..000000000 --- a/migration/README.md +++ /dev/null @@ -1,8 +0,0 @@ -To bring up fresh database: -migrate.exe -database postgres://user:password@host:port/dbname?sslmode=disable -path /pathto/migrations up -To tear down database -migrate.exe -database postgres://user:password@host:port/dbname?sslmode=disable -path /pathto/migrations down - - -More info: -https://github.com/golang-migrate/migrate/releases/tag/v4.15.2 \ No newline at end of file diff --git a/migration/migrate.exe b/migration/migrate.exe deleted file mode 100644 index 47514e575..000000000 Binary files a/migration/migrate.exe and /dev/null differ