mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 15:04:38 +01:00
Compare commits
362 Commits
fix/mutex-
...
5f265ee291
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f265ee291 | ||
|
|
2a297e693f | ||
|
|
531b3d2fa6 | ||
|
|
7459dede49 | ||
|
|
b2768e5af8 | ||
|
|
c13d6e6116 | ||
|
|
425a245af5 | ||
|
|
da43ad0cad | ||
|
|
8f3624d589 | ||
|
|
8d1c6a79e2 | ||
|
|
d83c784452 | ||
|
|
ee7b099deb | ||
|
|
ef3212da11 | ||
|
|
3d0114ce22 | ||
|
|
c539905c1d | ||
|
|
69a2a7ca3b | ||
|
|
7e58a26693 | ||
|
|
8c219be30f | ||
|
|
f9cfb07760 | ||
|
|
f2862ea4b8 | ||
|
|
3e71c308f4 | ||
|
|
3c0d29ed41 | ||
|
|
09f09e230d | ||
|
|
5028355cfc | ||
|
|
ba04b79bd8 | ||
|
|
06c01153f6 | ||
|
|
296bc36dbc | ||
|
|
79b65281f9 | ||
|
|
d17d97fefc | ||
|
|
0bf39b9caf | ||
|
|
51ae16541f | ||
|
|
d86f50bd29 | ||
|
|
7c61f70590 | ||
|
|
d1dfc3fbb1 | ||
|
|
b3305d1185 | ||
|
|
4eed6a9738 | ||
|
|
ab7bb0d004 | ||
|
|
7bf2fd5b8f | ||
|
|
366ec833d5 | ||
|
|
a4fa55f9c9 | ||
|
|
2215afca2b | ||
|
|
4348aa02a8 | ||
|
|
8191994acb | ||
|
|
436e30f83d | ||
|
|
34e84f31df | ||
|
|
1432e8f2b8 | ||
|
|
edd357fe50 | ||
|
|
ae32951671 | ||
|
|
2d48d63263 | ||
|
|
b20969ddc6 | ||
|
|
8f68e10f1d | ||
|
|
2c5896814f | ||
|
|
8a55c5ff89 | ||
|
|
7d760bd3b4 | ||
|
|
04008fceb8 | ||
|
|
1ab6940b01 | ||
|
|
ae759be046 | ||
|
|
459f382dd7 | ||
|
|
f545576fc9 | ||
|
|
4204ab1ecb | ||
|
|
717d785342 | ||
|
|
d29b7d00fc | ||
|
|
b755de269e | ||
|
|
0ef3b08e86 | ||
|
|
aa5d95e7c5 | ||
|
|
5de6570510 | ||
|
|
ca38f5671d | ||
|
|
632aa081b9 | ||
|
|
0caaeac3af | ||
|
|
dd13713bc1 | ||
|
|
12c7774cc1 | ||
|
|
e12f444b8d | ||
|
|
100ec30fba | ||
|
|
ef99cc7659 | ||
|
|
b8be6e7aa8 | ||
|
|
853758a951 | ||
|
|
5342dc4df1 | ||
|
|
a10ecf2a11 | ||
|
|
449c3e443b | ||
|
|
4d134d0624 | ||
|
|
7d7fd50ba8 | ||
|
|
fc13b1bdd9 | ||
|
|
843b6a9dff | ||
|
|
d26ae4563e | ||
|
|
76858bb111 | ||
|
|
295ff6537b | ||
|
|
d123182a2f | ||
|
|
62a2fe9f73 | ||
|
|
12b3dd1be3 | ||
|
|
3797438ca2 | ||
|
|
def2bc3d2c | ||
|
|
25bb69b6df | ||
|
|
19aadc6e10 | ||
|
|
5284fe55cd | ||
|
|
b08c41a886 | ||
|
|
bfb22951f2 | ||
|
|
89c1db4712 | ||
|
|
fac68a2b4b | ||
|
|
d9479ea863 | ||
|
|
734a982689 | ||
|
|
846f8d6693 | ||
|
|
e5703617bb | ||
|
|
76425efd2e | ||
|
|
f5c772413e | ||
|
|
a0282bd11e | ||
|
|
7640195d2b | ||
|
|
d217ae1a85 | ||
|
|
ecffe63d6b | ||
|
|
c74ce4b07f | ||
|
|
40d4aba3c4 | ||
|
|
a9b9c94347 | ||
|
|
b969c53f3a | ||
|
|
e80a03dcc7 | ||
|
|
020f122bb0 | ||
|
|
caf4deb1a6 | ||
|
|
9f19358c8b | ||
|
|
f51d65cf02 | ||
|
|
d0e727d444 | ||
|
|
db364110eb | ||
|
|
c3409996ef | ||
|
|
a968f18438 | ||
|
|
c5905d74d4 | ||
|
|
5bcfe25ede | ||
|
|
d22a7c782f | ||
|
|
1c4370b929 | ||
|
|
df062613eb | ||
|
|
b73f85ef4a | ||
|
|
9cfbd92454 | ||
|
|
183f88654b | ||
|
|
864586a40b | ||
|
|
7549fe63e6 | ||
|
|
0b3e1f520f | ||
|
|
377ff14a22 | ||
|
|
18cabd03f1 | ||
|
|
79cdc28a01 | ||
|
|
685f51ecb3 | ||
|
|
5f370896df | ||
|
|
6ec9d9d869 | ||
|
|
771f240d13 | ||
|
|
bbf4fa2472 | ||
|
|
df9e33bdcc | ||
|
|
86f79e4331 | ||
|
|
b4639b628b | ||
|
|
08e6fd2cda | ||
|
|
1bbcae395b | ||
|
|
20cc4c2a9e | ||
|
|
851301b088 | ||
|
|
abe4744587 | ||
|
|
463ceba555 | ||
|
|
76e62c6af2 | ||
|
|
4a7f7b8041 | ||
|
|
59eafbe3d5 | ||
|
|
6b54e40cc6 | ||
|
|
1a6a9da308 | ||
|
|
4fbfd569df | ||
|
|
af29ee637e | ||
|
|
2685476022 | ||
|
|
a7bf38388c | ||
|
|
4ccb3af5ac | ||
|
|
ba7321b535 | ||
|
|
c8e21387c0 | ||
|
|
f73bdd7445 | ||
|
|
2135c443d8 | ||
|
|
e0615dcd0c | ||
|
|
8cd114988d | ||
|
|
ca80a98141 | ||
|
|
1766b6f2bd | ||
|
|
ca09c24656 | ||
|
|
d6322e2f80 | ||
|
|
63388aa4f7 | ||
|
|
1ed8b97347 | ||
|
|
0d28637095 | ||
|
|
a602bda47b | ||
|
|
4f5eeb1508 | ||
|
|
b3a265e218 | ||
|
|
3db6ee7b25 | ||
|
|
57bf1ca6e4 | ||
|
|
1aa2e36087 | ||
|
|
5a8bc3b67a | ||
|
|
32dee9039e | ||
|
|
0ea0dc217b | ||
|
|
52082aaf06 | ||
|
|
0069a5029f | ||
|
|
fd02a12ae9 | ||
|
|
293122b9a1 | ||
|
|
c715578519 | ||
|
|
b8f431ae66 | ||
|
|
345126ffcb | ||
|
|
7e34862e25 | ||
|
|
6686d59146 | ||
|
|
24eed13a7c | ||
|
|
a7ac2c0672 | ||
|
|
526a9504bb | ||
|
|
26438306c6 | ||
|
|
c1b9c75138 | ||
|
|
ef7d46ba2e | ||
|
|
7717f2f12a | ||
|
|
4844acee9c | ||
|
|
b6e7f019de | ||
|
|
8a485f3120 | ||
|
|
ddcef6570f | ||
|
|
5662564842 | ||
|
|
4ce65e47e6 | ||
|
|
da022d913b | ||
|
|
d67ad93c63 | ||
|
|
3d08e64b07 | ||
|
|
af3491b996 | ||
|
|
9d54a9746c | ||
|
|
a604836b62 | ||
|
|
11bac4ecf3 | ||
|
|
df173e9edf | ||
|
|
622b2efa03 | ||
|
|
64427fd317 | ||
|
|
d50eb923ba | ||
|
|
4bae0e5758 | ||
|
|
22a02f9291 | ||
|
|
b14b75ee23 | ||
|
|
b7c5fe70e7 | ||
|
|
51e1860a92 | ||
|
|
a108a67522 | ||
|
|
67e791be2b | ||
|
|
58708eaaf2 | ||
|
|
c46a3a78f0 | ||
|
|
617d600f9a | ||
|
|
4376ed6678 | ||
|
|
15739ad0d2 | ||
|
|
4a962e2701 | ||
|
|
c996975bf1 | ||
|
|
e914cf406b | ||
|
|
ea981ca70f | ||
|
|
1d816a8a6a | ||
|
|
d7b400c812 | ||
|
|
1cd60eb5ae | ||
|
|
8d02c9f907 | ||
|
|
acf942075c | ||
|
|
2502b47077 | ||
|
|
2199e07be8 | ||
|
|
7b7b2874c5 | ||
|
|
eeeb998040 | ||
|
|
de5c3addd1 | ||
|
|
88652e1dc0 | ||
|
|
325f6bebb9 | ||
|
|
dcac7b433e | ||
|
|
7d0ef7db23 | ||
|
|
ce849ef06e | ||
|
|
c152e2d0b9 | ||
|
|
f0744b4040 | ||
|
|
bc12f4cd3b | ||
|
|
a846a71ca3 | ||
|
|
23bc66eda5 | ||
|
|
ce773a6c56 | ||
|
|
76ba7cb942 | ||
|
|
a77d6d53aa | ||
|
|
7d630088a4 | ||
|
|
a4745f05d5 | ||
|
|
523266fc68 | ||
|
|
38b57c6d98 | ||
|
|
d2e9e3d1a9 | ||
|
|
226adddc43 | ||
|
|
50946b9c68 | ||
|
|
3c6067c8a6 | ||
|
|
fc4476ed8c | ||
|
|
22b1d1b716 | ||
|
|
8f8e82b3b4 | ||
|
|
a2f488e5e3 | ||
|
|
662c137467 | ||
|
|
dfc359f5e2 | ||
|
|
a0fbfc248b | ||
|
|
b3af01b803 | ||
|
|
33665130cf | ||
|
|
7e5fd73496 | ||
|
|
a0970de48c | ||
|
|
d799932f70 | ||
|
|
ae7044c771 | ||
|
|
b823cbf2ae | ||
|
|
0481b15b9b | ||
|
|
2481d4871f | ||
|
|
a0b50bdf8d | ||
|
|
aa77b52233 | ||
|
|
f9d7f56ccb | ||
|
|
0550fb21b5 | ||
|
|
ab6c86ce8e | ||
|
|
3f9c2e87f1 | ||
|
|
5a6ced5a41 | ||
|
|
46eb75a866 | ||
|
|
b32c154fa0 | ||
|
|
e39630564e | ||
|
|
d4ddf7bc25 | ||
|
|
43f8cef35d | ||
|
|
c86b95fe40 | ||
|
|
e141b7980c | ||
|
|
524009039c | ||
|
|
46587b8d01 | ||
|
|
3b33c1917c | ||
|
|
8dbc54fa14 | ||
|
|
ffb0d25a43 | ||
|
|
858a9adb17 | ||
|
|
6bd2b637a7 | ||
|
|
3778d03402 | ||
|
|
405e65346b | ||
|
|
e9fa4e5261 | ||
|
|
bcf2ba40e5 | ||
|
|
b6cc8c3a12 | ||
|
|
105a118163 | ||
|
|
e066e9566f | ||
|
|
d7d3e7c61f | ||
|
|
e5fa0501b7 | ||
|
|
1e6675b3f5 | ||
|
|
85fc76edd5 | ||
|
|
fc57d63689 | ||
|
|
47ca302384 | ||
|
|
734b60bee1 | ||
|
|
c554943140 | ||
|
|
490aecd94b | ||
|
|
c20380b79d | ||
|
|
a34a0e42b2 | ||
|
|
50d3ec36b2 | ||
|
|
233990f452 | ||
|
|
800e993c1f | ||
|
|
6384d79a7a | ||
|
|
2e2d129871 | ||
|
|
34044f72b0 | ||
|
|
6c32eae9f2 | ||
|
|
72bda06916 | ||
|
|
15253cdc1f | ||
|
|
8c69a98c58 | ||
|
|
a27d15bff1 | ||
|
|
a9b8bb4c56 | ||
|
|
f588d47aa1 | ||
|
|
4a83b68725 | ||
|
|
3e4e325675 | ||
|
|
08a1f352cb | ||
|
|
611cb2da5b | ||
|
|
378dfd0372 | ||
|
|
af519a59cf | ||
|
|
7eaf37c1ff | ||
|
|
317daef04b | ||
|
|
14e61fd661 | ||
|
|
29904d5b92 | ||
|
|
5e760da8bc | ||
|
|
cce64d4010 | ||
|
|
68de64a05f | ||
|
|
4edeaedea3 | ||
|
|
be6f55b5a8 | ||
|
|
a9f280a2ef | ||
|
|
45e912a8d9 | ||
|
|
b74e571beb | ||
|
|
5cd268df23 | ||
|
|
43c59da809 | ||
|
|
c4f11721c6 | ||
|
|
d3a6121b2c | ||
|
|
391e0c9d98 | ||
|
|
5d156021dc | ||
|
|
30a215396b | ||
|
|
c0d11bea4b | ||
|
|
6708c9fc8f | ||
|
|
f7c4a1c925 | ||
|
|
f643960b62 | ||
|
|
f5b40b55b9 | ||
|
|
fe465b5de4 | ||
|
|
292426bb5d | ||
|
|
f2bf8be1ae |
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
bin/
|
||||
48
.github/workflows/docker.yml
vendored
Normal file
48
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Create and publish a Docker image
|
||||
|
||||
# Configures this workflow to run every time a tag is created.
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
#
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
|
||||
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
|
||||
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
20
.github/workflows/go.yml
vendored
20
.github/workflows/go.yml
vendored
@@ -1,16 +1,26 @@
|
||||
name: Build
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'common/**'
|
||||
- 'config/**'
|
||||
- 'network/**'
|
||||
- 'server/**'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- 'main.go'
|
||||
- '.github/workflows/go.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
@@ -18,7 +28,7 @@ jobs:
|
||||
run: env GOOS=linux GOARCH=amd64 go build -v
|
||||
|
||||
- name: Upload Linux-amd64 artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux-amd64
|
||||
path: |
|
||||
@@ -33,7 +43,7 @@ jobs:
|
||||
run: env GOOS=windows GOARCH=amd64 go build -v
|
||||
|
||||
- name: Upload Windows-amd64 artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows-amd64
|
||||
path: |
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -6,4 +6,6 @@ vendor/
|
||||
savedata/*/
|
||||
*.exe
|
||||
*.lnk
|
||||
*.bat
|
||||
*.bat
|
||||
/docker/db-data
|
||||
screenshots/*
|
||||
30
AUTHORS.md
Normal file
30
AUTHORS.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# List of authors who contributed to Erupe
|
||||
|
||||
## Point of current development
|
||||
The project is currently developed under https://github.com/ZeruLight/Erupe
|
||||
|
||||
## History of development
|
||||
Development of this project dates back to 2019, and was developed under various umbrellas over time:
|
||||
* Cappuccino (Fist/Ando/Ellie42) ("The Erupe Developers"), 2019-2020 (https://github.com/Ellie42/Erupe / https://github.com/ricochhet/Erupe-Legacy) (Still active closed source)
|
||||
* Einherjar Team, ????-2022 Feb (There is no git history for this period, this team's work was taken and used as a foundation for future repositories)
|
||||
* Community Edition, 2022 (https://github.com/xl3lackout/Erupe)
|
||||
* sekaiwish Fork, 2022 (https://github.com/sekaiwish/Erupe)
|
||||
* ZeruLight, 2022-2023 (https://github.com/ZeruLight/Erupe)
|
||||
|
||||
## Authorship of the code
|
||||
Authorship is assigned for each commit within the git history, which is stored in these git repos:
|
||||
* https://github.com/ZeruLight/Erupe
|
||||
* https://github.com/Ellie42/Erupe
|
||||
* https://github.com/ricochhet/Erupe-Legacy
|
||||
* https://github.com/xl3lackout/Erupe
|
||||
|
||||
Note the divergence between Ellie42's branch and xl3lackout's where history has been lost.
|
||||
|
||||
Unfortunately, we have no detailed information on the history of Erupe before 2022.
|
||||
If somebody can provide information, please contact us, so that we can make this history available.
|
||||
|
||||
## Exceptions with third-party libraries
|
||||
The third-party libraries have their own way of addressing authorship and the authorship of commits importing/updating
|
||||
a third-party library reflects who did the importing instead of who wrote the code within the commit.
|
||||
|
||||
The authors of third-party libraries are not explicitly mentioned, and usually is possible to obtain from the files belonging to the third-party libraries.
|
||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM golang:1.21-alpine3.19
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /app/erupe
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "go", "run", "." ]
|
||||
18
README.md
18
README.md
@@ -1,6 +1,6 @@
|
||||
# Erupe
|
||||
|
||||
## Client Compatiblity
|
||||
## Client Compatibility
|
||||
### Platforms
|
||||
- PC
|
||||
- PlayStation 3
|
||||
@@ -28,10 +28,24 @@ If you want to modify or compile Erupe yourself, please read on.
|
||||
## Installation
|
||||
|
||||
1. Bring up a fresh database by using the [backup file attached with the latest release](https://github.com/ZeruLight/Erupe/releases/latest/download/SCHEMA.sql).
|
||||
2. Run each script under [patch-schema](./patch-schema) as they introduce newer schema.
|
||||
2. Run each script under [patch-schema](./schemas/patch-schema) as they introduce newer schema.
|
||||
3. Edit [config.json](./config.json) such that the database password matches your PostgreSQL setup.
|
||||
4. Run `go build` or `go run .` to compile Erupe.
|
||||
|
||||
## Docker
|
||||
|
||||
Please see [docker/README.md](./docker/README.md). This is intended for quick installs and development, not for production.
|
||||
|
||||
## Schemas
|
||||
|
||||
We source control the following schemas:
|
||||
- Initialization Schema: This initializes the application database to a specific version (9.1.0).
|
||||
- Update Schemas: These are update files that should be ran on top of the initialization schema.
|
||||
- Patch Schemas: These are for development and should be run after running all initialization and update schema. These get condensed into `Update Schemas` and deleted when updated to a new release.
|
||||
- Bundled Schemas: These are demo reference files to give servers standard set-ups.
|
||||
|
||||
Note: Patch schemas are subject to change! You should only be using them if you are following along with development.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Quest and Scenario Binary Files](https://files.catbox.moe/xf0l7w.7z)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,391 +0,0 @@
|
||||
BEGIN;
|
||||
|
||||
INSERT INTO fpoint_items (item_type, item_id, quantity, fpoints, trade_type) VALUES
|
||||
(7,8895,1,500,0),
|
||||
(7,8891,1,300,0),
|
||||
(7,8892,1,300,0),
|
||||
(7,8893,1,300,0),
|
||||
(7,8894,1,300,0),
|
||||
(7,8890,1,10,0),
|
||||
(7,10354,1,500,0),
|
||||
(7,11983,1,300,0),
|
||||
(7,11984,1,300,0),
|
||||
(7,11985,1,300,0),
|
||||
(7,11986,1,300,0),
|
||||
(7,12524,1,500,0),
|
||||
(7,12470,1,300,0),
|
||||
(7,12471,1,300,0),
|
||||
(7,12472,1,300,0),
|
||||
(7,12473,1,300,0),
|
||||
(7,2158,2,1,0),
|
||||
(7,14548,1,500,0),
|
||||
(7,9509,1,1,0),
|
||||
(7,9510,1,1,0),
|
||||
(7,9511,1,1,0),
|
||||
(7,9512,1,1,0),
|
||||
(7,9513,1,1,0),
|
||||
(7,9514,1,1,0),
|
||||
(7,9515,1,1,0),
|
||||
(7,10753,1,1,0),
|
||||
(7,10754,1,1,0),
|
||||
(7,10755,1,1,0),
|
||||
(7,10756,1,1,0),
|
||||
(7,10757,1,1,0),
|
||||
(7,10758,1,1,0),
|
||||
(7,10759,1,1,0),
|
||||
(7,11296,1,1,0),
|
||||
(7,11297,1,1,0),
|
||||
(7,11298,1,1,0),
|
||||
(7,11299,1,1,0),
|
||||
(7,11300,1,1,0),
|
||||
(7,12386,1,1,0),
|
||||
(7,12387,1,1,0),
|
||||
(7,12388,1,1,0),
|
||||
(7,12389,1,1,0),
|
||||
(7,12390,1,1,0),
|
||||
(7,13034,1,1,0),
|
||||
(7,13035,1,1,0),
|
||||
(7,13036,1,1,0),
|
||||
(7,13037,1,1,0),
|
||||
(7,13038,1,1,0),
|
||||
(7,14179,1,1,0),
|
||||
(7,14180,1,1,0),
|
||||
(7,14181,1,1,0),
|
||||
(7,14182,1,1,0),
|
||||
(7,14183,1,1,0),
|
||||
(7,13422,1,1,0),
|
||||
(7,13423,1,1,0),
|
||||
(7,13424,1,1,0),
|
||||
(7,13425,1,1,0),
|
||||
(7,13426,1,1,0),
|
||||
(7,13427,1,1,0),
|
||||
(7,9796,1,3,0),
|
||||
(7,9700,1,3,0),
|
||||
(7,10380,1,3,0),
|
||||
(7,10810,1,3,0),
|
||||
(7,10811,1,3,0),
|
||||
(7,11436,1,3,0),
|
||||
(7,9509,1,1,0),
|
||||
(7,9510,1,1,0),
|
||||
(7,9511,1,1,0),
|
||||
(7,9512,1,1,0),
|
||||
(7,9513,1,1,0),
|
||||
(7,9514,1,1,0),
|
||||
(7,9515,1,1,0),
|
||||
(7,10753,1,1,0),
|
||||
(7,10754,1,1,0),
|
||||
(7,10755,1,1,0),
|
||||
(7,10756,1,1,0),
|
||||
(7,10757,1,1,0),
|
||||
(7,10758,1,1,0),
|
||||
(7,10759,1,1,0),
|
||||
(7,11296,1,1,0),
|
||||
(7,11297,1,1,0),
|
||||
(7,11298,1,1,0),
|
||||
(7,11299,1,1,0),
|
||||
(7,11300,1,1,0),
|
||||
(7,12509,1,3,0),
|
||||
(7,12386,1,1,0),
|
||||
(7,12387,1,1,0),
|
||||
(7,12388,1,1,0),
|
||||
(7,12389,1,1,0),
|
||||
(7,12390,1,1,0),
|
||||
(7,12872,1,3,0),
|
||||
(7,12873,1,3,0),
|
||||
(7,12840,1,1,0),
|
||||
(7,12841,1,1,0),
|
||||
(7,12874,1,1,0),
|
||||
(7,12875,1,1,0),
|
||||
(7,13191,1,3,0),
|
||||
(7,13177,1,3,0),
|
||||
(7,13326,1,3,0),
|
||||
(7,13034,1,1,0),
|
||||
(7,13035,1,1,0),
|
||||
(7,13036,1,1,0),
|
||||
(7,13037,1,1,0),
|
||||
(7,13038,1,1,0),
|
||||
(7,13178,1,3,0),
|
||||
(7,13453,1,3,0),
|
||||
(7,13449,1,3,0),
|
||||
(7,13450,1,3,0),
|
||||
(7,13404,1,3,0),
|
||||
(7,13422,1,1,0),
|
||||
(7,13423,1,1,0),
|
||||
(7,13424,1,1,0),
|
||||
(7,13425,1,1,0),
|
||||
(7,13426,1,1,0),
|
||||
(7,13427,1,1,0),
|
||||
(7,13791,1,3,0),
|
||||
(7,14006,1,3,0),
|
||||
(7,14031,1,3,0),
|
||||
(7,14032,1,3,0),
|
||||
(7,13960,1,3,0),
|
||||
(7,14029,1,3,0),
|
||||
(7,13956,1,1,0),
|
||||
(7,13958,1,1,0),
|
||||
(7,13957,1,1,0),
|
||||
(7,13959,1,1,0),
|
||||
(7,13790,1,3,0),
|
||||
(7,14005,1,3,0),
|
||||
(7,14010,1,3,0),
|
||||
(7,14009,1,3,0),
|
||||
(7,14008,1,3,0),
|
||||
(7,13965,1,3,0),
|
||||
(7,14028,1,3,0),
|
||||
(7,13963,1,3,0),
|
||||
(7,14026,1,3,0),
|
||||
(7,13964,1,3,0),
|
||||
(7,14027,1,3,0),
|
||||
(7,14069,1,3,0),
|
||||
(7,14124,1,3,0),
|
||||
(7,14065,1,1,0),
|
||||
(7,14066,1,1,0),
|
||||
(7,14067,1,1,0),
|
||||
(7,14068,1,1,0),
|
||||
(7,13962,1,3,0),
|
||||
(7,14125,1,3,0),
|
||||
(7,14089,1,3,0),
|
||||
(7,14090,1,3,0),
|
||||
(7,14091,1,3,0),
|
||||
(7,14092,1,3,0),
|
||||
(7,14194,1,3,0),
|
||||
(7,14191,1,3,0),
|
||||
(7,14198,1,3,0),
|
||||
(7,14197,1,3,0),
|
||||
(7,14179,1,1,0),
|
||||
(7,14180,1,1,0),
|
||||
(7,14181,1,1,0),
|
||||
(7,14182,1,1,0),
|
||||
(7,14183,1,1,0),
|
||||
(7,14196,1,3,0),
|
||||
(7,14195,1,3,0),
|
||||
(7,14193,1,3,0),
|
||||
(7,14192,1,3,0),
|
||||
(7,14407,1,3,0),
|
||||
(7,14414,1,3,0),
|
||||
(7,14406,1,3,0),
|
||||
(7,14413,1,3,0),
|
||||
(7,14416,1,3,0),
|
||||
(7,14549,1,3,0),
|
||||
(7,14550,1,3,0),
|
||||
(7,14502,1,3,0),
|
||||
(7,14507,1,3,0),
|
||||
(7,14501,1,3,0),
|
||||
(7,14506,1,3,0),
|
||||
(7,14500,1,3,0),
|
||||
(7,14505,1,3,0),
|
||||
(7,14498,1,3,0),
|
||||
(7,14659,1,3,0),
|
||||
(7,14660,1,3,0),
|
||||
(7,14657,1,1,0),
|
||||
(7,14658,1,1,0),
|
||||
(7,11420,1,3,0),
|
||||
(7,14704,1,3,0),
|
||||
(7,11288,1,1,0),
|
||||
(7,11289,1,1,0),
|
||||
(7,11290,1,1,0),
|
||||
(7,11291,1,1,0),
|
||||
(7,10750,1,3,0),
|
||||
(7,14705,1,3,0),
|
||||
(7,10633,1,1,0),
|
||||
(7,10634,1,1,0),
|
||||
(7,10635,1,1,0),
|
||||
(7,10636,1,1,0),
|
||||
(7,14662,1,3,0),
|
||||
(7,14663,1,3,0),
|
||||
(7,14665,1,3,0),
|
||||
(7,14666,1,3,0),
|
||||
(7,14667,1,3,0),
|
||||
(7,14668,1,3,0),
|
||||
(7,14669,1,3,0),
|
||||
(7,14670,1,3,0),
|
||||
(7,14671,1,3,0),
|
||||
(7,14672,1,3,0),
|
||||
(7,14673,1,3,0),
|
||||
(7,14674,1,3,0),
|
||||
(7,14675,1,3,0),
|
||||
(7,14676,1,3,0),
|
||||
(7,14677,1,3,0),
|
||||
(7,14678,1,3,0),
|
||||
(7,14679,1,3,0),
|
||||
(7,14680,1,3,0),
|
||||
(7,14681,1,3,0),
|
||||
(7,14682,1,3,0),
|
||||
(7,14683,1,3,0),
|
||||
(7,14684,1,3,0),
|
||||
(7,14685,1,3,0),
|
||||
(7,14686,1,3,0),
|
||||
(7,14687,1,3,0),
|
||||
(7,14688,1,3,0),
|
||||
(7,14689,1,3,0),
|
||||
(7,14690,1,3,0),
|
||||
(7,14691,1,3,0),
|
||||
(7,14692,1,3,0),
|
||||
(7,14693,1,3,0),
|
||||
(7,14694,1,3,0),
|
||||
(7,14695,1,3,0),
|
||||
(7,14696,1,3,0),
|
||||
(7,14697,1,3,0),
|
||||
(7,14698,1,3,0),
|
||||
(7,14699,1,3,0),
|
||||
(7,14700,1,3,0),
|
||||
(7,14314,1,3,0),
|
||||
(7,14503,1,3,0),
|
||||
(7,14510,1,3,0),
|
||||
(7,14904,1,3,0),
|
||||
(7,14906,1,3,0),
|
||||
(7,14910,1,1,0),
|
||||
(7,14912,1,1,0),
|
||||
(7,14905,1,3,0),
|
||||
(7,14907,1,3,0),
|
||||
(7,14911,1,1,0),
|
||||
(7,14909,1,1,0),
|
||||
(7,14855,1,3,0),
|
||||
(7,14894,1,3,0),
|
||||
(7,14913,1,3,0),
|
||||
(7,14914,1,3,0),
|
||||
(7,14891,1,3,0),
|
||||
(7,14895,1,3,0),
|
||||
(7,15027,1,3,0),
|
||||
(7,15028,1,3,0),
|
||||
(7,15026,1,1,0),
|
||||
(7,15025,1,1,0),
|
||||
(7,15024,1,1,0),
|
||||
(7,15023,1,1,0),
|
||||
(7,15064,1,3,0),
|
||||
(7,15065,1,3,0),
|
||||
(7,15030,1,3,0),
|
||||
(7,15031,1,3,0),
|
||||
(7,15062,1,3,0),
|
||||
(7,15063,1,3,0),
|
||||
(7,15066,1,3,0),
|
||||
(7,15067,1,3,0),
|
||||
(7,15061,1,3,0),
|
||||
(7,15060,1,3,0),
|
||||
(7,1227,1,2,0),
|
||||
(7,13176,1,2,0),
|
||||
(7,4360,1,2,0),
|
||||
(7,4358,1,1,0),
|
||||
(7,15118,1,3,0),
|
||||
(7,15119,1,3,0),
|
||||
(7,15113,1,3,0),
|
||||
(7,15114,1,3,0),
|
||||
(7,15115,1,3,0),
|
||||
(7,15116,1,3,0),
|
||||
(7,15220,1,3,0),
|
||||
(7,15221,1,3,0),
|
||||
(7,14126,1,3,0),
|
||||
(7,15222,1,3,0),
|
||||
(7,15223,1,3,0),
|
||||
(7,15224,1,3,0),
|
||||
(7,15225,1,3,0),
|
||||
(7,15524,1,3,0),
|
||||
(7,15525,1,3,0),
|
||||
(7,15507,1,3,0),
|
||||
(7,15508,1,3,0),
|
||||
(7,15285,1,3,0),
|
||||
(7,15286,1,3,0),
|
||||
(7,15281,1,1,0),
|
||||
(7,15282,1,1,0),
|
||||
(7,15283,1,1,0),
|
||||
(7,15284,1,1,0),
|
||||
(7,15776,1,3,0),
|
||||
(7,15777,1,3,0),
|
||||
(7,15774,1,3,0),
|
||||
(7,15775,1,3,0),
|
||||
(7,15823,1,3,0),
|
||||
(7,15824,1,3,0),
|
||||
(7,15343,1,3,0),
|
||||
(7,15342,1,3,0),
|
||||
(7,15341,1,3,0),
|
||||
(7,15340,1,3,0),
|
||||
(7,15339,1,3,0),
|
||||
(7,15338,1,3,0),
|
||||
(7,15337,1,3,0),
|
||||
(7,15336,1,3,0),
|
||||
(7,15335,1,3,0),
|
||||
(7,15334,1,3,0),
|
||||
(7,15333,1,3,0),
|
||||
(7,15332,1,3,0),
|
||||
(7,15331,1,3,0),
|
||||
(7,15330,1,3,0),
|
||||
(7,15329,1,3,0),
|
||||
(7,15328,1,3,0),
|
||||
(7,15327,1,3,0),
|
||||
(7,15326,1,3,0),
|
||||
(7,15325,1,3,0),
|
||||
(7,15324,1,3,0),
|
||||
(7,15323,1,3,0),
|
||||
(7,15322,1,3,0),
|
||||
(7,15321,1,3,0),
|
||||
(7,15314,1,3,0),
|
||||
(7,15312,1,3,0),
|
||||
(7,15311,1,3,0),
|
||||
(7,15306,1,3,0),
|
||||
(7,15307,1,3,0),
|
||||
(7,15308,1,3,0),
|
||||
(7,15309,1,3,0),
|
||||
(7,15310,1,3,0),
|
||||
(7,15305,1,3,0),
|
||||
(7,15304,1,3,0),
|
||||
(7,15303,1,3,0),
|
||||
(7,15302,1,3,0),
|
||||
(7,15301,1,3,0),
|
||||
(7,15300,1,3,0),
|
||||
(7,15299,1,3,0),
|
||||
(7,15298,1,3,0),
|
||||
(7,15297,1,3,0),
|
||||
(7,15296,1,3,0),
|
||||
(7,15295,1,3,0),
|
||||
(7,15293,1,3,0),
|
||||
(7,15294,1,3,0),
|
||||
(7,15292,1,3,0),
|
||||
(7,15291,1,3,0),
|
||||
(7,15290,1,3,0),
|
||||
(7,15289,1,3,0),
|
||||
(7,15315,1,3,0),
|
||||
(7,15316,1,3,0),
|
||||
(7,15317,1,3,0),
|
||||
(7,15318,1,3,0),
|
||||
(7,15319,1,3,0),
|
||||
(7,15320,1,3,0),
|
||||
(7,15819,1,3,0),
|
||||
(7,15820,1,3,0),
|
||||
(7,15821,1,3,0),
|
||||
(7,15822,1,3,0),
|
||||
(7,16450,1,3,0),
|
||||
(7,16451,1,3,0),
|
||||
(7,16459,1,1,0),
|
||||
(7,16460,1,1,0),
|
||||
(7,16461,1,1,0),
|
||||
(7,16462,1,1,0),
|
||||
(7,16463,1,1,0),
|
||||
(7,16464,1,1,0),
|
||||
(7,16465,1,1,0),
|
||||
(7,16466,1,1,0),
|
||||
(7,16467,1,1,0),
|
||||
(7,16468,1,1,0),
|
||||
(7,16469,1,1,0),
|
||||
(7,16470,1,1,0),
|
||||
(7,16471,1,1,0),
|
||||
(7,16472,1,1,0),
|
||||
(7,16454,1,3,0),
|
||||
(7,16455,1,3,0),
|
||||
(7,16442,1,3,0),
|
||||
(7,16443,1,3,0),
|
||||
(7,16342,1,3,0),
|
||||
(7,16343,1,3,0),
|
||||
(7,16444,1,3,0),
|
||||
(7,16445,1,3,0),
|
||||
(7,16344,1,3,0),
|
||||
(7,16345,1,3,0),
|
||||
(7,16352,1,3,0),
|
||||
(7,16353,1,3,0),
|
||||
(7,16446,1,3,0),
|
||||
(7,16447,1,3,0),
|
||||
(7,16448,1,3,0),
|
||||
(7,16449,1,3,0),
|
||||
(7,16348,1,3,0),
|
||||
(7,16349,1,3,0);
|
||||
|
||||
END;
|
||||
@@ -1,13 +0,0 @@
|
||||
BEGIN;
|
||||
|
||||
INSERT INTO public.cafebonus (time_req, item_type, item_id, quantity)
|
||||
VALUES
|
||||
(1800, 17, 0, 250),
|
||||
(3600, 17, 0, 500),
|
||||
(7200, 17, 0, 1000),
|
||||
(10800, 17, 0, 1500),
|
||||
(18000, 17, 0, 1750),
|
||||
(28800, 17, 0, 3000),
|
||||
(43200, 17, 0, 4000);
|
||||
|
||||
END;
|
||||
@@ -1,12 +0,0 @@
|
||||
BEGIN;
|
||||
|
||||
INSERT INTO public.shop_items
|
||||
(shop_type, shop_id, item_id, cost, quantity, min_hr, min_sr, min_gr, store_level, max_quantity, road_floors, road_fatalis)
|
||||
VALUES
|
||||
(5,5,16516,100,1,0,0,1,0,0,0,0),
|
||||
(5,5,16517,100,1,0,0,1,0,0,0,0),
|
||||
(7,0,13190,10,1,0,0,0,0,0,0,0),
|
||||
(7,0,1662,10,1,0,0,0,0,0,0,0),
|
||||
(7,0,10179,100,1,0,0,0,0,0,0,0);
|
||||
|
||||
END;
|
||||
54
common/mhfcid/mhfcid.go
Normal file
54
common/mhfcid/mhfcid.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package mhfcid
|
||||
|
||||
import (
|
||||
"math"
|
||||
)
|
||||
|
||||
// ConvertCID converts a MHF Character ID String to integer
|
||||
//
|
||||
// Banned characters: 0, I, O, S
|
||||
func ConvertCID(ID string) (r uint32) {
|
||||
if len(ID) != 6 {
|
||||
return
|
||||
}
|
||||
|
||||
m := map[rune]uint32{
|
||||
'1': 0,
|
||||
'2': 1,
|
||||
'3': 2,
|
||||
'4': 3,
|
||||
'5': 4,
|
||||
'6': 5,
|
||||
'7': 6,
|
||||
'8': 7,
|
||||
'9': 8,
|
||||
'A': 9,
|
||||
'B': 10,
|
||||
'C': 11,
|
||||
'D': 12,
|
||||
'E': 13,
|
||||
'F': 14,
|
||||
'G': 15,
|
||||
'H': 16,
|
||||
'J': 17,
|
||||
'K': 18,
|
||||
'L': 19,
|
||||
'M': 20,
|
||||
'N': 21,
|
||||
'P': 22,
|
||||
'Q': 23,
|
||||
'R': 24,
|
||||
'T': 25,
|
||||
'U': 26,
|
||||
'V': 27,
|
||||
'W': 28,
|
||||
'X': 29,
|
||||
'Y': 30,
|
||||
'Z': 31,
|
||||
}
|
||||
|
||||
for i, c := range ID {
|
||||
r += m[c] * uint32(math.Pow(32, float64(i)))
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package mhfcourse
|
||||
|
||||
import (
|
||||
_config "erupe-ce/config"
|
||||
"math"
|
||||
"sort"
|
||||
"time"
|
||||
@@ -66,12 +67,15 @@ func CourseExists(ID uint16, c []Course) bool {
|
||||
|
||||
// GetCourseStruct returns a slice of Course(s) from a rights integer
|
||||
func GetCourseStruct(rights uint32) ([]Course, uint32) {
|
||||
resp := []Course{{ID: 1}, {ID: 23}, {ID: 24}}
|
||||
var resp []Course
|
||||
for _, c := range _config.ErupeConfig.DefaultCourses {
|
||||
resp = append(resp, Course{ID: c})
|
||||
}
|
||||
s := Courses()
|
||||
sort.Slice(s, func(i, j int) bool {
|
||||
return s[i].ID > s[j].ID
|
||||
})
|
||||
var normalCafeCourseSet, netcafeCourseSet bool
|
||||
var normalCafeCourseSet, netcafeCourseSet, hidenCourseSet bool
|
||||
for _, course := range s {
|
||||
if rights-course.Value() < 0x80000000 {
|
||||
switch course.ID {
|
||||
@@ -88,6 +92,12 @@ func GetCourseStruct(rights uint32) ([]Course, uint32) {
|
||||
}
|
||||
netcafeCourseSet = true
|
||||
resp = append(resp, Course{ID: 30})
|
||||
case 10:
|
||||
if hidenCourseSet {
|
||||
break
|
||||
}
|
||||
hidenCourseSet = true
|
||||
resp = append(resp, Course{ID: 31})
|
||||
}
|
||||
course.Expiry = time.Date(2030, 1, 1, 0, 0, 0, 0, time.FixedZone("UTC+9", 9*60*60))
|
||||
resp = append(resp, course)
|
||||
|
||||
175
common/mhfitem/mhfitem.go
Normal file
175
common/mhfitem/mhfitem.go
Normal file
@@ -0,0 +1,175 @@
|
||||
package mhfitem
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/token"
|
||||
_config "erupe-ce/config"
|
||||
)
|
||||
|
||||
type MHFItem struct {
|
||||
ItemID uint16
|
||||
}
|
||||
|
||||
type MHFSigilEffect struct {
|
||||
ID uint16
|
||||
Level uint16
|
||||
}
|
||||
|
||||
type MHFSigil struct {
|
||||
Effects []MHFSigilEffect
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
Unk3 uint8
|
||||
}
|
||||
|
||||
type MHFEquipment struct {
|
||||
WarehouseID uint32
|
||||
ItemType uint8
|
||||
Unk0 uint8
|
||||
ItemID uint16
|
||||
Level uint16
|
||||
Decorations []MHFItem
|
||||
Sigils []MHFSigil
|
||||
Unk1 uint16
|
||||
}
|
||||
|
||||
type MHFItemStack struct {
|
||||
WarehouseID uint32
|
||||
Item MHFItem
|
||||
Quantity uint16
|
||||
Unk0 uint32
|
||||
}
|
||||
|
||||
func ReadWarehouseItem(bf *byteframe.ByteFrame) MHFItemStack {
|
||||
var item MHFItemStack
|
||||
item.WarehouseID = bf.ReadUint32()
|
||||
if item.WarehouseID == 0 {
|
||||
item.WarehouseID = token.RNG.Uint32()
|
||||
}
|
||||
item.Item.ItemID = bf.ReadUint16()
|
||||
item.Quantity = bf.ReadUint16()
|
||||
item.Unk0 = bf.ReadUint32()
|
||||
return item
|
||||
}
|
||||
|
||||
func DiffItemStacks(o []MHFItemStack, u []MHFItemStack) []MHFItemStack {
|
||||
// o = old, u = update, f = final
|
||||
var f []MHFItemStack
|
||||
for _, uItem := range u {
|
||||
exists := false
|
||||
for i := range o {
|
||||
if o[i].WarehouseID == uItem.WarehouseID {
|
||||
exists = true
|
||||
o[i].Quantity = uItem.Quantity
|
||||
}
|
||||
}
|
||||
if !exists {
|
||||
uItem.WarehouseID = token.RNG.Uint32()
|
||||
f = append(f, uItem)
|
||||
}
|
||||
}
|
||||
for _, oItem := range o {
|
||||
if oItem.Quantity > 0 {
|
||||
f = append(f, oItem)
|
||||
}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
func (is MHFItemStack) ToBytes() []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint32(is.WarehouseID)
|
||||
bf.WriteUint16(is.Item.ItemID)
|
||||
bf.WriteUint16(is.Quantity)
|
||||
bf.WriteUint32(is.Unk0)
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func SerializeWarehouseItems(i []MHFItemStack) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(len(i)))
|
||||
bf.WriteUint16(0) // Unused
|
||||
for _, j := range i {
|
||||
bf.WriteBytes(j.ToBytes())
|
||||
}
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func ReadWarehouseEquipment(bf *byteframe.ByteFrame) MHFEquipment {
|
||||
var equipment MHFEquipment
|
||||
equipment.Decorations = make([]MHFItem, 3)
|
||||
equipment.Sigils = make([]MHFSigil, 3)
|
||||
for i := 0; i < 3; i++ {
|
||||
equipment.Sigils[i].Effects = make([]MHFSigilEffect, 3)
|
||||
}
|
||||
equipment.WarehouseID = bf.ReadUint32()
|
||||
if equipment.WarehouseID == 0 {
|
||||
equipment.WarehouseID = token.RNG.Uint32()
|
||||
}
|
||||
equipment.ItemType = bf.ReadUint8()
|
||||
equipment.Unk0 = bf.ReadUint8()
|
||||
equipment.ItemID = bf.ReadUint16()
|
||||
equipment.Level = bf.ReadUint16()
|
||||
for i := 0; i < 3; i++ {
|
||||
equipment.Decorations[i].ItemID = bf.ReadUint16()
|
||||
}
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
for i := 0; i < 3; i++ {
|
||||
for j := 0; j < 3; j++ {
|
||||
equipment.Sigils[i].Effects[j].ID = bf.ReadUint16()
|
||||
}
|
||||
for j := 0; j < 3; j++ {
|
||||
equipment.Sigils[i].Effects[j].Level = bf.ReadUint16()
|
||||
}
|
||||
equipment.Sigils[i].Unk0 = bf.ReadUint8()
|
||||
equipment.Sigils[i].Unk1 = bf.ReadUint8()
|
||||
equipment.Sigils[i].Unk2 = bf.ReadUint8()
|
||||
equipment.Sigils[i].Unk3 = bf.ReadUint8()
|
||||
}
|
||||
}
|
||||
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
|
||||
equipment.Unk1 = bf.ReadUint16()
|
||||
}
|
||||
return equipment
|
||||
}
|
||||
|
||||
func (e MHFEquipment) ToBytes() []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint32(e.WarehouseID)
|
||||
bf.WriteUint8(e.ItemType)
|
||||
bf.WriteUint8(e.Unk0)
|
||||
bf.WriteUint16(e.ItemID)
|
||||
bf.WriteUint16(e.Level)
|
||||
for i := 0; i < 3; i++ {
|
||||
bf.WriteUint16(e.Decorations[i].ItemID)
|
||||
}
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
for i := 0; i < 3; i++ {
|
||||
for j := 0; j < 3; j++ {
|
||||
bf.WriteUint16(e.Sigils[i].Effects[j].ID)
|
||||
}
|
||||
for j := 0; j < 3; j++ {
|
||||
bf.WriteUint16(e.Sigils[i].Effects[j].Level)
|
||||
}
|
||||
bf.WriteUint8(e.Sigils[i].Unk0)
|
||||
bf.WriteUint8(e.Sigils[i].Unk1)
|
||||
bf.WriteUint8(e.Sigils[i].Unk2)
|
||||
bf.WriteUint8(e.Sigils[i].Unk3)
|
||||
}
|
||||
}
|
||||
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
|
||||
bf.WriteUint16(e.Unk1)
|
||||
}
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func SerializeWarehouseEquipment(i []MHFEquipment) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(len(i)))
|
||||
bf.WriteUint16(0) // Unused
|
||||
for _, j := range i {
|
||||
bf.WriteBytes(j.ToBytes())
|
||||
}
|
||||
return bf.Data()
|
||||
}
|
||||
@@ -82,7 +82,7 @@ const (
|
||||
BrightHypnoc
|
||||
RedLavasioth
|
||||
Espinas
|
||||
OrangeEspinas
|
||||
BurningEspinas
|
||||
WhiteHypnoc
|
||||
AqraVashimu
|
||||
AqraJebia
|
||||
@@ -91,7 +91,7 @@ const (
|
||||
Mon87
|
||||
Mon88
|
||||
Pariapuria
|
||||
WhiteEspinas
|
||||
PearlEspinas
|
||||
KamuOrugaron
|
||||
NonoOrugaron
|
||||
Raviente
|
||||
@@ -267,7 +267,7 @@ var Monsters = []Monster{
|
||||
{"Bright Hypnocatrice", true},
|
||||
{"Red Lavasioth", true},
|
||||
{"Espinas", true},
|
||||
{"Orange Espinas", true},
|
||||
{"Burning Espinas", true},
|
||||
{"White Hypnocatrice", true},
|
||||
{"Aqra Vashimu", true},
|
||||
{"Aqra Jebia", true},
|
||||
@@ -276,7 +276,7 @@ var Monsters = []Monster{
|
||||
{"Mon87", false},
|
||||
{"Mon88", false},
|
||||
{"Pariapuria", true},
|
||||
{"White Espinas", true},
|
||||
{"Pearl Espinas", true},
|
||||
{"Kamu Orugaron", true},
|
||||
{"Nono Orugaron", true},
|
||||
{"Raviente", true}, // + Violent
|
||||
|
||||
@@ -6,13 +6,12 @@ import (
|
||||
|
||||
// StringStack is a basic LIFO "stack" for storing strings.
|
||||
type StringStack struct {
|
||||
Locked bool
|
||||
stack []string
|
||||
stack []string
|
||||
}
|
||||
|
||||
// New creates a new instance of StringStack
|
||||
func New() *StringStack {
|
||||
return &StringStack{Locked: false}
|
||||
return &StringStack{}
|
||||
}
|
||||
|
||||
// Set sets up a new StringStack
|
||||
@@ -20,20 +19,6 @@ func (s *StringStack) Set(v string) {
|
||||
s.stack = []string{v}
|
||||
}
|
||||
|
||||
// Lock freezes the StringStack
|
||||
func (s *StringStack) Lock() {
|
||||
if !s.Locked {
|
||||
s.Locked = true
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock unfreezes the StringStack
|
||||
func (s *StringStack) Unlock() {
|
||||
if s.Locked {
|
||||
s.Locked = false
|
||||
}
|
||||
}
|
||||
|
||||
// Push pushes a string onto the stack.
|
||||
func (s *StringStack) Push(v string) {
|
||||
s.stack = append(s.stack, v)
|
||||
@@ -41,11 +26,12 @@ func (s *StringStack) Push(v string) {
|
||||
|
||||
// Pop pops a string from the stack.
|
||||
func (s *StringStack) Pop() (string, error) {
|
||||
var x string
|
||||
if len(s.stack) == 0 {
|
||||
return "", errors.New("no items on stack")
|
||||
return x, errors.New("no items on stack")
|
||||
}
|
||||
|
||||
x := s.stack[len(s.stack)-1]
|
||||
x = s.stack[len(s.stack)-1]
|
||||
s.stack = s.stack[:len(s.stack)-1]
|
||||
|
||||
return x, nil
|
||||
|
||||
@@ -29,6 +29,23 @@ func SJISToUTF8(b []byte) string {
|
||||
return string(result)
|
||||
}
|
||||
|
||||
func ToNGWord(x string) []uint16 {
|
||||
var w []uint16
|
||||
for _, r := range []rune(x) {
|
||||
if r > 0xFF {
|
||||
t := UTF8ToSJIS(string(r))
|
||||
if len(t) > 1 {
|
||||
w = append(w, uint16(t[1])<<8|uint16(t[0]))
|
||||
} else {
|
||||
w = append(w, uint16(t[0]))
|
||||
}
|
||||
} else {
|
||||
w = append(w, uint16(r))
|
||||
}
|
||||
}
|
||||
return w
|
||||
}
|
||||
|
||||
func PaddedString(x string, size uint, t bool) []byte {
|
||||
if t {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
@@ -69,7 +86,7 @@ func CSVRemove(csv string, v int) string {
|
||||
func CSVContains(csv string, v int) bool {
|
||||
s := strings.Split(csv, ",")
|
||||
for i := 0; i < len(s); i++ {
|
||||
j, _ := strconv.ParseInt(s[i], 10, 64)
|
||||
j, _ := strconv.ParseInt(s[i], 10, 32)
|
||||
if int(j) == v {
|
||||
return true
|
||||
}
|
||||
@@ -92,7 +109,7 @@ func CSVElems(csv string) []int {
|
||||
}
|
||||
s := strings.Split(csv, ",")
|
||||
for i := 0; i < len(s); i++ {
|
||||
j, _ := strconv.ParseInt(s[i], 10, 64)
|
||||
j, _ := strconv.ParseInt(s[i], 10, 32)
|
||||
r = append(r, int(j))
|
||||
}
|
||||
return r
|
||||
|
||||
@@ -5,18 +5,19 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var RNG = NewRNG()
|
||||
|
||||
// Generate returns an alphanumeric token of specified length
|
||||
func Generate(length int) string {
|
||||
rng := RNG()
|
||||
var chars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
b := make([]rune, length)
|
||||
for i := range b {
|
||||
b[i] = chars[rng.Intn(len(chars))]
|
||||
b[i] = chars[RNG.Intn(len(chars))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// RNG returns a new RNG generator
|
||||
func RNG() *rand.Rand {
|
||||
// NewRNG returns a new NewRNG generator
|
||||
func NewRNG() *rand.Rand {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
}
|
||||
|
||||
130
config.json
130
config.json
@@ -9,46 +9,63 @@
|
||||
],
|
||||
"PatchServerManifest": "",
|
||||
"PatchServerFile": "",
|
||||
"ScreenshotAPIURL": "",
|
||||
"Screenshots":{
|
||||
"Enabled":true,
|
||||
"Host":"127.0.0.1",
|
||||
"Port":8080,
|
||||
"OutputDir":"screenshots",
|
||||
"UploadQuality":100
|
||||
},
|
||||
"DeleteOnSaveCorruption": false,
|
||||
"ClientMode": "ZZ",
|
||||
"DevMode": true,
|
||||
"DevModeOptions": {
|
||||
"AutoCreateAccount": true,
|
||||
"QuestCacheExpiry": 300,
|
||||
"CommandPrefix": "!",
|
||||
"AutoCreateAccount": true,
|
||||
"LoopDelay": 50,
|
||||
"DefaultCourses": [1, 23, 24],
|
||||
"EarthStatus": 0,
|
||||
"EarthID": 0,
|
||||
"EarthMonsters": [0, 0, 0, 0],
|
||||
"SaveDumps": {
|
||||
"Enabled": true,
|
||||
"RawEnabled": false,
|
||||
"OutputDir": "save-backups"
|
||||
},
|
||||
"DebugOptions": {
|
||||
"CleanDB": false,
|
||||
"MaxLauncherHR": false,
|
||||
"LogInboundMessages": true,
|
||||
"LogOutboundMessages": true,
|
||||
"LogInboundMessages": false,
|
||||
"LogOutboundMessages": false,
|
||||
"LogMessageData": false,
|
||||
"MaxHexdumpLength": 256,
|
||||
"DivaEvent": 0,
|
||||
"FestaEvent": -1,
|
||||
"TournamentEvent": 0,
|
||||
"MezFesEvent": true,
|
||||
"MezFesAlt": false,
|
||||
"DivaOverride": 0,
|
||||
"FestaOverride": -1,
|
||||
"TournamentOverride": 0,
|
||||
"DisableTokenCheck": false,
|
||||
"QuestDebugTools": false,
|
||||
"EarthStatusOverride": 0,
|
||||
"EarthIDOverride": 0,
|
||||
"EarthMonsterOverride": 0,
|
||||
"SaveDumps": {
|
||||
"Enabled": true,
|
||||
"OutputDir": "save-backups"
|
||||
"QuestTools": false,
|
||||
"AutoQuestBackport": true,
|
||||
"ProxyPort": 0,
|
||||
"CapLink": {
|
||||
"Values": [51728, 20000, 51729, 1, 20000],
|
||||
"Key": "",
|
||||
"Host": "",
|
||||
"Port": 80
|
||||
}
|
||||
},
|
||||
"GameplayOptions": {
|
||||
"FeaturedWeapons": 1,
|
||||
"MinFeatureWeapons": 0,
|
||||
"MaxFeatureWeapons": 1,
|
||||
"MaximumNP": 100000,
|
||||
"MaximumRP": 50000,
|
||||
"MaximumFP": 120000,
|
||||
"TreasureHuntExpiry": 604800,
|
||||
"DisableLoginBoost": false,
|
||||
"DisableBoostTime": false,
|
||||
"BoostTimeDuration": 120,
|
||||
"GuildMealDuration": 60,
|
||||
"BoostTimeDuration": 7200,
|
||||
"ClanMealDuration": 3600,
|
||||
"ClanMemberLimits": [[0, 30], [3, 40], [7, 50], [10, 60]],
|
||||
"BonusQuestAllowance": 3,
|
||||
"DailyQuestAllowance": 1,
|
||||
"MezfesSoloTickets": 10,
|
||||
"MezfesGroupTickets": 4,
|
||||
"LowLatencyRaviente": false,
|
||||
"RegularRavienteMaxPlayers": 8,
|
||||
"ViolentRavienteMaxPlayers": 8,
|
||||
@@ -57,12 +74,31 @@
|
||||
"SmallBerserkRavienteMaxPlayers": 8,
|
||||
"GUrgentRate": 0.10,
|
||||
"GCPMultiplier": 1.00,
|
||||
"HRPMultiplier": 1.00,
|
||||
"HRPMultiplierNC": 1.00,
|
||||
"SRPMultiplier": 1.00,
|
||||
"SRPMultiplierNC": 1.00,
|
||||
"GRPMultiplier": 1.00,
|
||||
"GRPMultiplierNC": 1.00,
|
||||
"GSRPMultiplier": 1.00,
|
||||
"GSRPMultiplierNC": 1.00,
|
||||
"ZennyMultiplier": 1.00,
|
||||
"ZennyMultiplierNC": 1.00,
|
||||
"GZennyMultiplier": 1.00,
|
||||
"GZennyMultiplierNC": 1.00,
|
||||
"MaterialMultiplier": 1.00,
|
||||
"MaterialMultiplierNC": 1.00,
|
||||
"GMaterialMultiplier": 1.00,
|
||||
"GMaterialMultiplierNC": 1.00,
|
||||
"ExtraCarves": 0,
|
||||
"ExtraCarvesNC": 0,
|
||||
"GExtraCarves": 0,
|
||||
"GExtraCarvesNC": 0,
|
||||
"DisableHunterNavi": false,
|
||||
"MezFesSoloTickets": 5,
|
||||
"MezFesGroupTickets": 1,
|
||||
"MezFesDuration": 172800,
|
||||
"MezFesSwitchMinigame": false,
|
||||
"EnableKaijiEvent": false,
|
||||
"EnableHiganjimaEvent": false,
|
||||
"EnableNierEvent": false,
|
||||
@@ -72,37 +108,73 @@
|
||||
"Discord": {
|
||||
"Enabled": false,
|
||||
"BotToken": "",
|
||||
"RealtimeChannelID": ""
|
||||
"RelayChannel": {
|
||||
"Enabled": false,
|
||||
"MaxMessageLength": 183,
|
||||
"RelayChannelID": ""
|
||||
}
|
||||
},
|
||||
"Commands": [
|
||||
{
|
||||
"Name": "Help",
|
||||
"Enabled": true,
|
||||
"Description": "Show enabled chat commands",
|
||||
"Prefix": "help"
|
||||
}, {
|
||||
"Name": "Rights",
|
||||
"Enabled": false,
|
||||
"Description": "Overwrite the Rights value on your account",
|
||||
"Prefix": "rights"
|
||||
}, {
|
||||
"Name": "Raviente",
|
||||
"Enabled": true,
|
||||
"Description": "Various Raviente siege commands",
|
||||
"Prefix": "ravi"
|
||||
}, {
|
||||
"Name": "Teleport",
|
||||
"Enabled": false,
|
||||
"Description": "Teleport to specified coordinates",
|
||||
"Prefix": "tele"
|
||||
}, {
|
||||
"Name": "Reload",
|
||||
"Enabled": true,
|
||||
"Description": "Reload all players in your Land",
|
||||
"Prefix": "reload"
|
||||
}, {
|
||||
"Name": "KeyQuest",
|
||||
"Enabled": false,
|
||||
"Description": "Overwrite your HR Key Quest progress",
|
||||
"Prefix": "kqf"
|
||||
}, {
|
||||
"Name": "Course",
|
||||
"Enabled": true,
|
||||
"Description": "Toggle Courses on your account",
|
||||
"Prefix": "course"
|
||||
}, {
|
||||
"Name": "PSN",
|
||||
"Enabled": true,
|
||||
"Description": "Link a PlayStation Network ID to your account",
|
||||
"Prefix": "psn"
|
||||
}, {
|
||||
"Name": "Discord",
|
||||
"Enabled": true,
|
||||
"Description": "Generate a token to link your Discord account",
|
||||
"Prefix": "discord"
|
||||
}, {
|
||||
"Name": "Ban",
|
||||
"Enabled": false,
|
||||
"Description": "Ban/Temp Ban a user",
|
||||
"Prefix": "ban"
|
||||
}, {
|
||||
"Name": "Timer",
|
||||
"Enabled": true,
|
||||
"Description": "Toggle the Quest timer",
|
||||
"Prefix": "timer"
|
||||
}, {
|
||||
"Name": "Playtime",
|
||||
"Enabled": true,
|
||||
"Description": "Show your playtime",
|
||||
"Prefix": "playtime"
|
||||
}
|
||||
],
|
||||
"Courses": [
|
||||
@@ -129,9 +201,13 @@
|
||||
"Enabled": true,
|
||||
"Port": 53312
|
||||
},
|
||||
"SignV2": {
|
||||
"Enabled": false,
|
||||
"Port": 8080
|
||||
"API": {
|
||||
"Enabled": true,
|
||||
"Port": 8080,
|
||||
"PatchServer": "",
|
||||
"Banners": [],
|
||||
"Messages": [],
|
||||
"Links": []
|
||||
},
|
||||
"Channel": {
|
||||
"Enabled": true
|
||||
|
||||
177
config/config.go
177
config/config.go
@@ -58,7 +58,7 @@ const (
|
||||
)
|
||||
|
||||
var versionStrings = []string{"S1.0", "S1.5", "S2.0", "S2.5", "S3.0", "S3.5", "S4.0", "S5.0", "S5.5", "S6.0", "S7.0",
|
||||
"S8.0", "S8.5", "S9", "S10", "FW.1", "FW.2", "FW.3", "FW.4", "FW.5", "G1", "G2", "G3", "G3.1", "G3.2", "GG", "G5",
|
||||
"S8.0", "S8.5", "S9.0", "S10", "FW.1", "FW.2", "FW.3", "FW.4", "FW.5", "G1", "G2", "G3", "G3.1", "G3.2", "GG", "G5",
|
||||
"G5.1", "G5.2", "G6", "G6.1", "G7", "G8", "G8.1", "G9", "G9.1", "G10", "G10.1", "Z1", "Z2", "ZZ"}
|
||||
|
||||
func (m Mode) String() string {
|
||||
@@ -75,67 +75,88 @@ type Config struct {
|
||||
LoginNotices []string // MHFML string of the login notices displayed
|
||||
PatchServerManifest string // Manifest patch server override
|
||||
PatchServerFile string // File patch server override
|
||||
ScreenshotAPIURL string // Destination for screenshots uploaded to BBS
|
||||
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
||||
ClientMode string
|
||||
RealClientMode Mode
|
||||
DevMode bool
|
||||
QuestCacheExpiry int // Number of seconds to keep quest data cached
|
||||
CommandPrefix string // The prefix for commands
|
||||
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||
LoopDelay int // Delay in milliseconds between each loop iteration
|
||||
DefaultCourses []uint16
|
||||
EarthStatus int32
|
||||
EarthID int32
|
||||
EarthMonsters []int32
|
||||
SaveDumps SaveDumpOptions
|
||||
Screenshots ScreenshotsOptions
|
||||
|
||||
DevModeOptions DevModeOptions
|
||||
DebugOptions DebugOptions
|
||||
GameplayOptions GameplayOptions
|
||||
Discord Discord
|
||||
Commands []Command
|
||||
Courses []Course
|
||||
Database Database
|
||||
Sign Sign
|
||||
SignV2 SignV2
|
||||
API API
|
||||
Channel Channel
|
||||
Entrance Entrance
|
||||
}
|
||||
|
||||
// DevModeOptions holds various debug/temporary options for use while developing Erupe.
|
||||
type DevModeOptions struct {
|
||||
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||
CleanDB bool // Automatically wipes the DB on server reset.
|
||||
MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds.
|
||||
LogInboundMessages bool // Log all messages sent to the server
|
||||
LogOutboundMessages bool // Log all messages sent to the clients
|
||||
MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled
|
||||
DivaEvent int // Diva Defense event status
|
||||
FestaEvent int // Hunter's Festa event status
|
||||
TournamentEvent int // VS Tournament event status
|
||||
MezFesEvent bool // MezFes status
|
||||
MezFesAlt bool // Swaps out Volpakkun for Tokotoko
|
||||
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
||||
QuestDebugTools bool // Enable various quest debug logs
|
||||
EarthStatusOverride int32
|
||||
EarthIDOverride int32
|
||||
EarthMonsterOverride int32
|
||||
SaveDumps SaveDumpOptions
|
||||
type SaveDumpOptions struct {
|
||||
Enabled bool
|
||||
RawEnabled bool
|
||||
OutputDir string
|
||||
}
|
||||
|
||||
type SaveDumpOptions struct {
|
||||
Enabled bool
|
||||
OutputDir string
|
||||
type ScreenshotsOptions struct {
|
||||
Enabled bool
|
||||
Host string // Destination for screenshots uploaded to BBS
|
||||
Port uint32 // Port for screenshots API
|
||||
OutputDir string
|
||||
UploadQuality int //Determines the upload quality to the server
|
||||
}
|
||||
|
||||
// DebugOptions holds various debug/temporary options for use while developing Erupe.
|
||||
type DebugOptions struct {
|
||||
CleanDB bool // Automatically wipes the DB on server reset.
|
||||
MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds.
|
||||
LogInboundMessages bool // Log all messages sent to the server
|
||||
LogOutboundMessages bool // Log all messages sent to the clients
|
||||
LogMessageData bool // Log all bytes transferred as a hexdump
|
||||
MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled
|
||||
DivaOverride int // Diva Defense event status
|
||||
FestaOverride int // Hunter's Festa event status
|
||||
TournamentOverride int // VS Tournament event status
|
||||
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
||||
QuestTools bool // Enable various quest debug logs
|
||||
AutoQuestBackport bool // Automatically backport quest files
|
||||
ProxyPort uint16 // Forces the game to connect to a channel server proxy
|
||||
CapLink CapLinkOptions
|
||||
}
|
||||
|
||||
type CapLinkOptions struct {
|
||||
Values []uint16
|
||||
Key string
|
||||
Host string
|
||||
Port int
|
||||
}
|
||||
|
||||
// GameplayOptions has various gameplay modifiers
|
||||
type GameplayOptions struct {
|
||||
FeaturedWeapons int // Number of Active Feature weapons to generate daily
|
||||
MaximumNP int // Maximum number of NP held by a player
|
||||
MaximumRP uint16 // Maximum number of RP held by a player
|
||||
MaximumFP uint32 // Maximum number of FP held by a player
|
||||
TreasureHuntExpiry uint32 // Seconds until a Clan Treasure Hunt will expire
|
||||
TreasureHuntPartnyaCooldown uint32 // Seconds until a Partnya can be assigned to another Clan Treasure Hunt
|
||||
DisableLoginBoost bool // Disables the Login Boost system
|
||||
DisableBoostTime bool // Disables the daily NetCafe Boost Time
|
||||
BoostTimeDuration int // The number of minutes NetCafe Boost Time lasts for
|
||||
GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking
|
||||
BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily
|
||||
DailyQuestAllowance uint32 // Number of Daily Quests to allow daily
|
||||
MezfesSoloTickets uint32 // Number of solo tickets given weekly
|
||||
MezfesGroupTickets uint32 // Number of group tickets given weekly
|
||||
LowLatencyRaviente bool // Toggles low latency mode for Raviente, can be network intensive
|
||||
MinFeatureWeapons int // Minimum number of Active Feature weapons to generate daily
|
||||
MaxFeatureWeapons int // Maximum number of Active Feature weapons to generate daily
|
||||
MaximumNP int // Maximum number of NP held by a player
|
||||
MaximumRP uint16 // Maximum number of RP held by a player
|
||||
MaximumFP uint32 // Maximum number of FP held by a player
|
||||
TreasureHuntExpiry uint32 // Seconds until a Clan Treasure Hunt will expire
|
||||
TreasureHuntPartnyaCooldown uint32 // Seconds until a Partnya can be assigned to another Clan Treasure Hunt
|
||||
DisableLoginBoost bool // Disables the Login Boost system
|
||||
DisableBoostTime bool // Disables the daily NetCafe Boost Time
|
||||
BoostTimeDuration int // Second that the NetCafe Boost Time lasts
|
||||
ClanMealDuration int // Second that a Clan Meal can be activated for after cooking
|
||||
ClanMemberLimits [][]uint8 // Array of maximum Clan Members -> [Rank, Members]
|
||||
BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily
|
||||
DailyQuestAllowance uint32 // Number of Daily Quests to allow daily
|
||||
LowLatencyRaviente bool // Toggles low latency mode for Raviente, can be network intensive
|
||||
RegularRavienteMaxPlayers uint8
|
||||
ViolentRavienteMaxPlayers uint8
|
||||
BerserkRavienteMaxPlayers uint8
|
||||
@@ -143,12 +164,31 @@ type GameplayOptions struct {
|
||||
SmallBerserkRavienteMaxPlayers uint8
|
||||
GUrgentRate float32 // Adjusts the rate of G Urgent quests spawning
|
||||
GCPMultiplier float32 // Adjusts the multiplier of GCP rewarded for quest completion
|
||||
HRPMultiplier float32 // Adjusts the multiplier of Hunter Rank Points rewarded for quest completion
|
||||
HRPMultiplierNC float32 // Adjusts the multiplier of Hunter Rank Points rewarded for quest completion in a NetCafe
|
||||
SRPMultiplier float32 // Adjusts the multiplier of Skill Rank Points rewarded for quest completion
|
||||
SRPMultiplierNC float32 // Adjusts the multiplier of Skill Rank Points rewarded for quest completion in a NetCafe
|
||||
GRPMultiplier float32 // Adjusts the multiplier of G Rank Points rewarded for quest completion
|
||||
GRPMultiplierNC float32 // Adjusts the multiplier of G Rank Points rewarded for quest completion in a NetCafe
|
||||
GSRPMultiplier float32 // Adjusts the multiplier of G Skill Rank Points rewarded for quest completion
|
||||
GSRPMultiplierNC float32 // Adjusts the multiplier of G Skill Rank Points rewarded for quest completion in a NetCafe
|
||||
ZennyMultiplier float32 // Adjusts the multiplier of Zenny rewarded for quest completion
|
||||
ZennyMultiplierNC float32 // Adjusts the multiplier of Zenny rewarded for quest completion in a NetCafe
|
||||
GZennyMultiplier float32 // Adjusts the multiplier of G Zenny rewarded for quest completion
|
||||
GZennyMultiplierNC float32 // Adjusts the multiplier of G Zenny rewarded for quest completion in a NetCafe
|
||||
MaterialMultiplier float32 // Adjusts the multiplier of Monster Materials rewarded for quest completion
|
||||
MaterialMultiplierNC float32 // Adjusts the multiplier of Monster Materials rewarded for quest completion in a NetCafe
|
||||
GMaterialMultiplier float32 // Adjusts the multiplier of G Rank Monster Materials rewarded for quest completion
|
||||
GMaterialMultiplierNC float32 // Adjusts the multiplier of G Rank Monster Materials rewarded for quest completion in a NetCafe
|
||||
ExtraCarves uint16 // Grant n extra chances to carve ALL carcasses
|
||||
ExtraCarvesNC uint16 // Grant n extra chances to carve ALL carcasses in a NetCafe
|
||||
GExtraCarves uint16 // Grant n extra chances to carve ALL G Rank carcasses
|
||||
GExtraCarvesNC uint16 // Grant n extra chances to carve ALL G Rank carcasses in a NetCafe
|
||||
DisableHunterNavi bool // Disables the Hunter Navi
|
||||
MezFesSoloTickets uint32 // Number of solo tickets given weekly
|
||||
MezFesGroupTickets uint32 // Number of group tickets given weekly
|
||||
MezFesDuration int // Seconds that MezFes will last for weekly (from 12AM Mon backwards)
|
||||
MezFesSwitchMinigame bool // Swaps out Volpakkun Together for Tokotoko Partnya
|
||||
EnableKaijiEvent bool // Enables the Kaiji event in the Rasta Bar
|
||||
EnableHiganjimaEvent bool // Enables the Higanjima event in the Rasta Bar
|
||||
EnableNierEvent bool // Enables the Nier event in the Rasta Bar
|
||||
@@ -158,16 +198,23 @@ type GameplayOptions struct {
|
||||
|
||||
// Discord holds the discord integration config.
|
||||
type Discord struct {
|
||||
Enabled bool
|
||||
BotToken string
|
||||
RealtimeChannelID string
|
||||
Enabled bool
|
||||
BotToken string
|
||||
RelayChannel DiscordRelay
|
||||
}
|
||||
|
||||
type DiscordRelay struct {
|
||||
Enabled bool
|
||||
MaxMessageLength int
|
||||
RelayChannelID string
|
||||
}
|
||||
|
||||
// Command is a channelserver chat command
|
||||
type Command struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Prefix string
|
||||
Name string
|
||||
Enabled bool
|
||||
Description string
|
||||
Prefix string
|
||||
}
|
||||
|
||||
// Course represents a course within MHF
|
||||
@@ -191,10 +238,32 @@ type Sign struct {
|
||||
Port int
|
||||
}
|
||||
|
||||
// SignV2 holds the new sign server config
|
||||
type SignV2 struct {
|
||||
Enabled bool
|
||||
Port int
|
||||
// API holds server config
|
||||
type API struct {
|
||||
Enabled bool
|
||||
Port int
|
||||
PatchServer string
|
||||
Banners []APISignBanner
|
||||
Messages []APISignMessage
|
||||
Links []APISignLink
|
||||
}
|
||||
|
||||
type APISignBanner struct {
|
||||
Src string `json:"src"` // Displayed image URL
|
||||
Link string `json:"link"` // Link accessed on click
|
||||
}
|
||||
|
||||
type APISignMessage struct {
|
||||
Message string `json:"message"` // Displayed message
|
||||
Date int64 `json:"date"` // Displayed date
|
||||
Kind int `json:"kind"` // 0 for 'Default', 1 for 'New'
|
||||
Link string `json:"link"` // Link accessed on click
|
||||
}
|
||||
|
||||
type APISignLink struct {
|
||||
Name string `json:"name"` // Displayed name
|
||||
Icon string `json:"icon"` // Displayed icon. It will be cast as a monochrome color as long as it is transparent.
|
||||
Link string `json:"link"` // Link accessed on click
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
@@ -293,6 +362,10 @@ func LoadConfig() (*Config, error) {
|
||||
c.RealClientMode = ZZ
|
||||
}
|
||||
|
||||
if c.GameplayOptions.MinFeatureWeapons > c.GameplayOptions.MaxFeatureWeapons {
|
||||
c.GameplayOptions.MinFeatureWeapons = c.GameplayOptions.MaxFeatureWeapons
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
||||
70
docker/README.md
Normal file
70
docker/README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Docker for erupe
|
||||
|
||||
## Building the container
|
||||
Run the following from the route of the source folder. In this example we give it the tag of dev to seperate it from any other container verions.
|
||||
```bash
|
||||
docker build . -t erupe:dev
|
||||
```
|
||||
## Running the container in isolation
|
||||
This is just running the container. You can do volume mounts into the container for the `config.json` to tell it to communicate to a database. You will need to do this also for other folders such as `bin` and `savedata`
|
||||
```bash
|
||||
docker run erupe:dev
|
||||
```
|
||||
|
||||
## Docker compose
|
||||
Docker compose allows you to run multiple containers at once. The docker compose in this folder has 3 things set up.
|
||||
- postgres
|
||||
- pg admin (Admin interface to make db changes)
|
||||
- erupe
|
||||
|
||||
We automatically populate the database to the latest version on start. If you you are updating you will need to apply the new schemas manually.
|
||||
|
||||
Before we get started you should make sure the database info matches whats in the docker compose file for the environment variables `POSTGRES_PASSWORD`,`POSTGRES_USER` and `POSTGRES_DB`. You can set the host to be the service name `db`.
|
||||
|
||||
Here is a example of what you would put in the config.json if you was to leave the defaults. It is strongly recommended to change the password.
|
||||
```txt
|
||||
"Database": {
|
||||
"Host": "db",
|
||||
"Port": 5432,
|
||||
"User": "postgres",
|
||||
"Password": "password",
|
||||
"Database": "erupe"
|
||||
},
|
||||
```
|
||||
|
||||
Place this file within ./docker/config.json
|
||||
|
||||
You will need to do the same for your bins place these in ./docker/bin
|
||||
|
||||
# Setting up the web hosted materials
|
||||
Clone the Severs repo into ./docker/Severs
|
||||
|
||||
Make sure your hosts are pointing to where this is hosted
|
||||
|
||||
|
||||
|
||||
## Turning off the server safely
|
||||
```bash
|
||||
docker-compose stop
|
||||
```
|
||||
|
||||
## Turning off the server destructive
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
Make sure if you want to delete your data you delete the folders that persisted
|
||||
- ./docker/savedata
|
||||
- ./docker/db-data
|
||||
## Turning on the server again
|
||||
This boots the db pgadmin and the server in a detached state
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
if you want all the logs and you want it to be in an attached state
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
|
||||
# Troubleshooting
|
||||
Q: My Postgres will not populate. A: You're setup.sh is maybe saved as CRLF it needs to be saved as LF.
|
||||
71
docker/docker-compose.yml
Normal file
71
docker/docker-compose.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
version: "3.9"
|
||||
# 1. docker-compose up db pgadmin
|
||||
# 2. Use pgadmin to restore db and also apply patch-schema
|
||||
# 3. Configure the config.json example. in docker you can point to the service name for the database i.e db
|
||||
# 4. In seperate terminal docker-compose up server
|
||||
# 5. If all went well happy hunting!
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
environment:
|
||||
# (Make sure these match config.json)
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=erupe
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./db-data/:/var/lib/postgresql/data/
|
||||
- ../schemas/:/schemas/
|
||||
- ./init/setup.sh:/docker-entrypoint-initdb.d/setup.sh
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4
|
||||
restart: always
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: user@pgadmin.com
|
||||
PGADMIN_DEFAULT_PASSWORD: password
|
||||
ports:
|
||||
- "5050:80"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
server:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
# If using prebuilt container change paths and config
|
||||
build:
|
||||
context: ../
|
||||
volumes:
|
||||
- ../config.json:/app/erupe/config.json
|
||||
- ../bin:/app/erupe/bin
|
||||
- ./savedata:/app/erupe/savedata
|
||||
ports:
|
||||
# (Make sure these match config.json)
|
||||
- "53312:53312" #Sign V1
|
||||
- "8080:8080" #Sign V2
|
||||
- "53310:53310" #Entrance
|
||||
# Channels
|
||||
- "54001:54001"
|
||||
- "54002:54002"
|
||||
- "54003:54003"
|
||||
- "54004:54004"
|
||||
- "54005:54005"
|
||||
- "54006:54006"
|
||||
- "54007:54007"
|
||||
- "54008:54008"
|
||||
web:
|
||||
image: httpd:latest
|
||||
container_name: my-apache-app
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ./Servers:/usr/local/apache2/htdocs
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
22
docker/init/setup.sh
Normal file
22
docker/init/setup.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
echo "INIT!"
|
||||
pg_restore --username="$POSTGRES_USER" --dbname="$POSTGRES_DB" --verbose /schemas/init.sql
|
||||
|
||||
|
||||
|
||||
echo "Updating!"
|
||||
|
||||
for file in /schemas/update-schema/*
|
||||
do
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f $file
|
||||
done
|
||||
|
||||
|
||||
|
||||
echo "Patching!"
|
||||
|
||||
for file in /schemas/patch-schema/*
|
||||
do
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f $file
|
||||
done
|
||||
33
go.mod
33
go.mod
@@ -1,35 +1,38 @@
|
||||
module erupe-ce
|
||||
|
||||
go 1.21
|
||||
go 1.23.0
|
||||
|
||||
require (
|
||||
github.com/bwmarrin/discordgo v0.27.1
|
||||
github.com/gorilla/handlers v1.5.1
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/gorilla/handlers v1.5.2
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/jmoiron/sqlx v1.3.5
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/spf13/viper v1.16.0
|
||||
go.uber.org/zap v1.25.0
|
||||
golang.org/x/crypto v0.12.0
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
|
||||
golang.org/x/text v0.12.0
|
||||
github.com/spf13/viper v1.17.0
|
||||
go.uber.org/zap v1.26.0
|
||||
golang.org/x/crypto v0.36.0
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
||||
golang.org/x/text v0.23.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
||||
github.com/spf13/afero v1.9.5 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.10.0 // indirect
|
||||
github.com/spf13/cast v1.5.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/sys v0.11.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
76
go.sum
76
go.sum
@@ -38,8 +38,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
|
||||
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/bwmarrin/discordgo v0.27.1 h1:ib9AIc/dom1E/fSIulrBwnez0CToJE113ZGt4HoliGY=
|
||||
github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
@@ -51,21 +49,21 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
|
||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
|
||||
github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
||||
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
@@ -127,13 +125,13 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
|
||||
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
|
||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
|
||||
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
@@ -162,30 +160,34 @@ github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRU
|
||||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
||||
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
|
||||
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
||||
github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ=
|
||||
github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
|
||||
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
||||
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
|
||||
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
|
||||
github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
|
||||
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
|
||||
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
@@ -209,8 +211,8 @@ go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
|
||||
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
|
||||
go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
|
||||
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
|
||||
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
@@ -218,8 +220,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -230,8 +232,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
|
||||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -287,6 +289,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -341,9 +345,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -353,8 +356,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -498,8 +501,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
|
||||
41
main.go
41
main.go
@@ -10,11 +10,11 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"erupe-ce/server/api"
|
||||
"erupe-ce/server/channelserver"
|
||||
"erupe-ce/server/discordbot"
|
||||
"erupe-ce/server/entranceserver"
|
||||
"erupe-ce/server/signserver"
|
||||
"erupe-ce/server/signv2server"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/lib/pq"
|
||||
@@ -26,7 +26,6 @@ func cleanDB(db *sqlx.DB) {
|
||||
_ = db.MustExec("DELETE FROM guild_characters")
|
||||
_ = db.MustExec("DELETE FROM guilds")
|
||||
_ = db.MustExec("DELETE FROM characters")
|
||||
_ = db.MustExec("DELETE FROM sign_sessions")
|
||||
_ = db.MustExec("DELETE FROM users")
|
||||
}
|
||||
|
||||
@@ -46,11 +45,7 @@ func main() {
|
||||
|
||||
var zapLogger *zap.Logger
|
||||
config := _config.ErupeConfig
|
||||
if config.DevMode {
|
||||
zapLogger, _ = zap.NewDevelopment()
|
||||
} else {
|
||||
zapLogger, _ = zap.NewProduction()
|
||||
}
|
||||
zapLogger, _ = zap.NewDevelopment()
|
||||
|
||||
defer zapLogger.Sync()
|
||||
logger := zapLogger.Named("main")
|
||||
@@ -96,6 +91,12 @@ func main() {
|
||||
}
|
||||
|
||||
discordBot = bot
|
||||
|
||||
_, err = discordBot.Session.ApplicationCommandBulkOverwrite(discordBot.Session.State.User.ID, "", discordbot.Commands)
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Discord: Failed to start, %s", err.Error()))
|
||||
}
|
||||
|
||||
logger.Info("Discord: Started successfully")
|
||||
} else {
|
||||
logger.Info("Discord: Disabled")
|
||||
@@ -124,12 +125,14 @@ func main() {
|
||||
logger.Info("Database: Started successfully")
|
||||
|
||||
// Clear stale data
|
||||
_ = db.MustExec("DELETE FROM sign_sessions")
|
||||
if config.DebugOptions.ProxyPort == 0 {
|
||||
_ = db.MustExec("DELETE FROM sign_sessions")
|
||||
}
|
||||
_ = db.MustExec("DELETE FROM servers")
|
||||
_ = db.MustExec(`UPDATE guild_characters SET treasure_hunt=NULL`)
|
||||
|
||||
// Clean the DB if the option is on.
|
||||
if config.DevMode && config.DevModeOptions.CleanDB {
|
||||
if config.DebugOptions.CleanDB {
|
||||
logger.Info("Database: Started clearing...")
|
||||
cleanDB(db)
|
||||
logger.Info("Database: Finished clearing")
|
||||
@@ -178,21 +181,21 @@ func main() {
|
||||
}
|
||||
|
||||
// New Sign server
|
||||
var newSignServer *signv2server.Server
|
||||
if config.SignV2.Enabled {
|
||||
newSignServer = signv2server.NewServer(
|
||||
&signv2server.Config{
|
||||
var ApiServer *api.APIServer
|
||||
if config.API.Enabled {
|
||||
ApiServer = api.NewAPIServer(
|
||||
&api.Config{
|
||||
Logger: logger.Named("sign"),
|
||||
ErupeConfig: _config.ErupeConfig,
|
||||
DB: db,
|
||||
})
|
||||
err = newSignServer.Start()
|
||||
err = ApiServer.Start()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("SignV2: Failed to start, %s", err.Error()))
|
||||
preventClose(fmt.Sprintf("API: Failed to start, %s", err.Error()))
|
||||
}
|
||||
logger.Info("SignV2: Started successfully")
|
||||
logger.Info("API: Started successfully")
|
||||
} else {
|
||||
logger.Info("SignV2: Disabled")
|
||||
logger.Info("API: Disabled")
|
||||
}
|
||||
|
||||
var channels []*channelserver.Server
|
||||
@@ -270,8 +273,8 @@ func main() {
|
||||
signServer.Shutdown()
|
||||
}
|
||||
|
||||
if config.SignV2.Enabled {
|
||||
newSignServer.Shutdown()
|
||||
if config.API.Enabled {
|
||||
ApiServer.Shutdown()
|
||||
}
|
||||
|
||||
if config.Entrance.Enabled {
|
||||
|
||||
@@ -11,7 +11,8 @@ type ChatType uint8
|
||||
|
||||
// Chat types
|
||||
const (
|
||||
ChatTypeLocal ChatType = 1
|
||||
ChatTypeWorld ChatType = 0
|
||||
ChatTypeStage = 1
|
||||
ChatTypeGuild = 2
|
||||
ChatTypeAlliance = 3
|
||||
ChatTypeParty = 4
|
||||
|
||||
@@ -4,11 +4,10 @@ import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network/crypto"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"erupe-ce/network/crypto"
|
||||
)
|
||||
|
||||
// CryptConn represents a MHF encrypted two-way connection,
|
||||
@@ -67,7 +66,7 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
cc.readKeyRot = uint32(cph.KeyRotDelta) * (cc.readKeyRot + 1)
|
||||
}
|
||||
|
||||
out, combinedCheck, check0, check1, check2 := crypto.Decrypt(encryptedPacketBody, cc.readKeyRot, nil)
|
||||
out, combinedCheck, check0, check1, check2 := crypto.Crypto(encryptedPacketBody, cc.readKeyRot, false, nil)
|
||||
if cph.Check0 != check0 || cph.Check1 != check1 || cph.Check2 != check2 {
|
||||
fmt.Printf("got c0 %X, c1 %X, c2 %X\n", check0, check1, check2)
|
||||
fmt.Printf("want c0 %X, c1 %X, c2 %X\n", cph.Check0, cph.Check1, cph.Check2)
|
||||
@@ -77,7 +76,7 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
// Attempt to bruteforce it.
|
||||
fmt.Println("Crypto out of sync? Attempting bruteforce")
|
||||
for key := byte(0); key < 255; key++ {
|
||||
out, combinedCheck, check0, check1, check2 = crypto.Decrypt(encryptedPacketBody, 0, &key)
|
||||
out, combinedCheck, check0, check1, check2 = crypto.Crypto(encryptedPacketBody, 0, false, &key)
|
||||
//fmt.Printf("Key: 0x%X\n%s\n", key, hex.Dump(out))
|
||||
if cph.Check0 == check0 && cph.Check1 == check1 && cph.Check2 == check2 {
|
||||
fmt.Printf("Bruceforce successful, override key: 0x%X\n", key)
|
||||
@@ -106,7 +105,7 @@ func (cc *CryptConn) SendPacket(data []byte) error {
|
||||
}
|
||||
|
||||
// Encrypt the data
|
||||
encData, combinedCheck, check0, check1, check2 := crypto.Encrypt(data, cc.sendKeyRot, nil)
|
||||
encData, combinedCheck, check0, check1, check2 := crypto.Crypto(data, cc.sendKeyRot, true, nil)
|
||||
|
||||
header := &CryptPacketHeader{}
|
||||
header.Pf0 = byte(((uint(len(encData)) >> 12) & 0xF3) | 3)
|
||||
@@ -123,9 +122,7 @@ func (cc *CryptConn) SendPacket(data []byte) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cc.conn.Write(headerBytes)
|
||||
cc.conn.Write(encData)
|
||||
|
||||
cc.conn.Write(append(headerBytes, encData...))
|
||||
cc.sentPackets++
|
||||
cc.prevSendPacketCombinedCheck = combinedCheck
|
||||
|
||||
|
||||
@@ -6,46 +6,30 @@ var (
|
||||
_sharedCryptKey = []byte{0xDD, 0xA8, 0x5F, 0x1E, 0x57, 0xAF, 0xC0, 0xCC, 0x43, 0x35, 0x8F, 0xBB, 0x6F, 0xE6, 0xA1, 0xD6, 0x60, 0xB9, 0x1A, 0xAE, 0x20, 0x49, 0x24, 0x81, 0x21, 0xFE, 0x86, 0x2B, 0x98, 0xB7, 0xB3, 0xD2, 0x91, 0x01, 0x3A, 0x4C, 0x65, 0x92, 0x1C, 0xF4, 0xBE, 0xDD, 0xD9, 0x08, 0xE6, 0x81, 0x98, 0x1B, 0x8D, 0x60, 0xF3, 0x6F, 0xA1, 0x47, 0x24, 0xF1, 0x53, 0x45, 0xC8, 0x7B, 0x88, 0x80, 0x4E, 0x36, 0xC3, 0x0D, 0xC9, 0xD6, 0x8B, 0x08, 0x19, 0x0B, 0xA5, 0xC1, 0x11, 0x4C, 0x60, 0xF8, 0x5D, 0xFC, 0x15, 0x68, 0x7E, 0x32, 0xC0, 0x50, 0xAB, 0x64, 0x1F, 0x8A, 0xD4, 0x08, 0x39, 0x7F, 0xC2, 0xFB, 0xBA, 0x6C, 0xF0, 0xE6, 0xB0, 0x31, 0x10, 0xC1, 0xBF, 0x75, 0x43, 0xBB, 0x18, 0x04, 0x0D, 0xD1, 0x97, 0xF7, 0x23, 0x21, 0x83, 0x8B, 0xCA, 0x25, 0x2B, 0xA3, 0x03, 0x13, 0xEA, 0xAE, 0xFE, 0xF0, 0xEB, 0xFD, 0x85, 0x57, 0x53, 0x65, 0x41, 0x2A, 0x40, 0x99, 0xC0, 0x94, 0x65, 0x7E, 0x7C, 0x93, 0x82, 0xB0, 0xB3, 0xE5, 0xC0, 0x21, 0x09, 0x84, 0xD5, 0xEF, 0x9F, 0xD1, 0x7E, 0xDC, 0x4D, 0xF5, 0x7E, 0xCD, 0x45, 0x3C, 0x7F, 0xF5, 0x59, 0x98, 0xC6, 0x55, 0xFC, 0x9F, 0xA3, 0xB7, 0x74, 0xEE, 0x31, 0x98, 0xE6, 0xB7, 0xBE, 0x26, 0xF4, 0x3C, 0x76, 0xF1, 0x23, 0x7E, 0x02, 0x4E, 0x3C, 0xD1, 0xC7, 0x28, 0x23, 0x73, 0xC4, 0xD9, 0x5E, 0x0D, 0xA1, 0x80, 0xA5, 0xAA, 0x26, 0x0A, 0xA3, 0x44, 0x82, 0x74, 0xE6, 0x3C, 0x44, 0x27, 0x51, 0x0D, 0x5F, 0xC7, 0x9C, 0xD6, 0x63, 0x67, 0xA5, 0x27, 0x97, 0x38, 0xFB, 0x2D, 0xD3, 0xD6, 0x60, 0x25, 0x83, 0x4D, 0x37, 0x5B, 0x40, 0x59, 0x11, 0x77, 0x51, 0x11, 0x14, 0x18, 0x07, 0x63, 0xB1, 0x34, 0x3D, 0xB8, 0x60, 0x13, 0xC2, 0xE8, 0x13, 0x82}
|
||||
)
|
||||
|
||||
// Encrypt encrypts the given data using MHF's custom encryption+checksum method.
|
||||
// if a overrideByteKey value is supplied (!= nil), it will be used to override the derived/truncated key byte.
|
||||
func Encrypt(data []byte, key uint32, overrideByteKey *byte) (outputData []byte, combinedCheck uint16, check0 uint16, check1 uint16, check2 uint16) {
|
||||
return _generalCrypt(data, key, 0, overrideByteKey)
|
||||
}
|
||||
|
||||
// Decrypt decrypts the given data using MHF's custom decryption+checksum method.
|
||||
// if a overrideByteKey value is supplied (!= nil), it will be used to override the derived/truncated key byte.
|
||||
func Decrypt(data []byte, key uint32, overrideByteKey *byte) (outputData []byte, combinedCheck uint16, check0 uint16, check1 uint16, check2 uint16) {
|
||||
return _generalCrypt(data, key, 1, overrideByteKey)
|
||||
}
|
||||
|
||||
// _generalCrypt is a generalized MHF crypto function that can perform both encryption and decryption,
|
||||
// Crypto is a generalized MHF crypto function that can perform both encryption and decryption,
|
||||
// these two crypto operations are combined into a single function because they shared most of their logic.
|
||||
// encrypt: cryptType==0
|
||||
// decrypt: cryptType==1
|
||||
func _generalCrypt(data []byte, rotKey uint32, cryptType int, overrideByteKey *byte) ([]byte, uint16, uint16, uint16, uint16) {
|
||||
func Crypto(data []byte, rotKey uint32, encrypt bool, overrideByteKey *byte) ([]byte, uint16, uint16, uint16, uint16) {
|
||||
cryptKeyTruncByte := byte(((rotKey >> 1) % 999983) & 0xFF)
|
||||
if overrideByteKey != nil {
|
||||
cryptKeyTruncByte = *overrideByteKey
|
||||
}
|
||||
|
||||
derivedCryptKey := int32((uint32(len(data)) * (uint32(cryptKeyTruncByte) + 1)) & 0xFFFFFFFF)
|
||||
derivedCryptKey := (uint32(len(data)) * (uint32(cryptKeyTruncByte) + 1)) & 0xFFFFFFFF
|
||||
sharedBufIdx := byte(1)
|
||||
accumulator0 := uint32(0)
|
||||
accumulator1 := uint32(0)
|
||||
accumulator2 := uint32(0)
|
||||
var accumulator0, accumulator1, accumulator2 uint32
|
||||
|
||||
var outputData []byte
|
||||
if cryptType == 0 {
|
||||
if encrypt {
|
||||
for i := 0; i < len(data); i++ {
|
||||
// Do the encryption for this iteration
|
||||
encKeyIdx := int32(((uint32(derivedCryptKey) >> 10) ^ uint32(data[i])) & 0xFF)
|
||||
derivedCryptKey = (0x4FD * (derivedCryptKey + 1))
|
||||
encKeyIdx := ((derivedCryptKey >> 10) ^ uint32(data[i])) & 0xFF
|
||||
derivedCryptKey = 1277*derivedCryptKey + 1277
|
||||
encKeyByte := _encryptKey[encKeyIdx]
|
||||
|
||||
// Update the checksum accumulators.
|
||||
accumulator2 = uint32((accumulator2 + (uint32(sharedBufIdx) * uint32(data[i]))) & 0xFFFFFFFF)
|
||||
accumulator1 = uint32((accumulator1 + uint32(encKeyIdx)) & 0xFFFFFFFF)
|
||||
accumulator0 = uint32((accumulator0 + (uint32(encKeyByte)<<(i&7))&0xFFFFFFFF) & 0xFFFFFFFF)
|
||||
accumulator2 = accumulator2 + (uint32(sharedBufIdx) * uint32(data[i]))
|
||||
accumulator1 = accumulator1 + encKeyIdx
|
||||
accumulator0 = accumulator0 + uint32(encKeyByte)<<(i&7)
|
||||
|
||||
// Append the output.
|
||||
outputData = append(outputData, _sharedCryptKey[sharedBufIdx]^encKeyByte)
|
||||
@@ -53,32 +37,32 @@ func _generalCrypt(data []byte, rotKey uint32, cryptType int, overrideByteKey *b
|
||||
// Update the sharedBufIdx for the next iteration.
|
||||
sharedBufIdx = data[i]
|
||||
}
|
||||
|
||||
} else if cryptType == 1 {
|
||||
} else {
|
||||
for i := 0; i < len(data); i++ {
|
||||
// Do the decryption for this iteration
|
||||
oldSharedBufIdx := sharedBufIdx
|
||||
tIdx := data[i] ^ _sharedCryptKey[sharedBufIdx]
|
||||
decKeyByte := _decryptKey[tIdx]
|
||||
sharedBufIdx = byte(((uint32(derivedCryptKey) >> 10) ^ uint32(decKeyByte)) & 0xFF)
|
||||
sharedBufIdx = byte((derivedCryptKey >> 10) ^ uint32(decKeyByte))
|
||||
|
||||
// Update the checksum accumulators.
|
||||
accumulator0 = (accumulator0 + ((uint32(tIdx) << (i & 7)) & 0xFFFFFFFF))
|
||||
accumulator1 = (accumulator1 + uint32(decKeyByte)) & 0xFFFFFFFF
|
||||
accumulator2 = (accumulator2 + ((uint32(oldSharedBufIdx) * uint32(sharedBufIdx)) & 0xFFFFFFFF)) & 0xFFFFFFFF
|
||||
accumulator0 = accumulator0 + uint32(tIdx)<<(i&7)
|
||||
accumulator1 = accumulator1 + uint32(decKeyByte)
|
||||
accumulator2 = accumulator2 + uint32(oldSharedBufIdx)*uint32(sharedBufIdx)
|
||||
|
||||
// Append the output.
|
||||
outputData = append(outputData, sharedBufIdx)
|
||||
|
||||
// Update the key pos for next iteration.
|
||||
derivedCryptKey = (0x4FD * (derivedCryptKey + 1))
|
||||
derivedCryptKey = 1277*derivedCryptKey + 1277
|
||||
}
|
||||
}
|
||||
|
||||
combinedCheck := uint16((accumulator1 + (accumulator0 >> 1) + (accumulator2 >> 2)) & 0xFFFF)
|
||||
check0 := uint16((accumulator0 ^ ((accumulator0 & 0xFFFF0000) >> 16)) & 0xFFFF)
|
||||
check1 := uint16((accumulator1 ^ ((accumulator1 & 0xFFFF0000) >> 16)) & 0xFFFF)
|
||||
check2 := uint16((accumulator2 ^ ((accumulator2 & 0xFFFF0000) >> 16)) & 0xFFFF)
|
||||
var check [4]uint16
|
||||
check[0] = uint16(accumulator1 + (accumulator0 >> 1) + (accumulator2 >> 2))
|
||||
check[1] = uint16(accumulator0 ^ ((accumulator0 & 0xFFFF0000) >> 16))
|
||||
check[2] = uint16(accumulator1 ^ ((accumulator1 & 0xFFFF0000) >> 16))
|
||||
check[3] = uint16(accumulator2 ^ ((accumulator2 & 0xFFFF0000) >> 16))
|
||||
|
||||
return outputData, combinedCheck, check0, check1, check2
|
||||
return outputData, check[0], check[1], check[2], check[3]
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestEncrypt(t *testing.T) {
|
||||
for k, tt := range tests {
|
||||
testname := fmt.Sprintf("encrypt_test_%d", k)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
out, cc, c0, c1, c2 := Encrypt(tt.decryptedData, tt.key, nil)
|
||||
out, cc, c0, c1, c2 := Crypto(tt.decryptedData, tt.key, true, nil)
|
||||
if cc != tt.ecc {
|
||||
t.Errorf("got cc 0x%X, want 0x%X", cc, tt.ecc)
|
||||
} else if c0 != tt.ec0 {
|
||||
@@ -86,7 +86,7 @@ func TestDecrypt(t *testing.T) {
|
||||
for k, tt := range tests {
|
||||
testname := fmt.Sprintf("decrypt_test_%d", k)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
out, cc, c0, c1, c2 := Decrypt(tt.encryptedData, tt.key, nil)
|
||||
out, cc, c0, c1, c2 := Crypto(tt.decryptedData, tt.key, false, nil)
|
||||
if cc != tt.ecc {
|
||||
t.Errorf("got cc 0x%X, want 0x%X", cc, tt.ecc)
|
||||
} else if c0 != tt.ec0 {
|
||||
|
||||
@@ -31,7 +31,7 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
|
||||
m.ItemType = bf.ReadUint16()
|
||||
m.ItemID = bf.ReadUint16()
|
||||
m.Quant = bf.ReadUint16()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G6 {
|
||||
m.PointCost = bf.ReadUint32()
|
||||
} else {
|
||||
m.PointCost = uint32(bf.ReadUint16())
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireFesta represents the MSG_MHF_ACQUIRE_FESTA
|
||||
type MsgMhfAcquireFesta struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Unk uint16
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Unk uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,11 +23,12 @@ func (m *MsgMhfAcquireFesta) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint16()
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
type MsgMhfAcquireGuildTresure struct {
|
||||
AckHandle uint32
|
||||
HuntID uint32
|
||||
Unk uint8
|
||||
Unk bool
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +24,7 @@ func (m *MsgMhfAcquireGuildTresure) Opcode() network.PacketID {
|
||||
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.HuntID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint8()
|
||||
m.Unk = bf.ReadBool()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// MsgMhfAcquireMonthlyItem represents the MSG_MHF_ACQUIRE_MONTHLY_ITEM
|
||||
type MsgMhfAcquireMonthlyItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Unk2 uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 uint32
|
||||
}
|
||||
|
||||
@@ -25,10 +25,11 @@ func (m *MsgMhfAcquireMonthlyItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
bf.ReadUint32() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ import (
|
||||
// MsgMhfAcquireTitle represents the MSG_MHF_ACQUIRE_TITLE
|
||||
type MsgMhfAcquireTitle struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
TitleID uint16
|
||||
TitleIDs []uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,9 +22,11 @@ func (m *MsgMhfAcquireTitle) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.TitleID = bf.ReadUint16()
|
||||
titles := int(bf.ReadUint16())
|
||||
bf.ReadUint16() // Zeroed
|
||||
for i := 0; i < titles; i++ {
|
||||
m.TitleIDs = append(m.TitleIDs, bf.ReadUint16())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ type MsgMhfAnnounce struct {
|
||||
IPAddress uint32
|
||||
Port uint16
|
||||
StageID []byte
|
||||
Type uint8
|
||||
Data *byteframe.ByteFrame
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -31,8 +31,7 @@ func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint8()
|
||||
m.StageID = bf.ReadBytes(32)
|
||||
_ = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
m.Data = byteframe.NewByteFrameFromBytes(bf.ReadBytes(uint(bf.ReadUint32())))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -26,8 +27,12 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.DistributionType = bf.ReadUint8()
|
||||
m.DistributionID = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G8 {
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
}
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G10 {
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfArrangeGuildMember represents the MSG_MHF_ARRANGE_GUILD_MEMBER
|
||||
@@ -22,11 +23,11 @@ func (m *MsgMhfArrangeGuildMember) Opcode() network.PacketID {
|
||||
func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
charCount := bf.ReadUint16()
|
||||
|
||||
bf.ReadUint8() // Zeroed
|
||||
charCount := int(bf.ReadUint8())
|
||||
m.CharIDs = make([]uint32, charCount)
|
||||
|
||||
for i := uint16(0); i < charCount; i++ {
|
||||
for i := 0; i < charCount; i++ {
|
||||
m.CharIDs[i] = bf.ReadUint32()
|
||||
}
|
||||
|
||||
@@ -35,13 +36,5 @@ func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfArrangeGuildMember) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.GuildID)
|
||||
bf.WriteUint16(uint16(len(m.CharIDs)))
|
||||
|
||||
for _, charID := range m.CharIDs {
|
||||
bf.WriteUint32(charID)
|
||||
}
|
||||
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfChargeFesta represents the MSG_MHF_CHARGE_FESTA
|
||||
type MsgMhfChargeFesta struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Souls int
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Souls []uint16
|
||||
Auto bool
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,15 +24,14 @@ func (m *MsgMhfChargeFesta) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfChargeFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Souls = 0
|
||||
for i := bf.ReadUint16(); i > 0; i-- {
|
||||
m.Souls += int(bf.ReadUint16())
|
||||
}
|
||||
_ = bf.ReadUint8() // Unk
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
for i := bf.ReadUint16(); i > 0; i-- {
|
||||
m.Souls = append(m.Souls, bf.ReadUint16())
|
||||
}
|
||||
m.Auto = bf.ReadBool()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCheckDailyCafepoint represents the MSG_MHF_CHECK_DAILY_CAFEPOINT
|
||||
@@ -25,7 +26,5 @@ func (m *MsgMhfCheckDailyCafepoint) Parse(bf *byteframe.ByteFrame, ctx *clientct
|
||||
}
|
||||
|
||||
func (m *MsgMhfCheckDailyCafepoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.Unk)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
type MsgMhfCheckMonthlyItem struct {
|
||||
AckHandle uint32
|
||||
Type uint8
|
||||
Unk []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +23,9 @@ func (m *MsgMhfCheckMonthlyItem) Opcode() network.PacketID {
|
||||
func (m *MsgMhfCheckMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
m.Unk = bf.ReadBytes(3)
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ type MsgMhfCheckWeeklyStamp struct {
|
||||
AckHandle uint32
|
||||
StampType string
|
||||
Unk1 bool
|
||||
Unk2 uint16 // Hardcoded 0 in the binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -31,7 +30,7 @@ func (m *MsgMhfCheckWeeklyStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.C
|
||||
m.StampType = "ex"
|
||||
}
|
||||
m.Unk1 = bf.ReadBool()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import (
|
||||
// MsgMhfCreateGuild represents the MSG_MHF_CREATE_GUILD
|
||||
type MsgMhfCreateGuild struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Name string
|
||||
}
|
||||
|
||||
@@ -25,9 +23,8 @@ func (m *MsgMhfCreateGuild) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCreateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
_ = bf.ReadUint16() // len
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint16() // Name length
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfCreateJoint represents the MSG_MHF_CREATE_JOINT
|
||||
type MsgMhfCreateJoint struct {
|
||||
AckHandle uint32
|
||||
GuildID uint32
|
||||
Name string
|
||||
AckHandle uint32
|
||||
GuildID uint32
|
||||
Name string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,11 +23,12 @@ func (m *MsgMhfCreateJoint) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCreateJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
_ = bf.ReadUint32() // len
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint16() // Name length
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfDisplayedAchievement represents the MSG_MHF_DISPLAYED_ACHIEVEMENT
|
||||
type MsgMhfDisplayedAchievement struct {
|
||||
Unk0 uint8
|
||||
}
|
||||
type MsgMhfDisplayedAchievement struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfDisplayedAchievement) Opcode() network.PacketID {
|
||||
@@ -18,12 +17,11 @@ func (m *MsgMhfDisplayedAchievement) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfDisplayedAchievement) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfDisplayedAchievement) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint8(m.Unk0)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEntryFesta represents the MSG_MHF_ENTRY_FESTA
|
||||
type MsgMhfEntryFesta struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,11 +22,11 @@ func (m *MsgMhfEntryFesta) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEntryFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
_ = bf.ReadUint16() // Always 0
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -3,6 +3,7 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -10,7 +11,7 @@ import (
|
||||
// MsgMhfEnumerateDistItem represents the MSG_MHF_ENUMERATE_DIST_ITEM
|
||||
type MsgMhfEnumerateDistItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
DistType uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 []byte
|
||||
@@ -24,10 +25,12 @@ func (m *MsgMhfEnumerateDistItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.DistType = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
m.Unk2 = bf.ReadUint16() // Maximum? Hardcoded to 256
|
||||
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
|
||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateEvent represents the MSG_MHF_ENUMERATE_EVENT
|
||||
type MsgMhfEnumerateEvent struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in the binary
|
||||
Unk1 uint16 // Hardcoded 0 in the binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -21,15 +20,12 @@ func (m *MsgMhfEnumerateEvent) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfEnumerateEvent) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint16(m.Unk0)
|
||||
bf.WriteUint16(m.Unk1)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateFestaMember represents the MSG_MHF_ENUMERATE_FESTA_MEMBER
|
||||
type MsgMhfEnumerateFestaMember struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,11 +22,11 @@ func (m *MsgMhfEnumerateFestaMember) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateFestaMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
|
||||
return nil
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
// MsgMhfEnumerateGuacot represents the MSG_MHF_ENUMERATE_GUACOT
|
||||
type MsgMhfEnumerateGuacot struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32 // Hardcoded 0 in binary
|
||||
Unk1 uint16 // Hardcoded 0 in binary
|
||||
Unk0 uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,7 +22,7 @@ func (m *MsgMhfEnumerateGuacot) Opcode() network.PacketID {
|
||||
func (m *MsgMhfEnumerateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -34,8 +32,8 @@ type MsgMhfEnumerateGuild struct {
|
||||
Type EnumerateGuildType
|
||||
Page uint8
|
||||
Sorting bool
|
||||
Data1 []byte
|
||||
Data2 string
|
||||
Data1 *byteframe.ByteFrame
|
||||
Data2 *byteframe.ByteFrame
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -49,12 +47,12 @@ func (m *MsgMhfEnumerateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
|
||||
m.Type = EnumerateGuildType(bf.ReadUint8())
|
||||
m.Page = bf.ReadUint8()
|
||||
m.Sorting = bf.ReadBool()
|
||||
_ = bf.ReadBytes(1)
|
||||
m.Data1 = bf.ReadBytes(4)
|
||||
_ = bf.ReadBytes(2)
|
||||
lenData2 := uint(bf.ReadUint8())
|
||||
_ = bf.ReadBytes(1)
|
||||
m.Data2 = stringsupport.SJISToUTF8(bfutil.UpToNull(bf.ReadBytes(lenData2)))
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.Data1 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(4))
|
||||
bf.ReadUint16() // Zeroed
|
||||
dataLen := uint(bf.ReadUint8())
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.Data2 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(dataLen))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateGuildItem represents the MSG_MHF_ENUMERATE_GUILD_ITEM
|
||||
type MsgMhfEnumerateGuildItem struct {
|
||||
AckHandle uint32
|
||||
GuildId uint32
|
||||
Unk0 uint16
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,9 +21,10 @@ func (m *MsgMhfEnumerateGuildItem) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateGuildItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildId = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateGuildMember represents the MSG_MHF_ENUMERATE_GUILD_MEMBER
|
||||
type MsgMhfEnumerateGuildMember struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 00 01 in the binary
|
||||
Unk1 uint32 // Alliance related
|
||||
GuildID uint32
|
||||
AckHandle uint32
|
||||
AllianceID uint32
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,17 +22,14 @@ func (m *MsgMhfEnumerateGuildMember) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Always 1
|
||||
m.AllianceID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfEnumerateGuildMember) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint16(m.Unk0)
|
||||
bf.WriteUint32(m.Unk1)
|
||||
bf.WriteUint32(m.GuildID)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ type MsgMhfEnumerateHouse struct {
|
||||
AckHandle uint32
|
||||
CharID uint32
|
||||
Method uint8
|
||||
Unk uint16
|
||||
Name string
|
||||
}
|
||||
|
||||
@@ -28,7 +27,7 @@ func (m *MsgMhfEnumerateHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.CharID = bf.ReadUint32()
|
||||
m.Method = bf.ReadUint8()
|
||||
m.Unk = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
lenName := bf.ReadUint8()
|
||||
if lenName > 0 {
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
|
||||
@@ -10,8 +10,13 @@ import (
|
||||
|
||||
// MsgMhfEnumerateInvGuild represents the MSG_MHF_ENUMERATE_INV_GUILD
|
||||
type MsgMhfEnumerateInvGuild struct {
|
||||
AckHandle uint32
|
||||
Unk []byte
|
||||
AckHandle uint32
|
||||
Unk uint32
|
||||
Operation uint8
|
||||
ActiveHours uint8
|
||||
DaysActive uint8
|
||||
PlayStyle uint8
|
||||
GuildRequest uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,7 +27,12 @@ func (m *MsgMhfEnumerateInvGuild) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateInvGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk = bf.ReadBytes(9)
|
||||
m.Unk = bf.ReadUint32()
|
||||
m.Operation = bf.ReadUint8()
|
||||
m.ActiveHours = bf.ReadUint8()
|
||||
m.DaysActive = bf.ReadUint8()
|
||||
m.PlayStyle = bf.ReadUint8()
|
||||
m.GuildRequest = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumeratePrice represents the MSG_MHF_ENUMERATE_PRICE
|
||||
type MsgMhfEnumeratePrice struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in the binary
|
||||
Unk1 uint16 // Hardcoded 0 in the binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +21,8 @@ func (m *MsgMhfEnumeratePrice) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumeratePrice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateRanking represents the MSG_MHF_ENUMERATE_RANKING
|
||||
type MsgMhfEnumerateRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in the binary
|
||||
Unk1 uint16 // Hardcoded 0 in the binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +21,9 @@ func (m *MsgMhfEnumerateRanking) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ type MsgMhfEnumerateShop struct {
|
||||
AckHandle uint32
|
||||
ShopType uint8 // 1 running gachas, 10 normal shop extensions, 8 Diva Defense shop
|
||||
ShopID uint32
|
||||
Unk2 uint16 // 00 80 running gachas, 00 20 normal shop
|
||||
Limit uint16
|
||||
Unk3 uint8
|
||||
Unk4 uint8
|
||||
Unk5 uint32
|
||||
@@ -30,7 +30,7 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ShopType = bf.ReadUint8()
|
||||
m.ShopID = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Limit = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G2 {
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
// MsgMhfEnumerateUnionItem represents the MSG_MHF_ENUMERATE_UNION_ITEM
|
||||
type MsgMhfEnumerateUnionItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,8 +21,8 @@ func (m *MsgMhfEnumerateUnionItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateUnionItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// MsgMhfEnumerateWarehouse represents the MSG_MHF_ENUMERATE_WAREHOUSE
|
||||
type MsgMhfEnumerateWarehouse struct {
|
||||
AckHandle uint32
|
||||
BoxType string
|
||||
BoxType uint8
|
||||
BoxIndex uint8
|
||||
}
|
||||
|
||||
@@ -23,15 +23,10 @@ func (m *MsgMhfEnumerateWarehouse) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
boxType := bf.ReadUint8()
|
||||
switch boxType {
|
||||
case 0:
|
||||
m.BoxType = "item"
|
||||
case 1:
|
||||
m.BoxType = "equip"
|
||||
}
|
||||
m.BoxType = bf.ReadUint8()
|
||||
m.BoxIndex = bf.ReadUint8()
|
||||
_ = bf.ReadUint16()
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ type MsgMhfExchangeWeeklyStamp struct {
|
||||
AckHandle uint32
|
||||
StampType string
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,7 +31,7 @@ func (m *MsgMhfExchangeWeeklyStamp) Parse(bf *byteframe.ByteFrame, ctx *clientct
|
||||
m.StampType = "ex"
|
||||
}
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
type MsgMhfGetAchievement struct {
|
||||
AckHandle uint32
|
||||
CharID uint32
|
||||
Unk1 uint32 // char?
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +23,7 @@ func (m *MsgMhfGetAchievement) Opcode() network.PacketID {
|
||||
func (m *MsgMhfGetAchievement) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.CharID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
bf.ReadUint32() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfGetRengokuBinary represents the MSG_MHF_GET_RENGOKU_BINARY
|
||||
type MsgMhfGetRengokuBinary struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8 // Hardcoded 0 in binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,7 +21,7 @@ func (m *MsgMhfGetRengokuBinary) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetRengokuBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfInfoFesta represents the MSG_MHF_INFO_FESTA
|
||||
type MsgMhfInfoFesta struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in the binary
|
||||
Unk1 uint16 // Hardcoded 0 in the binary
|
||||
Unk0 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +22,10 @@ func (m *MsgMhfInfoFesta) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfInfoFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
type MsgMhfInfoJoint struct {
|
||||
AckHandle uint32
|
||||
AllianceID uint32
|
||||
Unk uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +23,7 @@ func (m *MsgMhfInfoJoint) Opcode() network.PacketID {
|
||||
func (m *MsgMhfInfoJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.AllianceID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint32()
|
||||
bf.ReadUint32() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfListMember represents the MSG_MHF_LIST_MEMBER
|
||||
type MsgMhfListMember struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 01 00 in the JP client.
|
||||
Unk0 uint8 // Hardcoded 01 in the JP client.
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,7 +22,8 @@ func (m *MsgMhfListMember) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfListMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfLoadGuildCooking represents the MSG_MHF_LOAD_GUILD_COOKING
|
||||
type MsgMhfLoadGuildCooking struct{
|
||||
AckHandle uint32
|
||||
MaxMeals uint8
|
||||
type MsgMhfLoadGuildCooking struct {
|
||||
AckHandle uint32
|
||||
MaxMeals uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,7 +22,7 @@ func (m *MsgMhfLoadGuildCooking) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfLoadGuildCooking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
_ = bf.ReadUint8()
|
||||
m.MaxMeals = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ type MsgMhfLoadHouse struct {
|
||||
Destination uint8
|
||||
// False if already in hosts My Series, in case host updates PW
|
||||
CheckPass bool
|
||||
Unk3 uint16 // Hardcoded 0 in binary
|
||||
Password string
|
||||
}
|
||||
|
||||
@@ -31,8 +30,8 @@ func (m *MsgMhfLoadHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCo
|
||||
m.CharID = bf.ReadUint32()
|
||||
m.Destination = bf.ReadUint8()
|
||||
m.CheckPass = bf.ReadBool()
|
||||
_ = bf.ReadUint16()
|
||||
_ = bf.ReadUint8() // Password length
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint8() // Password length
|
||||
m.Password = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ type MsgMhfOperateGuildMember struct {
|
||||
GuildID uint32
|
||||
CharID uint32
|
||||
Action uint8
|
||||
Unk []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -37,7 +36,8 @@ func (m *MsgMhfOperateGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.CharID = bf.ReadUint32()
|
||||
m.Action = bf.ReadUint8()
|
||||
m.Unk = bf.ReadBytes(3)
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ type MsgMhfOperateJoint struct {
|
||||
AllianceID uint32
|
||||
GuildID uint32
|
||||
Action OperateJointAction
|
||||
UnkData *byteframe.ByteFrame
|
||||
Data1 *byteframe.ByteFrame
|
||||
Data2 *byteframe.ByteFrame
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -36,8 +37,9 @@ func (m *MsgMhfOperateJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clien
|
||||
m.AllianceID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Action = OperateJointAction(bf.ReadUint8())
|
||||
m.UnkData = byteframe.NewByteFrameFromBytes(bf.DataFromCurrent())
|
||||
bf.Seek(int64(len(bf.Data())-2), 0)
|
||||
dataLen := uint(bf.ReadUint8())
|
||||
m.Data1 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(4))
|
||||
m.Data2 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(dataLen))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
type MsgMhfOperateWarehouse struct {
|
||||
AckHandle uint32
|
||||
Operation uint8
|
||||
BoxType string
|
||||
BoxType uint8
|
||||
BoxIndex uint8
|
||||
Name string
|
||||
}
|
||||
@@ -27,17 +27,13 @@ func (m *MsgMhfOperateWarehouse) Opcode() network.PacketID {
|
||||
func (m *MsgMhfOperateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Operation = bf.ReadUint8()
|
||||
boxType := bf.ReadUint8()
|
||||
switch boxType {
|
||||
case 0:
|
||||
m.BoxType = "item"
|
||||
case 1:
|
||||
m.BoxType = "equip"
|
||||
}
|
||||
m.BoxType = bf.ReadUint8()
|
||||
m.BoxIndex = bf.ReadUint8()
|
||||
_ = bf.ReadUint8() // lenName
|
||||
_ = bf.ReadUint16() // Unk
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
lenName := bf.ReadUint8()
|
||||
bf.ReadUint16() // Zeroed
|
||||
if lenName > 0 {
|
||||
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfOprMember represents the MSG_MHF_OPR_MEMBER
|
||||
type MsgMhfOprMember struct {
|
||||
AckHandle uint32
|
||||
Blacklist bool
|
||||
Operation bool
|
||||
Unk uint16
|
||||
CharID uint32
|
||||
AckHandle uint32
|
||||
Blacklist bool
|
||||
Operation bool
|
||||
CharIDs []uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,12 +23,15 @@ func (m *MsgMhfOprMember) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfOprMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Blacklist = bf.ReadBool()
|
||||
m.Operation = bf.ReadBool()
|
||||
m.Unk = bf.ReadUint16()
|
||||
m.CharID = bf.ReadUint32()
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Blacklist = bf.ReadBool()
|
||||
m.Operation = bf.ReadBool()
|
||||
bf.ReadUint8()
|
||||
chars := int(bf.ReadUint8())
|
||||
for i := 0; i < chars; i++ {
|
||||
m.CharIDs = append(m.CharIDs, bf.ReadUint32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPlayFreeGacha represents the MSG_MHF_PLAY_FREE_GACHA
|
||||
type MsgMhfPlayFreeGacha struct{}
|
||||
type MsgMhfPlayFreeGacha struct {
|
||||
AckHandle uint32
|
||||
GachaID uint32
|
||||
GachaType uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfPlayFreeGacha) Opcode() network.PacketID {
|
||||
@@ -18,7 +22,10 @@ func (m *MsgMhfPlayFreeGacha) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPlayFreeGacha) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GachaID = bf.ReadUint32()
|
||||
m.GachaType = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPostSeibattle represents the MSG_MHF_POST_SEIBATTLE
|
||||
type MsgMhfPostSeibattle struct{}
|
||||
type MsgMhfPostSeibattle struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint32
|
||||
Unk3 uint8
|
||||
Unk4 uint16
|
||||
Unk5 uint16
|
||||
Unk6 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfPostSeibattle) Opcode() network.PacketID {
|
||||
@@ -18,7 +27,15 @@ func (m *MsgMhfPostSeibattle) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostSeibattle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint16()
|
||||
m.Unk5 = bf.ReadUint16()
|
||||
m.Unk6 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -19,7 +19,6 @@ type MsgMhfReadMail struct {
|
||||
|
||||
// This is the index within the current mail list
|
||||
Index uint8
|
||||
Unk0 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,7 +31,7 @@ func (m *MsgMhfReadMail) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.AccIndex = bf.ReadUint8()
|
||||
m.Index = bf.ReadUint8()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ type MsgMhfRegisterEvent struct {
|
||||
Unk0 uint16
|
||||
WorldID uint16
|
||||
LandID uint16
|
||||
Unk3 uint8
|
||||
Unk4 uint8
|
||||
Unk1 bool
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -27,8 +26,8 @@ func (m *MsgMhfRegisterEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.WorldID = bf.ReadUint16()
|
||||
m.LandID = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadBool()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
type MsgMhfReleaseEvent struct {
|
||||
AckHandle uint32
|
||||
RaviID uint32
|
||||
Unk1 uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +23,7 @@ func (m *MsgMhfReleaseEvent) Opcode() network.PacketID {
|
||||
func (m *MsgMhfReleaseEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.RaviID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
bf.ReadUint32() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ type MsgMhfSetGuildManageRight struct {
|
||||
AckHandle uint32
|
||||
CharID uint32
|
||||
Allowed bool
|
||||
Unk []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -26,7 +25,7 @@ func (m *MsgMhfSetGuildManageRight) Parse(bf *byteframe.ByteFrame, ctx *clientct
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.CharID = bf.ReadUint32()
|
||||
m.Allowed = bf.ReadBool()
|
||||
m.Unk = bf.ReadBytes(3)
|
||||
bf.ReadBytes(3) // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -32,16 +32,21 @@ func (m *MsgMhfStampcardStamp) Opcode() network.PacketID {
|
||||
func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.HR = bf.ReadUint16()
|
||||
m.GR = bf.ReadUint16()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
m.GR = bf.ReadUint16()
|
||||
}
|
||||
m.Stamps = bf.ReadUint16()
|
||||
_ = bf.ReadUint16()
|
||||
if _config.ErupeConfig.RealClientMode > _config.Z1 {
|
||||
bf.ReadUint16() // Zeroed
|
||||
if _config.ErupeConfig.RealClientMode >= _config.Z2 {
|
||||
m.Reward1 = uint16(bf.ReadUint32())
|
||||
m.Reward2 = uint16(bf.ReadUint32())
|
||||
m.Item1 = uint16(bf.ReadUint32())
|
||||
m.Item2 = uint16(bf.ReadUint32())
|
||||
m.Quantity1 = uint16(bf.ReadUint32())
|
||||
m.Quantity2 = uint16(bf.ReadUint32())
|
||||
} else {
|
||||
m.Reward1 = 10
|
||||
m.Reward2 = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfStateFestaG represents the MSG_MHF_STATE_FESTA_G
|
||||
type MsgMhfStateFestaG struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -25,7 +25,7 @@ func (m *MsgMhfStateFestaG) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfStateFestaU represents the MSG_MHF_STATE_FESTA_U
|
||||
type MsgMhfStateFestaU struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,11 +22,11 @@ func (m *MsgMhfStateFestaU) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfStateFestaU) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfTransferItem represents the MSG_MHF_TRANSFER_ITEM
|
||||
@@ -15,8 +15,8 @@ type MsgMhfTransferItem struct {
|
||||
// correlate with any item IDs that would make sense to get after quests so
|
||||
// I have no idea what this actually does
|
||||
Unk0 uint32
|
||||
Unk1 uint16 // Hardcoded
|
||||
Unk2 uint16 // Hardcoded
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -28,7 +28,8 @@ func (m *MsgMhfTransferItem) Opcode() network.PacketID {
|
||||
func (m *MsgMhfTransferItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
type MsgMhfTransitMessage struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
SearchType uint16
|
||||
MessageData []byte
|
||||
}
|
||||
@@ -26,7 +25,7 @@ func (m *MsgMhfTransitMessage) Opcode() network.PacketID {
|
||||
func (m *MsgMhfTransitMessage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.SearchType = bf.ReadUint16()
|
||||
m.MessageData = bf.ReadBytes(uint(bf.ReadUint16()))
|
||||
return nil
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfUnreserveSrg represents the MSG_MHF_UNRESERVE_SRG
|
||||
type MsgMhfUnreserveSrg struct{}
|
||||
type MsgMhfUnreserveSrg struct {
|
||||
AckHandle uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfUnreserveSrg) Opcode() network.PacketID {
|
||||
@@ -18,7 +20,8 @@ func (m *MsgMhfUnreserveSrg) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUnreserveSrg) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfUpdateCafepoint represents the MSG_MHF_UPDATE_CAFEPOINT
|
||||
type MsgMhfUpdateCafepoint struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in binary
|
||||
Unk1 uint16 // Hardcoded 0 in binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +21,8 @@ func (m *MsgMhfUpdateCafepoint) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateCafepoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
type Goocoo struct {
|
||||
Index uint32
|
||||
Data1 []uint16
|
||||
Data1 []int16
|
||||
Data2 []uint32
|
||||
Name []byte
|
||||
}
|
||||
@@ -30,12 +30,12 @@ func (m *MsgMhfUpdateGuacot) Opcode() network.PacketID {
|
||||
func (m *MsgMhfUpdateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.EntryCount = bf.ReadUint16()
|
||||
_ = bf.ReadUint16() // Zero
|
||||
var temp Goocoo
|
||||
bf.ReadUint16() // Zeroed
|
||||
for i := 0; i < int(m.EntryCount); i++ {
|
||||
var temp Goocoo
|
||||
temp.Index = bf.ReadUint32()
|
||||
for j := 0; j < 22; j++ {
|
||||
temp.Data1 = append(temp.Data1, bf.ReadUint16())
|
||||
temp.Data1 = append(temp.Data1, bf.ReadInt16())
|
||||
}
|
||||
for j := 0; j < 2; j++ {
|
||||
temp.Data2 = append(temp.Data2, bf.ReadUint32())
|
||||
|
||||
@@ -25,8 +25,6 @@ type GuildIconMsgPart struct {
|
||||
type MsgMhfUpdateGuildIcon struct {
|
||||
AckHandle uint32
|
||||
GuildID uint32
|
||||
PartCount uint16
|
||||
Unk1 uint16
|
||||
IconParts []GuildIconMsgPart
|
||||
}
|
||||
|
||||
@@ -39,12 +37,12 @@ func (m *MsgMhfUpdateGuildIcon) Opcode() network.PacketID {
|
||||
func (m *MsgMhfUpdateGuildIcon) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.PartCount = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
partCount := int(bf.ReadUint16())
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.IconParts = make([]GuildIconMsgPart, partCount)
|
||||
|
||||
m.IconParts = make([]GuildIconMsgPart, m.PartCount)
|
||||
|
||||
for i := 0; i < int(m.PartCount); i++ {
|
||||
for i := 0; i < partCount; i++ {
|
||||
m.IconParts[i] = GuildIconMsgPart{
|
||||
Index: bf.ReadUint16(),
|
||||
ID: bf.ReadUint16(),
|
||||
|
||||
@@ -2,26 +2,18 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/mhfitem"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
type Item struct {
|
||||
Unk0 uint32
|
||||
ItemId uint16
|
||||
Amount uint16
|
||||
Unk1 uint32
|
||||
}
|
||||
|
||||
// MsgMhfUpdateGuildItem represents the MSG_MHF_UPDATE_GUILD_ITEM
|
||||
type MsgMhfUpdateGuildItem struct {
|
||||
AckHandle uint32
|
||||
GuildId uint32
|
||||
Amount uint16
|
||||
Unk1 uint16 // 0x00 0x00
|
||||
Items []Item // Array of updated item IDs
|
||||
AckHandle uint32
|
||||
GuildID uint32
|
||||
UpdatedItems []mhfitem.MHFItemStack
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,18 +24,13 @@ func (m *MsgMhfUpdateGuildItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateGuildItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildId = bf.ReadUint32()
|
||||
m.Amount = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Items = make([]Item, int(m.Amount))
|
||||
|
||||
for i := 0; i < int(m.Amount); i++ {
|
||||
m.Items[i].Unk0 = bf.ReadUint32()
|
||||
m.Items[i].ItemId = bf.ReadUint16()
|
||||
m.Items[i].Amount = bf.ReadUint16()
|
||||
m.Items[i].Unk1 = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
changes := int(bf.ReadUint16())
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
for i := 0; i < changes; i++ {
|
||||
m.UpdatedItems = append(m.UpdatedItems, mhfitem.ReadWarehouseItem(bf))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ import (
|
||||
type MsgMhfUpdateHouse struct {
|
||||
AckHandle uint32
|
||||
State uint8
|
||||
Unk1 uint8 // Always 0x01
|
||||
Unk2 uint16 // Always 0x0000
|
||||
Unk1 uint8 // Always 0x01
|
||||
Password string
|
||||
}
|
||||
|
||||
@@ -28,8 +27,9 @@ func (m *MsgMhfUpdateHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.State = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
_ = bf.ReadUint8() // Password length
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Password length
|
||||
m.Password = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/mhfitem"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
@@ -10,10 +11,8 @@ import (
|
||||
|
||||
// MsgMhfUpdateUnionItem represents the MSG_MHF_UPDATE_UNION_ITEM
|
||||
type MsgMhfUpdateUnionItem struct {
|
||||
AckHandle uint32
|
||||
Amount uint16
|
||||
Unk1 uint16 // 0x00 0x00
|
||||
Items []Item // Array of updated item IDs
|
||||
AckHandle uint32
|
||||
UpdatedItems []mhfitem.MHFItemStack
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,17 +23,12 @@ func (m *MsgMhfUpdateUnionItem) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateUnionItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Amount = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Items = make([]Item, int(m.Amount))
|
||||
|
||||
for i := 0; i < int(m.Amount); i++ {
|
||||
m.Items[i].Unk0 = bf.ReadUint32()
|
||||
m.Items[i].ItemId = bf.ReadUint16()
|
||||
m.Items[i].Amount = bf.ReadUint16()
|
||||
m.Items[i].Unk1 = bf.ReadUint32()
|
||||
changes := int(bf.ReadUint16())
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
for i := 0; i < changes; i++ {
|
||||
m.UpdatedItems = append(m.UpdatedItems, mhfitem.ReadWarehouseItem(bf))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,25 +3,18 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/mhfitem"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
type WarehouseStack struct {
|
||||
ID uint32
|
||||
Index uint16
|
||||
EquipType uint16
|
||||
ItemID uint16
|
||||
Quantity uint16
|
||||
Data []byte
|
||||
}
|
||||
|
||||
// MsgMhfUpdateWarehouse represents the MSG_MHF_UPDATE_WAREHOUSE
|
||||
type MsgMhfUpdateWarehouse struct {
|
||||
AckHandle uint32
|
||||
BoxType string
|
||||
BoxIndex uint8
|
||||
Updates []WarehouseStack
|
||||
AckHandle uint32
|
||||
BoxType uint8
|
||||
BoxIndex uint8
|
||||
UpdatedItems []mhfitem.MHFItemStack
|
||||
UpdatedEquipment []mhfitem.MHFEquipment
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,35 +25,19 @@ func (m *MsgMhfUpdateWarehouse) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
boxType := bf.ReadUint8()
|
||||
switch boxType {
|
||||
case 0:
|
||||
m.BoxType = "item"
|
||||
case 1:
|
||||
m.BoxType = "equip"
|
||||
}
|
||||
m.BoxType = bf.ReadUint8()
|
||||
m.BoxIndex = bf.ReadUint8()
|
||||
changes := int(bf.ReadUint16())
|
||||
var stackUpdate WarehouseStack
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
for i := 0; i < changes; i++ {
|
||||
switch boxType {
|
||||
switch m.BoxType {
|
||||
case 0:
|
||||
stackUpdate.ID = bf.ReadUint32()
|
||||
stackUpdate.Index = bf.ReadUint16()
|
||||
stackUpdate.ItemID = bf.ReadUint16()
|
||||
stackUpdate.Quantity = bf.ReadUint16()
|
||||
_ = bf.ReadUint16() // Unk
|
||||
m.Updates = append(m.Updates, stackUpdate)
|
||||
m.UpdatedItems = append(m.UpdatedItems, mhfitem.ReadWarehouseItem(bf))
|
||||
case 1:
|
||||
stackUpdate.ID = bf.ReadUint32()
|
||||
stackUpdate.Index = bf.ReadUint16()
|
||||
stackUpdate.EquipType = bf.ReadUint16()
|
||||
stackUpdate.ItemID = bf.ReadUint16()
|
||||
stackUpdate.Data = bf.ReadBytes(56)
|
||||
m.Updates = append(m.Updates, stackUpdate)
|
||||
m.UpdatedEquipment = append(m.UpdatedEquipment, mhfitem.ReadWarehouseEquipment(bf))
|
||||
}
|
||||
}
|
||||
_ = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfUseGachaPoint represents the MSG_MHF_USE_GACHA_POINT
|
||||
type MsgMhfUseGachaPoint struct{
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // padding?
|
||||
TrialCoins uint32
|
||||
PremiumCoins uint32
|
||||
type MsgMhfUseGachaPoint struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
TrialCoins uint32
|
||||
PremiumCoins uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,7 +25,8 @@ func (m *MsgMhfUseGachaPoint) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUseGachaPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.TrialCoins = bf.ReadUint32()
|
||||
m.PremiumCoins = bf.ReadUint32()
|
||||
return nil
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// MsgMhfVoteFesta represents the MSG_MHF_VOTE_FESTA
|
||||
type MsgMhfVoteFesta struct {
|
||||
AckHandle uint32
|
||||
Unk uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
TrialID uint32
|
||||
}
|
||||
@@ -24,7 +24,7 @@ func (m *MsgMhfVoteFesta) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfVoteFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.TrialID = bf.ReadUint32()
|
||||
return nil
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgSysCastBinary represents the MSG_SYS_CAST_BINARY
|
||||
type MsgSysCastBinary struct {
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Unk uint32
|
||||
BroadcastType uint8
|
||||
MessageType uint8
|
||||
RawDataPayload []byte
|
||||
@@ -24,8 +23,7 @@ func (m *MsgSysCastBinary) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysCastBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk = bf.ReadUint32()
|
||||
m.BroadcastType = bf.ReadUint8()
|
||||
m.MessageType = bf.ReadUint8()
|
||||
dataSize := bf.ReadUint16()
|
||||
|
||||
@@ -2,7 +2,6 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
@@ -29,8 +28,8 @@ func (m *MsgSysCreateAcquireSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clien
|
||||
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
|
||||
m.PlayerCount = bf.ReadUint8()
|
||||
}
|
||||
SemaphoreIDLength := bf.ReadUint8()
|
||||
m.SemaphoreID = string(bfutil.UpToNull(bf.ReadBytes(uint(SemaphoreIDLength))))
|
||||
bf.ReadUint8() // SemaphoreID length
|
||||
m.SemaphoreID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
@@ -10,10 +11,10 @@ import (
|
||||
|
||||
// MsgSysCreateSemaphore represents the MSG_SYS_CREATE_SEMAPHORE
|
||||
type MsgSysCreateSemaphore struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
DataSize uint16
|
||||
RawDataPayload []byte
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
PlayerCount uint8
|
||||
SemaphoreID string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -25,8 +26,11 @@ func (m *MsgSysCreateSemaphore) Opcode() network.PacketID {
|
||||
func (m *MsgSysCreateSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.DataSize = bf.ReadUint16()
|
||||
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
|
||||
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
|
||||
m.PlayerCount = bf.ReadUint8()
|
||||
}
|
||||
bf.ReadUint8() // SemaphoreID length
|
||||
m.SemaphoreID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ type MsgSysCreateStage struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8 // Likely only has 1 and 2 as values.
|
||||
PlayerCount uint8
|
||||
StageID string // NULL terminated string.
|
||||
StageID string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -26,8 +25,8 @@ func (m *MsgSysCreateStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.PlayerCount = bf.ReadUint8()
|
||||
stageIDLength := bf.ReadUint8()
|
||||
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
|
||||
bf.ReadUint8() // Length StageID
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -12,7 +11,7 @@ import (
|
||||
// MsgSysEnterStage represents the MSG_SYS_ENTER_STAGE
|
||||
type MsgSysEnterStage struct {
|
||||
AckHandle uint32
|
||||
UnkBool uint8
|
||||
Unk bool
|
||||
StageID string
|
||||
}
|
||||
|
||||
@@ -24,9 +23,9 @@ func (m *MsgSysEnterStage) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysEnterStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.UnkBool = bf.ReadUint8()
|
||||
stageIDLength := bf.ReadUint8()
|
||||
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
|
||||
m.Unk = bf.ReadBool() // IsQuest?
|
||||
bf.ReadUint8() // Length StageID
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
@@ -27,8 +26,8 @@ func (m *MsgSysEnumerateClient) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Get = bf.ReadUint8()
|
||||
stageIDLength := bf.ReadUint8()
|
||||
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
|
||||
bf.ReadUint8() // StageID length
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user