-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
6,822 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
### NOTE: Due to the exploratory nature of this project the git history is a mess, may be rewritten at any time and commits are big and messy. Architectural changes can happen at any time and will break any forks! | ||
# Alter-Pangya | ||
|
||
An attempt at creating a PangYa S8 server emulator | ||
A PangYa GB.852 server emulator | ||
|
||
#### Dependencies | ||
## Finding a client | ||
|
||
* Redis | ||
* PostgreSQL | ||
This emulator only works with the PangYa GB.852 client, if you browse around the pangya communities you'll easily find a download. | ||
In order to run the client it is highly recommended that you use [RugBurn](https://github.com/pangbox/rugburn). | ||
|
||
A big thanks to everyone at the [Cadie's Cauldron discord](https://discord.gg/HwDTssf) | ||
## Running the servers | ||
|
||
References: | ||
### Dependencies | ||
|
||
* A redis instance | ||
* A postgres instance | ||
|
||
## Development | ||
|
||
### Setting up a Postgres database | ||
You can run a local postgres database using the reference `Dockerfile` contained in the `database` directory, to quickly create an instance run: | ||
```bash | ||
docker image build -t alter_pangya database/ | ||
docker container run -d -p 5432:5432 --name alter_pangya alter_pangya | ||
``` | ||
|
||
### Applying the migrations | ||
Replace the relevant database parameters with your own values | ||
|
||
```bash | ||
mvn -Dflyway.url=jdbc:postgresql://localhost/alter_pangya -Dflyway.user=alter_pangya -Dflyway.password=alter_pangya -Dflyway.locations=filesystem:database/migrations org.flywaydb:flyway-maven-plugin:migrate --non-recursive | ||
``` | ||
|
||
### Regenerating the JooQ classes (Schema changes) | ||
|
||
While at the project root, run the following bash script to re-generate the jooq classes: | ||
|
||
```bash | ||
mvn -Djooq.codegen.jdbc.url=jdbc:postgresql://localhost/alter_pangya -Djooq.codegen.jdbc.user=alter_pangya -Djooq.codegen.jdbc.password=alter_pangya org.jooq:jooq-codegen-maven:generate --non-recursive | ||
``` | ||
|
||
A big thanks to everyone at the [Caddie's Cauldron discord](https://discord.gg/HwDTssf) | ||
|
||
#### References: | ||
|
||
* [PangYa Tools](https://github.com/pangyatools) | ||
* [Pangbox](https://github.com/pangbox/) | ||
* [UGPangya](https://github.com/eantoniobr/UGPangya/) | ||
* [SuperSS](https://github.com/Acrisio-Filho/SuperSS-Dev) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM postgres:15 | ||
|
||
ENV POSTGRES_USER=alter_pangya | ||
ENV POSTGRES_PASSWORD=alter_pangya | ||
ENV POSTGRES_DB=alter_pangya |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
CREATE TABLE account ( | ||
uid serial PRIMARY KEY, | ||
uuid uuid NOT NULL, | ||
username text NOT NULL, | ||
nickname text, | ||
password bytea NOT NULL, | ||
pang_balance int NOT NULL, | ||
cookie_balance int NOT NULL, | ||
created_at timestamptz DEFAULT NOW() | ||
); | ||
|
||
CREATE INDEX idx__account_uuid ON account (uuid); | ||
|
||
CREATE TABLE achievement ( | ||
iff_id int NOT NULL PRIMARY KEY, | ||
completed_with_milestone int NOT NULL, | ||
category int NOT NULL | ||
); | ||
|
||
CREATE TABLE achievement_milestone ( | ||
iff_id int NOT NULL PRIMARY KEY, | ||
achievement_iff_id int NOT NULL | ||
CONSTRAINT fk__achievement_milestone REFERENCES achievement (iff_id), | ||
name text NOT NULL | ||
); | ||
|
||
CREATE TABLE player_character ( | ||
uid serial PRIMARY KEY, | ||
account_uid int NOT NULL | ||
CONSTRAINT fk_player_character__account REFERENCES account (uid) ON DELETE CASCADE, | ||
iff_id int NOT NULL, | ||
hair_color int NOT NULL, | ||
part_iff_ids json NOT NULL, | ||
part_uids json NOT NULL, | ||
aux_parts json NOT NULL, | ||
cutin_iff_id int NOT NULL, | ||
stats json NOT NULL, | ||
mastery int NOT NULL, | ||
cards json NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_player_character ON player_character (account_uid, iff_id); | ||
|
||
CREATE TABLE player_caddie ( | ||
uid serial PRIMARY KEY, | ||
account_uid int NOT NULL | ||
CONSTRAINT fk_player_caddie__account REFERENCES account (uid) ON DELETE CASCADE, | ||
iff_id int NOT NULL, | ||
level int NOT NULL, | ||
experience int NOT NULL | ||
); | ||
CREATE UNIQUE INDEX idx_player_caddie ON player_caddie (account_uid, iff_id); | ||
|
||
CREATE TABLE player_inventory_item ( | ||
uid serial PRIMARY KEY, | ||
account_uid int NOT NULL | ||
CONSTRAINT fk_player_inventory_item__account REFERENCES account (uid) ON DELETE CASCADE, | ||
iff_id int NOT NULL, | ||
quantity int DEFAULT 0, | ||
stats json | ||
); | ||
|
||
CREATE TABLE player_equipment ( | ||
account_uid int NOT NULL PRIMARY KEY | ||
CONSTRAINT fk_player_statistics__account REFERENCES account (uid) ON DELETE CASCADE, | ||
item_iff_ids json NOT NULL, | ||
character_uid int NOT NULL, | ||
caddie_uid int NOT NULL, | ||
club_set_uid int NOT NULL, | ||
comet_iff_id int NOT NULL | ||
); | ||
|
||
CREATE TABLE player_statistics ( | ||
account_uid int NOT NULL PRIMARY KEY | ||
CONSTRAINT fk_player_statistics__account REFERENCES account (uid) ON DELETE CASCADE, | ||
total_shots int NOT NULL, | ||
total_putts int NOT NULL, | ||
playtime_seconds int NOT NULL, | ||
shot_time_seconds int NOT NULL, | ||
longest_drive float4 NOT NULL, | ||
pangya_shots int NOT NULL, | ||
timeouts int NOT NULL, | ||
oob_shots int NOT NULL, | ||
total_distance int NOT NULL, | ||
total_holes int NOT NULL, | ||
unfinished_holes int NOT NULL, | ||
hole_in_ones int NOT NULL, | ||
bunker_shots int NOT NULL, | ||
fairway_shots int NOT NULL, | ||
albatross int NOT NULL, | ||
successful_putts int NOT NULL, | ||
longest_putt float4 NOT NULL, | ||
longest_chip_in float4 NOT NULL, | ||
experience int NOT NULL, | ||
level int NOT NULL, | ||
pang_earned bigint NOT NULL, | ||
total_score int NOT NULL, | ||
games_played int NOT NULL, | ||
game_combo_current_streak int NOT NULL, | ||
game_combo_best_streak int NOT NULL, | ||
games_quit int NOT NULL, | ||
pang_won_in_battle int NOT NULL, | ||
pang_battle_wins int NOT NULL, | ||
pang_battle_losses int NOT NULL, | ||
pang_battle_all_ins int NOT NULL, | ||
pang_battle_combo int NOT NULL | ||
); | ||
|
||
CREATE TABLE player_achievement ( | ||
uid serial PRIMARY KEY, | ||
account_uid int NOT NULL | ||
CONSTRAINT fk_player_achievement__account REFERENCES account (uid) ON DELETE CASCADE, | ||
iff_id int NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_player_achievement ON player_achievement (account_uid, iff_id); | ||
|
||
CREATE TABLE player_achievement_milestone ( | ||
uid serial PRIMARY KEY, | ||
player_achievement_uid int NOT NULL | ||
CONSTRAINT fk_player_achievement_milestone__player_achievement REFERENCES player_achievement (uid) ON DELETE CASCADE, | ||
iff_id int NOT NULL, | ||
progress INT NOT NULL DEFAULT 0, | ||
completed_at timestamptz | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_player_achievement_milestone ON player_achievement_milestone (player_achievement_uid, iff_id); |
Oops, something went wrong.