mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
Compare commits
1 Commits
chore/reor
...
feature/tu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de3fb8ce4f |
@@ -1 +0,0 @@
|
||||
bin/
|
||||
48
.github/workflows/docker.yml
vendored
48
.github/workflows/docker.yml
vendored
@@ -1,48 +0,0 @@
|
||||
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 }}
|
||||
13
.github/workflows/go.yml
vendored
13
.github/workflows/go.yml
vendored
@@ -1,15 +1,6 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'common/**'
|
||||
- 'config/**'
|
||||
- 'network/**'
|
||||
- 'server/**'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- 'main.go'
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -21,7 +12,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.21'
|
||||
go-version: 1.18
|
||||
|
||||
- name: Build Linux-amd64
|
||||
run: env GOOS=linux GOARCH=amd64 go build -v
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -6,7 +6,4 @@ vendor/
|
||||
savedata/*/
|
||||
*.exe
|
||||
*.lnk
|
||||
*.bat
|
||||
/docker/db-data
|
||||
screenshots/*
|
||||
/docker/Servers
|
||||
*.bat
|
||||
30
AUTHORS.md
30
AUTHORS.md
@@ -1,30 +0,0 @@
|
||||
# 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
14
Dockerfile
@@ -1,14 +0,0 @@
|
||||
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", "." ]
|
||||
49
README.md
49
README.md
@@ -1,52 +1,19 @@
|
||||
# Erupe
|
||||
|
||||
## Client Compatibility
|
||||
### Platforms
|
||||
- PC
|
||||
- PlayStation 3
|
||||
- PlayStation Vita
|
||||
- Wii U (Up to Z2)
|
||||
### Versions (ClientMode)
|
||||
- All versions after HR compression (G10-ZZ) have been tested extensively and have great functionality.
|
||||
- All versions available on Wii U (G3-Z2) have been tested and should have good functionality.
|
||||
- The second oldest found version is Forward.4 (FW.4), this version has basic functionality.
|
||||
- The oldest found version is Season 6.0 (S6.0), however functionality is very limited.
|
||||
|
||||
If you have an **installed** copy of Monster Hunter Frontier on an old hard drive, **please** get in contact so we can archive it!
|
||||
|
||||
# Erupe Community Edition
|
||||
## Setup
|
||||
|
||||
If you are only looking to install Erupe, please use [a pre-compiled binary](https://github.com/ZeruLight/Erupe/releases/latest).
|
||||
|
||||
If you want to modify or compile Erupe yourself, please read on.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirements
|
||||
- [Go](https://go.dev/dl/)
|
||||
- [PostgreSQL](https://www.postgresql.org/download/)
|
||||
|
||||
## Installation
|
||||
|
||||
### 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.
|
||||
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
|
||||
|
||||
### Note
|
||||
- You will need to acquire and install the client files and quest binaries separately.
|
||||
# Resources
|
||||
- [Quest and Scenario Binary Files](https://files.catbox.moe/xf0l7w.7z)
|
||||
- [Mezeporta Square Discord](https://discord.gg/DnwcpXM488)
|
||||
- [PewPewDojo Discord](https://discord.gg/CFnzbhQ)
|
||||
- [Community FAQ Pastebin](https://pastebin.com/QqAwZSTC)
|
||||
387
bundled-schema/FPointItems.sql
Normal file
387
bundled-schema/FPointItems.sql
Normal file
@@ -0,0 +1,387 @@
|
||||
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)
|
||||
@@ -138,10 +138,6 @@ func (b *ByteFrame) DataFromCurrent() []byte {
|
||||
return b.buf[b.index:b.usedSize]
|
||||
}
|
||||
|
||||
func (b *ByteFrame) Index() uint {
|
||||
return b.index
|
||||
}
|
||||
|
||||
// SetLE sets the byte order to litte endian.
|
||||
func (b *ByteFrame) SetLE() {
|
||||
b.byteOrder = binary.LittleEndian
|
||||
@@ -1,8 +1,7 @@
|
||||
package pascalstring
|
||||
|
||||
import (
|
||||
"erupe-ce/utils/byteframe"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"golang.org/x/text/encoding/japanese"
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
@@ -6,12 +6,13 @@ import (
|
||||
|
||||
// StringStack is a basic LIFO "stack" for storing strings.
|
||||
type StringStack struct {
|
||||
stack []string
|
||||
Locked bool
|
||||
stack []string
|
||||
}
|
||||
|
||||
// New creates a new instance of StringStack
|
||||
func New() *StringStack {
|
||||
return &StringStack{}
|
||||
return &StringStack{Locked: false}
|
||||
}
|
||||
|
||||
// Set sets up a new StringStack
|
||||
@@ -19,6 +20,20 @@ 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)
|
||||
@@ -26,12 +41,11 @@ 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 x, errors.New("no items on stack")
|
||||
return "", 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
|
||||
190
common/stringsupport/string_convert.go
Normal file
190
common/stringsupport/string_convert.go
Normal file
@@ -0,0 +1,190 @@
|
||||
package stringsupport
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/text/encoding"
|
||||
"golang.org/x/text/encoding/japanese"
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
|
||||
// StringConverter is a small helper for encoding/decoding strings.
|
||||
type StringConverter struct {
|
||||
Encoding encoding.Encoding
|
||||
}
|
||||
|
||||
// Decode decodes the given bytes as the set encoding.
|
||||
func (sc *StringConverter) Decode(data []byte) (string, error) {
|
||||
decoded, err := ioutil.ReadAll(transform.NewReader(bytes.NewBuffer(data), sc.Encoding.NewDecoder()))
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(decoded), nil
|
||||
}
|
||||
|
||||
// MustDecode decodes the given bytes as the set encoding. Panics on decode failure.
|
||||
func (sc *StringConverter) MustDecode(data []byte) string {
|
||||
decoded, err := sc.Decode(data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return decoded
|
||||
}
|
||||
|
||||
// Encode encodes the given string as the set encoding.
|
||||
func (sc *StringConverter) Encode(data string) ([]byte, error) {
|
||||
encoded, err := ioutil.ReadAll(transform.NewReader(bytes.NewBuffer([]byte(data)), sc.Encoding.NewEncoder()))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return encoded, nil
|
||||
}
|
||||
|
||||
// MustEncode encodes the given string as the set encoding. Panics on encode failure.
|
||||
func (sc *StringConverter) MustEncode(data string) []byte {
|
||||
encoded, err := sc.Encode(data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return encoded
|
||||
}
|
||||
|
||||
/*
|
||||
func MustConvertShiftJISToUTF8(text string) string {
|
||||
result, err := ConvertShiftJISToUTF8(text)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return result
|
||||
}
|
||||
func MustConvertUTF8ToShiftJIS(text string) string {
|
||||
result, err := ConvertUTF8ToShiftJIS(text)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return result
|
||||
}
|
||||
func ConvertShiftJISToUTF8(text string) (string, error) {
|
||||
r := bytes.NewBuffer([]byte(text))
|
||||
decoded, err := ioutil.ReadAll(transform.NewReader(r, japanese.ShiftJIS.NewDecoder()))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(decoded), nil
|
||||
}
|
||||
*/
|
||||
|
||||
func UTF8ToSJIS(x string) []byte {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
xt, _, err := transform.String(e, x)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return []byte(xt)
|
||||
}
|
||||
|
||||
func SJISToUTF8(b []byte) string {
|
||||
d := japanese.ShiftJIS.NewDecoder()
|
||||
result, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(b), d))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(result)
|
||||
}
|
||||
|
||||
func PaddedString(x string, size uint, t bool) []byte {
|
||||
if t {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
xt, _, err := transform.String(e, x)
|
||||
if err != nil {
|
||||
return make([]byte, size)
|
||||
}
|
||||
x = xt
|
||||
}
|
||||
out := make([]byte, size)
|
||||
copy(out, x)
|
||||
out[len(out)-1] = 0
|
||||
return out
|
||||
}
|
||||
|
||||
func CSVAdd(csv string, v int) string {
|
||||
if len(csv) == 0 {
|
||||
return strconv.Itoa(v)
|
||||
}
|
||||
if CSVContains(csv, v) {
|
||||
return csv
|
||||
} else {
|
||||
return csv + "," + strconv.Itoa(v)
|
||||
}
|
||||
}
|
||||
|
||||
func CSVRemove(csv string, v int) string {
|
||||
s := strings.Split(csv, ",")
|
||||
for i, e := range s {
|
||||
if e == strconv.Itoa(v) {
|
||||
s[i] = s[len(s)-1]
|
||||
s = s[:len(s)-1]
|
||||
}
|
||||
}
|
||||
return strings.Join(s, ",")
|
||||
}
|
||||
|
||||
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)
|
||||
if int(j) == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func CSVLength(csv string) int {
|
||||
if csv == "" {
|
||||
return 0
|
||||
}
|
||||
s := strings.Split(csv, ",")
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func CSVElems(csv string) []int {
|
||||
var r []int
|
||||
if csv == "" {
|
||||
return r
|
||||
}
|
||||
s := strings.Split(csv, ",")
|
||||
for i := 0; i < len(s); i++ {
|
||||
j, _ := strconv.ParseInt(s[i], 10, 64)
|
||||
r = append(r, int(j))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// ConvertUTF8ToShiftJIS converts a UTF8 string to a Shift-JIS []byte.
|
||||
func ConvertUTF8ToShiftJIS(text string) ([]byte, error) {
|
||||
r := bytes.NewBuffer([]byte(text))
|
||||
encoded, err := ioutil.ReadAll(transform.NewReader(r, japanese.ShiftJIS.NewEncoder()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return encoded, nil
|
||||
}
|
||||
|
||||
func ConvertUTF8ToSJIS(text string) (string, error) {
|
||||
r, _, err := transform.String(japanese.ShiftJIS.NewEncoder(), text)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
@@ -1,23 +1,13 @@
|
||||
package token
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
var RNG = NewRNG()
|
||||
import "math/rand"
|
||||
|
||||
// Generate returns an alphanumeric token of specified length
|
||||
func Generate(length int) string {
|
||||
var chars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
b := make([]rune, length)
|
||||
for i := range b {
|
||||
b[i] = chars[RNG.Intn(len(chars))]
|
||||
b[i] = chars[rand.Intn(len(chars))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// NewRNG returns a new NewRNG generator
|
||||
func NewRNG() *rand.Rand {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
}
|
||||
182
config.json
182
config.json
@@ -3,163 +3,66 @@
|
||||
"BinPath": "bin",
|
||||
"Language": "en",
|
||||
"DisableSoftCrash": false,
|
||||
"FeaturedWeapons": 1,
|
||||
"HideLoginNotice": true,
|
||||
"LoginNotices": [
|
||||
"<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.3!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you."
|
||||
],
|
||||
"LoginNotice": "<BODY><CENTER><SIZE_3><C_4>Welcome to Erupe SU9.1!<BR><BODY><LEFT><SIZE_2><C_5>Erupe is experimental software<C_7>, we are not liable for any<BR><BODY>issues caused by installing the software!<BR><BODY><BR><BODY><C_4>■Report bugs on Discord!<C_7><BR><BODY><BR><BODY><C_4>■Test everything!<C_7><BR><BODY><BR><BODY><C_4>■Don't talk to softlocking NPCs!<C_7><BR><BODY><BR><BODY><C_4>■Fork the code on GitHub!<C_7><BR><BODY><BR><BODY>Thank you to all of the contributors,<BR><BODY><BR><BODY>this wouldn't exist without you.",
|
||||
"PatchServerManifest": "",
|
||||
"PatchServerFile": "",
|
||||
"Screenshots":{
|
||||
"Enabled":true,
|
||||
"Host":"127.0.0.1",
|
||||
"Port":8080,
|
||||
"OutputDir":"screenshots",
|
||||
"UploadQuality":100
|
||||
},
|
||||
"ScreenshotAPIURL": "",
|
||||
"DeleteOnSaveCorruption": false,
|
||||
"ClientMode": "ZZ",
|
||||
"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": {
|
||||
"DevMode": true,
|
||||
"DevModeOptions": {
|
||||
"AutoCreateAccount": true,
|
||||
"CleanDB": false,
|
||||
"MaxLauncherHR": false,
|
||||
"LogInboundMessages": false,
|
||||
"LogOutboundMessages": false,
|
||||
"LogMessageData": false,
|
||||
"MaxHexdumpLength": 256,
|
||||
"DivaOverride": 0,
|
||||
"FestaOverride": -1,
|
||||
"TournamentOverride": 0,
|
||||
"DivaEvent": 0,
|
||||
"FestaEvent": -1,
|
||||
"TournamentEvent": 0,
|
||||
"MezFesEvent": true,
|
||||
"MezFesAlt": false,
|
||||
"DisableMailItems": true,
|
||||
"DisableTokenCheck": false,
|
||||
"QuestTools": false,
|
||||
"AutoQuestBackport": true,
|
||||
"ProxyPort": 0,
|
||||
"CapLink": {
|
||||
"Values": [51728, 20000, 51729, 1, 20000],
|
||||
"Key": "",
|
||||
"Host": "",
|
||||
"Port": 80
|
||||
"QuestDebugTools": false,
|
||||
"SaveDumps": {
|
||||
"Enabled": true,
|
||||
"OutputDir": "savedata"
|
||||
}
|
||||
},
|
||||
"GameplayOptions": {
|
||||
"MinFeatureWeapons": 0,
|
||||
"MaxFeatureWeapons": 1,
|
||||
"MaximumNP": 100000,
|
||||
"MaximumRP": 50000,
|
||||
"MaximumFP": 120000,
|
||||
"TreasureHuntExpiry": 604800,
|
||||
"DisableLoginBoost": false,
|
||||
"DisableBoostTime": false,
|
||||
"BoostTimeDuration": 7200,
|
||||
"ClanMealDuration": 3600,
|
||||
"ClanMemberLimits": [[0, 30], [3, 40], [7, 50], [10, 60]],
|
||||
"BonusQuestAllowance": 3,
|
||||
"DailyQuestAllowance": 1,
|
||||
"LowLatencyRaviente": false,
|
||||
"RegularRavienteMaxPlayers": 8,
|
||||
"ViolentRavienteMaxPlayers": 8,
|
||||
"BerserkRavienteMaxPlayers": 32,
|
||||
"ExtremeRavienteMaxPlayers": 32,
|
||||
"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,
|
||||
"DisableRoad": false,
|
||||
"SeasonOverride": false
|
||||
},
|
||||
"Discord": {
|
||||
"Enabled": false,
|
||||
"BotToken": "",
|
||||
"RelayChannel": {
|
||||
"Enabled": false,
|
||||
"MaxMessageLength": 183,
|
||||
"RelayChannelID": ""
|
||||
}
|
||||
"RealtimeChannelID": ""
|
||||
},
|
||||
"Commands": {
|
||||
"help": {
|
||||
"Enabled": true,
|
||||
"Description": "Show enabled chat commands"
|
||||
},
|
||||
"rights":{
|
||||
"Commands": [
|
||||
{
|
||||
"Name": "Rights",
|
||||
"Enabled": false,
|
||||
"Description": "Overwrite the Rights value on your account"
|
||||
},
|
||||
"ravi": {
|
||||
"Prefix": "!rights"
|
||||
}, {
|
||||
"Name": "Raviente",
|
||||
"Enabled": true,
|
||||
"Description": "Various Raviente siege commands"
|
||||
},
|
||||
"teleport": {
|
||||
"Prefix": "!ravi"
|
||||
}, {
|
||||
"Name": "Teleport",
|
||||
"Enabled": false,
|
||||
"Description": "Teleport to specified coordinates"
|
||||
},
|
||||
"reload": {
|
||||
"Prefix": "!tele"
|
||||
}, {
|
||||
"Name": "Reload",
|
||||
"Enabled": true,
|
||||
"Description": "Reload all players in your Land"
|
||||
},
|
||||
"kqf":{
|
||||
"Prefix": "!reload"
|
||||
}, {
|
||||
"Name": "KeyQuest",
|
||||
"Enabled": false,
|
||||
"Description": "Get or Set your HR Key Quest progress"
|
||||
},
|
||||
"course": {
|
||||
"Prefix": "!kqf"
|
||||
}, {
|
||||
"Name": "Course",
|
||||
"Enabled": true,
|
||||
"Description": "Toggle Courses on your account"
|
||||
},
|
||||
"psn": {
|
||||
"Enabled": true,
|
||||
"Description": "Link a PlayStation Network ID to your account"
|
||||
},
|
||||
"discord": {
|
||||
"Enabled": true,
|
||||
"Description": "Generate a token to link your Discord account"
|
||||
},
|
||||
"ban": {
|
||||
"Enabled": false,
|
||||
"Description": "Ban/Temp Ban a user"
|
||||
},
|
||||
"timer": {
|
||||
"Enabled": true,
|
||||
"Description": "Toggle the Quest timer"
|
||||
"Prefix": "!course"
|
||||
}
|
||||
},
|
||||
],
|
||||
"Courses": [
|
||||
{"Name": "HunterLife", "Enabled": true},
|
||||
{"Name": "Extra", "Enabled": true},
|
||||
@@ -170,6 +73,7 @@
|
||||
{"Name": "HunterSupport", "Enabled": false},
|
||||
{"Name": "NBoost", "Enabled": false},
|
||||
{"Name": "NetCafe", "Enabled": true},
|
||||
{"Name": "OfficialCafe", "Enabled": true},
|
||||
{"Name": "HLRenewing", "Enabled": true},
|
||||
{"Name": "EXRenewing", "Enabled": true}
|
||||
],
|
||||
@@ -184,13 +88,9 @@
|
||||
"Enabled": true,
|
||||
"Port": 53312
|
||||
},
|
||||
"API": {
|
||||
"Enabled": true,
|
||||
"Port": 8080,
|
||||
"PatchServer": "",
|
||||
"Banners": [],
|
||||
"Messages": [],
|
||||
"Links": []
|
||||
"SignV2": {
|
||||
"Enabled": false,
|
||||
"Port": 8080
|
||||
},
|
||||
"Channel": {
|
||||
"Enabled": true
|
||||
|
||||
311
config/config.go
311
config/config.go
@@ -5,217 +5,73 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type Mode int
|
||||
|
||||
const (
|
||||
S1 Mode = iota + 1
|
||||
S15
|
||||
S2
|
||||
S25
|
||||
S3
|
||||
S35
|
||||
S4
|
||||
S5
|
||||
S55
|
||||
S6
|
||||
S7
|
||||
S8
|
||||
S85
|
||||
S9
|
||||
S10
|
||||
F1
|
||||
F2
|
||||
F3
|
||||
F4
|
||||
F5
|
||||
G1
|
||||
G2
|
||||
G3
|
||||
G31
|
||||
G32
|
||||
GG
|
||||
G5
|
||||
G51
|
||||
G52
|
||||
G6
|
||||
G61
|
||||
G7
|
||||
G8
|
||||
G81
|
||||
G9
|
||||
G91
|
||||
G10
|
||||
G101
|
||||
Z1
|
||||
Z2
|
||||
ZZ
|
||||
)
|
||||
|
||||
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.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 {
|
||||
return versionStrings[m]
|
||||
}
|
||||
|
||||
// Config holds the global server-wide config.
|
||||
type Config struct {
|
||||
Host string `mapstructure:"Host"`
|
||||
BinPath string `mapstructure:"BinPath"`
|
||||
Language string
|
||||
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
|
||||
HideLoginNotice bool // Hide the Erupe notice on login
|
||||
LoginNotices []string // MHFML string of the login notices displayed
|
||||
PatchServerManifest string // Manifest patch server override
|
||||
PatchServerFile string // File patch server override
|
||||
DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion
|
||||
ClientMode string
|
||||
ClientID Mode
|
||||
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
|
||||
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
|
||||
FeaturedWeapons int // Number of Active Feature weapons to generate daily
|
||||
HideLoginNotice bool // Hide the Erupe notice on login
|
||||
LoginNotice string // MHFML string of the login notice 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
|
||||
DevMode bool
|
||||
|
||||
DebugOptions DebugOptions
|
||||
GameplayOptions GameplayOptions
|
||||
Discord Discord
|
||||
Commands map[string]Command
|
||||
Courses []Course
|
||||
Database Database
|
||||
Sign Sign
|
||||
API API
|
||||
Channel Channel
|
||||
Entrance Entrance
|
||||
DevModeOptions DevModeOptions
|
||||
Discord Discord
|
||||
Commands []Command
|
||||
Courses []Course
|
||||
Database Database
|
||||
Sign Sign
|
||||
SignV2 SignV2
|
||||
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!)
|
||||
DisableMailItems bool // Hack to prevent english versions of MHF from crashing
|
||||
QuestDebugTools bool // Enable various quest debug logs
|
||||
SaveDumps SaveDumpOptions
|
||||
}
|
||||
|
||||
type SaveDumpOptions struct {
|
||||
Enabled bool
|
||||
RawEnabled 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 {
|
||||
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
|
||||
ExtremeRavienteMaxPlayers uint8
|
||||
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
|
||||
DisableRoad bool // Disables the Hunting Road
|
||||
SeasonOverride bool // Overrides the Quest Season with the current Mezeporta Season
|
||||
Enabled bool
|
||||
OutputDir string
|
||||
}
|
||||
|
||||
// Discord holds the discord integration config.
|
||||
type Discord struct {
|
||||
Enabled bool
|
||||
BotToken string
|
||||
RelayChannel DiscordRelay
|
||||
}
|
||||
|
||||
type DiscordRelay struct {
|
||||
Enabled bool
|
||||
MaxMessageLength int
|
||||
RelayChannelID string
|
||||
Enabled bool
|
||||
BotToken string
|
||||
RealtimeChannelID string
|
||||
}
|
||||
|
||||
// Command is a channelserver chat command
|
||||
type Command struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Description string
|
||||
Prefix string
|
||||
Name string
|
||||
Enabled bool
|
||||
Prefix string
|
||||
}
|
||||
|
||||
// Course represents a course within MHF
|
||||
@@ -239,32 +95,10 @@ type Sign struct {
|
||||
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
|
||||
// SignV2 holds the new sign server config
|
||||
type SignV2 struct {
|
||||
Enabled bool
|
||||
Port int
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
@@ -300,10 +134,16 @@ type EntranceChannelInfo struct {
|
||||
CurrentPlayers uint16
|
||||
}
|
||||
|
||||
var (
|
||||
once sync.Once
|
||||
ErupeConfig *Config
|
||||
)
|
||||
var ErupeConfig *Config
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
ErupeConfig, err = LoadConfig()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to load config: %s", err.Error()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// getOutboundIP4 gets the preferred outbound ip4 of this machine
|
||||
// From https://stackoverflow.com/a/37382208
|
||||
@@ -325,8 +165,8 @@ func LoadConfig() (*Config, error) {
|
||||
viper.AddConfigPath(".")
|
||||
|
||||
viper.SetDefault("DevModeOptions.SaveDumps", SaveDumpOptions{
|
||||
Enabled: true,
|
||||
OutputDir: "save-backups",
|
||||
Enabled: false,
|
||||
OutputDir: "savedata",
|
||||
})
|
||||
|
||||
err := viper.ReadInConfig()
|
||||
@@ -344,36 +184,9 @@ func LoadConfig() (*Config, error) {
|
||||
c.Host = getOutboundIP4().To4().String()
|
||||
}
|
||||
|
||||
for i := range versionStrings {
|
||||
if strings.ToUpper(c.ClientMode) == versionStrings[i] {
|
||||
c.ClientID = Mode(i + 1)
|
||||
c.ClientMode = strings.ToUpper(c.ClientMode)
|
||||
if c.ClientID <= G101 {
|
||||
c.ClientMode += " (Debug only)"
|
||||
}
|
||||
}
|
||||
}
|
||||
if c.ClientID == 0 {
|
||||
c.ClientMode = versionStrings[len(versionStrings)-1]
|
||||
c.ClientID = ZZ
|
||||
}
|
||||
|
||||
if c.GameplayOptions.MinFeatureWeapons > c.GameplayOptions.MaxFeatureWeapons {
|
||||
c.GameplayOptions.MinFeatureWeapons = c.GameplayOptions.MaxFeatureWeapons
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
func GetConfig() *Config {
|
||||
once.Do(func() {
|
||||
var err error
|
||||
ErupeConfig, err = LoadConfig()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to load config: %s", err.Error()))
|
||||
}
|
||||
})
|
||||
return ErupeConfig
|
||||
}
|
||||
|
||||
func preventClose(text string) {
|
||||
if ErupeConfig.DisableSoftCrash {
|
||||
os.Exit(0)
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# Docker for erupe
|
||||
|
||||
## Building the container
|
||||
Run the following from the route of the soruce 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.
|
||||
@@ -1,71 +0,0 @@
|
||||
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
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/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
|
||||
61
go.mod
61
go.mod
@@ -1,38 +1,43 @@
|
||||
module erupe-ce
|
||||
|
||||
go 1.21
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/bwmarrin/discordgo v0.27.1
|
||||
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.17.0
|
||||
go.uber.org/zap v1.26.0
|
||||
golang.org/x/crypto v0.17.0
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
||||
golang.org/x/text v0.14.0
|
||||
github.com/bwmarrin/discordgo v0.23.2
|
||||
github.com/gorilla/handlers v1.5.1
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/jmoiron/sqlx v1.3.4
|
||||
github.com/lib/pq v1.10.4
|
||||
github.com/spf13/viper v1.8.1
|
||||
go.uber.org/zap v1.18.1
|
||||
golang.org/x/crypto v0.1.0
|
||||
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f
|
||||
golang.org/x/text v0.7.0
|
||||
)
|
||||
|
||||
require (
|
||||
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/felixge/httpsnoop v1.0.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.4.9 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.6.0 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // 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.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/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/pelletier/go-toml v1.9.3 // indirect
|
||||
github.com/rivo/tview v0.0.0-20230226195229-47e7db7885b4 // indirect
|
||||
github.com/rivo/uniseg v0.4.3 // indirect
|
||||
github.com/spf13/afero v1.6.0 // indirect
|
||||
github.com/spf13/cast v1.3.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/net v0.18.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.7.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/term v0.5.0 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
325
go.sum
325
go.sum
@@ -3,7 +3,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
@@ -16,7 +15,9 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
@@ -25,6 +26,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
@@ -34,12 +36,19 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
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/bwmarrin/discordgo v0.27.1 h1:ib9AIc/dom1E/fSIulrBwnez0CToJE113ZGt4HoliGY=
|
||||
github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||
github.com/bwmarrin/discordgo v0.23.2 h1:BzrtTktixGHIu9Tt7dEE6diysEF9HWnXeHuoJEt2fH4=
|
||||
github.com/bwmarrin/discordgo v0.23.2/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
@@ -48,27 +57,35 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
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/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
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/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/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.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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
|
||||
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
|
||||
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
|
||||
github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg=
|
||||
github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
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=
|
||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
@@ -80,6 +97,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@@ -94,6 +112,9 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
@@ -104,9 +125,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
@@ -119,109 +141,168 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
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.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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
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/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/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/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
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=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g=
|
||||
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
|
||||
github.com/jmoiron/sqlx v1.3.4 h1:wv+0IJZfL5z0uZoUjlpKgHkgaFSYD+r9CfrXjEXsO7w=
|
||||
github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
|
||||
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg=
|
||||
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.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/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
|
||||
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
|
||||
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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rivo/tview v0.0.0-20230226195229-47e7db7885b4 h1:tj6c++jeZxE3+Z+8+3/HOY/KpqaVt1tZ8i6sNRmjQ1M=
|
||||
github.com/rivo/tview v0.0.0-20230226195229-47e7db7885b4/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
|
||||
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
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/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/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
|
||||
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
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.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
|
||||
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
|
||||
github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
|
||||
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
||||
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.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
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.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
|
||||
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
|
||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec=
|
||||
go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
|
||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4=
|
||||
go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
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=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
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.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
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=
|
||||
@@ -232,8 +313,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-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
|
||||
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f h1:Al51T6tzvuh3oiwX11vex3QgJ2XTedFPGmbEVh8cdoc=
|
||||
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
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=
|
||||
@@ -247,6 +328,8 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
@@ -257,8 +340,12 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
@@ -285,12 +372,13 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
|
||||
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
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=
|
||||
@@ -300,6 +388,9 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
|
||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -310,7 +401,11 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -320,6 +415,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -341,23 +437,32 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
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-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
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=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
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=
|
||||
@@ -367,6 +472,7 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
@@ -376,6 +482,8 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
@@ -398,6 +506,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
@@ -406,8 +515,11 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f
|
||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -431,6 +543,9 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513
|
||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
@@ -461,6 +576,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
@@ -472,8 +588,12 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D
|
||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
@@ -487,9 +607,13 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -500,17 +624,22 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
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=
|
||||
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
BinaryMessageTypeState = 0
|
||||
BinaryMessageTypeChat = 1
|
||||
BinaryMessageTypeQuest = 2
|
||||
BinaryMessageTypeData = 3
|
||||
BinaryMessageTypeMailNotify = 4
|
||||
BinaryMessageTypeEmote = 6
|
||||
)
|
||||
|
||||
// MSG_SYS_CAST[ED]_BINARY broadcast types enum
|
||||
const (
|
||||
BroadcastTypeTargeted = 0x01
|
||||
BroadcastTypeStage = 0x03
|
||||
BroadcastTypeServer = 0x06
|
||||
BroadcastTypeWorld = 0x0a
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
package constant
|
||||
|
||||
import "erupe-ce/internal/model"
|
||||
|
||||
const (
|
||||
FestivalColorNone model.FestivalColor = "none"
|
||||
FestivalColorBlue model.FestivalColor = "blue"
|
||||
FestivalColorRed model.FestivalColor = "red"
|
||||
)
|
||||
|
||||
var FestivalColorCodes = map[model.FestivalColor]int16{
|
||||
FestivalColorNone: -1,
|
||||
FestivalColorBlue: 0,
|
||||
FestivalColorRed: 1,
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package constant
|
||||
|
||||
import "erupe-ce/internal/model"
|
||||
|
||||
const (
|
||||
GuildApplicationTypeApplied model.GuildApplicationType = "applied"
|
||||
GuildApplicationTypeInvited model.GuildApplicationType = "invited"
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
package model
|
||||
|
||||
type Achievement struct {
|
||||
Level uint8
|
||||
Value uint32
|
||||
NextValue uint16
|
||||
Required uint32
|
||||
Updated bool
|
||||
Progress uint32
|
||||
Trophy uint8
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package model
|
||||
|
||||
type Airou struct {
|
||||
ID uint32
|
||||
Name []byte
|
||||
Task uint8
|
||||
Personality uint8
|
||||
Class uint8
|
||||
Experience uint32
|
||||
WeaponType uint8
|
||||
WeaponID uint16
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package model
|
||||
|
||||
type CafeBonus struct {
|
||||
ID uint32 `db:"id"`
|
||||
TimeReq uint32 `db:"time_req"`
|
||||
ItemType uint32 `db:"item_type"`
|
||||
ItemID uint32 `db:"item_id"`
|
||||
Quantity uint32 `db:"quantity"`
|
||||
Claimed bool `db:"claimed"`
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type CampaignEvent struct {
|
||||
ID uint32
|
||||
Unk0 uint32
|
||||
MinHR int16
|
||||
MaxHR int16
|
||||
MinSR int16
|
||||
MaxSR int16
|
||||
MinGR int16
|
||||
MaxGR int16
|
||||
Unk1 uint16
|
||||
Unk2 uint8
|
||||
Unk3 uint8
|
||||
Unk4 uint16
|
||||
Unk5 uint16
|
||||
Start time.Time
|
||||
End time.Time
|
||||
Unk6 uint8
|
||||
String0 string
|
||||
String1 string
|
||||
String2 string
|
||||
String3 string
|
||||
Link string
|
||||
Prefix string
|
||||
Categories []uint16
|
||||
}
|
||||
|
||||
type CampaignCategory struct {
|
||||
ID uint16
|
||||
Type uint8
|
||||
Title string
|
||||
Description string
|
||||
}
|
||||
|
||||
type CampaignLink struct {
|
||||
CategoryID uint16
|
||||
CampaignID uint32
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Distribution struct {
|
||||
ID uint32 `db:"id"`
|
||||
Deadline time.Time `db:"deadline"`
|
||||
Rights uint32 `db:"rights"`
|
||||
TimesAcceptable uint16 `db:"times_acceptable"`
|
||||
TimesAccepted uint16 `db:"times_accepted"`
|
||||
MinHR int16 `db:"min_hr"`
|
||||
MaxHR int16 `db:"max_hr"`
|
||||
MinSR int16 `db:"min_sr"`
|
||||
MaxSR int16 `db:"max_sr"`
|
||||
MinGR int16 `db:"min_gr"`
|
||||
MaxGR int16 `db:"max_gr"`
|
||||
EventName string `db:"event_name"`
|
||||
Description string `db:"description"`
|
||||
Selection bool `db:"selection"`
|
||||
}
|
||||
|
||||
type DistributionItem struct {
|
||||
ItemType uint8 `db:"item_type"`
|
||||
ID uint32 `db:"id"`
|
||||
ItemID uint32 `db:"item_id"`
|
||||
Quantity uint32 `db:"quantity"`
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Event struct {
|
||||
EventType uint16
|
||||
Unk1 uint16
|
||||
Unk2 uint16
|
||||
Unk3 uint16
|
||||
Unk4 uint16
|
||||
Unk5 uint32
|
||||
Unk6 uint32
|
||||
QuestFileIDs []uint16
|
||||
}
|
||||
|
||||
type LoginBoost struct {
|
||||
WeekReq uint8 `db:"week_req"`
|
||||
WeekCount uint8
|
||||
Active bool
|
||||
Expiration time.Time `db:"expiration"`
|
||||
Reset time.Time `db:"reset"`
|
||||
}
|
||||
|
||||
type ActiveFeature struct {
|
||||
StartTime time.Time `db:"start_time"`
|
||||
ActiveFeatures uint32 `db:"featured"`
|
||||
}
|
||||
type TrendWeapon struct {
|
||||
WeaponType uint8
|
||||
WeaponID uint16
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package model
|
||||
|
||||
type FestaTrial struct {
|
||||
ID uint32 `db:"id"`
|
||||
Objective uint16 `db:"objective"`
|
||||
GoalID uint32 `db:"goal_id"`
|
||||
TimesReq uint16 `db:"times_req"`
|
||||
Locale uint16 `db:"locale_req"`
|
||||
Reward uint16 `db:"reward"`
|
||||
Monopoly FestivalColor `db:"monopoly"`
|
||||
Unk uint16
|
||||
}
|
||||
|
||||
type FestaReward struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
ItemType uint16
|
||||
Quantity uint16
|
||||
ItemID uint16
|
||||
Unk5 uint16
|
||||
Unk6 uint16
|
||||
Unk7 uint8
|
||||
}
|
||||
|
||||
type FestaPrize struct {
|
||||
ID uint32 `db:"id"`
|
||||
Tier uint32 `db:"tier"`
|
||||
SoulsReq uint32 `db:"souls_req"`
|
||||
ItemID uint32 `db:"item_id"`
|
||||
NumItem uint32 `db:"num_item"`
|
||||
Claimed int `db:"claimed"`
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package model
|
||||
|
||||
type ShopItem struct {
|
||||
ID uint32 `db:"id"`
|
||||
ItemID uint32 `db:"item_id"`
|
||||
Cost uint32 `db:"cost"`
|
||||
Quantity uint16 `db:"quantity"`
|
||||
MinHR uint16 `db:"min_hr"`
|
||||
MinSR uint16 `db:"min_sr"`
|
||||
MinGR uint16 `db:"min_gr"`
|
||||
StoreLevel uint8 `db:"store_level"`
|
||||
MaxQuantity uint16 `db:"max_quantity"`
|
||||
UsedQuantity uint16 `db:"used_quantity"`
|
||||
RoadFloors uint16 `db:"road_floors"`
|
||||
RoadFatalis uint16 `db:"road_fatalis"`
|
||||
}
|
||||
|
||||
type Gacha struct {
|
||||
ID uint32 `db:"id"`
|
||||
MinGR uint32 `db:"min_gr"`
|
||||
MinHR uint32 `db:"min_hr"`
|
||||
Name string `db:"name"`
|
||||
URLBanner string `db:"url_banner"`
|
||||
URLFeature string `db:"url_feature"`
|
||||
URLThumbnail string `db:"url_thumbnail"`
|
||||
Wide bool `db:"wide"`
|
||||
Recommended bool `db:"recommended"`
|
||||
GachaType uint8 `db:"gacha_type"`
|
||||
Hidden bool `db:"hidden"`
|
||||
}
|
||||
|
||||
type GachaEntry struct {
|
||||
EntryType uint8 `db:"entry_type"`
|
||||
ID uint32 `db:"id"`
|
||||
ItemType uint8 `db:"item_type"`
|
||||
ItemNumber uint32 `db:"item_number"`
|
||||
ItemQuantity uint16 `db:"item_quantity"`
|
||||
Weight float64 `db:"weight"`
|
||||
Rarity uint8 `db:"rarity"`
|
||||
Rolls uint8 `db:"rolls"`
|
||||
FrontierPoints uint16 `db:"frontier_points"`
|
||||
DailyLimit uint8 `db:"daily_limit"`
|
||||
Name string `db:"name"`
|
||||
}
|
||||
|
||||
type GachaItem struct {
|
||||
ItemType uint8 `db:"item_type"`
|
||||
ItemID uint16 `db:"item_id"`
|
||||
Quantity uint16 `db:"quantity"`
|
||||
}
|
||||
type FPointExchange struct {
|
||||
ID uint32 `db:"id"`
|
||||
ItemType uint8 `db:"item_type"`
|
||||
ItemID uint16 `db:"item_id"`
|
||||
Quantity uint16 `db:"quantity"`
|
||||
FPoints uint16 `db:"fpoints"`
|
||||
Buyable bool `db:"buyable"`
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type GuildAdventure struct {
|
||||
ID uint32 `db:"id"`
|
||||
Destination uint32 `db:"destination"`
|
||||
Charge uint32 `db:"charge"`
|
||||
Depart uint32 `db:"depart"`
|
||||
Return uint32 `db:"return"`
|
||||
CollectedBy string `db:"collected_by"`
|
||||
}
|
||||
|
||||
type GuildTreasureHunt struct {
|
||||
HuntID uint32 `db:"id"`
|
||||
HostID uint32 `db:"host_id"`
|
||||
Destination uint32 `db:"destination"`
|
||||
Level uint32 `db:"level"`
|
||||
Start time.Time `db:"start"`
|
||||
Acquired bool `db:"acquired"`
|
||||
Collected bool `db:"collected"`
|
||||
HuntData []byte `db:"hunt_data"`
|
||||
Hunters uint32 `db:"hunters"`
|
||||
Claimed bool `db:"claimed"`
|
||||
}
|
||||
type GuildTreasureSouvenir struct {
|
||||
Destination uint32
|
||||
Quantity uint32
|
||||
}
|
||||
|
||||
type FestivalColor string
|
||||
type GuildApplicationType string
|
||||
|
||||
type GuildIconPart struct {
|
||||
Index uint16
|
||||
ID uint16
|
||||
Page uint8
|
||||
Size uint8
|
||||
Rotation uint8
|
||||
Red uint8
|
||||
Green uint8
|
||||
Blue uint8
|
||||
PosX uint16
|
||||
PosY uint16
|
||||
}
|
||||
|
||||
type GuildApplication struct {
|
||||
ID int `db:"id"`
|
||||
GuildID uint32 `db:"guild_id"`
|
||||
CharID uint32 `db:"character_id"`
|
||||
ActorID uint32 `db:"actor_id"`
|
||||
ApplicationType GuildApplicationType `db:"application_type"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
type GuildLeader struct {
|
||||
LeaderCharID uint32 `db:"leader_id"`
|
||||
LeaderName string `db:"leader_name"`
|
||||
}
|
||||
type MessageBoardPost struct {
|
||||
ID uint32 `db:"id"`
|
||||
StampID uint32 `db:"stamp_id"`
|
||||
Title string `db:"title"`
|
||||
Body string `db:"body"`
|
||||
AuthorID uint32 `db:"author_id"`
|
||||
Timestamp time.Time `db:"created_at"`
|
||||
LikedBy string `db:"liked_by"`
|
||||
}
|
||||
|
||||
type GuildMeal struct {
|
||||
ID uint32 `db:"id"`
|
||||
MealID uint32 `db:"meal_id"`
|
||||
Level uint32 `db:"level"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
type GuildMission struct {
|
||||
ID uint32
|
||||
Unk uint32
|
||||
Type uint16
|
||||
Goal uint16
|
||||
Quantity uint16
|
||||
SkipTickets uint16
|
||||
GR bool
|
||||
RewardType uint16
|
||||
RewardLevel uint16
|
||||
}
|
||||
|
||||
type GuildAllianceInvite struct {
|
||||
GuildID uint32
|
||||
LeaderID uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Members uint16
|
||||
GuildName string
|
||||
LeaderName string
|
||||
}
|
||||
type UnkGuildInfo struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type HouseData struct {
|
||||
CharID uint32 `db:"id"`
|
||||
HR uint16 `db:"hr"`
|
||||
GR uint16 `db:"gr"`
|
||||
Name string `db:"name"`
|
||||
HouseState uint8 `db:"house_state"`
|
||||
HousePassword string `db:"house_password"`
|
||||
}
|
||||
type Title struct {
|
||||
ID uint16 `db:"id"`
|
||||
Acquired time.Time `db:"unlocked_at"`
|
||||
Updated time.Time `db:"updated_at"`
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type PaperMissionTimetable struct {
|
||||
Start time.Time
|
||||
End time.Time
|
||||
}
|
||||
|
||||
type PaperMissionData struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 int16
|
||||
Reward1ID uint16
|
||||
Reward1Quantity uint8
|
||||
Reward2ID uint16
|
||||
Reward2Quantity uint8
|
||||
}
|
||||
|
||||
type PaperMission struct {
|
||||
Timetables []PaperMissionTimetable
|
||||
Data []PaperMissionData
|
||||
}
|
||||
|
||||
type PaperData struct {
|
||||
Unk0 uint16
|
||||
Unk1 int16
|
||||
Unk2 int16
|
||||
Unk3 int16
|
||||
Unk4 int16
|
||||
Unk5 int16
|
||||
Unk6 int16
|
||||
}
|
||||
|
||||
type PaperGift struct {
|
||||
Unk0 uint16
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
Unk3 uint16
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type RyoudamaReward struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 uint16
|
||||
Unk4 uint16
|
||||
Unk5 uint16
|
||||
}
|
||||
|
||||
type RyoudamaKeyScore struct {
|
||||
Unk0 uint8
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
type RyoudamaCharInfo struct {
|
||||
CID uint32
|
||||
Unk0 int32
|
||||
Name string
|
||||
}
|
||||
|
||||
type RyoudamaBoostInfo struct {
|
||||
Start time.Time
|
||||
End time.Time
|
||||
}
|
||||
|
||||
type Ryoudama struct {
|
||||
Reward []RyoudamaReward
|
||||
KeyScore []RyoudamaKeyScore
|
||||
CharInfo []RyoudamaCharInfo
|
||||
BoostInfo []RyoudamaBoostInfo
|
||||
Score []int32
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type SeibattleTimetable struct {
|
||||
Start time.Time
|
||||
End time.Time
|
||||
}
|
||||
|
||||
type SeibattleKeyScore struct {
|
||||
Unk0 uint8
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
type SeibattleCareer struct {
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Unk2 uint16
|
||||
}
|
||||
|
||||
type SeibattleOpponent struct {
|
||||
Unk0 int32
|
||||
Unk1 int8
|
||||
}
|
||||
|
||||
type SeibattleConventionResult struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint16
|
||||
Unk2 uint16
|
||||
Unk3 uint16
|
||||
Unk4 uint16
|
||||
}
|
||||
|
||||
type SeibattleCharScore struct {
|
||||
Unk0 uint32
|
||||
}
|
||||
|
||||
type SeibattleCurResult struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint16
|
||||
Unk2 uint16
|
||||
Unk3 uint16
|
||||
}
|
||||
|
||||
type Seibattle struct {
|
||||
Timetable []SeibattleTimetable
|
||||
KeyScore []SeibattleKeyScore
|
||||
Career []SeibattleCareer
|
||||
Opponent []SeibattleOpponent
|
||||
ConventionResult []SeibattleConventionResult
|
||||
CharScore []SeibattleCharScore
|
||||
CurResult []SeibattleCurResult
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TournamentInfo0 struct {
|
||||
ID uint32
|
||||
MaxPlayers uint32
|
||||
CurrentPlayers uint32
|
||||
Unk1 uint16
|
||||
TextColor uint16
|
||||
Unk2 uint32
|
||||
Time1 time.Time
|
||||
Time2 time.Time
|
||||
Time3 time.Time
|
||||
Time4 time.Time
|
||||
Time5 time.Time
|
||||
Time6 time.Time
|
||||
Unk3 uint8
|
||||
Unk4 uint8
|
||||
MinHR uint32
|
||||
MaxHR uint32
|
||||
Unk5 string
|
||||
Unk6 string
|
||||
}
|
||||
|
||||
type TournamentInfo21 struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint8
|
||||
}
|
||||
|
||||
type TournamentInfo22 struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint8
|
||||
Unk4 string
|
||||
}
|
||||
|
||||
type TournamentReward struct {
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Unk2 uint16
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TowerInfoTRP struct {
|
||||
TR int32
|
||||
TRP int32
|
||||
}
|
||||
|
||||
type TowerInfoSkill struct {
|
||||
TSP int32
|
||||
Skills []int16 // 64
|
||||
}
|
||||
|
||||
type TowerInfoHistory struct {
|
||||
Unk0 []int16 // 5
|
||||
Unk1 []int16 // 5
|
||||
}
|
||||
|
||||
type TowerInfoLevel struct {
|
||||
Floors int32
|
||||
Unk1 int32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
}
|
||||
|
||||
type GemInfo struct {
|
||||
Gem uint16
|
||||
Quantity uint16
|
||||
}
|
||||
|
||||
type GemHistory struct {
|
||||
Gem uint16
|
||||
Message uint16
|
||||
Timestamp time.Time
|
||||
Sender string
|
||||
}
|
||||
type TenrouiraiProgress struct {
|
||||
Page uint8
|
||||
Mission1 uint16
|
||||
Mission2 uint16
|
||||
Mission3 uint16
|
||||
}
|
||||
|
||||
type TenrouiraiReward struct {
|
||||
Index uint8
|
||||
Item []uint16 // 5
|
||||
Quantity []uint8 // 5
|
||||
}
|
||||
|
||||
type TenrouiraiKeyScore struct {
|
||||
Unk0 uint8
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
type TenrouiraiData struct {
|
||||
Block uint8
|
||||
Mission uint8
|
||||
// 1 = Floors climbed
|
||||
// 2 = Collect antiques
|
||||
// 3 = Open chests
|
||||
// 4 = Cats saved
|
||||
// 5 = TRP acquisition
|
||||
// 6 = Monster slays
|
||||
Goal uint16
|
||||
Cost uint16
|
||||
Skill1 uint8 // 80
|
||||
Skill2 uint8 // 40
|
||||
Skill3 uint8 // 40
|
||||
Skill4 uint8 // 20
|
||||
Skill5 uint8 // 40
|
||||
Skill6 uint8 // 50
|
||||
}
|
||||
|
||||
type TenrouiraiCharScore struct {
|
||||
Score int32
|
||||
Name string
|
||||
}
|
||||
|
||||
type TenrouiraiTicket struct {
|
||||
Unk0 uint8
|
||||
RP uint32
|
||||
Unk2 uint32
|
||||
}
|
||||
|
||||
type Tenrouirai struct {
|
||||
Progress []TenrouiraiProgress
|
||||
Reward []TenrouiraiReward
|
||||
KeyScore []TenrouiraiKeyScore
|
||||
Data []TenrouiraiData
|
||||
CharScore []TenrouiraiCharScore
|
||||
Ticket []TenrouiraiTicket
|
||||
}
|
||||
type TowerInfo struct {
|
||||
TRP []TowerInfoTRP
|
||||
Skill []TowerInfoSkill
|
||||
History []TowerInfoHistory
|
||||
Level []TowerInfoLevel
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"erupe-ce/config"
|
||||
"erupe-ce/server/channelserver/compression/nullcomp"
|
||||
"erupe-ce/utils/bfutil"
|
||||
"erupe-ce/utils/database"
|
||||
"erupe-ce/utils/logger"
|
||||
"erupe-ce/utils/stringsupport"
|
||||
"fmt"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type SavePointer int
|
||||
|
||||
const (
|
||||
pGender = iota // +1
|
||||
pRP // +2
|
||||
pHouseTier // +5
|
||||
pHouseData // +195
|
||||
pBookshelfData // +lBookshelfData
|
||||
pGalleryData // +1748
|
||||
pToreData // +240
|
||||
pGardenData // +68
|
||||
pWeaponType // +1
|
||||
pWeaponID // +2
|
||||
pHR // +2
|
||||
pGRP // +4
|
||||
pKQF // +8
|
||||
lBookshelfData
|
||||
)
|
||||
|
||||
type CharacterSaveData struct {
|
||||
CharID uint32
|
||||
Name string
|
||||
IsNewCharacter bool
|
||||
Pointers map[SavePointer]int
|
||||
|
||||
Gender bool
|
||||
RP uint16
|
||||
HouseTier []byte
|
||||
HouseData []byte
|
||||
BookshelfData []byte
|
||||
GalleryData []byte
|
||||
ToreData []byte
|
||||
GardenData []byte
|
||||
WeaponType uint8
|
||||
WeaponID uint16
|
||||
HR uint16
|
||||
GR uint16
|
||||
KQF []byte
|
||||
|
||||
compSave []byte
|
||||
decompSave []byte
|
||||
}
|
||||
|
||||
func getPointers() map[SavePointer]int {
|
||||
pointers := map[SavePointer]int{pGender: 81, lBookshelfData: 5576}
|
||||
switch config.GetConfig().ClientID {
|
||||
case config.ZZ:
|
||||
pointers[pWeaponID] = 128522
|
||||
pointers[pWeaponType] = 128789
|
||||
pointers[pHouseTier] = 129900
|
||||
pointers[pToreData] = 130228
|
||||
pointers[pHR] = 130550
|
||||
pointers[pGRP] = 130556
|
||||
pointers[pHouseData] = 130561
|
||||
pointers[pBookshelfData] = 139928
|
||||
pointers[pGalleryData] = 140064
|
||||
pointers[pGardenData] = 142424
|
||||
pointers[pRP] = 142614
|
||||
pointers[pKQF] = 146720
|
||||
case config.Z2, config.Z1, config.G101, config.G10, config.G91, config.G9, config.G81, config.G8,
|
||||
config.G7, config.G61, config.G6, config.G52, config.G51, config.G5, config.GG, config.G32, config.G31,
|
||||
config.G3, config.G2, config.G1:
|
||||
pointers[pWeaponID] = 92522
|
||||
pointers[pWeaponType] = 92789
|
||||
pointers[pHouseTier] = 93900
|
||||
pointers[pToreData] = 94228
|
||||
pointers[pHR] = 94550
|
||||
pointers[pGRP] = 94556
|
||||
pointers[pHouseData] = 94561
|
||||
pointers[pBookshelfData] = 89118 // TODO: fix bookshelf data pointer
|
||||
pointers[pGalleryData] = 104064
|
||||
pointers[pGardenData] = 106424
|
||||
pointers[pRP] = 106614
|
||||
pointers[pKQF] = 110720
|
||||
case config.F5, config.F4:
|
||||
pointers[pWeaponID] = 60522
|
||||
pointers[pWeaponType] = 60789
|
||||
pointers[pHouseTier] = 61900
|
||||
pointers[pToreData] = 62228
|
||||
pointers[pHR] = 62550
|
||||
pointers[pHouseData] = 62561
|
||||
pointers[pBookshelfData] = 57118 // TODO: fix bookshelf data pointer
|
||||
pointers[pGalleryData] = 72064
|
||||
pointers[pGardenData] = 74424
|
||||
pointers[pRP] = 74614
|
||||
case config.S6:
|
||||
pointers[pWeaponID] = 12522
|
||||
pointers[pWeaponType] = 12789
|
||||
pointers[pHouseTier] = 13900
|
||||
pointers[pToreData] = 14228
|
||||
pointers[pHR] = 14550
|
||||
pointers[pHouseData] = 14561
|
||||
pointers[pBookshelfData] = 9118 // TODO: fix bookshelf data pointer
|
||||
pointers[pGalleryData] = 24064
|
||||
pointers[pGardenData] = 26424
|
||||
pointers[pRP] = 26614
|
||||
}
|
||||
if config.GetConfig().ClientID == config.G5 {
|
||||
pointers[lBookshelfData] = 5548
|
||||
} else if config.GetConfig().ClientID <= config.GG {
|
||||
pointers[lBookshelfData] = 4520
|
||||
}
|
||||
return pointers
|
||||
}
|
||||
|
||||
func GetCharacterSaveData(charID uint32) (*CharacterSaveData, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
result, err := db.Query("SELECT id, savedata, is_new_character, name FROM characters WHERE id = $1", charID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get savedata", zap.Error(err), zap.Uint32("charID", charID))
|
||||
return nil, err
|
||||
}
|
||||
defer result.Close()
|
||||
if !result.Next() {
|
||||
err = errors.New("no savedata found")
|
||||
logger.Error("No savedata found", zap.Uint32("charID", charID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
saveData := &CharacterSaveData{
|
||||
Pointers: getPointers(),
|
||||
}
|
||||
err = result.Scan(&saveData.CharID, &saveData.compSave, &saveData.IsNewCharacter, &saveData.Name)
|
||||
if err != nil {
|
||||
logger.Error("Failed to scan savedata", zap.Error(err), zap.Uint32("charID", charID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if saveData.compSave == nil {
|
||||
return saveData, nil
|
||||
}
|
||||
|
||||
err = saveData.Decompress()
|
||||
if err != nil {
|
||||
logger.Error("Failed to decompress savedata", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
saveData.UpdateStructWithSaveData()
|
||||
|
||||
return saveData, nil
|
||||
}
|
||||
|
||||
type SessionCharacter interface {
|
||||
Setkqf(data []byte)
|
||||
Getkqf() []byte
|
||||
GetkqfOverride() bool
|
||||
GetCharID() uint32
|
||||
}
|
||||
|
||||
func (save *CharacterSaveData) Save(s SessionCharacter) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
if !s.GetkqfOverride() {
|
||||
s.Setkqf(save.KQF)
|
||||
} else {
|
||||
save.KQF = s.Getkqf()
|
||||
}
|
||||
|
||||
save.updateSaveDataWithStruct()
|
||||
|
||||
if config.GetConfig().ClientID >= config.G1 {
|
||||
err := save.Compress()
|
||||
if err != nil {
|
||||
logger.Error("Failed to compress savedata", zap.Error(err))
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// Saves were not compressed
|
||||
save.compSave = save.decompSave
|
||||
}
|
||||
|
||||
_, err = db.Exec(`UPDATE characters SET savedata=$1, is_new_character=false, hr=$2, gr=$3, is_female=$4, weapon_type=$5, weapon_id=$6 WHERE id=$7
|
||||
`, save.compSave, save.HR, save.GR, save.Gender, save.WeaponType, save.WeaponID, save.CharID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to update savedata", zap.Error(err), zap.Uint32("charID", save.CharID))
|
||||
}
|
||||
|
||||
db.Exec(`UPDATE user_binary SET house_tier=$1, house_data=$2, bookshelf=$3, gallery=$4, tore=$5, garden=$6 WHERE id=$7
|
||||
`, save.HouseTier, save.HouseData, save.BookshelfData, save.GalleryData, save.ToreData, save.GardenData, s.GetCharID())
|
||||
}
|
||||
|
||||
func (save *CharacterSaveData) Compress() error {
|
||||
var err error
|
||||
save.compSave, err = nullcomp.Compress(save.decompSave)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (save *CharacterSaveData) Decompress() error {
|
||||
var err error
|
||||
save.decompSave, err = nullcomp.Decompress(save.compSave)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// This will update the character save with the values stored in the save struct
|
||||
func (save *CharacterSaveData) updateSaveDataWithStruct() {
|
||||
rpBytes := make([]byte, 2)
|
||||
binary.LittleEndian.PutUint16(rpBytes, save.RP)
|
||||
if config.GetConfig().ClientID >= config.F4 {
|
||||
copy(save.decompSave[save.Pointers[pRP]:save.Pointers[pRP]+2], rpBytes)
|
||||
}
|
||||
if config.GetConfig().ClientID >= config.G10 {
|
||||
copy(save.decompSave[save.Pointers[pKQF]:save.Pointers[pKQF]+8], save.KQF)
|
||||
}
|
||||
}
|
||||
|
||||
// This will update the save struct with the values stored in the character save
|
||||
func (save *CharacterSaveData) UpdateStructWithSaveData() {
|
||||
save.Name = stringsupport.SJISToUTF8(bfutil.UpToNull(save.decompSave[88:100]))
|
||||
if save.decompSave[save.Pointers[pGender]] == 1 {
|
||||
save.Gender = true
|
||||
} else {
|
||||
save.Gender = false
|
||||
}
|
||||
if !save.IsNewCharacter {
|
||||
if config.GetConfig().ClientID >= config.S6 {
|
||||
save.RP = binary.LittleEndian.Uint16(save.decompSave[save.Pointers[pRP] : save.Pointers[pRP]+2])
|
||||
save.HouseTier = save.decompSave[save.Pointers[pHouseTier] : save.Pointers[pHouseTier]+5]
|
||||
save.HouseData = save.decompSave[save.Pointers[pHouseData] : save.Pointers[pHouseData]+195]
|
||||
save.BookshelfData = save.decompSave[save.Pointers[pBookshelfData] : save.Pointers[pBookshelfData]+save.Pointers[lBookshelfData]]
|
||||
save.GalleryData = save.decompSave[save.Pointers[pGalleryData] : save.Pointers[pGalleryData]+1748]
|
||||
save.ToreData = save.decompSave[save.Pointers[pToreData] : save.Pointers[pToreData]+240]
|
||||
save.GardenData = save.decompSave[save.Pointers[pGardenData] : save.Pointers[pGardenData]+68]
|
||||
save.WeaponType = save.decompSave[save.Pointers[pWeaponType]]
|
||||
save.WeaponID = binary.LittleEndian.Uint16(save.decompSave[save.Pointers[pWeaponID] : save.Pointers[pWeaponID]+2])
|
||||
save.HR = binary.LittleEndian.Uint16(save.decompSave[save.Pointers[pHR] : save.Pointers[pHR]+2])
|
||||
if config.GetConfig().ClientID >= config.G1 {
|
||||
if save.HR == uint16(999) {
|
||||
save.GR = grpToGR(int(binary.LittleEndian.Uint32(save.decompSave[save.Pointers[pGRP] : save.Pointers[pGRP]+4])))
|
||||
}
|
||||
}
|
||||
if config.GetConfig().ClientID >= config.G10 {
|
||||
save.KQF = save.decompSave[save.Pointers[pKQF] : save.Pointers[pKQF]+8]
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
func grpToGR(n int) uint16 {
|
||||
var gr int
|
||||
a := []int{208750, 593400, 993400, 1400900, 2315900, 3340900, 4505900, 5850900, 7415900, 9230900, 11345900, 100000000}
|
||||
b := []int{7850, 8000, 8150, 9150, 10250, 11650, 13450, 15650, 18150, 21150, 23950}
|
||||
c := []int{51, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900}
|
||||
|
||||
for i := 0; i < len(a); i++ {
|
||||
if n < a[i] {
|
||||
if i == 0 {
|
||||
for {
|
||||
n -= 500
|
||||
if n <= 500 {
|
||||
if n < 0 {
|
||||
i--
|
||||
}
|
||||
break
|
||||
} else {
|
||||
i++
|
||||
for j := 0; j < i; j++ {
|
||||
n -= 150
|
||||
}
|
||||
}
|
||||
}
|
||||
gr = i + 2
|
||||
} else {
|
||||
n -= a[i-1]
|
||||
gr = c[i-1]
|
||||
gr += n / b[i-1]
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return uint16(gr)
|
||||
}
|
||||
|
||||
func (save *CharacterSaveData) GetDecompSave() []byte {
|
||||
return save.decompSave
|
||||
}
|
||||
|
||||
func (save *CharacterSaveData) SetDecompSave(decompSave []byte) {
|
||||
save.decompSave = decompSave
|
||||
}
|
||||
@@ -1,641 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"erupe-ce/config"
|
||||
"erupe-ce/internal/model"
|
||||
"erupe-ce/utils/database"
|
||||
"erupe-ce/utils/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type Guild struct {
|
||||
ID uint32 `db:"id"`
|
||||
Name string `db:"name"`
|
||||
MainMotto uint8 `db:"main_motto"`
|
||||
SubMotto uint8 `db:"sub_motto"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
MemberCount uint16 `db:"member_count"`
|
||||
RankRP uint32 `db:"rank_rp"`
|
||||
EventRP uint32 `db:"event_rp"`
|
||||
RoomRP uint16 `db:"room_rp"`
|
||||
RoomExpiry time.Time `db:"room_expiry"`
|
||||
Comment string `db:"comment"`
|
||||
PugiName1 string `db:"pugi_name_1"`
|
||||
PugiName2 string `db:"pugi_name_2"`
|
||||
PugiName3 string `db:"pugi_name_3"`
|
||||
PugiOutfit1 uint8 `db:"pugi_outfit_1"`
|
||||
PugiOutfit2 uint8 `db:"pugi_outfit_2"`
|
||||
PugiOutfit3 uint8 `db:"pugi_outfit_3"`
|
||||
PugiOutfits uint32 `db:"pugi_outfits"`
|
||||
Recruiting bool `db:"recruiting"`
|
||||
FestivalColor model.FestivalColor `db:"festival_color"`
|
||||
Souls uint32 `db:"souls"`
|
||||
AllianceID uint32 `db:"alliance_id"`
|
||||
Icon *GuildIcon `db:"icon"`
|
||||
|
||||
model.GuildLeader
|
||||
}
|
||||
|
||||
func RollbackTransaction(transaction *sql.Tx) {
|
||||
err := transaction.Rollback()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to rollback transaction", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
type GuildIcon struct {
|
||||
Parts []model.GuildIconPart
|
||||
}
|
||||
|
||||
func (gi *GuildIcon) Scan(val interface{}) (err error) {
|
||||
switch v := val.(type) {
|
||||
case []byte:
|
||||
err = json.Unmarshal(v, &gi)
|
||||
case string:
|
||||
err = json.Unmarshal([]byte(v), &gi)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (gi *GuildIcon) Value() (valuer driver.Value, err error) {
|
||||
return json.Marshal(gi)
|
||||
}
|
||||
|
||||
func (g *Guild) Rank() uint16 {
|
||||
rpMap := []uint32{
|
||||
24, 48, 96, 144, 192, 240, 288, 360, 432,
|
||||
504, 600, 696, 792, 888, 984, 1080, 1200,
|
||||
}
|
||||
if config.GetConfig().ClientID <= config.Z2 {
|
||||
rpMap = []uint32{
|
||||
3500, 6000, 8500, 11000, 13500, 16000, 20000, 24000, 28000,
|
||||
33000, 38000, 43000, 48000, 55000, 70000, 90000, 120000,
|
||||
}
|
||||
}
|
||||
for i, u := range rpMap {
|
||||
if g.RankRP < u {
|
||||
if config.GetConfig().ClientID <= config.S6 && i >= 12 {
|
||||
return 12
|
||||
} else if config.GetConfig().ClientID <= config.F5 && i >= 13 {
|
||||
return 13
|
||||
} else if config.GetConfig().ClientID <= config.G32 && i >= 14 {
|
||||
return 14
|
||||
}
|
||||
return uint16(i)
|
||||
}
|
||||
}
|
||||
if config.GetConfig().ClientID <= config.S6 {
|
||||
return 12
|
||||
} else if config.GetConfig().ClientID <= config.F5 {
|
||||
return 13
|
||||
} else if config.GetConfig().ClientID <= config.G32 {
|
||||
return 14
|
||||
}
|
||||
return 17
|
||||
}
|
||||
|
||||
func (guild *Guild) Save() error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec(`
|
||||
UPDATE guilds SET main_motto=$2, sub_motto=$3, comment=$4, pugi_name_1=$5, pugi_name_2=$6, pugi_name_3=$7,
|
||||
pugi_outfit_1=$8, pugi_outfit_2=$9, pugi_outfit_3=$10, pugi_outfits=$11, icon=$12, leader_id=$13 WHERE id=$1
|
||||
`, guild.ID, guild.MainMotto, guild.SubMotto, guild.Comment, guild.PugiName1, guild.PugiName2, guild.PugiName3,
|
||||
guild.PugiOutfit1, guild.PugiOutfit2, guild.PugiOutfit3, guild.PugiOutfits, guild.Icon, guild.GuildLeader.LeaderCharID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to update guild data", zap.Error(err), zap.Uint32("guildID", guild.ID))
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) CreateApplication(charID uint32, applicationType model.GuildApplicationType, transaction *sql.Tx, actorId uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
query := `
|
||||
INSERT INTO guild_applications (guild_id, character_id, actor_id, application_type)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
`
|
||||
// Actor ID is the s.CharID
|
||||
if transaction == nil {
|
||||
_, err = db.Exec(query, guild.ID, charID, actorId, applicationType)
|
||||
} else {
|
||||
_, err = transaction.Exec(query, guild.ID, charID, actorId, applicationType)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to add guild application",
|
||||
zap.Error(err),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
zap.Uint32("charID", charID),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) Disband(charID uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
transaction, err := db.Begin()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to begin transaction", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec("DELETE FROM guild_characters WHERE guild_id = $1", guild.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to remove guild characters", zap.Error(err), zap.Uint32("guildId", guild.ID))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec("DELETE FROM guilds WHERE id = $1", guild.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to remove guild", zap.Error(err), zap.Uint32("guildID", guild.ID))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec("DELETE FROM guild_alliances WHERE parent_id=$1", guild.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to remove guild alliance", zap.Error(err), zap.Uint32("guildID", guild.ID))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec("UPDATE guild_alliances SET sub1_id=sub2_id, sub2_id=NULL WHERE sub1_id=$1", guild.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to remove guild from alliance", zap.Error(err), zap.Uint32("guildID", guild.ID))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec("UPDATE guild_alliances SET sub2_id=NULL WHERE sub2_id=$1", guild.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to remove guild from alliance", zap.Error(err), zap.Uint32("guildID", guild.ID))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
err = transaction.Commit()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to commit transaction", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("Character disbanded guild", zap.Uint32("charID", charID), zap.Uint32("guildID", guild.ID))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) RemoveCharacter(charID uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec("DELETE FROM guild_characters WHERE character_id=$1", charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to remove character from guild",
|
||||
zap.Error(err),
|
||||
zap.Uint32("charID", charID),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) AcceptApplication(charID uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
transaction, err := db.Begin()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to start db transaction", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec(`DELETE FROM guild_applications WHERE character_id = $1`, charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to accept character's guild application", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec(`
|
||||
INSERT INTO guild_characters (guild_id, character_id, order_index)
|
||||
VALUES ($1, $2, (SELECT MAX(order_index) + 1 FROM guild_characters WHERE guild_id = $1))
|
||||
`, guild.ID, charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to add applicant to guild",
|
||||
zap.Error(err),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
zap.Uint32("charID", charID),
|
||||
)
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
err = transaction.Commit()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to commit db transaction", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// This is relying on the fact that invitation ID is also character ID right now
|
||||
// if invitation ID changes, this will break.
|
||||
func (guild *Guild) CancelInvitation(charID uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec(
|
||||
`DELETE FROM guild_applications WHERE character_id = $1 AND guild_id = $2 AND application_type = 'invited'`,
|
||||
charID, guild.ID,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to cancel guild invitation",
|
||||
zap.Error(err),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
zap.Uint32("charID", charID),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) RejectApplication(charID uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec(
|
||||
`DELETE FROM guild_applications WHERE character_id = $1 AND guild_id = $2 AND application_type = 'applied'`,
|
||||
charID, guild.ID,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to reject guild application",
|
||||
zap.Error(err),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
zap.Uint32("charID", charID),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) ArrangeCharacters(charIDs []uint32) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
transaction, err := db.Begin()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to start db transaction", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
|
||||
for i, id := range charIDs {
|
||||
_, err := transaction.Exec("UPDATE guild_characters SET order_index = $1 WHERE character_id = $2", 2+i, id)
|
||||
|
||||
if err != nil {
|
||||
err = transaction.Rollback()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to rollback db transaction", zap.Error(err))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = transaction.Commit()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to commit db transaction", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (guild *Guild) GetApplicationForCharID(charID uint32, applicationType model.GuildApplicationType) (*model.GuildApplication, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
row := db.QueryRowx(`
|
||||
SELECT * from guild_applications WHERE character_id = $1 AND guild_id = $2 AND application_type = $3
|
||||
`, charID, guild.ID, applicationType)
|
||||
|
||||
application := &model.GuildApplication{}
|
||||
|
||||
err = row.StructScan(application)
|
||||
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to retrieve guild application for character",
|
||||
zap.Error(err),
|
||||
zap.Uint32("charID", charID),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return application, nil
|
||||
}
|
||||
|
||||
func (guild *Guild) HasApplicationForCharID(charID uint32) (bool, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
row := db.QueryRowx(`
|
||||
SELECT 1 from guild_applications WHERE character_id = $1 AND guild_id = $2
|
||||
`, charID, guild.ID)
|
||||
|
||||
num := 0
|
||||
|
||||
err = row.Scan(&num)
|
||||
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to retrieve guild applications for character",
|
||||
zap.Error(err),
|
||||
zap.Uint32("charID", charID),
|
||||
zap.Uint32("guildID", guild.ID),
|
||||
)
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
const GuildInfoSelectQuery = `
|
||||
SELECT
|
||||
g.id,
|
||||
g.name,
|
||||
rank_rp,
|
||||
event_rp,
|
||||
room_rp,
|
||||
COALESCE(room_expiry, '1970-01-01') AS room_expiry,
|
||||
main_motto,
|
||||
sub_motto,
|
||||
created_at,
|
||||
leader_id,
|
||||
c.name AS leader_name,
|
||||
comment,
|
||||
COALESCE(pugi_name_1, '') AS pugi_name_1,
|
||||
COALESCE(pugi_name_2, '') AS pugi_name_2,
|
||||
COALESCE(pugi_name_3, '') AS pugi_name_3,
|
||||
pugi_outfit_1,
|
||||
pugi_outfit_2,
|
||||
pugi_outfit_3,
|
||||
pugi_outfits,
|
||||
recruiting,
|
||||
COALESCE((SELECT team FROM festa_registrations fr WHERE fr.guild_id = g.id), 'none') AS festival_color,
|
||||
COALESCE((SELECT SUM(fs.souls) FROM festa_submissions fs WHERE fs.guild_id=g.id), 0) AS souls,
|
||||
COALESCE((
|
||||
SELECT id FROM guild_alliances ga WHERE
|
||||
ga.parent_id = g.id OR
|
||||
ga.sub1_id = g.id OR
|
||||
ga.sub2_id = g.id
|
||||
), 0) AS alliance_id,
|
||||
icon,
|
||||
(SELECT count(1) FROM guild_characters gc WHERE gc.guild_id = g.id) AS member_count
|
||||
FROM guilds g
|
||||
JOIN guild_characters gc ON gc.character_id = leader_id
|
||||
JOIN characters c on leader_id = c.id
|
||||
`
|
||||
|
||||
func CreateGuild(guildName string, charID uint32) (int32, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
transaction, err := db.Begin()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to start db transaction", zap.Error(err))
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
guildResult, err := transaction.Query(
|
||||
"INSERT INTO guilds (name, leader_id) VALUES ($1, $2) RETURNING id",
|
||||
guildName, charID,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to create guild", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var guildId int32
|
||||
|
||||
guildResult.Next()
|
||||
|
||||
err = guildResult.Scan(&guildId)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve guild ID", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
err = guildResult.Close()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to finalise query", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
_, err = transaction.Exec(`
|
||||
INSERT INTO guild_characters (guild_id, character_id)
|
||||
VALUES ($1, $2)
|
||||
`, guildId, charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to add character to guild", zap.Error(err))
|
||||
RollbackTransaction(transaction)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
err = transaction.Commit()
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to commit guild creation", zap.Error(err))
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return guildId, nil
|
||||
}
|
||||
|
||||
func GetGuildInfoByID(guildID uint32) (*Guild, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(fmt.Sprintf(`
|
||||
%s
|
||||
WHERE g.id = $1
|
||||
LIMIT 1
|
||||
`, GuildInfoSelectQuery), guildID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve guild", zap.Error(err), zap.Uint32("guildID", guildID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer rows.Close()
|
||||
|
||||
hasRow := rows.Next()
|
||||
|
||||
if !hasRow {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return BuildGuildObjectFromDbResult(rows, err)
|
||||
}
|
||||
|
||||
func GetGuildInfoByCharacterId(charID uint32) (*Guild, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(fmt.Sprintf(`
|
||||
%s
|
||||
WHERE EXISTS(
|
||||
SELECT 1
|
||||
FROM guild_characters gc1
|
||||
WHERE gc1.character_id = $1
|
||||
AND gc1.guild_id = g.id
|
||||
)
|
||||
OR EXISTS(
|
||||
SELECT 1
|
||||
FROM guild_applications ga
|
||||
WHERE ga.character_id = $1
|
||||
AND ga.guild_id = g.id
|
||||
AND ga.application_type = 'applied'
|
||||
)
|
||||
LIMIT 1
|
||||
`, GuildInfoSelectQuery), charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve guild for character", zap.Error(err), zap.Uint32("charID", charID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer rows.Close()
|
||||
|
||||
hasRow := rows.Next()
|
||||
|
||||
if !hasRow {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return BuildGuildObjectFromDbResult(rows, err)
|
||||
}
|
||||
|
||||
func BuildGuildObjectFromDbResult(result *sqlx.Rows, err error) (*Guild, error) {
|
||||
guild := &Guild{}
|
||||
logger := logger.Get()
|
||||
|
||||
err = result.StructScan(guild)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve guild data from database", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return guild, nil
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"erupe-ce/utils/database"
|
||||
"erupe-ce/utils/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type GuildAlliance struct {
|
||||
ID uint32 `db:"id"`
|
||||
Name string `db:"name"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
TotalMembers uint16
|
||||
|
||||
ParentGuildID uint32 `db:"parent_id"`
|
||||
SubGuild1ID uint32 `db:"sub1_id"`
|
||||
SubGuild2ID uint32 `db:"sub2_id"`
|
||||
|
||||
ParentGuild Guild
|
||||
SubGuild1 Guild
|
||||
SubGuild2 Guild
|
||||
}
|
||||
|
||||
const AllianceInfoSelectQuery = `
|
||||
SELECT
|
||||
ga.id,
|
||||
ga.name,
|
||||
created_at,
|
||||
parent_id,
|
||||
CASE
|
||||
WHEN sub1_id IS NULL THEN 0
|
||||
ELSE sub1_id
|
||||
END,
|
||||
CASE
|
||||
WHEN sub2_id IS NULL THEN 0
|
||||
ELSE sub2_id
|
||||
END
|
||||
FROM guild_alliances ga
|
||||
`
|
||||
|
||||
func GetAllianceData(AllianceID uint32) (*GuildAlliance, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(fmt.Sprintf(`
|
||||
%s
|
||||
WHERE ga.id = $1
|
||||
`, AllianceInfoSelectQuery), AllianceID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to retrieve alliance data from database", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
hasRow := rows.Next()
|
||||
if !hasRow {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return BuildAllianceObjectFromDbResult(rows, err)
|
||||
}
|
||||
|
||||
func BuildAllianceObjectFromDbResult(result *sqlx.Rows, err error) (*GuildAlliance, error) {
|
||||
alliance := &GuildAlliance{}
|
||||
logger := logger.Get()
|
||||
|
||||
err = result.StructScan(alliance)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve alliance from database", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parentGuild, err := GetGuildInfoByID(alliance.ParentGuildID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get parent guild info", zap.Error(err))
|
||||
return nil, err
|
||||
} else {
|
||||
alliance.ParentGuild = *parentGuild
|
||||
alliance.TotalMembers += parentGuild.MemberCount
|
||||
}
|
||||
|
||||
if alliance.SubGuild1ID > 0 {
|
||||
subGuild1, err := GetGuildInfoByID(alliance.SubGuild1ID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get sub guild 1 info", zap.Error(err))
|
||||
return nil, err
|
||||
} else {
|
||||
alliance.SubGuild1 = *subGuild1
|
||||
alliance.TotalMembers += subGuild1.MemberCount
|
||||
}
|
||||
}
|
||||
|
||||
if alliance.SubGuild2ID > 0 {
|
||||
subGuild2, err := GetGuildInfoByID(alliance.SubGuild2ID)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get sub guild 2 info", zap.Error(err))
|
||||
return nil, err
|
||||
} else {
|
||||
alliance.SubGuild2 = *subGuild2
|
||||
alliance.TotalMembers += subGuild2.MemberCount
|
||||
}
|
||||
}
|
||||
|
||||
return alliance, nil
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"erupe-ce/utils/database"
|
||||
"erupe-ce/utils/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type GuildMember struct {
|
||||
GuildID uint32 `db:"guild_id"`
|
||||
CharID uint32 `db:"character_id"`
|
||||
JoinedAt *time.Time `db:"joined_at"`
|
||||
Souls uint32 `db:"souls"`
|
||||
RPToday uint16 `db:"rp_today"`
|
||||
RPYesterday uint16 `db:"rp_yesterday"`
|
||||
Name string `db:"name"`
|
||||
IsApplicant bool `db:"is_applicant"`
|
||||
OrderIndex uint16 `db:"order_index"`
|
||||
LastLogin uint32 `db:"last_login"`
|
||||
Recruiter bool `db:"recruiter"`
|
||||
AvoidLeadership bool `db:"avoid_leadership"`
|
||||
IsLeader bool `db:"is_leader"`
|
||||
HR uint16 `db:"hr"`
|
||||
GR uint16 `db:"gr"`
|
||||
WeaponID uint16 `db:"weapon_id"`
|
||||
WeaponType uint8 `db:"weapon_type"`
|
||||
}
|
||||
|
||||
func (gm *GuildMember) CanRecruit() bool {
|
||||
if gm.Recruiter {
|
||||
return true
|
||||
}
|
||||
if gm.OrderIndex <= 3 {
|
||||
return true
|
||||
}
|
||||
if gm.IsLeader {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (gm *GuildMember) IsSubLeader() bool {
|
||||
return gm.OrderIndex <= 3
|
||||
}
|
||||
|
||||
func (gm *GuildMember) Save() error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec("UPDATE guild_characters SET avoid_leadership=$1, order_index=$2 WHERE character_id=$3", gm.AvoidLeadership, gm.OrderIndex, gm.CharID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to update guild member data",
|
||||
zap.Error(err),
|
||||
zap.Uint32("charID", gm.CharID),
|
||||
zap.Uint32("guildID", gm.GuildID),
|
||||
)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
const guildMembersSelectSQL = `
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
g.id AS guild_id,
|
||||
joined_at,
|
||||
COALESCE((SELECT SUM(souls) FROM festa_submissions fs WHERE fs.character_id=c.id), 0) AS souls,
|
||||
COALESCE(rp_today, 0) AS rp_today,
|
||||
COALESCE(rp_yesterday, 0) AS rp_yesterday,
|
||||
c.name,
|
||||
c.id AS character_id,
|
||||
COALESCE(order_index, 0) AS order_index,
|
||||
c.last_login,
|
||||
COALESCE(recruiter, false) AS recruiter,
|
||||
COALESCE(avoid_leadership, false) AS avoid_leadership,
|
||||
c.hr,
|
||||
c.gr,
|
||||
c.weapon_id,
|
||||
c.weapon_type,
|
||||
EXISTS(SELECT 1 FROM guild_applications ga WHERE ga.character_id=c.id AND application_type='applied') AS is_applicant,
|
||||
CASE WHEN g.leader_id = c.id THEN true ELSE false END AS is_leader
|
||||
FROM guild_characters gc
|
||||
LEFT JOIN characters c ON c.id = gc.character_id
|
||||
LEFT JOIN guilds g ON g.id = gc.guild_id
|
||||
) AS subquery
|
||||
`
|
||||
|
||||
func GetGuildMembers(guildID uint32, applicants bool) ([]*GuildMember, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(fmt.Sprintf(`
|
||||
%s
|
||||
WHERE guild_id = $1 AND is_applicant = $2
|
||||
`, guildMembersSelectSQL), guildID, applicants)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve membership data for guild", zap.Error(err), zap.Uint32("guildID", guildID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer rows.Close()
|
||||
|
||||
members := make([]*GuildMember, 0)
|
||||
|
||||
for rows.Next() {
|
||||
member, err := buildGuildMemberObjectFromDBResult(rows, err)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
members = append(members, member)
|
||||
}
|
||||
|
||||
return members, nil
|
||||
}
|
||||
|
||||
func GetCharacterGuildData(charID uint32) (*GuildMember, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(fmt.Sprintf("%s WHERE character_id=$1", guildMembersSelectSQL), charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(fmt.Sprintf("failed to retrieve membership data for character '%d'", charID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer rows.Close()
|
||||
|
||||
hasRow := rows.Next()
|
||||
|
||||
if !hasRow {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return buildGuildMemberObjectFromDBResult(rows, err)
|
||||
}
|
||||
|
||||
func buildGuildMemberObjectFromDBResult(rows *sqlx.Rows, err error) (*GuildMember, error) {
|
||||
logger := logger.Get()
|
||||
|
||||
memberData := &GuildMember{}
|
||||
|
||||
err = rows.StructScan(&memberData)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to retrieve guild data from database", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return memberData, nil
|
||||
}
|
||||
@@ -1,236 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"erupe-ce/internal/constant"
|
||||
"erupe-ce/network/binpacket"
|
||||
"erupe-ce/network/mhfpacket"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/utils/database"
|
||||
|
||||
"erupe-ce/utils/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type Mail struct {
|
||||
ID int `db:"id"`
|
||||
SenderID uint32 `db:"sender_id"`
|
||||
RecipientID uint32 `db:"recipient_id"`
|
||||
Subject string `db:"subject"`
|
||||
Body string `db:"body"`
|
||||
Read bool `db:"read"`
|
||||
Deleted bool `db:"deleted"`
|
||||
Locked bool `db:"locked"`
|
||||
AttachedItemReceived bool `db:"attached_item_received"`
|
||||
AttachedItemID uint16 `db:"attached_item"`
|
||||
AttachedItemAmount uint16 `db:"attached_item_amount"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
IsGuildInvite bool `db:"is_guild_invite"`
|
||||
IsSystemMessage bool `db:"is_sys_message"`
|
||||
SenderName string `db:"sender_name"`
|
||||
}
|
||||
|
||||
func (m *Mail) Send(transaction *sql.Tx) error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
query := `
|
||||
INSERT INTO mail (sender_id, recipient_id, subject, body, attached_item, attached_item_amount, is_guild_invite, is_sys_message)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||
`
|
||||
|
||||
if transaction == nil {
|
||||
_, err = db.Exec(query, m.SenderID, m.RecipientID, m.Subject, m.Body, m.AttachedItemID, m.AttachedItemAmount, m.IsGuildInvite, m.IsSystemMessage)
|
||||
} else {
|
||||
_, err = transaction.Exec(query, m.SenderID, m.RecipientID, m.Subject, m.Body, m.AttachedItemID, m.AttachedItemAmount, m.IsGuildInvite, m.IsSystemMessage)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to send mail",
|
||||
zap.Error(err),
|
||||
zap.Uint32("senderID", m.SenderID),
|
||||
zap.Uint32("recipientID", m.RecipientID),
|
||||
zap.String("subject", m.Subject),
|
||||
zap.String("body", m.Body),
|
||||
zap.Uint16("itemID", m.AttachedItemID),
|
||||
zap.Uint16("itemAmount", m.AttachedItemAmount),
|
||||
zap.Bool("isGuildInvite", m.IsGuildInvite),
|
||||
zap.Bool("isSystemMessage", m.IsSystemMessage),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Mail) MarkRead() error {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
_, err = db.Exec(`
|
||||
UPDATE mail SET read = true WHERE id = $1
|
||||
`, m.ID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to mark mail as read",
|
||||
zap.Error(err),
|
||||
zap.Int("mailID", m.ID),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetMailListForCharacter(charID uint32) ([]Mail, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
rows, err := db.Queryx(`
|
||||
SELECT
|
||||
m.id,
|
||||
m.sender_id,
|
||||
m.recipient_id,
|
||||
m.subject,
|
||||
m.read,
|
||||
m.attached_item_received,
|
||||
m.attached_item,
|
||||
m.attached_item_amount,
|
||||
m.created_at,
|
||||
m.is_guild_invite,
|
||||
m.is_sys_message,
|
||||
m.deleted,
|
||||
m.locked,
|
||||
c.name as sender_name
|
||||
FROM mail m
|
||||
JOIN characters c ON c.id = m.sender_id
|
||||
WHERE recipient_id = $1 AND m.deleted = false
|
||||
ORDER BY m.created_at DESC, id DESC
|
||||
LIMIT 32
|
||||
`, charID)
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to get mail for character", zap.Error(err), zap.Uint32("charID", charID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer rows.Close()
|
||||
|
||||
allMail := make([]Mail, 0)
|
||||
|
||||
for rows.Next() {
|
||||
mail := Mail{}
|
||||
|
||||
err := rows.StructScan(&mail)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
allMail = append(allMail, mail)
|
||||
}
|
||||
|
||||
return allMail, nil
|
||||
}
|
||||
|
||||
func GetMailByID(ID int) (*Mail, error) {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
row := db.QueryRowx(`
|
||||
SELECT
|
||||
m.id,
|
||||
m.sender_id,
|
||||
m.recipient_id,
|
||||
m.subject,
|
||||
m.read,
|
||||
m.body,
|
||||
m.attached_item_received,
|
||||
m.attached_item,
|
||||
m.attached_item_amount,
|
||||
m.created_at,
|
||||
m.is_guild_invite,
|
||||
m.is_sys_message,
|
||||
m.deleted,
|
||||
m.locked,
|
||||
c.name as sender_name
|
||||
FROM mail m
|
||||
JOIN characters c ON c.id = m.sender_id
|
||||
WHERE m.id = $1
|
||||
LIMIT 1
|
||||
`, ID)
|
||||
|
||||
mail := &Mail{}
|
||||
|
||||
err = row.StructScan(mail)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(
|
||||
"failed to retrieve mail",
|
||||
zap.Error(err),
|
||||
zap.Int("mailID", ID),
|
||||
)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return mail, nil
|
||||
}
|
||||
|
||||
type SessionMail interface {
|
||||
QueueSendMHFLazy(packet mhfpacket.MHFPacket)
|
||||
}
|
||||
|
||||
func SendMailNotification(m *Mail, recipient SessionMail) {
|
||||
bf := byteframe.NewByteFrame()
|
||||
|
||||
notification := &binpacket.MsgBinMailNotify{
|
||||
SenderName: getCharacterName(m.SenderID),
|
||||
}
|
||||
|
||||
notification.Build(bf)
|
||||
|
||||
castedBinary := &mhfpacket.MsgSysCastedBinary{
|
||||
CharID: m.SenderID,
|
||||
BroadcastType: 0x00,
|
||||
MessageType: constant.BinaryMessageTypeMailNotify,
|
||||
RawDataPayload: bf.Data(),
|
||||
}
|
||||
|
||||
castedBinary.Build(bf)
|
||||
|
||||
recipient.QueueSendMHFLazy(castedBinary)
|
||||
}
|
||||
|
||||
func getCharacterName(charID uint32) string {
|
||||
db, err := database.GetDB()
|
||||
logger := logger.Get()
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal(fmt.Sprintf("Failed to get database instance: %s", err))
|
||||
}
|
||||
row := db.QueryRow("SELECT name FROM characters WHERE id = $1", charID)
|
||||
|
||||
charName := ""
|
||||
|
||||
err = row.Scan(&charName)
|
||||
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return charName
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"erupe-ce/network/mhfpacket"
|
||||
)
|
||||
|
||||
type SessionStage interface {
|
||||
QueueSendMHFLazy(packet mhfpacket.MHFPacket)
|
||||
GetCharID() uint32
|
||||
GetName() string
|
||||
}
|
||||
|
||||
// Object holds infomation about a specific object.
|
||||
type Object struct {
|
||||
sync.RWMutex
|
||||
Id uint32
|
||||
OwnerCharID uint32
|
||||
X, Y, Z float32
|
||||
}
|
||||
|
||||
// stageBinaryKey is a struct used as a map key for identifying a stage binary part.
|
||||
type StageBinaryKey struct {
|
||||
Id0 uint8
|
||||
Id1 uint8
|
||||
}
|
||||
|
||||
// Stage holds stage-specific information
|
||||
type Stage struct {
|
||||
sync.RWMutex
|
||||
|
||||
// Stage ID string
|
||||
Id string
|
||||
|
||||
// Objects
|
||||
Objects map[uint32]*Object
|
||||
objectIndex uint8
|
||||
|
||||
// Map of session -> charID.
|
||||
// These are clients that are CURRENTLY in the stage
|
||||
Clients map[SessionStage]uint32
|
||||
|
||||
// Map of charID -> bool, key represents whether they are ready
|
||||
// These are clients that aren't in the stage, but have reserved a slot (for quests, etc).
|
||||
ReservedClientSlots map[uint32]bool
|
||||
|
||||
// These are raw binary blobs that the stage owner sets,
|
||||
// other clients expect the server to echo them back in the exact same format.
|
||||
RawBinaryData map[StageBinaryKey][]byte
|
||||
|
||||
Host SessionStage
|
||||
MaxPlayers uint16
|
||||
Password string
|
||||
Locked bool
|
||||
}
|
||||
|
||||
// NewStage creates a new stage with intialized values.
|
||||
func NewStage(ID string) *Stage {
|
||||
s := &Stage{
|
||||
Id: ID,
|
||||
Clients: make(map[SessionStage]uint32),
|
||||
ReservedClientSlots: make(map[uint32]bool),
|
||||
Objects: make(map[uint32]*Object),
|
||||
objectIndex: 0,
|
||||
RawBinaryData: make(map[StageBinaryKey][]byte),
|
||||
MaxPlayers: 127,
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// BroadcastMHF queues a MHFPacket to be sent to all sessions in the stage.
|
||||
func (s *Stage) BroadcastMHF(pkt mhfpacket.MHFPacket, ignoredSession SessionStage) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
for session := range s.Clients {
|
||||
if session == ignoredSession {
|
||||
continue
|
||||
}
|
||||
session.QueueSendMHFLazy(pkt)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Stage) isCharInQuestByID(charID uint32) bool {
|
||||
if _, exists := s.ReservedClientSlots[charID]; exists {
|
||||
return exists
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *Stage) IsQuest() bool {
|
||||
return len(s.ReservedClientSlots) > 0
|
||||
}
|
||||
331
main.go
331
main.go
@@ -1,30 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"erupe-ce/config"
|
||||
"fmt"
|
||||
"github.com/rivo/tview"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime/debug"
|
||||
"syscall"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"erupe-ce/server/api"
|
||||
"erupe-ce/config"
|
||||
"erupe-ce/server/channelserver"
|
||||
"erupe-ce/server/discordbot"
|
||||
"erupe-ce/server/entrance"
|
||||
"erupe-ce/server/sign"
|
||||
"erupe-ce/utils/database"
|
||||
"erupe-ce/utils/logger"
|
||||
|
||||
"erupe-ce/utils/gametime"
|
||||
"erupe-ce/server/entranceserver"
|
||||
"erupe-ce/server/signserver"
|
||||
"erupe-ce/server/signv2server"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/lib/pq"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var mainLogger logger.Logger
|
||||
// Temporary DB auto clean on startup for quick development & testing.
|
||||
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")
|
||||
}
|
||||
|
||||
var Commit = func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
@@ -37,105 +41,174 @@ var Commit = func() string {
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func initLogger() {
|
||||
var zapLogger *zap.Logger
|
||||
zapLogger, _ = zap.NewDevelopment(zap.WithCaller(false))
|
||||
defer zapLogger.Sync()
|
||||
// Initialize the global logger
|
||||
logger.Init(zapLogger)
|
||||
mainLogger = logger.Get().Named("main")
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
var err error
|
||||
zapLogger, _ := zap.NewDevelopment()
|
||||
defer zapLogger.Sync()
|
||||
logger := zapLogger.Named("main")
|
||||
|
||||
config := config.GetConfig()
|
||||
initLogger()
|
||||
mainLogger.Info(fmt.Sprintf("Starting Erupe (9.3b-%s)", Commit()))
|
||||
mainLogger.Info(fmt.Sprintf("Client Mode: %s (%d)", config.ClientMode, config.ClientID))
|
||||
logger.Info(fmt.Sprintf("Starting Erupe (9.2b-%s)", Commit()))
|
||||
|
||||
checkAndExitIf(config.Database.Password == "", "Database password is blank")
|
||||
|
||||
resolveHostIP()
|
||||
|
||||
discordBot := initializeDiscordBot()
|
||||
|
||||
database, err := database.InitDB(config)
|
||||
if err != nil {
|
||||
mainLogger.Fatal(fmt.Sprintf("Database initialization failed: %s", err))
|
||||
if config.ErupeConfig.Database.Password == "" {
|
||||
preventClose("Database password is blank")
|
||||
}
|
||||
|
||||
mainLogger.Info(fmt.Sprintf("Server Time: %s", gametime.TimeAdjusted().String()))
|
||||
if net.ParseIP(config.ErupeConfig.Host) == nil {
|
||||
ips, _ := net.LookupIP(config.ErupeConfig.Host)
|
||||
for _, ip := range ips {
|
||||
if ip != nil {
|
||||
config.ErupeConfig.Host = ip.String()
|
||||
break
|
||||
}
|
||||
}
|
||||
if net.ParseIP(config.ErupeConfig.Host) == nil {
|
||||
preventClose("Invalid host address")
|
||||
}
|
||||
}
|
||||
|
||||
// Discord bot
|
||||
var discordBot *discordbot.DiscordBot = nil
|
||||
|
||||
if config.ErupeConfig.Discord.Enabled {
|
||||
bot, err := discordbot.NewDiscordBot(discordbot.Options{
|
||||
Logger: logger,
|
||||
Config: config.ErupeConfig,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to create Discord bot: %s", err.Error()))
|
||||
}
|
||||
|
||||
// Discord bot
|
||||
err = bot.Start()
|
||||
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to start Discord bot: %s", err.Error()))
|
||||
}
|
||||
|
||||
discordBot = bot
|
||||
logger.Info("Discord bot is enabled")
|
||||
} else {
|
||||
logger.Info("Discord bot is disabled")
|
||||
}
|
||||
|
||||
// Create the postgres DB pool.
|
||||
connectString := fmt.Sprintf(
|
||||
"host='%s' port='%d' user='%s' password='%s' dbname='%s' sslmode=disable",
|
||||
config.ErupeConfig.Database.Host,
|
||||
config.ErupeConfig.Database.Port,
|
||||
config.ErupeConfig.Database.User,
|
||||
config.ErupeConfig.Database.Password,
|
||||
config.ErupeConfig.Database.Database,
|
||||
)
|
||||
|
||||
db, err := sqlx.Open("postgres", connectString)
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to open SQL database: %s", err.Error()))
|
||||
}
|
||||
|
||||
// Test the DB connection.
|
||||
err = db.Ping()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to ping database: %s", err.Error()))
|
||||
}
|
||||
logger.Info("Connected to database")
|
||||
|
||||
// Clear stale data
|
||||
_ = db.MustExec("DELETE FROM sign_sessions")
|
||||
_ = db.MustExec("DELETE FROM servers")
|
||||
|
||||
// Clean the DB if the option is on.
|
||||
if config.ErupeConfig.DevMode && config.ErupeConfig.DevModeOptions.CleanDB {
|
||||
logger.Info("Cleaning DB")
|
||||
cleanDB(db)
|
||||
logger.Info("Done cleaning DB")
|
||||
}
|
||||
|
||||
logger.Info(fmt.Sprintf("Server Time: %s", channelserver.TimeAdjusted().String()))
|
||||
|
||||
// Now start our server(s).
|
||||
|
||||
// Entrance server.
|
||||
|
||||
var entranceServer *entrance.EntranceServer
|
||||
if config.Entrance.Enabled {
|
||||
entranceServer = entrance.NewServer()
|
||||
var entranceServer *entranceserver.Server
|
||||
if config.ErupeConfig.Entrance.Enabled {
|
||||
entranceServer = entranceserver.NewServer(
|
||||
&entranceserver.Config{
|
||||
Logger: logger.Named("entrance"),
|
||||
ErupeConfig: config.ErupeConfig,
|
||||
DB: db,
|
||||
})
|
||||
err = entranceServer.Start()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Entrance: Failed to start, %s", err.Error()))
|
||||
preventClose(fmt.Sprintf("Failed to start entrance server: %s", err.Error()))
|
||||
}
|
||||
mainLogger.Info("Entrance: Started successfully")
|
||||
} else {
|
||||
mainLogger.Info("Entrance: Disabled")
|
||||
logger.Info("Started entrance server")
|
||||
}
|
||||
|
||||
// Sign server.
|
||||
var signServer *sign.SignServer
|
||||
if config.Sign.Enabled {
|
||||
signServer = sign.NewServer()
|
||||
|
||||
var signServer *signserver.Server
|
||||
if config.ErupeConfig.Sign.Enabled {
|
||||
signServer = signserver.NewServer(
|
||||
&signserver.Config{
|
||||
Logger: logger.Named("sign"),
|
||||
ErupeConfig: config.ErupeConfig,
|
||||
DB: db,
|
||||
})
|
||||
err = signServer.Start()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Sign: Failed to start, %s", err.Error()))
|
||||
preventClose(fmt.Sprintf("Failed to start sign server: %s", err.Error()))
|
||||
}
|
||||
mainLogger.Info("Sign: Started successfully")
|
||||
} else {
|
||||
mainLogger.Info("Sign: Disabled")
|
||||
logger.Info("Started sign server")
|
||||
}
|
||||
|
||||
// Api server
|
||||
var apiServer *api.APIServer
|
||||
if config.API.Enabled {
|
||||
apiServer = api.NewAPIServer()
|
||||
err = apiServer.Start()
|
||||
// New Sign server
|
||||
var newSignServer *signv2server.Server
|
||||
if config.ErupeConfig.SignV2.Enabled {
|
||||
newSignServer = signv2server.NewServer(
|
||||
&signv2server.Config{
|
||||
Logger: logger.Named("sign"),
|
||||
ErupeConfig: config.ErupeConfig,
|
||||
DB: db,
|
||||
})
|
||||
err = newSignServer.Start()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("API: Failed to start, %s", err.Error()))
|
||||
preventClose(fmt.Sprintf("Failed to start sign-v2 server: %s", err.Error()))
|
||||
}
|
||||
mainLogger.Info("API: Started successfully")
|
||||
} else {
|
||||
mainLogger.Info("API: Disabled")
|
||||
logger.Info("Started new sign server")
|
||||
}
|
||||
var channelServers []*channelserver.ChannelServer
|
||||
if config.Channel.Enabled {
|
||||
|
||||
var channels []*channelserver.Server
|
||||
|
||||
if config.ErupeConfig.Channel.Enabled {
|
||||
channelQuery := ""
|
||||
si := 0
|
||||
ci := 0
|
||||
count := 1
|
||||
for j, ee := range config.Entrance.Entries {
|
||||
for _, ee := range config.ErupeConfig.Entrance.Entries {
|
||||
for i, ce := range ee.Channels {
|
||||
sid := (4096 + si*256) + (16 + ci)
|
||||
c := *channelserver.NewServer(&channelserver.Config{
|
||||
ID: uint16(sid),
|
||||
DiscordBot: discordBot,
|
||||
ID: uint16(sid),
|
||||
Logger: logger.Named("channel-" + fmt.Sprint(count)),
|
||||
ErupeConfig: config.ErupeConfig,
|
||||
DB: db,
|
||||
DiscordBot: discordBot,
|
||||
})
|
||||
if ee.IP == "" {
|
||||
c.IP = config.Host
|
||||
c.IP = config.ErupeConfig.Host
|
||||
} else {
|
||||
c.IP = ee.IP
|
||||
}
|
||||
c.Port = ce.Port
|
||||
c.GlobalID = fmt.Sprintf("%02d%02d", j+1, i+1)
|
||||
err = c.Start()
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Channel: Failed to start, %s", err.Error()))
|
||||
preventClose(fmt.Sprintf("Failed to start channel server: %s", err.Error()))
|
||||
} else {
|
||||
channelQuery += fmt.Sprintf(`INSERT INTO servers (server_id, current_players, world_name, world_description, land) VALUES (%d, 0, '%s', '%s', %d);`, sid, ee.Name, ee.Description, i+1)
|
||||
channelServers = append(channelServers, &c)
|
||||
mainLogger.Info(fmt.Sprintf("Channel %d (%d): Started successfully", count, ce.Port))
|
||||
channelQuery += fmt.Sprintf(`INSERT INTO servers (server_id, season, current_players, world_name, world_description, land) VALUES (%d, %d, 0, '%s', '%s', %d);`, sid, si%3, ee.Name, ee.Description, i+1)
|
||||
channels = append(channels, &c)
|
||||
logger.Info(fmt.Sprintf("Started channel server %d on port %d", count, ce.Port))
|
||||
ci++
|
||||
count++
|
||||
}
|
||||
@@ -145,50 +218,74 @@ func main() {
|
||||
}
|
||||
|
||||
// Register all servers in DB
|
||||
_ = database.MustExec(channelQuery)
|
||||
_ = db.MustExec(channelQuery)
|
||||
|
||||
for _, c := range channelServers {
|
||||
c.Channels = channelServers
|
||||
for _, c := range channels {
|
||||
c.Channels = channels
|
||||
}
|
||||
}
|
||||
|
||||
mainLogger.Info("Finished starting Erupe")
|
||||
logger.Info("Finished starting Erupe")
|
||||
|
||||
// Wait for exit or interrupt with ctrl+C.
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
<-c
|
||||
app := tview.NewApplication()
|
||||
|
||||
if !config.DisableSoftCrash {
|
||||
for i := 0; i < 10; i++ {
|
||||
message := fmt.Sprintf("Shutting down in %d...", 10-i)
|
||||
for _, channelServer := range channelServers {
|
||||
channelServer.BroadcastChatMessage(message)
|
||||
channelNode := tview.NewTreeNode("Channel")
|
||||
|
||||
browser := tview.NewTreeView().SetRoot(channelNode).SetCurrentNode(channelNode)
|
||||
browser.SetTitle("Channel Browser").SetBorder(true)
|
||||
|
||||
erupeNode := tview.NewTreeNode("Erupe")
|
||||
|
||||
channelsList := tview.NewTreeView().SetRoot(erupeNode).SetCurrentNode(erupeNode)
|
||||
channelsList.SetTitle("Channels").SetBorder(true)
|
||||
|
||||
for _, channel := range channels {
|
||||
temp := tview.NewTreeNode(strconv.Itoa(int(channel.Port))).SetReference(channel)
|
||||
erupeNode.AddChild(temp)
|
||||
}
|
||||
|
||||
channelsList.SetSelectedFunc(func(node *tview.TreeNode) {
|
||||
channelNode.ClearChildren()
|
||||
ref := node.GetReference()
|
||||
for id, stage := range ref.(*channelserver.Server).Stages() {
|
||||
stageNode := tview.NewTreeNode(id).SetExpanded(true)
|
||||
for i, j := range stage.Clients() {
|
||||
charNode := tview.NewTreeNode(i.Name + " (" + strconv.Itoa(int(j)) + ")")
|
||||
stageNode.AddChild(charNode)
|
||||
}
|
||||
mainLogger.Warn(message)
|
||||
time.Sleep(time.Second)
|
||||
channelNode.AddChild(stageNode)
|
||||
}
|
||||
})
|
||||
|
||||
flex := tview.NewFlex().
|
||||
AddItem(channelsList, 0, 1, true).
|
||||
AddItem(browser, 0, 3, false)
|
||||
|
||||
app.SetRoot(flex, true).EnableMouse(true)
|
||||
|
||||
if err = app.Run(); err != nil {
|
||||
logger.Error("Error in TUI")
|
||||
}
|
||||
|
||||
logger.Info("Shutting down...")
|
||||
|
||||
if config.ErupeConfig.Channel.Enabled {
|
||||
for _, c := range channels {
|
||||
c.Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
if config.Channel.Enabled {
|
||||
for _, channelServer := range channelServers {
|
||||
channelServer.Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
if config.Sign.Enabled {
|
||||
if config.ErupeConfig.Sign.Enabled {
|
||||
signServer.Shutdown()
|
||||
}
|
||||
|
||||
if config.API.Enabled {
|
||||
apiServer.Shutdown()
|
||||
if config.ErupeConfig.SignV2.Enabled {
|
||||
newSignServer.Shutdown()
|
||||
}
|
||||
|
||||
if config.Entrance.Enabled {
|
||||
if config.ErupeConfig.Entrance.Enabled {
|
||||
entranceServer.Shutdown()
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
func wait() {
|
||||
@@ -198,46 +295,12 @@ func wait() {
|
||||
}
|
||||
|
||||
func preventClose(text string) {
|
||||
if config.GetConfig().DisableSoftCrash {
|
||||
if config.ErupeConfig.DisableSoftCrash {
|
||||
os.Exit(0)
|
||||
}
|
||||
mainLogger.Error(fmt.Sprintf(("\nFailed to start Erupe:\n" + text)))
|
||||
fmt.Println("\nFailed to start Erupe:\n" + text)
|
||||
go wait()
|
||||
mainLogger.Error(fmt.Sprintf(("\nPress Enter/Return to exit...")))
|
||||
fmt.Println("\nPress Enter/Return to exit...")
|
||||
fmt.Scanln()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func checkAndExitIf(condition bool, message string) {
|
||||
if condition {
|
||||
preventClose(message)
|
||||
}
|
||||
}
|
||||
|
||||
func resolveHostIP() {
|
||||
if net.ParseIP(config.GetConfig().Host) == nil {
|
||||
ips, err := net.LookupIP(config.GetConfig().Host)
|
||||
if err == nil && len(ips) > 0 {
|
||||
config.GetConfig().Host = ips[0].String()
|
||||
}
|
||||
checkAndExitIf(net.ParseIP(config.GetConfig().Host) == nil, "Invalid host address")
|
||||
}
|
||||
}
|
||||
|
||||
func initializeDiscordBot() *discordbot.DiscordBot {
|
||||
if !config.GetConfig().Discord.Enabled {
|
||||
mainLogger.Info("Discord: Disabled")
|
||||
return nil
|
||||
}
|
||||
|
||||
bot, err := discordbot.NewDiscordBot()
|
||||
checkAndExitIf(err != nil, fmt.Sprintf("Discord: Failed to start, %s", err))
|
||||
|
||||
err = bot.Start()
|
||||
checkAndExitIf(err != nil, fmt.Sprintf("Discord: Failed to start, %s", err))
|
||||
|
||||
_, err = bot.Session.ApplicationCommandBulkOverwrite(bot.Session.State.User.ID, "", discordbot.Commands)
|
||||
checkAndExitIf(err != nil, fmt.Sprintf("Discord: Failed to register commands, %s", err))
|
||||
|
||||
mainLogger.Info("Discord: Started successfully")
|
||||
return bot
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/utils/stringsupport"
|
||||
)
|
||||
|
||||
// ChatType represents the chat message type (Thanks to @Alice on discord for identifying these!)
|
||||
@@ -11,8 +11,7 @@ type ChatType uint8
|
||||
|
||||
// Chat types
|
||||
const (
|
||||
ChatTypeWorld ChatType = 0
|
||||
ChatTypeStage = 1
|
||||
ChatTypeLocal ChatType = 1
|
||||
ChatTypeGuild = 2
|
||||
ChatTypeAlliance = 3
|
||||
ChatTypeParty = 4
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/utils/stringsupport"
|
||||
)
|
||||
|
||||
type MsgBinMailNotify struct {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
)
|
||||
|
||||
// MsgBinTargeted is a format used for some broadcast types
|
||||
|
||||
4
network/clientctx/clientcontext.go
Normal file
4
network/clientctx/clientcontext.go
Normal file
@@ -0,0 +1,4 @@
|
||||
package clientctx
|
||||
|
||||
// ClientContext holds contextual data required for packet encoding/decoding.
|
||||
type ClientContext struct{} // Unused
|
||||
@@ -3,11 +3,11 @@ package network
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"erupe-ce/config"
|
||||
"erupe-ce/network/crypto"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"erupe-ce/network/crypto"
|
||||
)
|
||||
|
||||
// CryptConn represents a MHF encrypted two-way connection,
|
||||
@@ -48,14 +48,7 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
}
|
||||
|
||||
// Now read the encrypted packet body after getting its size from the header.
|
||||
var encryptedPacketBody []byte
|
||||
|
||||
// Don't know when support for this was added, works in Forward.4, doesn't work in Season 6.0
|
||||
if config.GetConfig().ClientID < config.F1 {
|
||||
encryptedPacketBody = make([]byte, cph.DataSize)
|
||||
} else {
|
||||
encryptedPacketBody = make([]byte, uint32(cph.DataSize)+(uint32(cph.Pf0-0x03)*0x1000))
|
||||
}
|
||||
encryptedPacketBody := make([]byte, cph.DataSize)
|
||||
_, err = io.ReadFull(cc.conn, encryptedPacketBody)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -63,10 +56,10 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
|
||||
// Update the key rotation before decrypting.
|
||||
if cph.KeyRotDelta != 0 {
|
||||
cc.readKeyRot = uint32(cph.KeyRotDelta) * (cc.readKeyRot + 1)
|
||||
cc.readKeyRot = (uint32(cph.KeyRotDelta) * (cc.readKeyRot + 1))
|
||||
}
|
||||
|
||||
out, combinedCheck, check0, check1, check2 := crypto.Crypto(encryptedPacketBody, cc.readKeyRot, false, nil)
|
||||
out, combinedCheck, check0, check1, check2 := crypto.Decrypt(encryptedPacketBody, cc.readKeyRot, 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)
|
||||
@@ -76,7 +69,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.Crypto(encryptedPacketBody, 0, false, &key)
|
||||
out, combinedCheck, check0, check1, check2 = crypto.Decrypt(encryptedPacketBody, 0, &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)
|
||||
@@ -101,11 +94,11 @@ func (cc *CryptConn) SendPacket(data []byte) error {
|
||||
keyRotDelta := byte(3)
|
||||
|
||||
if keyRotDelta != 0 {
|
||||
cc.sendKeyRot = uint32(keyRotDelta) * (cc.sendKeyRot + 1)
|
||||
cc.sendKeyRot = (uint32(keyRotDelta) * (cc.sendKeyRot + 1))
|
||||
}
|
||||
|
||||
// Encrypt the data
|
||||
encData, combinedCheck, check0, check1, check2 := crypto.Crypto(data, cc.sendKeyRot, true, nil)
|
||||
encData, combinedCheck, check0, check1, check2 := crypto.Encrypt(data, cc.sendKeyRot, nil)
|
||||
|
||||
header := &CryptPacketHeader{}
|
||||
header.Pf0 = byte(((uint(len(encData)) >> 12) & 0xF3) | 3)
|
||||
@@ -122,7 +115,9 @@ func (cc *CryptConn) SendPacket(data []byte) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cc.conn.Write(append(headerBytes, encData...))
|
||||
cc.conn.Write(headerBytes)
|
||||
cc.conn.Write(encData)
|
||||
|
||||
cc.sentPackets++
|
||||
cc.prevSendPacketCombinedCheck = combinedCheck
|
||||
|
||||
|
||||
@@ -6,30 +6,46 @@ 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}
|
||||
)
|
||||
|
||||
// Crypto is a generalized MHF crypto function that can perform both encryption and decryption,
|
||||
// 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,
|
||||
// these two crypto operations are combined into a single function because they shared most of their logic.
|
||||
func Crypto(data []byte, rotKey uint32, encrypt bool, overrideByteKey *byte) ([]byte, uint16, uint16, uint16, uint16) {
|
||||
// encrypt: cryptType==0
|
||||
// decrypt: cryptType==1
|
||||
func _generalCrypt(data []byte, rotKey uint32, cryptType int, overrideByteKey *byte) ([]byte, uint16, uint16, uint16, uint16) {
|
||||
cryptKeyTruncByte := byte(((rotKey >> 1) % 999983) & 0xFF)
|
||||
if overrideByteKey != nil {
|
||||
cryptKeyTruncByte = *overrideByteKey
|
||||
}
|
||||
|
||||
derivedCryptKey := (uint32(len(data)) * (uint32(cryptKeyTruncByte) + 1)) & 0xFFFFFFFF
|
||||
derivedCryptKey := int32((uint32(len(data)) * (uint32(cryptKeyTruncByte) + 1)) & 0xFFFFFFFF)
|
||||
sharedBufIdx := byte(1)
|
||||
var accumulator0, accumulator1, accumulator2 uint32
|
||||
accumulator0 := uint32(0)
|
||||
accumulator1 := uint32(0)
|
||||
accumulator2 := uint32(0)
|
||||
|
||||
var outputData []byte
|
||||
if encrypt {
|
||||
if cryptType == 0 {
|
||||
for i := 0; i < len(data); i++ {
|
||||
// Do the encryption for this iteration
|
||||
encKeyIdx := ((derivedCryptKey >> 10) ^ uint32(data[i])) & 0xFF
|
||||
derivedCryptKey = 1277*derivedCryptKey + 1277
|
||||
encKeyIdx := int32(((uint32(derivedCryptKey) >> 10) ^ uint32(data[i])) & 0xFF)
|
||||
derivedCryptKey = (0x4FD * (derivedCryptKey + 1))
|
||||
encKeyByte := _encryptKey[encKeyIdx]
|
||||
|
||||
// Update the checksum accumulators.
|
||||
accumulator2 = accumulator2 + (uint32(sharedBufIdx) * uint32(data[i]))
|
||||
accumulator1 = accumulator1 + encKeyIdx
|
||||
accumulator0 = accumulator0 + uint32(encKeyByte)<<(i&7)
|
||||
accumulator2 = uint32((accumulator2 + (uint32(sharedBufIdx) * uint32(data[i]))) & 0xFFFFFFFF)
|
||||
accumulator1 = uint32((accumulator1 + uint32(encKeyIdx)) & 0xFFFFFFFF)
|
||||
accumulator0 = uint32((accumulator0 + (uint32(encKeyByte)<<(i&7))&0xFFFFFFFF) & 0xFFFFFFFF)
|
||||
|
||||
// Append the output.
|
||||
outputData = append(outputData, _sharedCryptKey[sharedBufIdx]^encKeyByte)
|
||||
@@ -37,32 +53,32 @@ func Crypto(data []byte, rotKey uint32, encrypt bool, overrideByteKey *byte) ([]
|
||||
// Update the sharedBufIdx for the next iteration.
|
||||
sharedBufIdx = data[i]
|
||||
}
|
||||
} else {
|
||||
|
||||
} else if cryptType == 1 {
|
||||
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((derivedCryptKey >> 10) ^ uint32(decKeyByte))
|
||||
sharedBufIdx = byte(((uint32(derivedCryptKey) >> 10) ^ uint32(decKeyByte)) & 0xFF)
|
||||
|
||||
// Update the checksum accumulators.
|
||||
accumulator0 = accumulator0 + uint32(tIdx)<<(i&7)
|
||||
accumulator1 = accumulator1 + uint32(decKeyByte)
|
||||
accumulator2 = accumulator2 + uint32(oldSharedBufIdx)*uint32(sharedBufIdx)
|
||||
accumulator0 = (accumulator0 + ((uint32(tIdx) << (i & 7)) & 0xFFFFFFFF))
|
||||
accumulator1 = (accumulator1 + uint32(decKeyByte)) & 0xFFFFFFFF
|
||||
accumulator2 = (accumulator2 + ((uint32(oldSharedBufIdx) * uint32(sharedBufIdx)) & 0xFFFFFFFF)) & 0xFFFFFFFF
|
||||
|
||||
// Append the output.
|
||||
outputData = append(outputData, sharedBufIdx)
|
||||
|
||||
// Update the key pos for next iteration.
|
||||
derivedCryptKey = 1277*derivedCryptKey + 1277
|
||||
derivedCryptKey = (0x4FD * (derivedCryptKey + 1))
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
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)
|
||||
|
||||
return outputData, check[0], check[1], check[2], check[3]
|
||||
return outputData, combinedCheck, check0, check1, check2
|
||||
}
|
||||
|
||||
@@ -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 := Crypto(tt.decryptedData, tt.key, true, nil)
|
||||
out, cc, c0, c1, c2 := Encrypt(tt.decryptedData, tt.key, 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 := Crypto(tt.decryptedData, tt.key, false, nil)
|
||||
out, cc, c0, c1, c2 := Decrypt(tt.encryptedData, tt.key, nil)
|
||||
if cc != tt.ecc {
|
||||
t.Errorf("got cc 0x%X, want 0x%X", cc, tt.ecc)
|
||||
} else if c0 != tt.ec0 {
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// Parser is the interface that wraps the Parse method.
|
||||
type Parser interface {
|
||||
Parse(bf *byteframe.ByteFrame) error
|
||||
Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error
|
||||
}
|
||||
|
||||
// Builder is the interface that wraps the Build method.
|
||||
type Builder interface {
|
||||
Build(bf *byteframe.ByteFrame) error
|
||||
Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error
|
||||
}
|
||||
|
||||
// Opcoder is the interface that wraps the Opcode method.
|
||||
|
||||
@@ -3,8 +3,9 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgCaExchangeItem represents the MSG_CA_EXCHANGE_ITEM
|
||||
@@ -16,11 +17,11 @@ func (m *MsgCaExchangeItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgCaExchangeItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgCaExchangeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgCaExchangeItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgCaExchangeItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgHead represents the MSG_HEAD
|
||||
@@ -16,11 +18,11 @@ func (m *MsgHead) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgHead) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgHead) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgHead) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgHead) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcceptReadReward represents the MSG_MHF_ACCEPT_READ_REWARD
|
||||
@@ -16,11 +18,11 @@ func (m *MsgMhfAcceptReadReward) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcceptReadReward) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcceptReadReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcceptReadReward) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcceptReadReward) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/config"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireCafeItem represents the MSG_MHF_ACQUIRE_CAFE_ITEM
|
||||
@@ -25,21 +25,17 @@ func (m *MsgMhfAcquireCafeItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ItemType = bf.ReadUint16()
|
||||
m.ItemID = bf.ReadUint16()
|
||||
m.Quant = bf.ReadUint16()
|
||||
if config.GetConfig().ClientID >= config.G1 {
|
||||
m.PointCost = bf.ReadUint32()
|
||||
} else {
|
||||
m.PointCost = uint32(bf.ReadUint16())
|
||||
}
|
||||
m.PointCost = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireCafeItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireCafeItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -4,14 +4,15 @@ import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireDistItem represents the MSG_MHF_ACQUIRE_DIST_ITEM
|
||||
type MsgMhfAcquireDistItem struct {
|
||||
AckHandle uint32
|
||||
AckHandle uint32
|
||||
DistributionType uint8
|
||||
DistributionID uint32
|
||||
DistributionID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,7 +21,7 @@ func (m *MsgMhfAcquireDistItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireDistItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.DistributionType = bf.ReadUint8()
|
||||
m.DistributionID = bf.ReadUint32()
|
||||
@@ -28,6 +29,6 @@ func (m *MsgMhfAcquireDistItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireDistItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireExchangeShop represents the MSG_MHF_ACQUIRE_EXCHANGE_SHOP
|
||||
@@ -18,7 +19,7 @@ func (m *MsgMhfAcquireExchangeShop) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireExchangeShop) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireExchangeShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.DataSize = bf.ReadUint16()
|
||||
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
|
||||
@@ -26,7 +27,7 @@ func (m *MsgMhfAcquireExchangeShop) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireExchangeShop) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireExchangeShop) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint16(m.DataSize)
|
||||
bf.WriteBytes(m.RawDataPayload)
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireFesta represents the MSG_MHF_ACQUIRE_FESTA
|
||||
type MsgMhfAcquireFesta struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Unk uint8
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Unk uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -21,16 +22,15 @@ func (m *MsgMhfAcquireFesta) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.FestaID = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
return nil
|
||||
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
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireFesta) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireFesta) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -4,13 +4,14 @@ import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireFestaIntermediatePrize represents the MSG_MHF_ACQUIRE_FESTA_INTERMEDIATE_PRIZE
|
||||
type MsgMhfAcquireFestaIntermediatePrize struct {
|
||||
AckHandle uint32
|
||||
PrizeID uint32
|
||||
PrizeID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfAcquireFestaIntermediatePrize) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireFestaIntermediatePrize) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireFestaIntermediatePrize) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.PrizeID = bf.ReadUint32()
|
||||
m.PrizeID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireFestaIntermediatePrize) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireFestaIntermediatePrize) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireFestaPersonalPrize represents the MSG_MHF_ACQUIRE_FESTA_PERSONAL_PRIZE
|
||||
type MsgMhfAcquireFestaPersonalPrize struct {
|
||||
AckHandle uint32
|
||||
PrizeID uint32
|
||||
AckHandle uint32
|
||||
PrizeID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfAcquireFestaPersonalPrize) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireFestaPersonalPrize) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.PrizeID = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfAcquireFestaPersonalPrize) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.PrizeID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireFestaPersonalPrize) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireFestaPersonalPrize) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireGuildAdventure represents the MSG_MHF_ACQUIRE_GUILD_ADVENTURE
|
||||
type MsgMhfAcquireGuildAdventure struct {
|
||||
AckHandle uint32
|
||||
ID uint32
|
||||
AckHandle uint32
|
||||
ID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfAcquireGuildAdventure) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireGuildAdventure) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ID = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfAcquireGuildAdventure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireGuildAdventure) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireGuildAdventure) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,15 +3,16 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireGuildTresure represents the MSG_MHF_ACQUIRE_GUILD_TRESURE
|
||||
type MsgMhfAcquireGuildTresure struct {
|
||||
AckHandle uint32
|
||||
HuntID uint32
|
||||
Unk bool
|
||||
Unk uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,14 +21,14 @@ func (m *MsgMhfAcquireGuildTresure) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.HuntID = bf.ReadUint32()
|
||||
m.Unk = bf.ReadBool()
|
||||
m.Unk = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireGuildTresure) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireGuildTresure) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireGuildTresureSouvenir represents the MSG_MHF_ACQUIRE_GUILD_TRESURE_SOUVENIR
|
||||
@@ -18,12 +19,12 @@ func (m *MsgMhfAcquireGuildTresureSouvenir) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireGuildTresureSouvenir) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireGuildTresureSouvenir) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireGuildTresureSouvenir) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireGuildTresureSouvenir) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireItem represents the MSG_MHF_ACQUIRE_ITEM
|
||||
type MsgMhfAcquireItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Length uint16
|
||||
Unk1 []uint32
|
||||
}
|
||||
type MsgMhfAcquireItem struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfAcquireItem) Opcode() network.PacketID {
|
||||
@@ -21,17 +17,11 @@ func (m *MsgMhfAcquireItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Length = bf.ReadUint16()
|
||||
for i := 0; i < int(m.Length); i++ {
|
||||
m.Unk1 = append(m.Unk1, bf.ReadUint32())
|
||||
}
|
||||
return nil
|
||||
func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,16 +3,17 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireMonthlyItem represents the MSG_MHF_ACQUIRE_MONTHLY_ITEM
|
||||
type MsgMhfAcquireMonthlyItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
}
|
||||
|
||||
@@ -22,17 +23,16 @@ func (m *MsgMhfAcquireMonthlyItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
bf.ReadUint32() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireMonthlyItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireMonthlyItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireMonthlyReward represents the MSG_MHF_ACQUIRE_MONTHLY_REWARD
|
||||
@@ -18,12 +19,12 @@ func (m *MsgMhfAcquireMonthlyReward) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireMonthlyReward) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireMonthlyReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireMonthlyReward) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireMonthlyReward) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,14 +3,17 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireTitle represents the MSG_MHF_ACQUIRE_TITLE
|
||||
type MsgMhfAcquireTitle struct {
|
||||
AckHandle uint32
|
||||
TitleIDs []uint16
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
TitleID uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,17 +22,15 @@ func (m *MsgMhfAcquireTitle) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireTitle) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
titles := int(bf.ReadUint16())
|
||||
bf.ReadUint16() // Zeroed
|
||||
for i := 0; i < titles; i++ {
|
||||
m.TitleIDs = append(m.TitleIDs, bf.ReadUint16())
|
||||
}
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.TitleID = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireTitle) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireTitle) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireTournament represents the MSG_MHF_ACQUIRE_TOURNAMENT
|
||||
type MsgMhfAcquireTournament struct {
|
||||
AckHandle uint32
|
||||
TournamentID uint32
|
||||
}
|
||||
type MsgMhfAcquireTournament struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfAcquireTournament) Opcode() network.PacketID {
|
||||
@@ -19,13 +17,11 @@ func (m *MsgMhfAcquireTournament) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireTournament) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.TournamentID = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfAcquireTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireTournament) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireTournament) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireUdItem represents the MSG_MHF_ACQUIRE_UD_ITEM
|
||||
type MsgMhfAcquireUdItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
// from gal
|
||||
// daily = 0
|
||||
// personal = 1
|
||||
// personal rank = 2
|
||||
// guild rank = 3
|
||||
// gcp = 4
|
||||
// from cat
|
||||
// treasure achievement = 5
|
||||
// personal achievement = 6
|
||||
// guild achievement = 7
|
||||
RewardType uint8
|
||||
Unk2 uint8 // Number of uint32s to read?
|
||||
Unk3 []byte
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
// from gal
|
||||
// daily = 0
|
||||
// personal = 1
|
||||
// personal rank = 2
|
||||
// guild rank = 3
|
||||
// gcp = 4
|
||||
// from cat
|
||||
// treasure achievement = 5
|
||||
// personal achievement = 6
|
||||
// guild achievement = 7
|
||||
RewardType uint8
|
||||
Unk2 uint8 // Number of uint32s to read?
|
||||
Unk3 []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,18 +33,18 @@ func (m *MsgMhfAcquireUdItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireUdItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
func (m *MsgMhfAcquireUdItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.RewardType = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint8()
|
||||
for i := uint8(0); i < m.Unk2; i++ {
|
||||
bf.ReadUint32()
|
||||
}
|
||||
m.Unk2 = bf.ReadUint8()
|
||||
for i := uint8(0); i < m.Unk2; i++ {
|
||||
bf.ReadUint32()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAcquireUdItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAcquireUdItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAddAchievement represents the MSG_MHF_ADD_ACHIEVEMENT
|
||||
@@ -20,7 +21,7 @@ func (m *MsgMhfAddAchievement) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddAchievement) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddAchievement) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AchievementID = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
@@ -28,6 +29,6 @@ func (m *MsgMhfAddAchievement) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddAchievement) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddAchievement) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddGuildMissionCount represents the MSG_MHF_ADD_GUILD_MISSION_COUNT
|
||||
type MsgMhfAddGuildMissionCount struct {
|
||||
AckHandle uint32
|
||||
MissionID uint32
|
||||
Count uint32
|
||||
AckHandle uint32
|
||||
MissionID uint32
|
||||
Count uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,14 +21,14 @@ func (m *MsgMhfAddGuildMissionCount) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddGuildMissionCount) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.MissionID = bf.ReadUint32()
|
||||
m.Count = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfAddGuildMissionCount) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.MissionID = bf.ReadUint32()
|
||||
m.Count = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddGuildMissionCount) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddGuildMissionCount) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddGuildWeeklyBonusExceptionalUser represents the MSG_MHF_ADD_GUILD_WEEKLY_BONUS_EXCEPTIONAL_USER
|
||||
type MsgMhfAddGuildWeeklyBonusExceptionalUser struct {
|
||||
AckHandle uint32
|
||||
NumUsers uint8
|
||||
AckHandle uint32
|
||||
NumUsers uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfAddGuildWeeklyBonusExceptionalUser) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddGuildWeeklyBonusExceptionalUser) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.NumUsers = bf.ReadUint8()
|
||||
return nil
|
||||
func (m *MsgMhfAddGuildWeeklyBonusExceptionalUser) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.NumUsers = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddGuildWeeklyBonusExceptionalUser) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddGuildWeeklyBonusExceptionalUser) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddKouryouPoint represents the MSG_MHF_ADD_KOURYOU_POINT
|
||||
@@ -17,14 +18,14 @@ func (m *MsgMhfAddKouryouPoint) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddKouryouPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddKouryouPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.KouryouPoints = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddKouryouPoint) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddKouryouPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.KouryouPoints)
|
||||
return nil
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddRewardSongCount represents the MSG_MHF_ADD_REWARD_SONG_COUNT
|
||||
@@ -16,11 +17,11 @@ func (m *MsgMhfAddRewardSongCount) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddRewardSongCount) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddRewardSongCount) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddRewardSongCount) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddRewardSongCount) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddUdPoint represents the MSG_MHF_ADD_UD_POINT
|
||||
@@ -20,7 +21,7 @@ func (m *MsgMhfAddUdPoint) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddUdPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddUdPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
@@ -30,6 +31,6 @@ func (m *MsgMhfAddUdPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddUdPoint) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddUdPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAddUdTacticsPoint represents the MSG_MHF_ADD_UD_TACTICS_POINT
|
||||
@@ -18,7 +19,7 @@ func (m *MsgMhfAddUdTacticsPoint) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
@@ -26,7 +27,7 @@ func (m *MsgMhfAddUdTacticsPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAddUdTacticsPoint) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAddUdTacticsPoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint16(m.Unk0)
|
||||
bf.WriteUint32(m.Unk1)
|
||||
|
||||
@@ -3,8 +3,9 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAnnounce represents the MSG_MHF_ANNOUNCE
|
||||
@@ -13,7 +14,7 @@ type MsgMhfAnnounce struct {
|
||||
IPAddress uint32
|
||||
Port uint16
|
||||
StageID []byte
|
||||
Data *byteframe.ByteFrame
|
||||
Type uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,19 +23,19 @@ func (m *MsgMhfAnnounce) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.IPAddress = bf.ReadUint32()
|
||||
m.Port = bf.ReadUint16()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint16()
|
||||
m.StageID = bf.ReadBytes(32)
|
||||
m.Data = byteframe.NewByteFrameFromBytes(bf.ReadBytes(uint(bf.ReadUint32())))
|
||||
_ = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAnnounce) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAnnounce) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAnswerGuildScout represents the MSG_MHF_ANSWER_GUILD_SCOUT
|
||||
@@ -20,7 +21,7 @@ func (m *MsgMhfAnswerGuildScout) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAnswerGuildScout) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAnswerGuildScout) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.LeaderID = bf.ReadUint32()
|
||||
m.Answer = bf.ReadBool()
|
||||
@@ -28,6 +29,6 @@ func (m *MsgMhfAnswerGuildScout) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfAnswerGuildScout) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfAnswerGuildScout) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/utils/bfutil"
|
||||
"erupe-ce/utils/stringsupport"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/stringsupport"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfApplyBbsArticle represents the MSG_MHF_APPLY_BBS_ARTICLE
|
||||
@@ -25,7 +26,7 @@ func (m *MsgMhfApplyBbsArticle) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfApplyBbsArticle) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfApplyBbsArticle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadBytes(16)
|
||||
@@ -36,6 +37,6 @@ func (m *MsgMhfApplyBbsArticle) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfApplyBbsArticle) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfApplyBbsArticle) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfApplyCampaign represents the MSG_MHF_APPLY_CAMPAIGN
|
||||
type MsgMhfApplyCampaign struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint16
|
||||
Unk2 []byte
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,15 +20,19 @@ func (m *MsgMhfApplyCampaign) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfApplyCampaign) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfApplyCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadBytes(16)
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfApplyCampaign) Build(bf *byteframe.ByteFrame) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
func (m *MsgMhfApplyCampaign) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.Unk0)
|
||||
bf.WriteUint8(m.Unk1)
|
||||
bf.WriteUint16(m.Unk2)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfApplyDistItem represents the MSG_MHF_APPLY_DIST_ITEM
|
||||
type MsgMhfApplyDistItem struct {
|
||||
AckHandle uint32
|
||||
AckHandle uint32
|
||||
DistributionType uint8
|
||||
DistributionID uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
DistributionID uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,20 +21,21 @@ func (m *MsgMhfApplyDistItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.DistributionType = bf.ReadUint8()
|
||||
m.DistributionID = bf.ReadUint32()
|
||||
if config.GetConfig().ClientID >= config.G8 {
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
}
|
||||
if config.GetConfig().ClientID >= config.G10 {
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
}
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfApplyDistItem) Build(bf *byteframe.ByteFrame) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
func (m *MsgMhfApplyDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.DistributionType)
|
||||
bf.WriteUint32(m.DistributionID)
|
||||
bf.WriteUint32(m.Unk2)
|
||||
bf.WriteUint32(m.Unk3)
|
||||
return nil
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfArrangeGuildMember represents the MSG_MHF_ARRANGE_GUILD_MEMBER
|
||||
@@ -19,14 +19,14 @@ func (m *MsgMhfArrangeGuildMember) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
bf.ReadUint8() // Zeroed
|
||||
charCount := int(bf.ReadUint8())
|
||||
charCount := bf.ReadUint16()
|
||||
|
||||
m.CharIDs = make([]uint32, charCount)
|
||||
|
||||
for i := 0; i < charCount; i++ {
|
||||
for i := uint16(0); i < charCount; i++ {
|
||||
m.CharIDs[i] = bf.ReadUint32()
|
||||
}
|
||||
|
||||
@@ -34,6 +34,14 @@ func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame) error {
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfArrangeGuildMember) Build(bf *byteframe.ByteFrame) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCancelGuildMissionTarget represents the MSG_MHF_CANCEL_GUILD_MISSION_TARGET
|
||||
type MsgMhfCancelGuildMissionTarget struct {
|
||||
AckHandle uint32
|
||||
MissionID uint32
|
||||
AckHandle uint32
|
||||
MissionID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfCancelGuildMissionTarget) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCancelGuildMissionTarget) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.MissionID = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfCancelGuildMissionTarget) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.MissionID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCancelGuildMissionTarget) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCancelGuildMissionTarget) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCancelGuildScout represents the MSG_MHF_CANCEL_GUILD_SCOUT
|
||||
@@ -19,13 +20,13 @@ func (m *MsgMhfCancelGuildScout) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCancelGuildScout) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCancelGuildScout) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.InvitationID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCancelGuildScout) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCancelGuildScout) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanMyRank represents the MSG_MHF_CARAVAN_MY_RANK
|
||||
type MsgMhfCaravanMyRank struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
}
|
||||
type MsgMhfCaravanMyRank struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID {
|
||||
@@ -21,15 +17,11 @@ func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanMyRank) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfCaravanMyRank) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCaravanMyRank) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCaravanMyRank) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanMyScore represents the MSG_MHF_CARAVAN_MY_SCORE
|
||||
type MsgMhfCaravanMyScore struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
Unk4 uint32
|
||||
Unk5 int32
|
||||
Unk6 int32
|
||||
}
|
||||
type MsgMhfCaravanMyScore struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID {
|
||||
@@ -25,19 +17,11 @@ func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanMyScore) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
m.Unk3 = bf.ReadInt32()
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadInt32()
|
||||
m.Unk6 = bf.ReadInt32()
|
||||
return nil
|
||||
func (m *MsgMhfCaravanMyScore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCaravanMyScore) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCaravanMyScore) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanRanking represents the MSG_MHF_CARAVAN_RANKING
|
||||
type MsgMhfCaravanRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
}
|
||||
type MsgMhfCaravanRanking struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanRanking) Opcode() network.PacketID {
|
||||
@@ -21,15 +17,11 @@ func (m *MsgMhfCaravanRanking) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanRanking) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
return nil
|
||||
func (m *MsgMhfCaravanRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCaravanRanking) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCaravanRanking) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfChargeFesta represents the MSG_MHF_CHARGE_FESTA
|
||||
type MsgMhfChargeFesta struct {
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Souls []uint16
|
||||
Auto bool
|
||||
AckHandle uint32
|
||||
FestaID uint32
|
||||
GuildID uint32
|
||||
Souls int
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,18 +22,19 @@ func (m *MsgMhfChargeFesta) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfChargeFesta) Parse(bf *byteframe.ByteFrame) error {
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfChargeFesta) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfChargeFesta) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfChargeGuildAdventure represents the MSG_MHF_CHARGE_GUILD_ADVENTURE
|
||||
type MsgMhfChargeGuildAdventure struct {
|
||||
AckHandle uint32
|
||||
ID uint32
|
||||
Amount uint32
|
||||
AckHandle uint32
|
||||
ID uint32
|
||||
Amount uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,14 +21,14 @@ func (m *MsgMhfChargeGuildAdventure) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfChargeGuildAdventure) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ID = bf.ReadUint32()
|
||||
m.Amount = bf.ReadUint32()
|
||||
return nil
|
||||
func (m *MsgMhfChargeGuildAdventure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.ID = bf.ReadUint32()
|
||||
m.Amount = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfChargeGuildAdventure) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfChargeGuildAdventure) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfCheckDailyCafepoint represents the MSG_MHF_CHECK_DAILY_CAFEPOINT
|
||||
@@ -18,12 +18,14 @@ func (m *MsgMhfCheckDailyCafepoint) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCheckDailyCafepoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCheckDailyCafepoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MsgMhfCheckDailyCafepoint) Build(bf *byteframe.ByteFrame) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
func (m *MsgMhfCheckDailyCafepoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.Unk)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfCheckMonthlyItem represents the MSG_MHF_CHECK_MONTHLY_ITEM
|
||||
type MsgMhfCheckMonthlyItem struct {
|
||||
AckHandle uint32
|
||||
Type uint8
|
||||
Unk []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -19,16 +21,14 @@ func (m *MsgMhfCheckMonthlyItem) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCheckMonthlyItem) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCheckMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
bf.ReadUint8() // Zeroed
|
||||
m.Unk = bf.ReadBytes(3)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCheckMonthlyItem) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCheckMonthlyItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -2,8 +2,9 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfCheckWeeklyStamp represents the MSG_MHF_CHECK_WEEKLY_STAMP
|
||||
@@ -11,6 +12,7 @@ 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.
|
||||
@@ -19,7 +21,7 @@ func (m *MsgMhfCheckWeeklyStamp) Opcode() network.PacketID {
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCheckWeeklyStamp) Parse(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCheckWeeklyStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
stampType := bf.ReadUint8()
|
||||
switch stampType {
|
||||
@@ -29,11 +31,11 @@ func (m *MsgMhfCheckWeeklyStamp) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.StampType = "ex"
|
||||
}
|
||||
m.Unk1 = bf.ReadBool()
|
||||
bf.ReadUint16() // Zeroed
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfCheckWeeklyStamp) Build(bf *byteframe.ByteFrame) error {
|
||||
func (m *MsgMhfCheckWeeklyStamp) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user