diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c33872e81..955febd9a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: '1.21' - name: Build Linux-amd64 run: env GOOS=linux GOARCH=amd64 go build -v diff --git a/README.md b/README.md index f9b5ecfd7..8f17c33ce 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,150 @@ -# Erupe Community Edition +# Erupe + +## Client Compatiblity +### 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! + ## 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. -### Note -- You will need to acquire and install the client files and quest binaries separately. -# Resources + +## Resources + - [Quest and Scenario Binary Files](https://files.catbox.moe/xf0l7w.7z) -- [PewPewDojo Discord](https://discord.gg/CFnzbhQ) -- [Community FAQ Pastebin](https://pastebin.com/QqAwZSTC) \ No newline at end of file +- [Mezeporta Square Discord](https://discord.gg/DnwcpXM488) + +## Configuration +This portion of the documentation goes over the `config.json` file. + +### General Configuration + +| Variable | Description | Default | Options | +|------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------|---------------------------------| +| Host | The IP or host address the server is running from | 127.0.0.1 | | +| BinPath | The bin path folder is where you place files needed for various parts of the game such as scenario and quest files | bin | | +| Language | This is the language the server will run in. Only English `en` and Japanese `jp` are available, contributions welcome | en | en/jp | +| DisableSoftCrash | | false | | +| HideLoginNotice | This hides the notices that appear on login from `LoginNotices` | true | | +| LoginNotices | This is where you place notices for users, you can have multiple notices | | | +| PatchServerManifest | | | | +| PatchServerFile | | | | +| ScreenshotAPIURL | This is the URL you want user sreenshots to go to | | | +| DeleteOnSaveCorruption | This option flags a character as deleted if they corrupt it, can be used as punishment for cheaters | false | | +| ClientMode | This tells the server what client version it should target | ZZ | Check compatible versions above | +| DevMode | This enables DevModeOptions to be configured | true | | + +### `DevModeOptions` Configuraiton + +| Variable | Description | Default | Options | +|----------------------|---------------------------------------------------------------------------------------------|--------------|----------------------------------| +| AutoCreateAccount | This allows users that don't exist to auto create their account from initial login | true | | +| CleanDB | This cleans the database down | false | | +| MaxLauncherHR | This sets the launcher value to HR7 to allow you to break World HR requirements | false | | +| LogInboundMessages | This will allow inbound messages to be logged to stdout | false | | +| LogOutboundMessages | This will allow outbound messages to be logged to stdout | false | | +| MaxHexdumpLength | This is the maximum amount of hex bytes that will be dumped to stdout | 0 | | +| DivaEvent | This overrides the Diva event stage in game | 0 | 0/1/2/3/-1 | +| FestaEvent | This overrides the Hunter Festival event stage in game | -1 | 0/1/2/3/-1 | +| TournamentEvent | This overrides the Hunter Tournament event stage in game | 0 | 0/1/2/3/-1 | +| MezFesEvent | Enables whether the MezFes event & World are active | true | | +| MezFesAlt | Switches the multiplayer MezFes minigame | false | | +| DisableTokenCheck | This disables the random token that is generated at login from being checked, very insecure | false | | +| QuestDebugTools | Enable various quest debug logs | false | | +| EarthStatusOverride | Enables Pallone Fest, Tower and Conquest War events | 0 | 2=Conquest, 11=Pallone, 21=Tower | +| EarthIDOverride | A random event ID | 0 | | +| EarthMonsterOverride | Sets the ID of the monster targeted in the Conquest War | 0 | | +| SaveDumps.Enables | Enables save dumps to a folder that is set at `SaveDumps.OutputDir` | true | | +| SaveDumps.OutputDir | The folder that save dumps are saved to | save-backups | | + +### `GameplayOptions` Configuraiton + +| Variable | Description | Default | Options | +|----------------------|-----------------------------------------------------------------------------|---------|---------| +| FeaturedWeapons | Number of Active Feature weapons to generate daily | 0 | | +| MaximumNP | Maximum number of NP held by a player | 100000 | | +| MaximumRP | Maximum number of RP held by a player | 100000 | | +| DisableLoginBoost | Disables the Login Boost system | false | | +| DisableBoostTime | Disables the daily NetCafe Boost Time | false | | +| BoostTimeDuration | The number of minutes NetCafe Boost Time lasts for | 120 | | +| GuildMealDuration | The number of minutes a Guild Meal can be activated for after cooking | 60 | | +| BonusQuestAllowance | Number of Bonus Point Quests to allow daily | 3 | | +| DailyQuestAllowance | Number of Daily Quests to allow daily | 1 | | +| MezfesSoloTickets | Number of solo tickets given weekly | 10 | | +| MezfesGroupTickets | Number of group tickets given weekly | 4 | | +| GUrgentRate | Adjusts the rate of G Urgent quests spawning | 10 | | +| GCPMultiplier | Adjusts the multiplier of GCP rewarded for quest completion | 1.00 | | +| GRPMultiplier | Adjusts the multiplier of G Rank Points rewarded for quest completion | 1.00 | | +| GSRPMultiplier | Adjusts the multiplier of G Skill Rank Points rewarded for quest completion | 1.00 | | +| GZennyMultiplier | Adjusts the multiplier of G Zenny rewarded for quest completion | 1.00 | | +| MaterialMultiplier | Adjusts the multiplier of Monster Materials rewarded for quest completion | 1.00 | | +| ExtraCarves | Grant n extra chances to carve ALL carcasses | 0 | | +| DisableHunterNavi | Disables the Hunter Navi | false | | +| EnableHiganjimaEvent | Enables the Higanjima event in the Rasta Bar | false | | +| EnableNierEvent | Enables the Nier event in the Rasta Bar | false | | +| DisableRoad | Disables the Hunting Road | false | | + +### Discord +There is limited Discord capability in Erupe. The feature allows you to replay messages from your server into a channel. +This may be either be removed or revamped in a future version. + +### Commands +There are several chat commands that can be turned on and off. Most of them are really for admins or debugging purposes. + +| Name | command | Description | Default | Options | +|----------|----------------|--------------------------------------------|----------|---------------------| +| Rights | !rights VALUE | Sets the rights integer for your account | disabled | | +| Teleport | !tele X,Y | Teleports user to specific x,y coordinate | disabled | | +| Reload | !reload | Reloads all users and character objects | enabled | | +| KeyQuest | !kqf FLAGS | Sets the Key Quest Flag for your character | disabled | | +| Course | !course OPTION | Enables/Disables a course for your account | enabled | HL,EX,Premium,Boost | +| PSN | !psn USERNAME | Links the specified PSN to your account | enabled | | + +### Ravi Sub Commands +| Name | command | Description | +|----------|----------------------------------|-------------------------------| +| Raviente | !ravi start | Starts Ravi Event | +| Raviente | !ravi cm / !ravi checkmultiplier | Checks Ravi Damage Multiplier | +| Raviente | !ravi ss | Send Sedation Support | +| Raviente | !ravi sr | Send Resurrection Support | +| Raviente | !ravi rs | Request Sedation Support | + + +## World `Entries` config + +| Config Item | Description | Options | +|-------------|---------------|------------------------------------------------------------| +| Type | Server type | 1=Normal, 2=Cities, 3=Newbie, 4=Tavern, 5=Return, 6=MezFes | +| Season | Server season | 0=Green/Breeding, 1=Orange/Warm, 2=Blue/Cold | + +### `Recommend` +This sets the types of Quests that can be ordered from a World. +* 0 = All quests +* 1 = Up to 2 star Quests +* 2 = Up to 4 star Quests +* 4 = All Quests in HR (Enables G Experience Tab) +* 5 = Only G Rank Quests +* 6 = Minigame World \ No newline at end of file diff --git a/bin/quests/desktop.ini b/bin/quests/desktop.ini new file mode 100644 index 000000000..a71744976 --- /dev/null +++ b/bin/quests/desktop.ini @@ -0,0 +1,2372 @@ +[LocalizedFileNames] +23484d1.bin=@23484d1.bin,0 +23484d2.bin=@23484d2.bin,0 +23484n0.bin=@23484n0.bin,0 +23484n1.bin=@23484n1.bin,0 +23484n2.bin=@23484n2.bin,0 +23485d0.bin=@23485d0.bin,0 +23485d1.bin=@23485d1.bin,0 +23485d2.bin=@23485d2.bin,0 +23485n0.bin=@23485n0.bin,0 +23485n1.bin=@23485n1.bin,0 +23485n2.bin=@23485n2.bin,0 +23486d0.bin=@23486d0.bin,0 +23486d1.bin=@23486d1.bin,0 +23486d2.bin=@23486d2.bin,0 +23486n0.bin=@23486n0.bin,0 +23486n1.bin=@23486n1.bin,0 +23486n2.bin=@23486n2.bin,0 +23487d0.bin=@23487d0.bin,0 +23487d1.bin=@23487d1.bin,0 +23487d2.bin=@23487d2.bin,0 +23487n0.bin=@23487n0.bin,0 +23487n1.bin=@23487n1.bin,0 +23487n2.bin=@23487n2.bin,0 +23488d0.bin=@23488d0.bin,0 +23488d1.bin=@23488d1.bin,0 +23488d2.bin=@23488d2.bin,0 +23488n0.bin=@23488n0.bin,0 +23488n1.bin=@23488n1.bin,0 +23488n2.bin=@23488n2.bin,0 +23489d0.bin=@23489d0.bin,0 +23489d1.bin=@23489d1.bin,0 +23489d2.bin=@23489d2.bin,0 +23489n0.bin=@23489n0.bin,0 +23489n1.bin=@23489n1.bin,0 +23489n2.bin=@23489n2.bin,0 +23490d0.bin=@23490d0.bin,0 +23490d1.bin=@23490d1.bin,0 +23490d2.bin=@23490d2.bin,0 +23490n0.bin=@23490n0.bin,0 +23490n1.bin=@23490n1.bin,0 +23490n2.bin=@23490n2.bin,0 +23491d0.bin=@23491d0.bin,0 +23491d1.bin=@23491d1.bin,0 +23491d2.bin=@23491d2.bin,0 +23491n0.bin=@23491n0.bin,0 +23491n1.bin=@23491n1.bin,0 +23491n2.bin=@23491n2.bin,0 +23492d0.bin=@23492d0.bin,0 +23492d1.bin=@23492d1.bin,0 +23492d2.bin=@23492d2.bin,0 +23492n0.bin=@23492n0.bin,0 +23492n1.bin=@23492n1.bin,0 +23492n2.bin=@23492n2.bin,0 +23484d0.bin=@23484d0.bin,0 +23585d0.bin=@23585d0.bin,0 +23585d1.bin=@23585d1.bin,0 +23585d2.bin=@23585d2.bin,0 +23585n0.bin=@23585n0.bin,0 +23585n1.bin=@23585n1.bin,0 +23585n2.bin=@23585n2.bin,0 +23586d0.bin=@23586d0.bin,0 +23586d1.bin=@23586d1.bin,0 +23586d2.bin=@23586d2.bin,0 +23586n0.bin=@23586n0.bin,0 +23586n1.bin=@23586n1.bin,0 +23586n2.bin=@23586n2.bin,0 +23587d0.bin=@23587d0.bin,0 +23587d1.bin=@23587d1.bin,0 +23587d2.bin=@23587d2.bin,0 +23587n0.bin=@23587n0.bin,0 +23587n1.bin=@23587n1.bin,0 +23587n2.bin=@23587n2.bin,0 +23588d0.bin=@23588d0.bin,0 +23588d1.bin=@23588d1.bin,0 +23588d2.bin=@23588d2.bin,0 +23588n0.bin=@23588n0.bin,0 +23588n1.bin=@23588n1.bin,0 +23588n2.bin=@23588n2.bin,0 +23589d0.bin=@23589d0.bin,0 +23589d1.bin=@23589d1.bin,0 +23589d2.bin=@23589d2.bin,0 +23589n0.bin=@23589n0.bin,0 +23589n1.bin=@23589n1.bin,0 +23589n2.bin=@23589n2.bin,0 +23590d0.bin=@23590d0.bin,0 +23590d1.bin=@23590d1.bin,0 +23590d2.bin=@23590d2.bin,0 +23590n0.bin=@23590n0.bin,0 +23590n1.bin=@23590n1.bin,0 +23590n2.bin=@23590n2.bin,0 +23591d0.bin=@23591d0.bin,0 +23591d1.bin=@23591d1.bin,0 +23591d2.bin=@23591d2.bin,0 +23591n0.bin=@23591n0.bin,0 +23591n1.bin=@23591n1.bin,0 +23591n2.bin=@23591n2.bin,0 +23592d0.bin=@23592d0.bin,0 +23592d1.bin=@23592d1.bin,0 +23592d2.bin=@23592d2.bin,0 +23592n0.bin=@23592n0.bin,0 +23592n1.bin=@23592n1.bin,0 +23592n2.bin=@23592n2.bin,0 +23593d0.bin=@23593d0.bin,0 +23593d1.bin=@23593d1.bin,0 +23593d2.bin=@23593d2.bin,0 +23593n0.bin=@23593n0.bin,0 +23593n1.bin=@23593n1.bin,0 +23593n2.bin=@23593n2.bin,0 +23594d0.bin=@23594d0.bin,0 +23594d1.bin=@23594d1.bin,0 +23594d2.bin=@23594d2.bin,0 +23594n0.bin=@23594n0.bin,0 +23594n1.bin=@23594n1.bin,0 +23594n2.bin=@23594n2.bin,0 +23595d0.bin=@23595d0.bin,0 +23595d1.bin=@23595d1.bin,0 +23595d2.bin=@23595d2.bin,0 +23595n0.bin=@23595n0.bin,0 +23595n1.bin=@23595n1.bin,0 +23595n2.bin=@23595n2.bin,0 +23596d0.bin=@23596d0.bin,0 +23596d1.bin=@23596d1.bin,0 +23596d2.bin=@23596d2.bin,0 +23596n0.bin=@23596n0.bin,0 +23596n1.bin=@23596n1.bin,0 +23596n2.bin=@23596n2.bin,0 +23597d0.bin=@23597d0.bin,0 +23597d1.bin=@23597d1.bin,0 +23597d2.bin=@23597d2.bin,0 +23597n0.bin=@23597n0.bin,0 +23597n1.bin=@23597n1.bin,0 +23597n2.bin=@23597n2.bin,0 +23598d0.bin=@23598d0.bin,0 +23598d1.bin=@23598d1.bin,0 +23598d2.bin=@23598d2.bin,0 +23598n0.bin=@23598n0.bin,0 +23598n1.bin=@23598n1.bin,0 +23598n2.bin=@23598n2.bin,0 +23599d0.bin=@23599d0.bin,0 +23599d1.bin=@23599d1.bin,0 +23599d2.bin=@23599d2.bin,0 +23599n0.bin=@23599n0.bin,0 +23599n1.bin=@23599n1.bin,0 +23599n2.bin=@23599n2.bin,0 +23601d0.bin=@23601d0.bin,0 +23601d1.bin=@23601d1.bin,0 +23601d2.bin=@23601d2.bin,0 +23601n0.bin=@23601n0.bin,0 +23601n1.bin=@23601n1.bin,0 +23601n2.bin=@23601n2.bin,0 +23602d0.bin=@23602d0.bin,0 +23602d1.bin=@23602d1.bin,0 +23602d2.bin=@23602d2.bin,0 +23602n0.bin=@23602n0.bin,0 +23602n1.bin=@23602n1.bin,0 +23602n2.bin=@23602n2.bin,0 +23603d0.bin=@23603d0.bin,0 +23603d1.bin=@23603d1.bin,0 +23603d2.bin=@23603d2.bin,0 +23603n0.bin=@23603n0.bin,0 +23603n1.bin=@23603n1.bin,0 +23603n2.bin=@23603n2.bin,0 +23604d0.bin=@23604d0.bin,0 +23604d1.bin=@23604d1.bin,0 +23604d2.bin=@23604d2.bin,0 +23604n0.bin=@23604n0.bin,0 +23604n1.bin=@23604n1.bin,0 +23604n2.bin=@23604n2.bin,0 +23605d0.bin=@23605d0.bin,0 +23605d1.bin=@23605d1.bin,0 +23605d2.bin=@23605d2.bin,0 +23605n0.bin=@23605n0.bin,0 +23605n1.bin=@23605n1.bin,0 +23605n2.bin=@23605n2.bin,0 +40241n0.bin=@40241n0.bin,0 +40241n1.bin=@40241n1.bin,0 +40241n2.bin=@40241n2.bin,0 +54594d0.bin=@54594d0.bin,0 +54594d1.bin=@54594d1.bin,0 +54594d2.bin=@54594d2.bin,0 +54594n0.bin=@54594n0.bin,0 +54594n1.bin=@54594n1.bin,0 +54594n2.bin=@54594n2.bin,0 +54603d0.bin=@54603d0.bin,0 +54603d1.bin=@54603d1.bin,0 +54603d2.bin=@54603d2.bin,0 +54603n0.bin=@54603n0.bin,0 +54603n1.bin=@54603n1.bin,0 +54603n2.bin=@54603n2.bin,0 +40241d0.bin=@40241d0.bin,0 +40241d1.bin=@40241d1.bin,0 +40241d2.bin=@40241d2.bin,0 +23493n0.bin=@23493n0.bin,0 +23493n1.bin=@23493n1.bin,0 +23493n2.bin=@23493n2.bin,0 +23494d0.bin=@23494d0.bin,0 +23494d1.bin=@23494d1.bin,0 +23494d2.bin=@23494d2.bin,0 +23494n0.bin=@23494n0.bin,0 +23494n1.bin=@23494n1.bin,0 +23494n2.bin=@23494n2.bin,0 +23495d0.bin=@23495d0.bin,0 +23495d1.bin=@23495d1.bin,0 +23495d2.bin=@23495d2.bin,0 +23495n0.bin=@23495n0.bin,0 +23495n1.bin=@23495n1.bin,0 +23495n2.bin=@23495n2.bin,0 +23496d0.bin=@23496d0.bin,0 +23496d1.bin=@23496d1.bin,0 +23496d2.bin=@23496d2.bin,0 +23496n0.bin=@23496n0.bin,0 +23496n1.bin=@23496n1.bin,0 +23496n2.bin=@23496n2.bin,0 +23497d0.bin=@23497d0.bin,0 +23497d1.bin=@23497d1.bin,0 +23497d2.bin=@23497d2.bin,0 +23497n0.bin=@23497n0.bin,0 +23497n1.bin=@23497n1.bin,0 +23497n2.bin=@23497n2.bin,0 +23498d0.bin=@23498d0.bin,0 +23498d1.bin=@23498d1.bin,0 +23498d2.bin=@23498d2.bin,0 +23498n0.bin=@23498n0.bin,0 +23498n1.bin=@23498n1.bin,0 +23498n2.bin=@23498n2.bin,0 +23499d0.bin=@23499d0.bin,0 +23499d1.bin=@23499d1.bin,0 +23499d2.bin=@23499d2.bin,0 +23499n0.bin=@23499n0.bin,0 +23499n1.bin=@23499n1.bin,0 +23499n2.bin=@23499n2.bin,0 +23513d0.bin=@23513d0.bin,0 +23513d1.bin=@23513d1.bin,0 +23513d2.bin=@23513d2.bin,0 +23513n0.bin=@23513n0.bin,0 +23513n1.bin=@23513n1.bin,0 +23513n2.bin=@23513n2.bin,0 +23528d0.bin=@23528d0.bin,0 +23528d1.bin=@23528d1.bin,0 +23528d2.bin=@23528d2.bin,0 +23528n0.bin=@23528n0.bin,0 +23528n1.bin=@23528n1.bin,0 +23528n2.bin=@23528n2.bin,0 +23643d0.bin=@23643d0.bin,0 +23643d1.bin=@23643d1.bin,0 +23643d2.bin=@23643d2.bin,0 +23643n0.bin=@23643n0.bin,0 +23643n1.bin=@23643n1.bin,0 +23643n2.bin=@23643n2.bin,0 +23667d0.bin=@23667d0.bin,0 +23667d1.bin=@23667d1.bin,0 +23667d2.bin=@23667d2.bin,0 +23667n0.bin=@23667n0.bin,0 +23667n1.bin=@23667n1.bin,0 +23667n2.bin=@23667n2.bin,0 +55679d0.bin=@55679d0.bin,0 +55679d1.bin=@55679d1.bin,0 +55679d2.bin=@55679d2.bin,0 +55679n0.bin=@55679n0.bin,0 +55679n1.bin=@55679n1.bin,0 +55679n2.bin=@55679n2.bin,0 +55680d0.bin=@55680d0.bin,0 +55680d1.bin=@55680d1.bin,0 +55680d2.bin=@55680d2.bin,0 +55680n0.bin=@55680n0.bin,0 +55680n1.bin=@55680n1.bin,0 +55680n2.bin=@55680n2.bin,0 +55772d0.bin=@55772d0.bin,0 +55772d1.bin=@55772d1.bin,0 +55772d2.bin=@55772d2.bin,0 +55772n0.bin=@55772n0.bin,0 +55772n1.bin=@55772n1.bin,0 +55772n2.bin=@55772n2.bin,0 +55916d0.bin=@55916d0.bin,0 +55916d1.bin=@55916d1.bin,0 +55916d2.bin=@55916d2.bin,0 +55916n0.bin=@55916n0.bin,0 +55916n1.bin=@55916n1.bin,0 +55916n2.bin=@55916n2.bin,0 +23493d0.bin=@23493d0.bin,0 +23493d1.bin=@23493d1.bin,0 +23493d2.bin=@23493d2.bin,0 +23199n2.bin=@23199n2.bin,0 +23201d0.bin=@23201d0.bin,0 +23201d1.bin=@23201d1.bin,0 +23201d2.bin=@23201d2.bin,0 +23201n0.bin=@23201n0.bin,0 +23201n1.bin=@23201n1.bin,0 +23201n2.bin=@23201n2.bin,0 +23202d0.bin=@23202d0.bin,0 +23202d1.bin=@23202d1.bin,0 +23202d2.bin=@23202d2.bin,0 +23202n0.bin=@23202n0.bin,0 +23202n1.bin=@23202n1.bin,0 +23202n2.bin=@23202n2.bin,0 +23203d0.bin=@23203d0.bin,0 +23203d1.bin=@23203d1.bin,0 +23203d2.bin=@23203d2.bin,0 +23203n0.bin=@23203n0.bin,0 +23203n1.bin=@23203n1.bin,0 +23203n2.bin=@23203n2.bin,0 +23204d0.bin=@23204d0.bin,0 +23204d1.bin=@23204d1.bin,0 +23204d2.bin=@23204d2.bin,0 +23204n0.bin=@23204n0.bin,0 +23204n1.bin=@23204n1.bin,0 +23204n2.bin=@23204n2.bin,0 +23205d0.bin=@23205d0.bin,0 +23205d1.bin=@23205d1.bin,0 +23205d2.bin=@23205d2.bin,0 +23205n0.bin=@23205n0.bin,0 +23205n1.bin=@23205n1.bin,0 +23205n2.bin=@23205n2.bin,0 +23206d0.bin=@23206d0.bin,0 +23206d1.bin=@23206d1.bin,0 +23206d2.bin=@23206d2.bin,0 +23206n0.bin=@23206n0.bin,0 +23206n1.bin=@23206n1.bin,0 +23206n2.bin=@23206n2.bin,0 +23207d0.bin=@23207d0.bin,0 +23207d1.bin=@23207d1.bin,0 +23207d2.bin=@23207d2.bin,0 +23207n0.bin=@23207n0.bin,0 +23207n1.bin=@23207n1.bin,0 +23207n2.bin=@23207n2.bin,0 +23208d0.bin=@23208d0.bin,0 +23208d1.bin=@23208d1.bin,0 +23208d2.bin=@23208d2.bin,0 +23208n0.bin=@23208n0.bin,0 +23208n1.bin=@23208n1.bin,0 +23208n2.bin=@23208n2.bin,0 +23209d0.bin=@23209d0.bin,0 +23209d1.bin=@23209d1.bin,0 +23209d2.bin=@23209d2.bin,0 +23209n0.bin=@23209n0.bin,0 +23209n1.bin=@23209n1.bin,0 +23209n2.bin=@23209n2.bin,0 +23210d0.bin=@23210d0.bin,0 +23210d1.bin=@23210d1.bin,0 +23210d2.bin=@23210d2.bin,0 +23210n0.bin=@23210n0.bin,0 +23210n1.bin=@23210n1.bin,0 +23210n2.bin=@23210n2.bin,0 +23253d0.bin=@23253d0.bin,0 +23253d1.bin=@23253d1.bin,0 +23253d2.bin=@23253d2.bin,0 +23253n0.bin=@23253n0.bin,0 +23253n1.bin=@23253n1.bin,0 +23253n2.bin=@23253n2.bin,0 +23254d0.bin=@23254d0.bin,0 +23254d1.bin=@23254d1.bin,0 +23254d2.bin=@23254d2.bin,0 +23254n0.bin=@23254n0.bin,0 +23254n1.bin=@23254n1.bin,0 +23254n2.bin=@23254n2.bin,0 +23269d0.bin=@23269d0.bin,0 +23269d1.bin=@23269d1.bin,0 +23269d2.bin=@23269d2.bin,0 +23269n0.bin=@23269n0.bin,0 +23269n1.bin=@23269n1.bin,0 +23269n2.bin=@23269n2.bin,0 +23270d0.bin=@23270d0.bin,0 +23270d1.bin=@23270d1.bin,0 +23270d2.bin=@23270d2.bin,0 +23270n0.bin=@23270n0.bin,0 +23270n1.bin=@23270n1.bin,0 +23270n2.bin=@23270n2.bin,0 +23271d0.bin=@23271d0.bin,0 +23271d1.bin=@23271d1.bin,0 +23271d2.bin=@23271d2.bin,0 +23271n0.bin=@23271n0.bin,0 +23271n1.bin=@23271n1.bin,0 +23271n2.bin=@23271n2.bin,0 +23272d0.bin=@23272d0.bin,0 +23272d1.bin=@23272d1.bin,0 +23272d2.bin=@23272d2.bin,0 +23272n0.bin=@23272n0.bin,0 +23272n1.bin=@23272n1.bin,0 +23272n2.bin=@23272n2.bin,0 +23273d0.bin=@23273d0.bin,0 +23273d1.bin=@23273d1.bin,0 +23273d2.bin=@23273d2.bin,0 +23273n0.bin=@23273n0.bin,0 +23273n1.bin=@23273n1.bin,0 +23273n2.bin=@23273n2.bin,0 +23274d0.bin=@23274d0.bin,0 +23274d1.bin=@23274d1.bin,0 +23274d2.bin=@23274d2.bin,0 +23274n0.bin=@23274n0.bin,0 +23274n1.bin=@23274n1.bin,0 +23274n2.bin=@23274n2.bin,0 +23280d0.bin=@23280d0.bin,0 +23280d1.bin=@23280d1.bin,0 +23280d2.bin=@23280d2.bin,0 +23280n0.bin=@23280n0.bin,0 +23280n1.bin=@23280n1.bin,0 +23280n2.bin=@23280n2.bin,0 +23281d0.bin=@23281d0.bin,0 +23281d1.bin=@23281d1.bin,0 +23281d2.bin=@23281d2.bin,0 +23281n0.bin=@23281n0.bin,0 +23281n1.bin=@23281n1.bin,0 +23281n2.bin=@23281n2.bin,0 +23303d0.bin=@23303d0.bin,0 +23303d1.bin=@23303d1.bin,0 +23303d2.bin=@23303d2.bin,0 +23303n0.bin=@23303n0.bin,0 +23303n1.bin=@23303n1.bin,0 +23303n2.bin=@23303n2.bin,0 +23304d0.bin=@23304d0.bin,0 +23304d1.bin=@23304d1.bin,0 +23304d2.bin=@23304d2.bin,0 +23304n0.bin=@23304n0.bin,0 +23304n1.bin=@23304n1.bin,0 +23304n2.bin=@23304n2.bin,0 +23323d0.bin=@23323d0.bin,0 +23323d1.bin=@23323d1.bin,0 +23323d2.bin=@23323d2.bin,0 +23323n0.bin=@23323n0.bin,0 +23323n1.bin=@23323n1.bin,0 +23323n2.bin=@23323n2.bin,0 +23326d0.bin=@23326d0.bin,0 +23326d1.bin=@23326d1.bin,0 +23326d2.bin=@23326d2.bin,0 +23326n0.bin=@23326n0.bin,0 +23326n1.bin=@23326n1.bin,0 +23326n2.bin=@23326n2.bin,0 +23199d0.bin=@23199d0.bin,0 +23199d1.bin=@23199d1.bin,0 +23199d2.bin=@23199d2.bin,0 +23199n0.bin=@23199n0.bin,0 +23199n1.bin=@23199n1.bin,0 +23211d2.bin=@23211d2.bin,0 +23211n0.bin=@23211n0.bin,0 +23211n1.bin=@23211n1.bin,0 +23211n2.bin=@23211n2.bin,0 +23212d0.bin=@23212d0.bin,0 +23212d1.bin=@23212d1.bin,0 +23212d2.bin=@23212d2.bin,0 +23212n0.bin=@23212n0.bin,0 +23212n1.bin=@23212n1.bin,0 +23212n2.bin=@23212n2.bin,0 +23213d0.bin=@23213d0.bin,0 +23213d1.bin=@23213d1.bin,0 +23213d2.bin=@23213d2.bin,0 +23213n0.bin=@23213n0.bin,0 +23213n1.bin=@23213n1.bin,0 +23213n2.bin=@23213n2.bin,0 +23214d0.bin=@23214d0.bin,0 +23214d1.bin=@23214d1.bin,0 +23214d2.bin=@23214d2.bin,0 +23214n0.bin=@23214n0.bin,0 +23214n1.bin=@23214n1.bin,0 +23214n2.bin=@23214n2.bin,0 +23215d0.bin=@23215d0.bin,0 +23215d1.bin=@23215d1.bin,0 +23215d2.bin=@23215d2.bin,0 +23215n0.bin=@23215n0.bin,0 +23215n1.bin=@23215n1.bin,0 +23215n2.bin=@23215n2.bin,0 +23216d0.bin=@23216d0.bin,0 +23216d1.bin=@23216d1.bin,0 +23216d2.bin=@23216d2.bin,0 +23216n0.bin=@23216n0.bin,0 +23216n1.bin=@23216n1.bin,0 +23216n2.bin=@23216n2.bin,0 +23217d0.bin=@23217d0.bin,0 +23217d1.bin=@23217d1.bin,0 +23217d2.bin=@23217d2.bin,0 +23217n0.bin=@23217n0.bin,0 +23217n1.bin=@23217n1.bin,0 +23217n2.bin=@23217n2.bin,0 +23218d0.bin=@23218d0.bin,0 +23218d1.bin=@23218d1.bin,0 +23218d2.bin=@23218d2.bin,0 +23218n0.bin=@23218n0.bin,0 +23218n1.bin=@23218n1.bin,0 +23218n2.bin=@23218n2.bin,0 +23219d0.bin=@23219d0.bin,0 +23219d1.bin=@23219d1.bin,0 +23219d2.bin=@23219d2.bin,0 +23219n0.bin=@23219n0.bin,0 +23219n1.bin=@23219n1.bin,0 +23219n2.bin=@23219n2.bin,0 +23220d0.bin=@23220d0.bin,0 +23220d1.bin=@23220d1.bin,0 +23220d2.bin=@23220d2.bin,0 +23220n0.bin=@23220n0.bin,0 +23220n1.bin=@23220n1.bin,0 +23220n2.bin=@23220n2.bin,0 +23221d0.bin=@23221d0.bin,0 +23221d1.bin=@23221d1.bin,0 +23221d2.bin=@23221d2.bin,0 +23221n0.bin=@23221n0.bin,0 +23221n1.bin=@23221n1.bin,0 +23221n2.bin=@23221n2.bin,0 +23223d0.bin=@23223d0.bin,0 +23223d1.bin=@23223d1.bin,0 +23223d2.bin=@23223d2.bin,0 +23223n0.bin=@23223n0.bin,0 +23223n1.bin=@23223n1.bin,0 +23223n2.bin=@23223n2.bin,0 +23255d0.bin=@23255d0.bin,0 +23255d1.bin=@23255d1.bin,0 +23255d2.bin=@23255d2.bin,0 +23255n0.bin=@23255n0.bin,0 +23255n1.bin=@23255n1.bin,0 +23255n2.bin=@23255n2.bin,0 +23256d0.bin=@23256d0.bin,0 +23256d1.bin=@23256d1.bin,0 +23256d2.bin=@23256d2.bin,0 +23256n0.bin=@23256n0.bin,0 +23256n1.bin=@23256n1.bin,0 +23256n2.bin=@23256n2.bin,0 +23282d0.bin=@23282d0.bin,0 +23282d1.bin=@23282d1.bin,0 +23282d2.bin=@23282d2.bin,0 +23282n0.bin=@23282n0.bin,0 +23282n1.bin=@23282n1.bin,0 +23282n2.bin=@23282n2.bin,0 +23283d0.bin=@23283d0.bin,0 +23283d1.bin=@23283d1.bin,0 +23283d2.bin=@23283d2.bin,0 +23283n0.bin=@23283n0.bin,0 +23283n1.bin=@23283n1.bin,0 +23283n2.bin=@23283n2.bin,0 +23305d0.bin=@23305d0.bin,0 +23305d1.bin=@23305d1.bin,0 +23305d2.bin=@23305d2.bin,0 +23305n0.bin=@23305n0.bin,0 +23305n1.bin=@23305n1.bin,0 +23305n2.bin=@23305n2.bin,0 +23320d0.bin=@23320d0.bin,0 +23320d1.bin=@23320d1.bin,0 +23320d2.bin=@23320d2.bin,0 +23320n0.bin=@23320n0.bin,0 +23320n1.bin=@23320n1.bin,0 +23320n2.bin=@23320n2.bin,0 +23321d0.bin=@23321d0.bin,0 +23321d1.bin=@23321d1.bin,0 +23321d2.bin=@23321d2.bin,0 +23321n0.bin=@23321n0.bin,0 +23321n1.bin=@23321n1.bin,0 +23321n2.bin=@23321n2.bin,0 +23324d0.bin=@23324d0.bin,0 +23324d1.bin=@23324d1.bin,0 +23324d2.bin=@23324d2.bin,0 +23324n0.bin=@23324n0.bin,0 +23324n1.bin=@23324n1.bin,0 +23324n2.bin=@23324n2.bin,0 +23350d0.bin=@23350d0.bin,0 +23350d1.bin=@23350d1.bin,0 +23350d2.bin=@23350d2.bin,0 +23350n0.bin=@23350n0.bin,0 +23350n1.bin=@23350n1.bin,0 +23350n2.bin=@23350n2.bin,0 +23351d0.bin=@23351d0.bin,0 +23351d1.bin=@23351d1.bin,0 +23351d2.bin=@23351d2.bin,0 +23351n0.bin=@23351n0.bin,0 +23351n1.bin=@23351n1.bin,0 +23351n2.bin=@23351n2.bin,0 +23369d0.bin=@23369d0.bin,0 +23369d1.bin=@23369d1.bin,0 +23369d2.bin=@23369d2.bin,0 +23369n0.bin=@23369n0.bin,0 +23369n1.bin=@23369n1.bin,0 +23369n2.bin=@23369n2.bin,0 +23370d0.bin=@23370d0.bin,0 +23370d1.bin=@23370d1.bin,0 +23370d2.bin=@23370d2.bin,0 +23370n0.bin=@23370n0.bin,0 +23370n1.bin=@23370n1.bin,0 +23370n2.bin=@23370n2.bin,0 +23399d0.bin=@23399d0.bin,0 +23399d1.bin=@23399d1.bin,0 +23399d2.bin=@23399d2.bin,0 +23399n0.bin=@23399n0.bin,0 +23399n1.bin=@23399n1.bin,0 +23399n2.bin=@23399n2.bin,0 +23401d0.bin=@23401d0.bin,0 +23401d1.bin=@23401d1.bin,0 +23401d2.bin=@23401d2.bin,0 +23401n0.bin=@23401n0.bin,0 +23401n1.bin=@23401n1.bin,0 +23401n2.bin=@23401n2.bin,0 +23211d0.bin=@23211d0.bin,0 +23211d1.bin=@23211d1.bin,0 +23224n1.bin=@23224n1.bin,0 +23224n2.bin=@23224n2.bin,0 +23225d0.bin=@23225d0.bin,0 +23225d1.bin=@23225d1.bin,0 +23225d2.bin=@23225d2.bin,0 +23225n0.bin=@23225n0.bin,0 +23225n1.bin=@23225n1.bin,0 +23225n2.bin=@23225n2.bin,0 +23226d0.bin=@23226d0.bin,0 +23226d1.bin=@23226d1.bin,0 +23226d2.bin=@23226d2.bin,0 +23226n0.bin=@23226n0.bin,0 +23226n1.bin=@23226n1.bin,0 +23226n2.bin=@23226n2.bin,0 +23227d0.bin=@23227d0.bin,0 +23227d1.bin=@23227d1.bin,0 +23227d2.bin=@23227d2.bin,0 +23227n0.bin=@23227n0.bin,0 +23227n1.bin=@23227n1.bin,0 +23227n2.bin=@23227n2.bin,0 +23228d0.bin=@23228d0.bin,0 +23228d1.bin=@23228d1.bin,0 +23228d2.bin=@23228d2.bin,0 +23228n0.bin=@23228n0.bin,0 +23228n1.bin=@23228n1.bin,0 +23228n2.bin=@23228n2.bin,0 +23229d0.bin=@23229d0.bin,0 +23229d1.bin=@23229d1.bin,0 +23229d2.bin=@23229d2.bin,0 +23229n0.bin=@23229n0.bin,0 +23229n1.bin=@23229n1.bin,0 +23229n2.bin=@23229n2.bin,0 +23230d0.bin=@23230d0.bin,0 +23230d1.bin=@23230d1.bin,0 +23230d2.bin=@23230d2.bin,0 +23230n0.bin=@23230n0.bin,0 +23230n1.bin=@23230n1.bin,0 +23230n2.bin=@23230n2.bin,0 +23231d0.bin=@23231d0.bin,0 +23231d1.bin=@23231d1.bin,0 +23231d2.bin=@23231d2.bin,0 +23231n0.bin=@23231n0.bin,0 +23231n1.bin=@23231n1.bin,0 +23231n2.bin=@23231n2.bin,0 +23232d0.bin=@23232d0.bin,0 +23232d1.bin=@23232d1.bin,0 +23232d2.bin=@23232d2.bin,0 +23232n0.bin=@23232n0.bin,0 +23232n1.bin=@23232n1.bin,0 +23232n2.bin=@23232n2.bin,0 +23233d0.bin=@23233d0.bin,0 +23233d1.bin=@23233d1.bin,0 +23233d2.bin=@23233d2.bin,0 +23233n0.bin=@23233n0.bin,0 +23233n1.bin=@23233n1.bin,0 +23233n2.bin=@23233n2.bin,0 +23238d0.bin=@23238d0.bin,0 +23238d1.bin=@23238d1.bin,0 +23238d2.bin=@23238d2.bin,0 +23238n0.bin=@23238n0.bin,0 +23238n1.bin=@23238n1.bin,0 +23238n2.bin=@23238n2.bin,0 +23239d0.bin=@23239d0.bin,0 +23239d1.bin=@23239d1.bin,0 +23239d2.bin=@23239d2.bin,0 +23239n0.bin=@23239n0.bin,0 +23239n1.bin=@23239n1.bin,0 +23239n2.bin=@23239n2.bin,0 +23257d0.bin=@23257d0.bin,0 +23257d1.bin=@23257d1.bin,0 +23257d2.bin=@23257d2.bin,0 +23257n0.bin=@23257n0.bin,0 +23257n1.bin=@23257n1.bin,0 +23257n2.bin=@23257n2.bin,0 +23258d0.bin=@23258d0.bin,0 +23258d1.bin=@23258d1.bin,0 +23258d2.bin=@23258d2.bin,0 +23258n0.bin=@23258n0.bin,0 +23258n1.bin=@23258n1.bin,0 +23258n2.bin=@23258n2.bin,0 +23284d0.bin=@23284d0.bin,0 +23284d1.bin=@23284d1.bin,0 +23284d2.bin=@23284d2.bin,0 +23284n0.bin=@23284n0.bin,0 +23284n1.bin=@23284n1.bin,0 +23284n2.bin=@23284n2.bin,0 +23285d0.bin=@23285d0.bin,0 +23285d1.bin=@23285d1.bin,0 +23285d2.bin=@23285d2.bin,0 +23285n0.bin=@23285n0.bin,0 +23285n1.bin=@23285n1.bin,0 +23285n2.bin=@23285n2.bin,0 +23311d0.bin=@23311d0.bin,0 +23311d1.bin=@23311d1.bin,0 +23311d2.bin=@23311d2.bin,0 +23311n0.bin=@23311n0.bin,0 +23311n1.bin=@23311n1.bin,0 +23311n2.bin=@23311n2.bin,0 +23346d0.bin=@23346d0.bin,0 +23346d1.bin=@23346d1.bin,0 +23346d2.bin=@23346d2.bin,0 +23346n0.bin=@23346n0.bin,0 +23346n1.bin=@23346n1.bin,0 +23346n2.bin=@23346n2.bin,0 +23347d0.bin=@23347d0.bin,0 +23347d1.bin=@23347d1.bin,0 +23347d2.bin=@23347d2.bin,0 +23347n0.bin=@23347n0.bin,0 +23347n1.bin=@23347n1.bin,0 +23347n2.bin=@23347n2.bin,0 +23371d0.bin=@23371d0.bin,0 +23371d1.bin=@23371d1.bin,0 +23371d2.bin=@23371d2.bin,0 +23371n0.bin=@23371n0.bin,0 +23371n1.bin=@23371n1.bin,0 +23371n2.bin=@23371n2.bin,0 +23372d0.bin=@23372d0.bin,0 +23372d1.bin=@23372d1.bin,0 +23372d2.bin=@23372d2.bin,0 +23372n0.bin=@23372n0.bin,0 +23372n1.bin=@23372n1.bin,0 +23372n2.bin=@23372n2.bin,0 +23386d0.bin=@23386d0.bin,0 +23386d1.bin=@23386d1.bin,0 +23386d2.bin=@23386d2.bin,0 +23386n0.bin=@23386n0.bin,0 +23386n1.bin=@23386n1.bin,0 +23386n2.bin=@23386n2.bin,0 +23387d0.bin=@23387d0.bin,0 +23387d1.bin=@23387d1.bin,0 +23387d2.bin=@23387d2.bin,0 +23387n0.bin=@23387n0.bin,0 +23387n1.bin=@23387n1.bin,0 +23387n2.bin=@23387n2.bin,0 +23224d0.bin=@23224d0.bin,0 +23224d1.bin=@23224d1.bin,0 +23224d2.bin=@23224d2.bin,0 +23224n0.bin=@23224n0.bin,0 +23236n0.bin=@23236n0.bin,0 +23236n1.bin=@23236n1.bin,0 +23236n2.bin=@23236n2.bin,0 +23237d0.bin=@23237d0.bin,0 +23237d1.bin=@23237d1.bin,0 +23237d2.bin=@23237d2.bin,0 +23237n0.bin=@23237n0.bin,0 +23237n1.bin=@23237n1.bin,0 +23237n2.bin=@23237n2.bin,0 +23240d0.bin=@23240d0.bin,0 +23240d1.bin=@23240d1.bin,0 +23240d2.bin=@23240d2.bin,0 +23240n0.bin=@23240n0.bin,0 +23240n1.bin=@23240n1.bin,0 +23240n2.bin=@23240n2.bin,0 +23241d0.bin=@23241d0.bin,0 +23241d1.bin=@23241d1.bin,0 +23241d2.bin=@23241d2.bin,0 +23241n0.bin=@23241n0.bin,0 +23241n1.bin=@23241n1.bin,0 +23241n2.bin=@23241n2.bin,0 +23250d0.bin=@23250d0.bin,0 +23250d1.bin=@23250d1.bin,0 +23250d2.bin=@23250d2.bin,0 +23250n0.bin=@23250n0.bin,0 +23250n1.bin=@23250n1.bin,0 +23250n2.bin=@23250n2.bin,0 +23251d0.bin=@23251d0.bin,0 +23251d1.bin=@23251d1.bin,0 +23251d2.bin=@23251d2.bin,0 +23251n0.bin=@23251n0.bin,0 +23251n1.bin=@23251n1.bin,0 +23251n2.bin=@23251n2.bin,0 +23252d0.bin=@23252d0.bin,0 +23252d1.bin=@23252d1.bin,0 +23252d2.bin=@23252d2.bin,0 +23252n0.bin=@23252n0.bin,0 +23252n1.bin=@23252n1.bin,0 +23252n2.bin=@23252n2.bin,0 +23259d0.bin=@23259d0.bin,0 +23259d1.bin=@23259d1.bin,0 +23259d2.bin=@23259d2.bin,0 +23259n0.bin=@23259n0.bin,0 +23259n1.bin=@23259n1.bin,0 +23259n2.bin=@23259n2.bin,0 +23260d0.bin=@23260d0.bin,0 +23260d1.bin=@23260d1.bin,0 +23260d2.bin=@23260d2.bin,0 +23260n0.bin=@23260n0.bin,0 +23260n1.bin=@23260n1.bin,0 +23260n2.bin=@23260n2.bin,0 +23286d0.bin=@23286d0.bin,0 +23286d1.bin=@23286d1.bin,0 +23286d2.bin=@23286d2.bin,0 +23286n0.bin=@23286n0.bin,0 +23286n1.bin=@23286n1.bin,0 +23286n2.bin=@23286n2.bin,0 +23287d0.bin=@23287d0.bin,0 +23287d1.bin=@23287d1.bin,0 +23287d2.bin=@23287d2.bin,0 +23287n0.bin=@23287n0.bin,0 +23287n1.bin=@23287n1.bin,0 +23287n2.bin=@23287n2.bin,0 +23288d0.bin=@23288d0.bin,0 +23288d1.bin=@23288d1.bin,0 +23288d2.bin=@23288d2.bin,0 +23288n0.bin=@23288n0.bin,0 +23288n1.bin=@23288n1.bin,0 +23288n2.bin=@23288n2.bin,0 +23289d0.bin=@23289d0.bin,0 +23289d1.bin=@23289d1.bin,0 +23289d2.bin=@23289d2.bin,0 +23289n0.bin=@23289n0.bin,0 +23289n1.bin=@23289n1.bin,0 +23289n2.bin=@23289n2.bin,0 +23325d0.bin=@23325d0.bin,0 +23325d1.bin=@23325d1.bin,0 +23325d2.bin=@23325d2.bin,0 +23325n0.bin=@23325n0.bin,0 +23325n1.bin=@23325n1.bin,0 +23325n2.bin=@23325n2.bin,0 +23327d0.bin=@23327d0.bin,0 +23327d1.bin=@23327d1.bin,0 +23327d2.bin=@23327d2.bin,0 +23327n0.bin=@23327n0.bin,0 +23327n1.bin=@23327n1.bin,0 +23327n2.bin=@23327n2.bin,0 +23348d0.bin=@23348d0.bin,0 +23348d1.bin=@23348d1.bin,0 +23348d2.bin=@23348d2.bin,0 +23348n0.bin=@23348n0.bin,0 +23348n1.bin=@23348n1.bin,0 +23348n2.bin=@23348n2.bin,0 +23349d0.bin=@23349d0.bin,0 +23349d1.bin=@23349d1.bin,0 +23349d2.bin=@23349d2.bin,0 +23349n0.bin=@23349n0.bin,0 +23349n1.bin=@23349n1.bin,0 +23349n2.bin=@23349n2.bin,0 +23382d0.bin=@23382d0.bin,0 +23382d1.bin=@23382d1.bin,0 +23382d2.bin=@23382d2.bin,0 +23382n0.bin=@23382n0.bin,0 +23382n1.bin=@23382n1.bin,0 +23382n2.bin=@23382n2.bin,0 +23383d0.bin=@23383d0.bin,0 +23383d1.bin=@23383d1.bin,0 +23383d2.bin=@23383d2.bin,0 +23383n0.bin=@23383n0.bin,0 +23383n1.bin=@23383n1.bin,0 +23383n2.bin=@23383n2.bin,0 +23384d0.bin=@23384d0.bin,0 +23384d1.bin=@23384d1.bin,0 +23384d2.bin=@23384d2.bin,0 +23384n0.bin=@23384n0.bin,0 +23384n1.bin=@23384n1.bin,0 +23384n2.bin=@23384n2.bin,0 +23385d0.bin=@23385d0.bin,0 +23385d1.bin=@23385d1.bin,0 +23385d2.bin=@23385d2.bin,0 +23385n0.bin=@23385n0.bin,0 +23385n1.bin=@23385n1.bin,0 +23385n2.bin=@23385n2.bin,0 +23394d0.bin=@23394d0.bin,0 +23394d1.bin=@23394d1.bin,0 +23394d2.bin=@23394d2.bin,0 +23394n0.bin=@23394n0.bin,0 +23394n1.bin=@23394n1.bin,0 +23394n2.bin=@23394n2.bin,0 +23395d0.bin=@23395d0.bin,0 +23395d1.bin=@23395d1.bin,0 +23395d2.bin=@23395d2.bin,0 +23395n0.bin=@23395n0.bin,0 +23395n1.bin=@23395n1.bin,0 +23395n2.bin=@23395n2.bin,0 +23396d0.bin=@23396d0.bin,0 +23396d1.bin=@23396d1.bin,0 +23396d2.bin=@23396d2.bin,0 +23396n0.bin=@23396n0.bin,0 +23396n1.bin=@23396n1.bin,0 +23396n2.bin=@23396n2.bin,0 +23236d0.bin=@23236d0.bin,0 +23236d1.bin=@23236d1.bin,0 +23236d2.bin=@23236d2.bin,0 +23234d2.bin=@23234d2.bin,0 +23234n0.bin=@23234n0.bin,0 +23234n1.bin=@23234n1.bin,0 +23234n2.bin=@23234n2.bin,0 +23235d0.bin=@23235d0.bin,0 +23235d1.bin=@23235d1.bin,0 +23235d2.bin=@23235d2.bin,0 +23235n0.bin=@23235n0.bin,0 +23235n1.bin=@23235n1.bin,0 +23235n2.bin=@23235n2.bin,0 +23246d0.bin=@23246d0.bin,0 +23246d1.bin=@23246d1.bin,0 +23246d2.bin=@23246d2.bin,0 +23246n0.bin=@23246n0.bin,0 +23246n1.bin=@23246n1.bin,0 +23246n2.bin=@23246n2.bin,0 +23247d0.bin=@23247d0.bin,0 +23247d1.bin=@23247d1.bin,0 +23247d2.bin=@23247d2.bin,0 +23247n0.bin=@23247n0.bin,0 +23247n1.bin=@23247n1.bin,0 +23247n2.bin=@23247n2.bin,0 +23248d0.bin=@23248d0.bin,0 +23248d1.bin=@23248d1.bin,0 +23248d2.bin=@23248d2.bin,0 +23248n0.bin=@23248n0.bin,0 +23248n1.bin=@23248n1.bin,0 +23248n2.bin=@23248n2.bin,0 +23249d0.bin=@23249d0.bin,0 +23249d1.bin=@23249d1.bin,0 +23249d2.bin=@23249d2.bin,0 +23249n0.bin=@23249n0.bin,0 +23249n1.bin=@23249n1.bin,0 +23249n2.bin=@23249n2.bin,0 +23261d0.bin=@23261d0.bin,0 +23261d1.bin=@23261d1.bin,0 +23261d2.bin=@23261d2.bin,0 +23261n0.bin=@23261n0.bin,0 +23261n1.bin=@23261n1.bin,0 +23261n2.bin=@23261n2.bin,0 +23262d0.bin=@23262d0.bin,0 +23262d1.bin=@23262d1.bin,0 +23262d2.bin=@23262d2.bin,0 +23262n0.bin=@23262n0.bin,0 +23262n1.bin=@23262n1.bin,0 +23262n2.bin=@23262n2.bin,0 +23267d0.bin=@23267d0.bin,0 +23267d1.bin=@23267d1.bin,0 +23267d2.bin=@23267d2.bin,0 +23267n0.bin=@23267n0.bin,0 +23267n1.bin=@23267n1.bin,0 +23267n2.bin=@23267n2.bin,0 +23268d0.bin=@23268d0.bin,0 +23268d1.bin=@23268d1.bin,0 +23268d2.bin=@23268d2.bin,0 +23268n0.bin=@23268n0.bin,0 +23268n1.bin=@23268n1.bin,0 +23268n2.bin=@23268n2.bin,0 +23275d0.bin=@23275d0.bin,0 +23275d1.bin=@23275d1.bin,0 +23275d2.bin=@23275d2.bin,0 +23275n0.bin=@23275n0.bin,0 +23275n1.bin=@23275n1.bin,0 +23275n2.bin=@23275n2.bin,0 +23309d0.bin=@23309d0.bin,0 +23309d1.bin=@23309d1.bin,0 +23309d2.bin=@23309d2.bin,0 +23309n0.bin=@23309n0.bin,0 +23309n1.bin=@23309n1.bin,0 +23309n2.bin=@23309n2.bin,0 +23310d0.bin=@23310d0.bin,0 +23310d1.bin=@23310d1.bin,0 +23310d2.bin=@23310d2.bin,0 +23310n0.bin=@23310n0.bin,0 +23310n1.bin=@23310n1.bin,0 +23310n2.bin=@23310n2.bin,0 +23345d0.bin=@23345d0.bin,0 +23345d1.bin=@23345d1.bin,0 +23345d2.bin=@23345d2.bin,0 +23345n0.bin=@23345n0.bin,0 +23345n1.bin=@23345n1.bin,0 +23345n2.bin=@23345n2.bin,0 +23397d0.bin=@23397d0.bin,0 +23397d1.bin=@23397d1.bin,0 +23397d2.bin=@23397d2.bin,0 +23397n0.bin=@23397n0.bin,0 +23397n1.bin=@23397n1.bin,0 +23397n2.bin=@23397n2.bin,0 +23398d0.bin=@23398d0.bin,0 +23398d1.bin=@23398d1.bin,0 +23398d2.bin=@23398d2.bin,0 +23398n0.bin=@23398n0.bin,0 +23398n1.bin=@23398n1.bin,0 +23398n2.bin=@23398n2.bin,0 +23403d0.bin=@23403d0.bin,0 +23403d1.bin=@23403d1.bin,0 +23403d2.bin=@23403d2.bin,0 +23403n0.bin=@23403n0.bin,0 +23403n1.bin=@23403n1.bin,0 +23403n2.bin=@23403n2.bin,0 +23404d0.bin=@23404d0.bin,0 +23404d1.bin=@23404d1.bin,0 +23404d2.bin=@23404d2.bin,0 +23404n0.bin=@23404n0.bin,0 +23404n1.bin=@23404n1.bin,0 +23404n2.bin=@23404n2.bin,0 +23425d0.bin=@23425d0.bin,0 +23425d1.bin=@23425d1.bin,0 +23425d2.bin=@23425d2.bin,0 +23425n0.bin=@23425n0.bin,0 +23425n1.bin=@23425n1.bin,0 +23425n2.bin=@23425n2.bin,0 +23426d0.bin=@23426d0.bin,0 +23426d1.bin=@23426d1.bin,0 +23426d2.bin=@23426d2.bin,0 +23426n0.bin=@23426n0.bin,0 +23426n1.bin=@23426n1.bin,0 +23426n2.bin=@23426n2.bin,0 +23433d0.bin=@23433d0.bin,0 +23433d1.bin=@23433d1.bin,0 +23433d2.bin=@23433d2.bin,0 +23433n0.bin=@23433n0.bin,0 +23433n1.bin=@23433n1.bin,0 +23433n2.bin=@23433n2.bin,0 +23434d0.bin=@23434d0.bin,0 +23434d1.bin=@23434d1.bin,0 +23434d2.bin=@23434d2.bin,0 +23434n0.bin=@23434n0.bin,0 +23434n1.bin=@23434n1.bin,0 +23434n2.bin=@23434n2.bin,0 +23234d0.bin=@23234d0.bin,0 +23234d1.bin=@23234d1.bin,0 +23242n0.bin=@23242n0.bin,0 +23242n1.bin=@23242n1.bin,0 +23242n2.bin=@23242n2.bin,0 +23243d0.bin=@23243d0.bin,0 +23243d1.bin=@23243d1.bin,0 +23243d2.bin=@23243d2.bin,0 +23243n0.bin=@23243n0.bin,0 +23243n1.bin=@23243n1.bin,0 +23243n2.bin=@23243n2.bin,0 +23244d0.bin=@23244d0.bin,0 +23244d1.bin=@23244d1.bin,0 +23244d2.bin=@23244d2.bin,0 +23244n0.bin=@23244n0.bin,0 +23244n1.bin=@23244n1.bin,0 +23244n2.bin=@23244n2.bin,0 +23245d0.bin=@23245d0.bin,0 +23245d1.bin=@23245d1.bin,0 +23245d2.bin=@23245d2.bin,0 +23245n0.bin=@23245n0.bin,0 +23245n1.bin=@23245n1.bin,0 +23245n2.bin=@23245n2.bin,0 +23263d0.bin=@23263d0.bin,0 +23263d1.bin=@23263d1.bin,0 +23263d2.bin=@23263d2.bin,0 +23263n0.bin=@23263n0.bin,0 +23263n1.bin=@23263n1.bin,0 +23263n2.bin=@23263n2.bin,0 +23264d0.bin=@23264d0.bin,0 +23264d1.bin=@23264d1.bin,0 +23264d2.bin=@23264d2.bin,0 +23264n0.bin=@23264n0.bin,0 +23264n1.bin=@23264n1.bin,0 +23264n2.bin=@23264n2.bin,0 +23277d0.bin=@23277d0.bin,0 +23277d1.bin=@23277d1.bin,0 +23277d2.bin=@23277d2.bin,0 +23277n0.bin=@23277n0.bin,0 +23277n1.bin=@23277n1.bin,0 +23277n2.bin=@23277n2.bin,0 +23278d0.bin=@23278d0.bin,0 +23278d1.bin=@23278d1.bin,0 +23278d2.bin=@23278d2.bin,0 +23278n0.bin=@23278n0.bin,0 +23278n1.bin=@23278n1.bin,0 +23278n2.bin=@23278n2.bin,0 +23279d0.bin=@23279d0.bin,0 +23279d1.bin=@23279d1.bin,0 +23279d2.bin=@23279d2.bin,0 +23279n0.bin=@23279n0.bin,0 +23279n1.bin=@23279n1.bin,0 +23279n2.bin=@23279n2.bin,0 +23307d0.bin=@23307d0.bin,0 +23307d1.bin=@23307d1.bin,0 +23307d2.bin=@23307d2.bin,0 +23307n0.bin=@23307n0.bin,0 +23307n1.bin=@23307n1.bin,0 +23307n2.bin=@23307n2.bin,0 +23312d0.bin=@23312d0.bin,0 +23312d1.bin=@23312d1.bin,0 +23312d2.bin=@23312d2.bin,0 +23312n0.bin=@23312n0.bin,0 +23312n1.bin=@23312n1.bin,0 +23312n2.bin=@23312n2.bin,0 +23313d0.bin=@23313d0.bin,0 +23313d1.bin=@23313d1.bin,0 +23313d2.bin=@23313d2.bin,0 +23313n0.bin=@23313n0.bin,0 +23313n1.bin=@23313n1.bin,0 +23313n2.bin=@23313n2.bin,0 +23318d0.bin=@23318d0.bin,0 +23318d1.bin=@23318d1.bin,0 +23318d2.bin=@23318d2.bin,0 +23318n0.bin=@23318n0.bin,0 +23318n1.bin=@23318n1.bin,0 +23318n2.bin=@23318n2.bin,0 +23319d0.bin=@23319d0.bin,0 +23319d1.bin=@23319d1.bin,0 +23319d2.bin=@23319d2.bin,0 +23319n0.bin=@23319n0.bin,0 +23319n1.bin=@23319n1.bin,0 +23319n2.bin=@23319n2.bin,0 +23322d0.bin=@23322d0.bin,0 +23322d1.bin=@23322d1.bin,0 +23322d2.bin=@23322d2.bin,0 +23322n0.bin=@23322n0.bin,0 +23322n1.bin=@23322n1.bin,0 +23322n2.bin=@23322n2.bin,0 +23342d0.bin=@23342d0.bin,0 +23342d1.bin=@23342d1.bin,0 +23342d2.bin=@23342d2.bin,0 +23342n0.bin=@23342n0.bin,0 +23342n1.bin=@23342n1.bin,0 +23342n2.bin=@23342n2.bin,0 +23343d0.bin=@23343d0.bin,0 +23343d1.bin=@23343d1.bin,0 +23343d2.bin=@23343d2.bin,0 +23343n0.bin=@23343n0.bin,0 +23343n1.bin=@23343n1.bin,0 +23343n2.bin=@23343n2.bin,0 +23344d0.bin=@23344d0.bin,0 +23344d1.bin=@23344d1.bin,0 +23344d2.bin=@23344d2.bin,0 +23344n0.bin=@23344n0.bin,0 +23344n1.bin=@23344n1.bin,0 +23344n2.bin=@23344n2.bin,0 +23373d0.bin=@23373d0.bin,0 +23373d1.bin=@23373d1.bin,0 +23373d2.bin=@23373d2.bin,0 +23373n0.bin=@23373n0.bin,0 +23373n1.bin=@23373n1.bin,0 +23373n2.bin=@23373n2.bin,0 +23429d0.bin=@23429d0.bin,0 +23429d1.bin=@23429d1.bin,0 +23429d2.bin=@23429d2.bin,0 +23429n0.bin=@23429n0.bin,0 +23429n1.bin=@23429n1.bin,0 +23429n2.bin=@23429n2.bin,0 +23430d0.bin=@23430d0.bin,0 +23430d1.bin=@23430d1.bin,0 +23430d2.bin=@23430d2.bin,0 +23430n0.bin=@23430n0.bin,0 +23430n1.bin=@23430n1.bin,0 +23430n2.bin=@23430n2.bin,0 +23431d0.bin=@23431d0.bin,0 +23431d1.bin=@23431d1.bin,0 +23431d2.bin=@23431d2.bin,0 +23431n0.bin=@23431n0.bin,0 +23431n1.bin=@23431n1.bin,0 +23431n2.bin=@23431n2.bin,0 +23432d0.bin=@23432d0.bin,0 +23432d1.bin=@23432d1.bin,0 +23432d2.bin=@23432d2.bin,0 +23432n0.bin=@23432n0.bin,0 +23432n1.bin=@23432n1.bin,0 +23432n2.bin=@23432n2.bin,0 +23242d0.bin=@23242d0.bin,0 +23242d1.bin=@23242d1.bin,0 +23242d2.bin=@23242d2.bin,0 +23265n2.bin=@23265n2.bin,0 +23266d0.bin=@23266d0.bin,0 +23266d1.bin=@23266d1.bin,0 +23266d2.bin=@23266d2.bin,0 +23266n0.bin=@23266n0.bin,0 +23266n1.bin=@23266n1.bin,0 +23266n2.bin=@23266n2.bin,0 +23306d0.bin=@23306d0.bin,0 +23306d1.bin=@23306d1.bin,0 +23306d2.bin=@23306d2.bin,0 +23306n0.bin=@23306n0.bin,0 +23306n1.bin=@23306n1.bin,0 +23306n2.bin=@23306n2.bin,0 +23308d0.bin=@23308d0.bin,0 +23308d1.bin=@23308d1.bin,0 +23308d2.bin=@23308d2.bin,0 +23308n0.bin=@23308n0.bin,0 +23308n1.bin=@23308n1.bin,0 +23308n2.bin=@23308n2.bin,0 +23314d0.bin=@23314d0.bin,0 +23314d1.bin=@23314d1.bin,0 +23314d2.bin=@23314d2.bin,0 +23314n0.bin=@23314n0.bin,0 +23314n1.bin=@23314n1.bin,0 +23314n2.bin=@23314n2.bin,0 +23367d0.bin=@23367d0.bin,0 +23367d1.bin=@23367d1.bin,0 +23367d2.bin=@23367d2.bin,0 +23367n0.bin=@23367n0.bin,0 +23367n1.bin=@23367n1.bin,0 +23367n2.bin=@23367n2.bin,0 +23368d0.bin=@23368d0.bin,0 +23368d1.bin=@23368d1.bin,0 +23368d2.bin=@23368d2.bin,0 +23368n0.bin=@23368n0.bin,0 +23368n1.bin=@23368n1.bin,0 +23368n2.bin=@23368n2.bin,0 +23380d0.bin=@23380d0.bin,0 +23380d1.bin=@23380d1.bin,0 +23380d2.bin=@23380d2.bin,0 +23380n0.bin=@23380n0.bin,0 +23380n1.bin=@23380n1.bin,0 +23380n2.bin=@23380n2.bin,0 +23381d0.bin=@23381d0.bin,0 +23381d1.bin=@23381d1.bin,0 +23381d2.bin=@23381d2.bin,0 +23381n0.bin=@23381n0.bin,0 +23381n1.bin=@23381n1.bin,0 +23381n2.bin=@23381n2.bin,0 +23392d0.bin=@23392d0.bin,0 +23392d1.bin=@23392d1.bin,0 +23392d2.bin=@23392d2.bin,0 +23392n0.bin=@23392n0.bin,0 +23392n1.bin=@23392n1.bin,0 +23392n2.bin=@23392n2.bin,0 +23393d0.bin=@23393d0.bin,0 +23393d1.bin=@23393d1.bin,0 +23393d2.bin=@23393d2.bin,0 +23393n0.bin=@23393n0.bin,0 +23393n1.bin=@23393n1.bin,0 +23393n2.bin=@23393n2.bin,0 +23402d0.bin=@23402d0.bin,0 +23402d1.bin=@23402d1.bin,0 +23402d2.bin=@23402d2.bin,0 +23402n0.bin=@23402n0.bin,0 +23402n1.bin=@23402n1.bin,0 +23402n2.bin=@23402n2.bin,0 +23424d0.bin=@23424d0.bin,0 +23424d1.bin=@23424d1.bin,0 +23424d2.bin=@23424d2.bin,0 +23424n0.bin=@23424n0.bin,0 +23424n1.bin=@23424n1.bin,0 +23424n2.bin=@23424n2.bin,0 +23427d0.bin=@23427d0.bin,0 +23427d1.bin=@23427d1.bin,0 +23427d2.bin=@23427d2.bin,0 +23427n0.bin=@23427n0.bin,0 +23427n1.bin=@23427n1.bin,0 +23427n2.bin=@23427n2.bin,0 +23428d0.bin=@23428d0.bin,0 +23428d1.bin=@23428d1.bin,0 +23428d2.bin=@23428d2.bin,0 +23428n0.bin=@23428n0.bin,0 +23428n1.bin=@23428n1.bin,0 +23428n2.bin=@23428n2.bin,0 +23514d0.bin=@23514d0.bin,0 +23514d1.bin=@23514d1.bin,0 +23514d2.bin=@23514d2.bin,0 +23514n0.bin=@23514n0.bin,0 +23514n1.bin=@23514n1.bin,0 +23514n2.bin=@23514n2.bin,0 +23515d0.bin=@23515d0.bin,0 +23515d1.bin=@23515d1.bin,0 +23515d2.bin=@23515d2.bin,0 +23515n0.bin=@23515n0.bin,0 +23515n1.bin=@23515n1.bin,0 +23515n2.bin=@23515n2.bin,0 +23626d0.bin=@23626d0.bin,0 +23626d1.bin=@23626d1.bin,0 +23626d2.bin=@23626d2.bin,0 +23626n0.bin=@23626n0.bin,0 +23626n1.bin=@23626n1.bin,0 +23626n2.bin=@23626n2.bin,0 +55016d0.bin=@55016d0.bin,0 +55016d1.bin=@55016d1.bin,0 +55016d2.bin=@55016d2.bin,0 +55016n0.bin=@55016n0.bin,0 +55016n1.bin=@55016n1.bin,0 +55016n2.bin=@55016n2.bin,0 +55202d0.bin=@55202d0.bin,0 +55202d1.bin=@55202d1.bin,0 +55202d2.bin=@55202d2.bin,0 +55202n0.bin=@55202n0.bin,0 +55202n1.bin=@55202n1.bin,0 +55202n2.bin=@55202n2.bin,0 +58073d0.bin=@58073d0.bin,0 +58073d1.bin=@58073d1.bin,0 +58073d2.bin=@58073d2.bin,0 +58073n0.bin=@58073n0.bin,0 +58073n1.bin=@58073n1.bin,0 +58073n2.bin=@58073n2.bin,0 +64551d0.bin=@64551d0.bin,0 +64551d1.bin=@64551d1.bin,0 +64551d2.bin=@64551d2.bin,0 +23265d0.bin=@23265d0.bin,0 +23265d1.bin=@23265d1.bin,0 +23265d2.bin=@23265d2.bin,0 +23265n0.bin=@23265n0.bin,0 +23265n1.bin=@23265n1.bin,0 +23648n1.bin=@23648n1.bin,0 +23648n2.bin=@23648n2.bin,0 +23649d0.bin=@23649d0.bin,0 +23649d1.bin=@23649d1.bin,0 +23649d2.bin=@23649d2.bin,0 +23649n0.bin=@23649n0.bin,0 +23649n1.bin=@23649n1.bin,0 +23649n2.bin=@23649n2.bin,0 +54926d0.bin=@54926d0.bin,0 +54926d1.bin=@54926d1.bin,0 +54926d2.bin=@54926d2.bin,0 +54926n0.bin=@54926n0.bin,0 +54926n1.bin=@54926n1.bin,0 +54926n2.bin=@54926n2.bin,0 +55195d0.bin=@55195d0.bin,0 +55195d1.bin=@55195d1.bin,0 +55195d2.bin=@55195d2.bin,0 +55195n0.bin=@55195n0.bin,0 +55195n1.bin=@55195n1.bin,0 +55195n2.bin=@55195n2.bin,0 +55529d0.bin=@55529d0.bin,0 +55529d1.bin=@55529d1.bin,0 +55529d2.bin=@55529d2.bin,0 +55529n0.bin=@55529n0.bin,0 +55529n1.bin=@55529n1.bin,0 +55529n2.bin=@55529n2.bin,0 +55530d0.bin=@55530d0.bin,0 +55530d1.bin=@55530d1.bin,0 +55530d2.bin=@55530d2.bin,0 +55530n0.bin=@55530n0.bin,0 +55530n1.bin=@55530n1.bin,0 +55530n2.bin=@55530n2.bin,0 +55531d0.bin=@55531d0.bin,0 +55531d1.bin=@55531d1.bin,0 +55531d2.bin=@55531d2.bin,0 +55531n0.bin=@55531n0.bin,0 +55531n1.bin=@55531n1.bin,0 +55531n2.bin=@55531n2.bin,0 +55532d0.bin=@55532d0.bin,0 +55532d1.bin=@55532d1.bin,0 +55532d2.bin=@55532d2.bin,0 +55532n0.bin=@55532n0.bin,0 +55532n1.bin=@55532n1.bin,0 +55532n2.bin=@55532n2.bin,0 +55534d0.bin=@55534d0.bin,0 +55534d1.bin=@55534d1.bin,0 +55534d2.bin=@55534d2.bin,0 +55534n0.bin=@55534n0.bin,0 +55534n1.bin=@55534n1.bin,0 +55534n2.bin=@55534n2.bin,0 +55535d0.bin=@55535d0.bin,0 +55535d1.bin=@55535d1.bin,0 +55535d2.bin=@55535d2.bin,0 +55535n0.bin=@55535n0.bin,0 +55535n1.bin=@55535n1.bin,0 +55535n2.bin=@55535n2.bin,0 +55714d0.bin=@55714d0.bin,0 +55714d1.bin=@55714d1.bin,0 +55714d2.bin=@55714d2.bin,0 +55714n0.bin=@55714n0.bin,0 +55714n1.bin=@55714n1.bin,0 +55714n2.bin=@55714n2.bin,0 +55917d0.bin=@55917d0.bin,0 +55917d1.bin=@55917d1.bin,0 +55917d2.bin=@55917d2.bin,0 +55917n0.bin=@55917n0.bin,0 +55917n1.bin=@55917n1.bin,0 +55917n2.bin=@55917n2.bin,0 +55918d0.bin=@55918d0.bin,0 +55918d1.bin=@55918d1.bin,0 +55918d2.bin=@55918d2.bin,0 +55918n0.bin=@55918n0.bin,0 +55918n1.bin=@55918n1.bin,0 +55918n2.bin=@55918n2.bin,0 +55920d0.bin=@55920d0.bin,0 +55920d1.bin=@55920d1.bin,0 +55920d2.bin=@55920d2.bin,0 +55920n0.bin=@55920n0.bin,0 +55920n1.bin=@55920n1.bin,0 +55920n2.bin=@55920n2.bin,0 +55921d0.bin=@55921d0.bin,0 +55921d1.bin=@55921d1.bin,0 +55921d2.bin=@55921d2.bin,0 +55921n0.bin=@55921n0.bin,0 +55921n1.bin=@55921n1.bin,0 +55921n2.bin=@55921n2.bin,0 +55922d0.bin=@55922d0.bin,0 +55922d1.bin=@55922d1.bin,0 +55922d2.bin=@55922d2.bin,0 +55922n0.bin=@55922n0.bin,0 +55922n1.bin=@55922n1.bin,0 +55922n2.bin=@55922n2.bin,0 +55935d0.bin=@55935d0.bin,0 +55935d1.bin=@55935d1.bin,0 +55935d2.bin=@55935d2.bin,0 +55935n0.bin=@55935n0.bin,0 +55935n1.bin=@55935n1.bin,0 +55935n2.bin=@55935n2.bin,0 +55936d0.bin=@55936d0.bin,0 +55936d1.bin=@55936d1.bin,0 +55936d2.bin=@55936d2.bin,0 +55936n0.bin=@55936n0.bin,0 +55936n1.bin=@55936n1.bin,0 +55936n2.bin=@55936n2.bin,0 +55948d0.bin=@55948d0.bin,0 +55948d1.bin=@55948d1.bin,0 +55948d2.bin=@55948d2.bin,0 +55948n0.bin=@55948n0.bin,0 +55948n1.bin=@55948n1.bin,0 +55948n2.bin=@55948n2.bin,0 +55949d0.bin=@55949d0.bin,0 +55949d1.bin=@55949d1.bin,0 +55949d2.bin=@55949d2.bin,0 +55949n0.bin=@55949n0.bin,0 +55949n1.bin=@55949n1.bin,0 +55949n2.bin=@55949n2.bin,0 +55950d0.bin=@55950d0.bin,0 +55950d1.bin=@55950d1.bin,0 +55950d2.bin=@55950d2.bin,0 +55950n0.bin=@55950n0.bin,0 +55950n1.bin=@55950n1.bin,0 +55950n2.bin=@55950n2.bin,0 +55951d0.bin=@55951d0.bin,0 +55951d1.bin=@55951d1.bin,0 +55951d2.bin=@55951d2.bin,0 +55951n0.bin=@55951n0.bin,0 +55951n1.bin=@55951n1.bin,0 +55951n2.bin=@55951n2.bin,0 +56106d0.bin=@56106d0.bin,0 +56106d1.bin=@56106d1.bin,0 +56106d2.bin=@56106d2.bin,0 +56106n0.bin=@56106n0.bin,0 +56106n1.bin=@56106n1.bin,0 +56106n2.bin=@56106n2.bin,0 +56115d0.bin=@56115d0.bin,0 +56115d1.bin=@56115d1.bin,0 +56115d2.bin=@56115d2.bin,0 +56115n0.bin=@56115n0.bin,0 +56115n1.bin=@56115n1.bin,0 +56115n2.bin=@56115n2.bin,0 +56126d0.bin=@56126d0.bin,0 +56126d1.bin=@56126d1.bin,0 +56126d2.bin=@56126d2.bin,0 +56126n0.bin=@56126n0.bin,0 +56126n1.bin=@56126n1.bin,0 +56126n2.bin=@56126n2.bin,0 +56127d0.bin=@56127d0.bin,0 +56127d1.bin=@56127d1.bin,0 +56127d2.bin=@56127d2.bin,0 +56127n0.bin=@56127n0.bin,0 +56127n1.bin=@56127n1.bin,0 +56127n2.bin=@56127n2.bin,0 +56128d0.bin=@56128d0.bin,0 +56128d1.bin=@56128d1.bin,0 +56128d2.bin=@56128d2.bin,0 +56128n0.bin=@56128n0.bin,0 +56128n1.bin=@56128n1.bin,0 +56128n2.bin=@56128n2.bin,0 +56130d0.bin=@56130d0.bin,0 +56130d1.bin=@56130d1.bin,0 +56130d2.bin=@56130d2.bin,0 +56130n0.bin=@56130n0.bin,0 +56130n1.bin=@56130n1.bin,0 +56130n2.bin=@56130n2.bin,0 +56131d0.bin=@56131d0.bin,0 +56131d1.bin=@56131d1.bin,0 +56131d2.bin=@56131d2.bin,0 +56131n0.bin=@56131n0.bin,0 +56131n1.bin=@56131n1.bin,0 +56131n2.bin=@56131n2.bin,0 +56133d0.bin=@56133d0.bin,0 +56133d1.bin=@56133d1.bin,0 +56133d2.bin=@56133d2.bin,0 +56133n0.bin=@56133n0.bin,0 +56133n1.bin=@56133n1.bin,0 +56133n2.bin=@56133n2.bin,0 +56152d0.bin=@56152d0.bin,0 +56152d1.bin=@56152d1.bin,0 +56152d2.bin=@56152d2.bin,0 +56152n0.bin=@56152n0.bin,0 +56152n1.bin=@56152n1.bin,0 +56152n2.bin=@56152n2.bin,0 +56153d0.bin=@56153d0.bin,0 +56153d1.bin=@56153d1.bin,0 +56153d2.bin=@56153d2.bin,0 +56153n0.bin=@56153n0.bin,0 +56153n1.bin=@56153n1.bin,0 +56153n2.bin=@56153n2.bin,0 +56158d0.bin=@56158d0.bin,0 +56158d1.bin=@56158d1.bin,0 +56158d2.bin=@56158d2.bin,0 +56158n0.bin=@56158n0.bin,0 +56158n1.bin=@56158n1.bin,0 +56158n2.bin=@56158n2.bin,0 +23648d0.bin=@23648d0.bin,0 +23648d1.bin=@23648d1.bin,0 +23648d2.bin=@23648d2.bin,0 +23648n0.bin=@23648n0.bin,0 +23468n0.bin=@23468n0.bin,0 +23468n1.bin=@23468n1.bin,0 +23468n2.bin=@23468n2.bin,0 +23472d0.bin=@23472d0.bin,0 +23472d1.bin=@23472d1.bin,0 +23472d2.bin=@23472d2.bin,0 +23472n0.bin=@23472n0.bin,0 +23472n1.bin=@23472n1.bin,0 +23472n2.bin=@23472n2.bin,0 +23476d0.bin=@23476d0.bin,0 +23476d1.bin=@23476d1.bin,0 +23476d2.bin=@23476d2.bin,0 +23476n0.bin=@23476n0.bin,0 +23476n1.bin=@23476n1.bin,0 +23476n2.bin=@23476n2.bin,0 +23480d0.bin=@23480d0.bin,0 +23480d1.bin=@23480d1.bin,0 +23480d2.bin=@23480d2.bin,0 +23480n0.bin=@23480n0.bin,0 +23480n1.bin=@23480n1.bin,0 +23480n2.bin=@23480n2.bin,0 +23516d0.bin=@23516d0.bin,0 +23516d1.bin=@23516d1.bin,0 +23516d2.bin=@23516d2.bin,0 +23516n0.bin=@23516n0.bin,0 +23516n1.bin=@23516n1.bin,0 +23516n2.bin=@23516n2.bin,0 +23520d0.bin=@23520d0.bin,0 +23520d1.bin=@23520d1.bin,0 +23520d2.bin=@23520d2.bin,0 +23520n0.bin=@23520n0.bin,0 +23520n1.bin=@23520n1.bin,0 +23520n2.bin=@23520n2.bin,0 +23536d0.bin=@23536d0.bin,0 +23536d1.bin=@23536d1.bin,0 +23536d2.bin=@23536d2.bin,0 +23536n0.bin=@23536n0.bin,0 +23536n1.bin=@23536n1.bin,0 +23536n2.bin=@23536n2.bin,0 +23540d0.bin=@23540d0.bin,0 +23540d1.bin=@23540d1.bin,0 +23540d2.bin=@23540d2.bin,0 +23540n0.bin=@23540n0.bin,0 +23540n1.bin=@23540n1.bin,0 +23540n2.bin=@23540n2.bin,0 +23606d0.bin=@23606d0.bin,0 +23606d1.bin=@23606d1.bin,0 +23606d2.bin=@23606d2.bin,0 +23606n0.bin=@23606n0.bin,0 +23606n1.bin=@23606n1.bin,0 +23606n2.bin=@23606n2.bin,0 +23610d0.bin=@23610d0.bin,0 +23610d1.bin=@23610d1.bin,0 +23610d2.bin=@23610d2.bin,0 +23610n0.bin=@23610n0.bin,0 +23610n1.bin=@23610n1.bin,0 +23610n2.bin=@23610n2.bin,0 +23614d0.bin=@23614d0.bin,0 +23614d1.bin=@23614d1.bin,0 +23614d2.bin=@23614d2.bin,0 +23614n0.bin=@23614n0.bin,0 +23614n1.bin=@23614n1.bin,0 +23614n2.bin=@23614n2.bin,0 +23618d0.bin=@23618d0.bin,0 +23618d1.bin=@23618d1.bin,0 +23618d2.bin=@23618d2.bin,0 +23618n0.bin=@23618n0.bin,0 +23618n1.bin=@23618n1.bin,0 +23618n2.bin=@23618n2.bin,0 +23622d0.bin=@23622d0.bin,0 +23622d1.bin=@23622d1.bin,0 +23622d2.bin=@23622d2.bin,0 +23622n0.bin=@23622n0.bin,0 +23622n1.bin=@23622n1.bin,0 +23622n2.bin=@23622n2.bin,0 +23644d0.bin=@23644d0.bin,0 +23644d1.bin=@23644d1.bin,0 +23644d2.bin=@23644d2.bin,0 +23644n0.bin=@23644n0.bin,0 +23644n1.bin=@23644n1.bin,0 +23644n2.bin=@23644n2.bin,0 +23655d0.bin=@23655d0.bin,0 +23655d1.bin=@23655d1.bin,0 +23655d2.bin=@23655d2.bin,0 +23655n0.bin=@23655n0.bin,0 +23655n1.bin=@23655n1.bin,0 +23655n2.bin=@23655n2.bin,0 +23659d0.bin=@23659d0.bin,0 +23659d1.bin=@23659d1.bin,0 +23659d2.bin=@23659d2.bin,0 +23659n0.bin=@23659n0.bin,0 +23659n1.bin=@23659n1.bin,0 +23659n2.bin=@23659n2.bin,0 +23668d0.bin=@23668d0.bin,0 +23668d1.bin=@23668d1.bin,0 +23668d2.bin=@23668d2.bin,0 +23668n0.bin=@23668n0.bin,0 +23668n1.bin=@23668n1.bin,0 +23668n2.bin=@23668n2.bin,0 +23705d0.bin=@23705d0.bin,0 +23705d1.bin=@23705d1.bin,0 +23705d2.bin=@23705d2.bin,0 +23705n0.bin=@23705n0.bin,0 +23705n1.bin=@23705n1.bin,0 +23705n2.bin=@23705n2.bin,0 +23709d0.bin=@23709d0.bin,0 +23709d1.bin=@23709d1.bin,0 +23709d2.bin=@23709d2.bin,0 +23709n0.bin=@23709n0.bin,0 +23709n1.bin=@23709n1.bin,0 +23709n2.bin=@23709n2.bin,0 +23713d0.bin=@23713d0.bin,0 +23713d1.bin=@23713d1.bin,0 +23713d2.bin=@23713d2.bin,0 +23713n0.bin=@23713n0.bin,0 +23713n1.bin=@23713n1.bin,0 +23713n2.bin=@23713n2.bin,0 +23718d0.bin=@23718d0.bin,0 +23718d1.bin=@23718d1.bin,0 +23718d2.bin=@23718d2.bin,0 +23718n0.bin=@23718n0.bin,0 +23718n1.bin=@23718n1.bin,0 +23718n2.bin=@23718n2.bin,0 +40236d0.bin=@40236d0.bin,0 +40236d1.bin=@40236d1.bin,0 +40236d2.bin=@40236d2.bin,0 +40236n0.bin=@40236n0.bin,0 +40236n1.bin=@40236n1.bin,0 +40236n2.bin=@40236n2.bin,0 +55691d0.bin=@55691d0.bin,0 +55691d1.bin=@55691d1.bin,0 +55691d2.bin=@55691d2.bin,0 +55691n0.bin=@55691n0.bin,0 +55691n1.bin=@55691n1.bin,0 +55691n2.bin=@55691n2.bin,0 +55692d0.bin=@55692d0.bin,0 +55692d1.bin=@55692d1.bin,0 +55692d2.bin=@55692d2.bin,0 +55692n0.bin=@55692n0.bin,0 +55692n1.bin=@55692n1.bin,0 +55692n2.bin=@55692n2.bin,0 +55693d0.bin=@55693d0.bin,0 +55693d1.bin=@55693d1.bin,0 +55693d2.bin=@55693d2.bin,0 +55693n0.bin=@55693n0.bin,0 +55693n1.bin=@55693n1.bin,0 +55693n2.bin=@55693n2.bin,0 +55694d0.bin=@55694d0.bin,0 +55694d1.bin=@55694d1.bin,0 +55694d2.bin=@55694d2.bin,0 +55694n0.bin=@55694n0.bin,0 +55694n1.bin=@55694n1.bin,0 +55694n2.bin=@55694n2.bin,0 +55695d0.bin=@55695d0.bin,0 +55695d1.bin=@55695d1.bin,0 +55695d2.bin=@55695d2.bin,0 +55695n0.bin=@55695n0.bin,0 +55695n1.bin=@55695n1.bin,0 +55695n2.bin=@55695n2.bin,0 +55696d0.bin=@55696d0.bin,0 +55696d1.bin=@55696d1.bin,0 +55696d2.bin=@55696d2.bin,0 +55696n0.bin=@55696n0.bin,0 +55696n1.bin=@55696n1.bin,0 +55696n2.bin=@55696n2.bin,0 +55697d0.bin=@55697d0.bin,0 +55697d1.bin=@55697d1.bin,0 +55697d2.bin=@55697d2.bin,0 +55697n0.bin=@55697n0.bin,0 +55697n1.bin=@55697n1.bin,0 +55697n2.bin=@55697n2.bin,0 +55698d0.bin=@55698d0.bin,0 +55698d1.bin=@55698d1.bin,0 +55698d2.bin=@55698d2.bin,0 +55698n0.bin=@55698n0.bin,0 +55698n1.bin=@55698n1.bin,0 +55698n2.bin=@55698n2.bin,0 +55728d0.bin=@55728d0.bin,0 +55728d1.bin=@55728d1.bin,0 +55728d2.bin=@55728d2.bin,0 +55728n0.bin=@55728n0.bin,0 +55728n1.bin=@55728n1.bin,0 +55728n2.bin=@55728n2.bin,0 +55738d0.bin=@55738d0.bin,0 +55738d1.bin=@55738d1.bin,0 +55738d2.bin=@55738d2.bin,0 +55738n0.bin=@55738n0.bin,0 +55738n1.bin=@55738n1.bin,0 +55738n2.bin=@55738n2.bin,0 +55923d0.bin=@55923d0.bin,0 +55923d1.bin=@55923d1.bin,0 +55923d2.bin=@55923d2.bin,0 +55923n0.bin=@55923n0.bin,0 +55923n1.bin=@55923n1.bin,0 +55923n2.bin=@55923n2.bin,0 +55929d0.bin=@55929d0.bin,0 +55929d1.bin=@55929d1.bin,0 +55929d2.bin=@55929d2.bin,0 +55929n0.bin=@55929n0.bin,0 +55929n1.bin=@55929n1.bin,0 +55929n2.bin=@55929n2.bin,0 +56076d0.bin=@56076d0.bin,0 +56076d1.bin=@56076d1.bin,0 +56076d2.bin=@56076d2.bin,0 +56076n0.bin=@56076n0.bin,0 +56076n1.bin=@56076n1.bin,0 +56076n2.bin=@56076n2.bin,0 +56077d0.bin=@56077d0.bin,0 +56077d1.bin=@56077d1.bin,0 +56077d2.bin=@56077d2.bin,0 +56077n0.bin=@56077n0.bin,0 +56077n1.bin=@56077n1.bin,0 +56077n2.bin=@56077n2.bin,0 +56078d0.bin=@56078d0.bin,0 +56078d1.bin=@56078d1.bin,0 +56078d2.bin=@56078d2.bin,0 +56078n0.bin=@56078n0.bin,0 +56078n1.bin=@56078n1.bin,0 +56078n2.bin=@56078n2.bin,0 +56079d0.bin=@56079d0.bin,0 +56079d1.bin=@56079d1.bin,0 +56079d2.bin=@56079d2.bin,0 +56079n0.bin=@56079n0.bin,0 +56079n1.bin=@56079n1.bin,0 +56079n2.bin=@56079n2.bin,0 +56080d0.bin=@56080d0.bin,0 +56080d1.bin=@56080d1.bin,0 +56080d2.bin=@56080d2.bin,0 +56080n0.bin=@56080n0.bin,0 +56080n1.bin=@56080n1.bin,0 +56080n2.bin=@56080n2.bin,0 +56125d0.bin=@56125d0.bin,0 +56125d1.bin=@56125d1.bin,0 +56125d2.bin=@56125d2.bin,0 +56125n0.bin=@56125n0.bin,0 +56125n1.bin=@56125n1.bin,0 +56125n2.bin=@56125n2.bin,0 +56144d0.bin=@56144d0.bin,0 +56144d1.bin=@56144d1.bin,0 +56144d2.bin=@56144d2.bin,0 +56144n0.bin=@56144n0.bin,0 +56144n1.bin=@56144n1.bin,0 +56144n2.bin=@56144n2.bin,0 +56145d0.bin=@56145d0.bin,0 +56145d1.bin=@56145d1.bin,0 +56145d2.bin=@56145d2.bin,0 +56145n0.bin=@56145n0.bin,0 +56145n1.bin=@56145n1.bin,0 +56145n2.bin=@56145n2.bin,0 +56150d0.bin=@56150d0.bin,0 +56150d1.bin=@56150d1.bin,0 +56150d2.bin=@56150d2.bin,0 +56150n0.bin=@56150n0.bin,0 +56150n1.bin=@56150n1.bin,0 +56150n2.bin=@56150n2.bin,0 +56151d0.bin=@56151d0.bin,0 +56151d1.bin=@56151d1.bin,0 +56151d2.bin=@56151d2.bin,0 +56151n0.bin=@56151n0.bin,0 +56151n1.bin=@56151n1.bin,0 +56151n2.bin=@56151n2.bin,0 +56154d0.bin=@56154d0.bin,0 +56154d1.bin=@56154d1.bin,0 +56154d2.bin=@56154d2.bin,0 +56154n0.bin=@56154n0.bin,0 +56154n1.bin=@56154n1.bin,0 +56154n2.bin=@56154n2.bin,0 +56155d0.bin=@56155d0.bin,0 +56155d1.bin=@56155d1.bin,0 +56155d2.bin=@56155d2.bin,0 +56155n0.bin=@56155n0.bin,0 +56155n1.bin=@56155n1.bin,0 +56155n2.bin=@56155n2.bin,0 +56156d0.bin=@56156d0.bin,0 +56156d1.bin=@56156d1.bin,0 +56156d2.bin=@56156d2.bin,0 +56156n0.bin=@56156n0.bin,0 +56156n1.bin=@56156n1.bin,0 +56156n2.bin=@56156n2.bin,0 +23468d0.bin=@23468d0.bin,0 +23468d1.bin=@23468d1.bin,0 +23468d2.bin=@23468d2.bin,0 +23469n2.bin=@23469n2.bin,0 +23473d0.bin=@23473d0.bin,0 +23473d1.bin=@23473d1.bin,0 +23473d2.bin=@23473d2.bin,0 +23473n0.bin=@23473n0.bin,0 +23473n1.bin=@23473n1.bin,0 +23473n2.bin=@23473n2.bin,0 +23477d0.bin=@23477d0.bin,0 +23477d1.bin=@23477d1.bin,0 +23477d2.bin=@23477d2.bin,0 +23477n0.bin=@23477n0.bin,0 +23477n1.bin=@23477n1.bin,0 +23477n2.bin=@23477n2.bin,0 +23481d0.bin=@23481d0.bin,0 +23481d1.bin=@23481d1.bin,0 +23481d2.bin=@23481d2.bin,0 +23481n0.bin=@23481n0.bin,0 +23481n1.bin=@23481n1.bin,0 +23481n2.bin=@23481n2.bin,0 +23517d0.bin=@23517d0.bin,0 +23517d1.bin=@23517d1.bin,0 +23517d2.bin=@23517d2.bin,0 +23517n0.bin=@23517n0.bin,0 +23517n1.bin=@23517n1.bin,0 +23517n2.bin=@23517n2.bin,0 +23521d0.bin=@23521d0.bin,0 +23521d1.bin=@23521d1.bin,0 +23521d2.bin=@23521d2.bin,0 +23521n0.bin=@23521n0.bin,0 +23521n1.bin=@23521n1.bin,0 +23521n2.bin=@23521n2.bin,0 +23537d0.bin=@23537d0.bin,0 +23537d1.bin=@23537d1.bin,0 +23537d2.bin=@23537d2.bin,0 +23537n0.bin=@23537n0.bin,0 +23537n1.bin=@23537n1.bin,0 +23537n2.bin=@23537n2.bin,0 +23541d0.bin=@23541d0.bin,0 +23541d1.bin=@23541d1.bin,0 +23541d2.bin=@23541d2.bin,0 +23541n0.bin=@23541n0.bin,0 +23541n1.bin=@23541n1.bin,0 +23541n2.bin=@23541n2.bin,0 +23607d0.bin=@23607d0.bin,0 +23607d1.bin=@23607d1.bin,0 +23607d2.bin=@23607d2.bin,0 +23607n0.bin=@23607n0.bin,0 +23607n1.bin=@23607n1.bin,0 +23607n2.bin=@23607n2.bin,0 +23611d0.bin=@23611d0.bin,0 +23611d1.bin=@23611d1.bin,0 +23611d2.bin=@23611d2.bin,0 +23611n0.bin=@23611n0.bin,0 +23611n1.bin=@23611n1.bin,0 +23611n2.bin=@23611n2.bin,0 +23615d0.bin=@23615d0.bin,0 +23615d1.bin=@23615d1.bin,0 +23615d2.bin=@23615d2.bin,0 +23615n0.bin=@23615n0.bin,0 +23615n1.bin=@23615n1.bin,0 +23615n2.bin=@23615n2.bin,0 +23619d0.bin=@23619d0.bin,0 +23619d1.bin=@23619d1.bin,0 +23619d2.bin=@23619d2.bin,0 +23619n0.bin=@23619n0.bin,0 +23619n1.bin=@23619n1.bin,0 +23619n2.bin=@23619n2.bin,0 +23623d0.bin=@23623d0.bin,0 +23623d1.bin=@23623d1.bin,0 +23623d2.bin=@23623d2.bin,0 +23623n0.bin=@23623n0.bin,0 +23623n1.bin=@23623n1.bin,0 +23623n2.bin=@23623n2.bin,0 +23645d0.bin=@23645d0.bin,0 +23645d1.bin=@23645d1.bin,0 +23645d2.bin=@23645d2.bin,0 +23645n0.bin=@23645n0.bin,0 +23645n1.bin=@23645n1.bin,0 +23645n2.bin=@23645n2.bin,0 +23656d0.bin=@23656d0.bin,0 +23656d1.bin=@23656d1.bin,0 +23656d2.bin=@23656d2.bin,0 +23656n0.bin=@23656n0.bin,0 +23656n1.bin=@23656n1.bin,0 +23656n2.bin=@23656n2.bin,0 +23660d0.bin=@23660d0.bin,0 +23660d1.bin=@23660d1.bin,0 +23660d2.bin=@23660d2.bin,0 +23660n0.bin=@23660n0.bin,0 +23660n1.bin=@23660n1.bin,0 +23660n2.bin=@23660n2.bin,0 +23669d0.bin=@23669d0.bin,0 +23669d1.bin=@23669d1.bin,0 +23669d2.bin=@23669d2.bin,0 +23669n0.bin=@23669n0.bin,0 +23669n1.bin=@23669n1.bin,0 +23669n2.bin=@23669n2.bin,0 +23706d0.bin=@23706d0.bin,0 +23706d1.bin=@23706d1.bin,0 +23706d2.bin=@23706d2.bin,0 +23706n0.bin=@23706n0.bin,0 +23706n1.bin=@23706n1.bin,0 +23706n2.bin=@23706n2.bin,0 +23710d0.bin=@23710d0.bin,0 +23710d1.bin=@23710d1.bin,0 +23710d2.bin=@23710d2.bin,0 +23710n0.bin=@23710n0.bin,0 +23710n1.bin=@23710n1.bin,0 +23710n2.bin=@23710n2.bin,0 +23714d0.bin=@23714d0.bin,0 +23714d1.bin=@23714d1.bin,0 +23714d2.bin=@23714d2.bin,0 +23714n0.bin=@23714n0.bin,0 +23714n1.bin=@23714n1.bin,0 +23714n2.bin=@23714n2.bin,0 +23719d0.bin=@23719d0.bin,0 +23719d1.bin=@23719d1.bin,0 +23719d2.bin=@23719d2.bin,0 +23719n0.bin=@23719n0.bin,0 +23719n1.bin=@23719n1.bin,0 +23719n2.bin=@23719n2.bin,0 +55513d0.bin=@55513d0.bin,0 +55513d1.bin=@55513d1.bin,0 +55513d2.bin=@55513d2.bin,0 +55513n0.bin=@55513n0.bin,0 +55513n1.bin=@55513n1.bin,0 +55513n2.bin=@55513n2.bin,0 +55924d0.bin=@55924d0.bin,0 +55924d1.bin=@55924d1.bin,0 +55924d2.bin=@55924d2.bin,0 +55924n0.bin=@55924n0.bin,0 +55924n1.bin=@55924n1.bin,0 +55924n2.bin=@55924n2.bin,0 +55930d0.bin=@55930d0.bin,0 +55930d1.bin=@55930d1.bin,0 +55930d2.bin=@55930d2.bin,0 +55930n0.bin=@55930n0.bin,0 +55930n1.bin=@55930n1.bin,0 +55930n2.bin=@55930n2.bin,0 +23469d0.bin=@23469d0.bin,0 +23469d1.bin=@23469d1.bin,0 +23469d2.bin=@23469d2.bin,0 +23469n0.bin=@23469n0.bin,0 +23469n1.bin=@23469n1.bin,0 +23470n2.bin=@23470n2.bin,0 +23474d0.bin=@23474d0.bin,0 +23474d1.bin=@23474d1.bin,0 +23474d2.bin=@23474d2.bin,0 +23474n0.bin=@23474n0.bin,0 +23474n1.bin=@23474n1.bin,0 +23474n2.bin=@23474n2.bin,0 +23478d0.bin=@23478d0.bin,0 +23478d1.bin=@23478d1.bin,0 +23478d2.bin=@23478d2.bin,0 +23478n0.bin=@23478n0.bin,0 +23478n1.bin=@23478n1.bin,0 +23478n2.bin=@23478n2.bin,0 +23482d0.bin=@23482d0.bin,0 +23482d1.bin=@23482d1.bin,0 +23482d2.bin=@23482d2.bin,0 +23482n0.bin=@23482n0.bin,0 +23482n1.bin=@23482n1.bin,0 +23482n2.bin=@23482n2.bin,0 +23518d0.bin=@23518d0.bin,0 +23518d1.bin=@23518d1.bin,0 +23518d2.bin=@23518d2.bin,0 +23518n0.bin=@23518n0.bin,0 +23518n1.bin=@23518n1.bin,0 +23518n2.bin=@23518n2.bin,0 +23522d0.bin=@23522d0.bin,0 +23522d1.bin=@23522d1.bin,0 +23522d2.bin=@23522d2.bin,0 +23522n0.bin=@23522n0.bin,0 +23522n1.bin=@23522n1.bin,0 +23522n2.bin=@23522n2.bin,0 +23538d0.bin=@23538d0.bin,0 +23538d1.bin=@23538d1.bin,0 +23538d2.bin=@23538d2.bin,0 +23538n0.bin=@23538n0.bin,0 +23538n1.bin=@23538n1.bin,0 +23538n2.bin=@23538n2.bin,0 +23542d0.bin=@23542d0.bin,0 +23542d1.bin=@23542d1.bin,0 +23542d2.bin=@23542d2.bin,0 +23542n0.bin=@23542n0.bin,0 +23542n1.bin=@23542n1.bin,0 +23542n2.bin=@23542n2.bin,0 +23608d0.bin=@23608d0.bin,0 +23608d1.bin=@23608d1.bin,0 +23608d2.bin=@23608d2.bin,0 +23608n0.bin=@23608n0.bin,0 +23608n1.bin=@23608n1.bin,0 +23608n2.bin=@23608n2.bin,0 +23612d0.bin=@23612d0.bin,0 +23612d1.bin=@23612d1.bin,0 +23612d2.bin=@23612d2.bin,0 +23612n0.bin=@23612n0.bin,0 +23612n1.bin=@23612n1.bin,0 +23612n2.bin=@23612n2.bin,0 +23616d0.bin=@23616d0.bin,0 +23616d1.bin=@23616d1.bin,0 +23616d2.bin=@23616d2.bin,0 +23616n0.bin=@23616n0.bin,0 +23616n1.bin=@23616n1.bin,0 +23616n2.bin=@23616n2.bin,0 +23620d0.bin=@23620d0.bin,0 +23620d1.bin=@23620d1.bin,0 +23620d2.bin=@23620d2.bin,0 +23620n0.bin=@23620n0.bin,0 +23620n1.bin=@23620n1.bin,0 +23620n2.bin=@23620n2.bin,0 +23624d0.bin=@23624d0.bin,0 +23624d1.bin=@23624d1.bin,0 +23624d2.bin=@23624d2.bin,0 +23624n0.bin=@23624n0.bin,0 +23624n1.bin=@23624n1.bin,0 +23624n2.bin=@23624n2.bin,0 +23646d0.bin=@23646d0.bin,0 +23646d1.bin=@23646d1.bin,0 +23646d2.bin=@23646d2.bin,0 +23646n0.bin=@23646n0.bin,0 +23646n1.bin=@23646n1.bin,0 +23646n2.bin=@23646n2.bin,0 +23657d0.bin=@23657d0.bin,0 +23657d1.bin=@23657d1.bin,0 +23657d2.bin=@23657d2.bin,0 +23657n0.bin=@23657n0.bin,0 +23657n1.bin=@23657n1.bin,0 +23657n2.bin=@23657n2.bin,0 +23661d0.bin=@23661d0.bin,0 +23661d1.bin=@23661d1.bin,0 +23661d2.bin=@23661d2.bin,0 +23661n0.bin=@23661n0.bin,0 +23661n1.bin=@23661n1.bin,0 +23661n2.bin=@23661n2.bin,0 +23670d0.bin=@23670d0.bin,0 +23670d1.bin=@23670d1.bin,0 +23670d2.bin=@23670d2.bin,0 +23670n0.bin=@23670n0.bin,0 +23670n1.bin=@23670n1.bin,0 +23670n2.bin=@23670n2.bin,0 +23707d0.bin=@23707d0.bin,0 +23707d1.bin=@23707d1.bin,0 +23707d2.bin=@23707d2.bin,0 +23707n0.bin=@23707n0.bin,0 +23707n1.bin=@23707n1.bin,0 +23707n2.bin=@23707n2.bin,0 +23711d0.bin=@23711d0.bin,0 +23711d1.bin=@23711d1.bin,0 +23711d2.bin=@23711d2.bin,0 +23711n0.bin=@23711n0.bin,0 +23711n1.bin=@23711n1.bin,0 +23711n2.bin=@23711n2.bin,0 +23715d0.bin=@23715d0.bin,0 +23715d1.bin=@23715d1.bin,0 +23715d2.bin=@23715d2.bin,0 +23715n0.bin=@23715n0.bin,0 +23715n1.bin=@23715n1.bin,0 +23715n2.bin=@23715n2.bin,0 +23720d0.bin=@23720d0.bin,0 +23720d1.bin=@23720d1.bin,0 +23720d2.bin=@23720d2.bin,0 +23720n0.bin=@23720n0.bin,0 +23720n1.bin=@23720n1.bin,0 +23720n2.bin=@23720n2.bin,0 +55925d0.bin=@55925d0.bin,0 +55925d1.bin=@55925d1.bin,0 +55925d2.bin=@55925d2.bin,0 +55925n0.bin=@55925n0.bin,0 +55925n1.bin=@55925n1.bin,0 +55925n2.bin=@55925n2.bin,0 +55931d0.bin=@55931d0.bin,0 +55931d1.bin=@55931d1.bin,0 +55931d2.bin=@55931d2.bin,0 +55931n0.bin=@55931n0.bin,0 +55931n1.bin=@55931n1.bin,0 +55931n2.bin=@55931n2.bin,0 +56042d0.bin=@56042d0.bin,0 +56042d1.bin=@56042d1.bin,0 +56042d2.bin=@56042d2.bin,0 +56042n0.bin=@56042n0.bin,0 +56042n1.bin=@56042n1.bin,0 +56042n2.bin=@56042n2.bin,0 +56063d0.bin=@56063d0.bin,0 +56063d1.bin=@56063d1.bin,0 +56063d2.bin=@56063d2.bin,0 +56063n0.bin=@56063n0.bin,0 +56063n1.bin=@56063n1.bin,0 +56063n2.bin=@56063n2.bin,0 +56064d0.bin=@56064d0.bin,0 +56064d1.bin=@56064d1.bin,0 +56064d2.bin=@56064d2.bin,0 +56064n0.bin=@56064n0.bin,0 +56064n1.bin=@56064n1.bin,0 +56064n2.bin=@56064n2.bin,0 +23470d0.bin=@23470d0.bin,0 +23470d1.bin=@23470d1.bin,0 +23470d2.bin=@23470d2.bin,0 +23470n0.bin=@23470n0.bin,0 +23470n1.bin=@23470n1.bin,0 +23475d0.bin=@23475d0.bin,0 +23475d1.bin=@23475d1.bin,0 +23475d2.bin=@23475d2.bin,0 +23475n0.bin=@23475n0.bin,0 +23475n1.bin=@23475n1.bin,0 +23475n2.bin=@23475n2.bin,0 +23479d0.bin=@23479d0.bin,0 +23479d1.bin=@23479d1.bin,0 +23479d2.bin=@23479d2.bin,0 +23479n0.bin=@23479n0.bin,0 +23479n1.bin=@23479n1.bin,0 +23479n2.bin=@23479n2.bin,0 +23483d0.bin=@23483d0.bin,0 +23483d1.bin=@23483d1.bin,0 +23483d2.bin=@23483d2.bin,0 +23483n0.bin=@23483n0.bin,0 +23483n1.bin=@23483n1.bin,0 +23483n2.bin=@23483n2.bin,0 +23519d0.bin=@23519d0.bin,0 +23519d1.bin=@23519d1.bin,0 +23519d2.bin=@23519d2.bin,0 +23519n0.bin=@23519n0.bin,0 +23519n1.bin=@23519n1.bin,0 +23519n2.bin=@23519n2.bin,0 +23523d0.bin=@23523d0.bin,0 +23523d1.bin=@23523d1.bin,0 +23523d2.bin=@23523d2.bin,0 +23523n0.bin=@23523n0.bin,0 +23523n1.bin=@23523n1.bin,0 +23523n2.bin=@23523n2.bin,0 +23539d0.bin=@23539d0.bin,0 +23539d1.bin=@23539d1.bin,0 +23539d2.bin=@23539d2.bin,0 +23539n0.bin=@23539n0.bin,0 +23539n1.bin=@23539n1.bin,0 +23539n2.bin=@23539n2.bin,0 +23543d0.bin=@23543d0.bin,0 +23543d1.bin=@23543d1.bin,0 +23543d2.bin=@23543d2.bin,0 +23543n0.bin=@23543n0.bin,0 +23543n1.bin=@23543n1.bin,0 +23543n2.bin=@23543n2.bin,0 +23609d0.bin=@23609d0.bin,0 +23609d1.bin=@23609d1.bin,0 +23609d2.bin=@23609d2.bin,0 +23609n0.bin=@23609n0.bin,0 +23609n1.bin=@23609n1.bin,0 +23609n2.bin=@23609n2.bin,0 +23613d0.bin=@23613d0.bin,0 +23613d1.bin=@23613d1.bin,0 +23613d2.bin=@23613d2.bin,0 +23613n0.bin=@23613n0.bin,0 +23613n1.bin=@23613n1.bin,0 +23613n2.bin=@23613n2.bin,0 +23617d0.bin=@23617d0.bin,0 +23617d1.bin=@23617d1.bin,0 +23617d2.bin=@23617d2.bin,0 +23617n0.bin=@23617n0.bin,0 +23617n1.bin=@23617n1.bin,0 +23617n2.bin=@23617n2.bin,0 +23621d0.bin=@23621d0.bin,0 +23621d1.bin=@23621d1.bin,0 +23621d2.bin=@23621d2.bin,0 +23621n0.bin=@23621n0.bin,0 +23621n1.bin=@23621n1.bin,0 +23621n2.bin=@23621n2.bin,0 +23625d0.bin=@23625d0.bin,0 +23625d1.bin=@23625d1.bin,0 +23625d2.bin=@23625d2.bin,0 +23625n0.bin=@23625n0.bin,0 +23625n1.bin=@23625n1.bin,0 +23625n2.bin=@23625n2.bin,0 +23647d0.bin=@23647d0.bin,0 +23647d1.bin=@23647d1.bin,0 +23647d2.bin=@23647d2.bin,0 +23647n0.bin=@23647n0.bin,0 +23647n1.bin=@23647n1.bin,0 +23647n2.bin=@23647n2.bin,0 +23658d0.bin=@23658d0.bin,0 +23658d1.bin=@23658d1.bin,0 +23658d2.bin=@23658d2.bin,0 +23658n0.bin=@23658n0.bin,0 +23658n1.bin=@23658n1.bin,0 +23658n2.bin=@23658n2.bin,0 +23662d0.bin=@23662d0.bin,0 +23662d1.bin=@23662d1.bin,0 +23662d2.bin=@23662d2.bin,0 +23662n0.bin=@23662n0.bin,0 +23662n1.bin=@23662n1.bin,0 +23662n2.bin=@23662n2.bin,0 +23671d0.bin=@23671d0.bin,0 +23671d1.bin=@23671d1.bin,0 +23671d2.bin=@23671d2.bin,0 +23671n0.bin=@23671n0.bin,0 +23671n1.bin=@23671n1.bin,0 +23671n2.bin=@23671n2.bin,0 +23708d0.bin=@23708d0.bin,0 +23708d1.bin=@23708d1.bin,0 +23708d2.bin=@23708d2.bin,0 +23708n0.bin=@23708n0.bin,0 +23708n1.bin=@23708n1.bin,0 +23708n2.bin=@23708n2.bin,0 +23712d0.bin=@23712d0.bin,0 +23712d1.bin=@23712d1.bin,0 +23712d2.bin=@23712d2.bin,0 +23712n0.bin=@23712n0.bin,0 +23712n1.bin=@23712n1.bin,0 +23712n2.bin=@23712n2.bin,0 +23716d0.bin=@23716d0.bin,0 +23716d1.bin=@23716d1.bin,0 +23716d2.bin=@23716d2.bin,0 +23716n0.bin=@23716n0.bin,0 +23716n1.bin=@23716n1.bin,0 +23716n2.bin=@23716n2.bin,0 +23721d0.bin=@23721d0.bin,0 +23721d1.bin=@23721d1.bin,0 +23721d2.bin=@23721d2.bin,0 +23721n0.bin=@23721n0.bin,0 +23721n1.bin=@23721n1.bin,0 +23721n2.bin=@23721n2.bin,0 +55926d0.bin=@55926d0.bin,0 +55926d1.bin=@55926d1.bin,0 +55926d2.bin=@55926d2.bin,0 +55926n0.bin=@55926n0.bin,0 +55926n1.bin=@55926n1.bin,0 +55926n2.bin=@55926n2.bin,0 +55932d0.bin=@55932d0.bin,0 +55932d1.bin=@55932d1.bin,0 +55932d2.bin=@55932d2.bin,0 +55932n0.bin=@55932n0.bin,0 +55932n1.bin=@55932n1.bin,0 +55932n2.bin=@55932n2.bin,0 +23471d0.bin=@23471d0.bin,0 +23471d1.bin=@23471d1.bin,0 +23471d2.bin=@23471d2.bin,0 +23471n0.bin=@23471n0.bin,0 +23471n1.bin=@23471n1.bin,0 +23471n2.bin=@23471n2.bin,0 +21731n0.bin=@21731n0.bin,0 +21731n1.bin=@21731n1.bin,0 +21731n2.bin=@21731n2.bin,0 +21746d0.bin=@21746d0.bin,0 +21746d1.bin=@21746d1.bin,0 +21746d2.bin=@21746d2.bin,0 +21746n0.bin=@21746n0.bin,0 +21746n1.bin=@21746n1.bin,0 +21746n2.bin=@21746n2.bin,0 +21731d0.bin=@21731d0.bin,0 +21731d1.bin=@21731d1.bin,0 +21731d2.bin=@21731d2.bin,0 +54633d0.bin=@54633d0.bin,0 +54633d1.bin=@54633d1.bin,0 +54633d2.bin=@54633d2.bin,0 +54633n0.bin=@54633n0.bin,0 +54633n1.bin=@54633n1.bin,0 +54633n2.bin=@54633n2.bin,0 +54801d0.bin=@54801d0.bin,0 +54801d1.bin=@54801d1.bin,0 +54801d2.bin=@54801d2.bin,0 +54801n0.bin=@54801n0.bin,0 +54801n1.bin=@54801n1.bin,0 +54801n2.bin=@54801n2.bin,0 +55203d0.bin=@55203d0.bin,0 +55203d1.bin=@55203d1.bin,0 +55203d2.bin=@55203d2.bin,0 +55203n0.bin=@55203n0.bin,0 +55203n1.bin=@55203n1.bin,0 +55203n2.bin=@55203n2.bin,0 +55204d0.bin=@55204d0.bin,0 +55204d1.bin=@55204d1.bin,0 +55204d2.bin=@55204d2.bin,0 +55204n0.bin=@55204n0.bin,0 +55204n1.bin=@55204n1.bin,0 +55204n2.bin=@55204n2.bin,0 +55464d0.bin=@55464d0.bin,0 +55464d1.bin=@55464d1.bin,0 +55464d2.bin=@55464d2.bin,0 +55464n0.bin=@55464n0.bin,0 +55464n1.bin=@55464n1.bin,0 +55464n2.bin=@55464n2.bin,0 +55619d0.bin=@55619d0.bin,0 +55619d1.bin=@55619d1.bin,0 +55619d2.bin=@55619d2.bin,0 +55619n0.bin=@55619n0.bin,0 +55619n1.bin=@55619n1.bin,0 +55619n2.bin=@55619n2.bin,0 +55730d0.bin=@55730d0.bin,0 +55730d1.bin=@55730d1.bin,0 +55730d2.bin=@55730d2.bin,0 +55730n0.bin=@55730n0.bin,0 +55730n1.bin=@55730n1.bin,0 +55730n2.bin=@55730n2.bin,0 +55771d0.bin=@55771d0.bin,0 +55771d1.bin=@55771d1.bin,0 +55771d2.bin=@55771d2.bin,0 +55771n0.bin=@55771n0.bin,0 +55771n1.bin=@55771n1.bin,0 +55771n2.bin=@55771n2.bin,0 +55896d0.bin=@55896d0.bin,0 +55896d1.bin=@55896d1.bin,0 +55896d2.bin=@55896d2.bin,0 +55896n0.bin=@55896n0.bin,0 +55896n1.bin=@55896n1.bin,0 +55896n2.bin=@55896n2.bin,0 +55937d0.bin=@55937d0.bin,0 +55937d1.bin=@55937d1.bin,0 +55937d2.bin=@55937d2.bin,0 +55937n0.bin=@55937n0.bin,0 +55937n1.bin=@55937n1.bin,0 +55937n2.bin=@55937n2.bin,0 +55938d0.bin=@55938d0.bin,0 +55938d1.bin=@55938d1.bin,0 +55938d2.bin=@55938d2.bin,0 +55938n0.bin=@55938n0.bin,0 +55938n1.bin=@55938n1.bin,0 +55938n2.bin=@55938n2.bin,0 +55939d0.bin=@55939d0.bin,0 +55939d1.bin=@55939d1.bin,0 +55939d2.bin=@55939d2.bin,0 +55939n0.bin=@55939n0.bin,0 +55939n1.bin=@55939n1.bin,0 +55939n2.bin=@55939n2.bin,0 +55964d0.bin=@55964d0.bin,0 +55964d1.bin=@55964d1.bin,0 +55964d2.bin=@55964d2.bin,0 +55964n0.bin=@55964n0.bin,0 +55964n1.bin=@55964n1.bin,0 +55964n2.bin=@55964n2.bin,0 +55967d0.bin=@55967d0.bin,0 +55967d1.bin=@55967d1.bin,0 +55967d2.bin=@55967d2.bin,0 +55967n0.bin=@55967n0.bin,0 +55967n1.bin=@55967n1.bin,0 +55967n2.bin=@55967n2.bin,0 +56109d0.bin=@56109d0.bin,0 +56109d1.bin=@56109d1.bin,0 +56109d2.bin=@56109d2.bin,0 +56109n0.bin=@56109n0.bin,0 +56109n1.bin=@56109n1.bin,0 +56109n2.bin=@56109n2.bin,0 +56110d0.bin=@56110d0.bin,0 +56110d1.bin=@56110d1.bin,0 +56110d2.bin=@56110d2.bin,0 +56110n0.bin=@56110n0.bin,0 +56110n1.bin=@56110n1.bin,0 +56110n2.bin=@56110n2.bin,0 +56143d0.bin=@56143d0.bin,0 +56143d1.bin=@56143d1.bin,0 +56143d2.bin=@56143d2.bin,0 +56143n0.bin=@56143n0.bin,0 +56143n1.bin=@56143n1.bin,0 +56143n2.bin=@56143n2.bin,0 +56147d0.bin=@56147d0.bin,0 +56147d1.bin=@56147d1.bin,0 +56147d2.bin=@56147d2.bin,0 +56147n0.bin=@56147n0.bin,0 +56147n1.bin=@56147n1.bin,0 +56147n2.bin=@56147n2.bin,0 +56157d0.bin=@56157d0.bin,0 +56157d1.bin=@56157d1.bin,0 +56157d2.bin=@56157d2.bin,0 +56157n0.bin=@56157n0.bin,0 +56157n1.bin=@56157n1.bin,0 +56157n2.bin=@56157n2.bin,0 +56159d0.bin=@56159d0.bin,0 +56159d1.bin=@56159d1.bin,0 +56159d2.bin=@56159d2.bin,0 +56159n0.bin=@56159n0.bin,0 +56159n1.bin=@56159n1.bin,0 +56159n2.bin=@56159n2.bin,0 +64552d0.bin=@64552d0.bin,0 +64552d1.bin=@64552d1.bin,0 +64552d2.bin=@64552d2.bin,0 +64555d0.bin=@64555d0.bin,0 +64555d1.bin=@64555d1.bin,0 +64555d2.bin=@64555d2.bin,0 +64556d0.bin=@64556d0.bin,0 +64556d1.bin=@64556d1.bin,0 +64556d2.bin=@64556d2.bin,0 +51122d0.bin=@51122d0.bin,0 +51122d1.bin=@51122d1.bin,0 +51122d2.bin=@51122d2.bin,0 +51122n0.bin=@51122n0.bin,0 +51122n1.bin=@51122n1.bin,0 +51122n2.bin=@51122n2.bin,0 +55732d0.bin=@55732d0.bin,0 +55732d1.bin=@55732d1.bin,0 +55732d2.bin=@55732d2.bin,0 +55732n0.bin=@55732n0.bin,0 +55732n1.bin=@55732n1.bin,0 +55732n2.bin=@55732n2.bin,0 +55731d0.bin=@55731d0.bin,0 +55731d1.bin=@55731d1.bin,0 +55731d2.bin=@55731d2.bin,0 +55731n0.bin=@55731n0.bin,0 +55731n1.bin=@55731n1.bin,0 +55731n2.bin=@55731n2.bin,0 +55818d0.bin=@55818d0.bin,0 +55818d1.bin=@55818d1.bin,0 +55818d2.bin=@55818d2.bin,0 +55818n0.bin=@55818n0.bin,0 +55818n1.bin=@55818n1.bin,0 +55818n2.bin=@55818n2.bin,0 +56112d0.bin=@56112d0.bin,0 +56112d1.bin=@56112d1.bin,0 +56112d2.bin=@56112d2.bin,0 +56112n0.bin=@56112n0.bin,0 +56112n1.bin=@56112n1.bin,0 +56112n2.bin=@56112n2.bin,0 +56105d0.bin=@56105d0.bin,0 +56105d1.bin=@56105d1.bin,0 +56105d2.bin=@56105d2.bin,0 +56105n0.bin=@56105n0.bin,0 +56105n1.bin=@56105n1.bin,0 +56105n2.bin=@56105n2.bin,0 +58007d2.bin=@58007d2.bin,0 +58008d2.bin=@58008d2.bin,0 +58009d2.bin=@58009d2.bin,0 +58010d2.bin=@58010d2.bin,0 +58129d0.bin=@58129d0.bin,0 +58130d0.bin=@58130d0.bin,0 +58139d0.bin=@58139d0.bin,0 diff --git a/bundled-schema/EventQuests.sql b/bundled-schema/EventQuests.sql new file mode 100644 index 000000000..23b4277c7 --- /dev/null +++ b/bundled-schema/EventQuests.sql @@ -0,0 +1,292 @@ +BEGIN; + +-- Ripped quests +INSERT INTO public.event_quests (max_players, quest_type, quest_id, mark) VALUES + (0,9,40060,0), + (0,9,40079,0), + (0,9,40080,0), + (0,9,40081,0), + (0,9,40133,0), + (0,9,40134,0), + (0,9,40135,0), + (0,9,40136,0), + (0,9,40137,0), + (0,9,40138,0), + (0,9,40142,0), + (0,9,40143,0), + (0,9,40161,0), + (0,9,40162,0), + (4,9,40173,0), + (4,9,40174,0), + (0,9,40201,0), + (0,9,40218,0), + (4,43,40236,1), + (4,28,40241,1), + (0,8,50534,0), + (4,18,50852,1), + (4,18,50940,1), + (4,18,51024,1), + (4,18,51025,1), + (4,18,51026,1), + (4,18,51027,1), + (4,38,51052,9), + (4,38,51053,9), + (4,18,51059,1), + (4,38,51107,9), + (4,24,51125,0), + (1,24,51126,0), + (4,24,51127,0), + (4,24,51128,0), + (4,24,51129,0), + (4,26,53034,1), + (4,18,53140,1), + (4,18,53187,1), + (4,18,53201,1), + (1,18,53253,1), + (4,26,53307,1), + (4,24,53314,0), + (4,24,53315,0), + (4,24,53316,0), + (4,24,53317,0), + (4,24,53318,0), + (4,24,53319,0), + (4,24,53320,0), + (4,24,53321,0), + (4,24,53324,0), + (1,18,53326,2), + (4,31,54244,0), + (0,8,54425,0), + (4,28,54449,1), + (4,28,54593,1), + (4,28,54594,1), + (4,28,54603,1), + (4,28,54604,1), + (4,28,54605,1), + (4,28,54606,1), + (1,28,54608,0), + (1,28,54609,0), + (32,40,54751,0), + (32,40,54752,0), + (32,40,54753,0), + (32,40,54754,0), + (32,40,54755,0), + (32,40,54756,0), + (32,40,54757,0), + (32,40,54758,0), + (32,40,54759,0), + (32,40,54760,0), + (32,40,54761,0), + (4,28,54801,0), + (4,28,55002,1), + (4,28,55195,0), + (4,28,55202,0), + (4,28,55203,0), + (4,28,55204,0), + (0,8,55369,0), + (4,28,55464,1), + (4,43,55513,1), + (4,28,55529,0), + (4,28,55532,0), + (1,28,55536,0), + (1,28,55537,0), + (32,50,55596,0), + (32,50,55597,0), + (32,50,55598,0), + (32,50,55599,0), + (32,50,55601,0), + (32,50,55602,0), + (32,50,55603,0), + (32,50,55604,0), + (32,50,55605,0), + (32,50,55606,0), + (32,50,55607,0), + (4,28,55619,0), + (4,28,55670,1), + (4,39,55679,9), + (4,39,55680,9), + (4,43,55691,1), + (4,43,55692,1), + (4,43,55693,1), + (4,43,55694,1), + (4,43,55695,1), + (4,43,55696,1), + (4,43,55697,1), + (4,43,55698,1), + (1,43,55728,1), + (4,43,55738,1), + (0,8,55767,0), + (0,8,55768,0), + (4,28,55771,1), + (4,39,55772,9), + (8,51,55796,0), + (8,51,55797,0), + (8,51,55798,0), + (8,51,55799,0), + (8,51,55801,0), + (8,51,55802,0), + (8,51,55803,0), + (8,51,55804,0), + (8,51,55805,0), + (8,51,55806,0), + (8,51,55807,0), + (1,28,55808,0), + (0,8,55870,0), + (0,8,55872,0), + (0,8,55879,0), + (0,8,55880,0), + (0,8,55881,0), + (0,8,55882,0), + (4,28,55896,1), + (0,8,55897,0), + (0,8,55899,0), + (0,8,55901,0), + (0,8,55902,0), + (0,8,55903,0), + (0,8,55904,0), + (0,8,55905,0), + (0,8,55906,0), + (0,8,55907,0), + (0,8,55908,0), + (0,8,55909,0), + (0,8,55910,0), + (0,8,55911,0), + (0,8,55912,0), + (4,39,55916,9), + (4,39,55917,9), + (4,39,55918,9), + (4,39,55919,9), + (4,28,55920,0), + (4,39,55921,9), + (4,39,55922,9), + (4,43,55923,1), + (4,43,55924,1), + (4,43,55925,1), + (4,43,55926,1), + (4,43,55929,1), + (4,43,55930,1), + (4,43,55931,1), + (4,43,55932,1), + (4,28,55935,0), + (4,28,55936,0), + (4,28,55937,0), + (4,28,55938,0), + (4,28,55939,0), + (4,28,55948,0), + (4,28,55949,0), + (4,28,55950,0), + (4,28,55951,0), + (1,28,55963,0), + (4,28,55964,1), + (4,28,55967,1), + (4,43,56042,1), + (4,43,56056,1), + (4,43,56058,1), + (4,43,56059,1), + (4,43,56063,1), + (4,43,56064,1), + (4,43,56076,4), + (4,43,56077,4), + (4,43,56078,4), + (4,43,56079,4), + (4,43,56080,4), + (4,43,56125,1), + (4,24,56134,0), + (4,24,56135,0), + (4,24,56138,0), + (4,24,56139,0), + (4,24,56141,0), + (4,24,56142,0), + (4,28,56143,1), + (4,43,56144,1), + (4,43,56145,1), + (0,8,56146,0), + (4,28,56147,1), + (4,24,56148,0), + (1,24,56149,0), + (4,43,56150,1), + (4,43,56151,1), + (4,43,56154,1), + (4,43,56155,1), + (4,43,56156,1), + (4,28,56157,1), + (1,28,56158,1), + (4,28,56159,1), + (4,48,58043,1), + (4,46,58050,0), + (4,46,58051,0), + (4,46,58052,0), + (4,46,58053,0), + (4,46,58054,0), + (4,46,58055,0), + (4,46,58056,0), + (4,46,58057,0), + (4,46,58058,0), + (4,46,58059,0), + (4,46,58060,0), + (4,46,58061,0), + (4,46,58062,0), + (4,46,58063,0), + (4,46,58064,0), + (4,46,58065,0), + (4,46,58066,0), + (4,46,58067,0), + (4,46,58068,0), + (4,46,58069,0), + (4,46,58070,0), + (4,46,58071,0), + (4,46,58072,0), + (4,46,58074,0), + (4,46,58075,0), + (4,46,58076,0), + (4,46,58077,0), + (4,46,58078,0), + (4,47,58079,0), + (4,47,58080,0), + (4,47,58081,0), + (4,47,58082,0), + (4,47,58083,0), + (4,46,58088,0), + (4,46,58089,0), + (4,46,58090,0), + (4,46,58091,0), + (4,46,58096,0), + (4,46,58097,0), + (4,46,58098,0), + (4,46,58099,0), + (4,46,58101,0), + (4,46,58102,1), + (4,46,58103,1), + (4,46,58104,1), + (4,46,58105,1), + (4,46,58106,1), + (4,46,58107,1), + (4,46,58108,1), + (4,46,58109,1), + (4,46,58112,1), + (4,46,58113,1), + (4,46,58114,1), + (4,46,58115,1), + (4,46,58118,0), + (4,46,58119,0), + (4,46,58120,0), + (4,46,58121,0), + (4,46,58122,0), + (4,46,58123,0), + (4,46,58125,1), + (4,46,58126,1), + (4,46,58127,1), + (4,46,58128,1), + (4,13,61050,0), + (4,13,61051,0), + (4,13,61053,0), + (4,13,61055,0), + (2,13,61067,0), + (4,13,61068,0), + (2,13,61070,0), + (4,13,61071,0), + (8,22,62101,0), + (8,16,62104,0), + (8,16,62105,0), + (8,16,62108,0), + (1,18,62910,1); +END; \ No newline at end of file diff --git a/bundled-schema/ScenarioDefaults.sql b/bundled-schema/ScenarioDefaults.sql new file mode 100644 index 000000000..ec7b3d99e --- /dev/null +++ b/bundled-schema/ScenarioDefaults.sql @@ -0,0 +1,178 @@ +BEGIN; + +INSERT INTO public.scenario_counter +(scenario_id, category_id) +VALUES + (17,0), + (93,1), + (92,1), + (81,1), + (91,1), + (90,1), + (89,1), + (88,1), + (87,1), + (86,1), + (85,1), + (84,1), + (83,1), + (82,1), + (87,3), + (88,3), + (89,3), + (90,3), + (91,3), + (92,3), + (83,3), + (86,3), + (60,3), + (58,3), + (59,3), + (27,3), + (25,3), + (26,3), + (23,3), + (2,3), + (3,3), + (4,3), + (31,3), + (32,3), + (33,3), + (34,3), + (35,3), + (36,3), + (37,3), + (40,3), + (38,3), + (39,3), + (48,3), + (12,3), + (13,3), + (30,3), + (29,3), + (46,3), + (0,4), + (1,4), + (2,4), + (3,4), + (4,4), + (5,4), + (6,4), + (7,4), + (8,4), + (9,4), + (10,4), + (11,4), + (12,4), + (13,4), + (14,4), + (50,5), + (51,5), + (52,5), + (53,5), + (54,5), + (55,5), + (56,5), + (58,5), + (63,5), + (64,5), + (65,5), + (67,5), + (71,5), + (75,5), + (61,5), + (68,5), + (66,5), + (76,5), + (70,5), + (77,5), + (72,5), + (74,5), + (73,5), + (78,5), + (69,5), + (62,5), + (79,5), + (0,6), + (1,6), + (2,6), + (3,6), + (4,6), + (5,6), + (6,6), + (7,6), + (8,6), + (9,6), + (17,6), + (10,6), + (11,6), + (12,6), + (13,6), + (14,6), + (15,6), + (16,6), + (50,7), + (53,7), + (62,7), + (52,7), + (56,7), + (51,7), + (49,7), + (54,7), + (57,7), + (55,7), + (61,7), + (58,7), + (60,7), + (59,7), + (42,7), + (48,7), + (40,7), + (39,7), + (43,7), + (46,7), + (41,7), + (44,7), + (45,7), + (47,7), + (37,7), + (34,7), + (33,7), + (32,7), + (28,7), + (26,7), + (36,7), + (38,7), + (35,7), + (27,7), + (30,7), + (31,7), + (29,7), + (24,7), + (23,7), + (22,7), + (21,7), + (25,7), + (20,7), + (7,7), + (9,7), + (13,7), + (16,7), + (12,7), + (14,7), + (15,7), + (19,7), + (10,7), + (8,7), + (11,7), + (18,7), + (17,7), + (6,7), + (5,7), + (4,7), + (3,7), + (2,7), + (1,7), + (0,7); + +END; \ No newline at end of file diff --git a/common/byteframe/byteframe.go b/common/byteframe/byteframe.go index ffeb66dc1..357595fe0 100644 --- a/common/byteframe/byteframe.go +++ b/common/byteframe/byteframe.go @@ -138,6 +138,10 @@ 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 diff --git a/common/decryption/jpk.go b/common/decryption/jpk.go new file mode 100644 index 000000000..99011b625 --- /dev/null +++ b/common/decryption/jpk.go @@ -0,0 +1,109 @@ +package decryption + +/* + This code is HEAVILY based from + https://github.com/Chakratos/ReFrontier/blob/master/ReFrontier/Unpack.cs +*/ + +import ( + "erupe-ce/common/byteframe" + "io" +) + +var mShiftIndex = 0 +var mFlag = byte(0) + +func UnpackSimple(data []byte) []byte { + mShiftIndex = 0 + mFlag = byte(0) + + bf := byteframe.NewByteFrameFromBytes(data) + bf.SetLE() + header := bf.ReadUint32() + + if header == 0x1A524B4A { + bf.Seek(0x2, io.SeekCurrent) + jpkType := bf.ReadUint16() + + switch jpkType { + case 3: + startOffset := bf.ReadInt32() + outSize := bf.ReadInt32() + outBuffer := make([]byte, outSize) + bf.Seek(int64(startOffset), io.SeekStart) + ProcessDecode(bf, outBuffer) + + return outBuffer + } + } + + return data +} + +func ProcessDecode(data *byteframe.ByteFrame, outBuffer []byte) { + outIndex := 0 + + for int(data.Index()) < len(data.Data()) && outIndex < len(outBuffer)-1 { + if JPKBitShift(data) == 0 { + outBuffer[outIndex] = ReadByte(data) + outIndex++ + continue + } else { + if JPKBitShift(data) == 0 { + length := (JPKBitShift(data) << 1) | JPKBitShift(data) + off := ReadByte(data) + JPKCopy(outBuffer, int(off), int(length)+3, &outIndex) + continue + } else { + hi := ReadByte(data) + lo := ReadByte(data) + length := int(hi&0xE0) >> 5 + off := ((int(hi) & 0x1F) << 8) | int(lo) + if length != 0 { + JPKCopy(outBuffer, off, length+2, &outIndex) + continue + } else { + if JPKBitShift(data) == 0 { + length := (JPKBitShift(data) << 3) | (JPKBitShift(data) << 2) | (JPKBitShift(data) << 1) | JPKBitShift(data) + JPKCopy(outBuffer, off, int(length)+2+8, &outIndex) + continue + } else { + temp := ReadByte(data) + if temp == 0xFF { + for i := 0; i < off+0x1B; i++ { + outBuffer[outIndex] = ReadByte(data) + outIndex++ + continue + } + } else { + JPKCopy(outBuffer, off, int(temp)+0x1a, &outIndex) + } + } + } + } + } + } +} + +func JPKBitShift(data *byteframe.ByteFrame) byte { + mShiftIndex-- + + if mShiftIndex < 0 { + mShiftIndex = 7 + mFlag = ReadByte(data) + } + + return (byte)((mFlag >> mShiftIndex) & 1) +} + +func JPKCopy(outBuffer []byte, offset int, length int, index *int) { + for i := 0; i < length; i++ { + outBuffer[*index] = outBuffer[*index-offset-1] + *index++ + } +} + +func ReadByte(bf *byteframe.ByteFrame) byte { + value := bf.ReadUint8() + return value +} diff --git a/common/mhfcourse/mhfcourse.go b/common/mhfcourse/mhfcourse.go index 13496119b..f838e64a5 100644 --- a/common/mhfcourse/mhfcourse.go +++ b/common/mhfcourse/mhfcourse.go @@ -1,8 +1,8 @@ package mhfcourse import ( - "golang.org/x/exp/slices" "math" + "sort" "time" ) @@ -66,10 +66,10 @@ func CourseExists(ID uint16, c []Course) bool { // GetCourseStruct returns a slice of Course(s) from a rights integer func GetCourseStruct(rights uint32) ([]Course, uint32) { - resp := []Course{{ID: 1}, {ID: 24}} + resp := []Course{{ID: 1}, {ID: 23}, {ID: 24}} s := Courses() - slices.SortStableFunc(s, func(i, j Course) bool { - return i.ID > j.ID + sort.Slice(s, func(i, j int) bool { + return s[i].ID > s[j].ID }) var normalCafeCourseSet, netcafeCourseSet bool for _, course := range s { diff --git a/common/mhfmon/mhfmon.go b/common/mhfmon/mhfmon.go new file mode 100644 index 000000000..183a75bd8 --- /dev/null +++ b/common/mhfmon/mhfmon.go @@ -0,0 +1,366 @@ +package mhfmon + +const ( + Mon0 = iota + Rathian + Fatalis + Kelbi + Mosswine + Bullfango + YianKutKu + LaoShanLung + Cephadrome + Felyne + VeggieElder + Rathalos + Aptonoth + Genprey + Diablos + Khezu + Velociprey + Gravios + Mon18 + Vespoid + Gypceros + Plesioth + Basarios + Melynx + Hornetaur + Apceros + Monoblos + Velocidrome + Gendrome + Mon29 + Ioprey + Iodrome + Mon32 + Kirin + Cephalos + Giaprey + CrimsonFatalis + PinkRathian + BlueYianKutKu + PurpleGypceros + YianGaruga + SilverRathalos + GoldRathian + BlackDiablos + WhiteMonoblos + RedKhezu + GreenPlesioth + BlackGravios + DaimyoHermitaur + AzureRathalos + AshenLaoShanLung + Blangonga + Congalala + Rajang + KushalaDaora + ShenGaoren + GreatThunderbug + Shakalaka + YamaTsukami + Chameleos + RustedKushalaDaora + Blango + Conga + Remobra + Lunastra + Teostra + Hermitaur + ShogunCeanataur + Bulldrome + Anteka + Popo + WhiteFatalis + Mon72 + Ceanataur + Hypnocatrice + Lavasioth + Tigrex + Akantor + BrightHypnoc + RedLavasioth + Espinas + OrangeEspinas + WhiteHypnoc + AqraVashimu + AqraJebia + Berukyurosu + Mon86 + Mon87 + Mon88 + Pariapuria + WhiteEspinas + KamuOrugaron + NonoOrugaron + Raviente + Dyuragaua + Doragyurosu + Gurenzeburu + Burukku + Erupe + Rukodiora + Unknown + Gogomoa + Kokomoa + TaikunZamuza + Abiorugu + Kuarusepusu + Odibatorasu + Disufiroa + Rebidiora + Anorupatisu + Hyujikiki + Midogaron + Giaorugu + MiRu + Farunokku + Pokaradon + Shantien + Pokara + Mon118 + Goruganosu + Aruganosu + Baruragaru + Zerureusu + Gougarf + Uruki + Forokururu + Meraginasu + Diorex + GarubaDaora + Inagami + Varusaburosu + Poborubarumu + Block1Duremudira + Mon133 + Mon134 + Mon135 + Mon136 + Mon137 + Mon138 + Gureadomosu + Harudomerugu + Toridcless + Gasurabazura + Kusubami + YamaKurai + Block2Duremudira + Zinogre + Deviljho + Brachydios + BerserkRaviente + ToaTesukatora + Barioth + Uragaan + StygianZinogre + Guanzorumu + SavageDeviljho + Mon156 + Egyurasu + Voljang + Nargacuga + Keoaruboru + Zenaserisu + GoreMagala + BlinkingNargacuga + ShagaruMagala + Amatsu + Eruzerion + MusouDuremudira + Mon168 + Seregios + Bogabadorumu + Mon171 + MusouBogabadorumu + CostumedUruki + MusouZerureusu + Rappy + KingShakalaka +) + +type Monster struct { + Name string + Large bool +} + +var Monsters = []Monster{ + {"Mon0", false}, + {"Rathian", true}, + {"Fatalis", true}, + {"Kelbi", false}, + {"Mosswine", false}, + {"Bullfango", false}, + {"Yian Kut-Ku", true}, + {"Lao-Shan Lung", true}, + {"Cephadrome", true}, + {"Felyne", false}, + {"Veggie Elder", false}, + {"Rathalos", true}, + {"Aptonoth", false}, + {"Genprey", false}, + {"Diablos", true}, + {"Khezu", true}, + {"Velociprey", false}, + {"Gravios", true}, + {"Mon18", false}, + {"Vespoid", false}, + {"Gypceros", true}, + {"Plesioth", true}, + {"Basarios", true}, + {"Melynx", false}, + {"Hornetaur", false}, + {"Apceros", false}, + {"Monoblos", true}, + {"Velocidrome", true}, + {"Gendrome", true}, + {"Mon29", false}, + {"Ioprey", false}, + {"Iodrome", true}, + {"Mon32", false}, + {"Kirin", true}, + {"Cephalos", false}, + {"Giaprey", false}, + {"Crimson Fatalis", true}, + {"Pink Rathian", true}, + {"Blue Yian Kut-Ku", true}, + {"Purple Gypceros", true}, + {"Yian Garuga", true}, + {"Silver Rathalos", true}, + {"Gold Rathian", true}, + {"Black Diablos", true}, + {"White Monoblos", true}, + {"Red Khezu", true}, + {"Green Plesioth", true}, + {"Black Gravios", true}, + {"Daimyo Hermitaur", true}, + {"Azure Rathalos", true}, + {"Ashen Lao-Shan Lung", true}, + {"Blangonga", true}, + {"Congalala", true}, + {"Rajang", true}, + {"Kushala Daora", true}, + {"Shen Gaoren", true}, + {"Great Thunderbug", false}, + {"Shakalaka", false}, + {"Yama Tsukami", true}, + {"Chameleos", true}, + {"Rusted Kushala Daora", true}, + {"Blango", false}, + {"Conga", false}, + {"Remobra", false}, + {"Lunastra", true}, + {"Teostra", true}, + {"Hermitaur", false}, + {"Shogun Ceanataur", true}, + {"Bulldrome", true}, + {"Anteka", false}, + {"Popo", false}, + {"White Fatalis", true}, + {"Mon72", false}, + {"Ceanataur", false}, + {"Hypnocatrice", true}, + {"Lavasioth", true}, + {"Tigrex", true}, + {"Akantor", true}, + {"Bright Hypnocatrice", true}, + {"Red Lavasioth", true}, + {"Espinas", true}, + {"Orange Espinas", true}, + {"White Hypnocatrice", true}, + {"Aqra Vashimu", true}, + {"Aqra Jebia", true}, + {"Berukyurosu", true}, + {"Mon86", false}, + {"Mon87", false}, + {"Mon88", false}, + {"Pariapuria", true}, + {"White Espinas", true}, + {"Kamu Orugaron", true}, + {"Nono Orugaron", true}, + {"Raviente", true}, // + Violent + {"Dyuragaua", true}, + {"Doragyurosu", true}, + {"Gurenzeburu", true}, + {"Burukku", false}, + {"Erupe", false}, + {"Rukodiora", true}, + {"Unknown", true}, + {"Gogomoa", true}, + {"Kokomoa", false}, + {"Taikun Zamuza", true}, + {"Abiorugu", true}, + {"Kuarusepusu", true}, + {"Odibatorasu", true}, + {"Disufiroa", true}, + {"Rebidiora", true}, + {"Anorupatisu", true}, + {"Hyujikiki", true}, + {"Midogaron", true}, + {"Giaorugu", true}, + {"Mi-Ru", true}, // + Musou + {"Farunokku", true}, + {"Pokaradon", true}, + {"Shantien", true}, + {"Pokara", false}, + {"Mon118", false}, + {"Goruganosu", true}, + {"Aruganosu", true}, + {"Baruragaru", true}, + {"Zerureusu", true}, + {"Gougarf", true}, // Both + {"Uruki", false}, + {"Forokururu", true}, + {"Meraginasu", true}, + {"Diorex", true}, + {"Garuba Daora", true}, + {"Inagami", true}, + {"Varusablos", true}, + {"Poborubarumu", true}, + {"1st Block Duremudira", true}, + {"Mon133", false}, + {"Mon134", false}, + {"Mon135", false}, + {"Mon136", false}, + {"Mon137", false}, + {"Mon138", false}, + {"Gureadomosu", true}, + {"Harudomerugu", true}, + {"Toridcless", true}, + {"Gasurabazura", true}, + {"Kusubami", false}, + {"Yama Kurai", true}, + {"2nd Block Duremudira", true}, + {"Zinogre", true}, + {"Deviljho", true}, + {"Brachydios", true}, + {"Berserk Raviente", true}, + {"Toa Tesukatora", true}, + {"Barioth", true}, + {"Uragaan", true}, + {"Stygian Zinogre", true}, + {"Guanzorumu", true}, + {"Savage Deviljho", true}, // + Starving/Heavenly + {"Mon156", false}, + {"Egyurasu", false}, + {"Voljang", true}, + {"Nargacuga", true}, + {"Keoaruboru", true}, + {"Zenaserisu", true}, + {"Gore Magala", true}, + {"Blinking Nargacuga", true}, + {"Shagaru Magala", true}, + {"Amatsu", true}, + {"Eruzerion", true}, // + Musou + {"Musou Duremudira", true}, + {"Mon168", false}, + {"Seregios", true}, + {"Bogabadorumu", true}, + {"Mon171", false}, + {"Musou Bogabadorumu", true}, + {"Costumed Uruki", false}, + {"Musou Zerureusu", true}, + {"Rappy", false}, + {"King Shakalaka", false}, +} diff --git a/common/stringsupport/string_convert.go b/common/stringsupport/string_convert.go index 53ed2ec69..452c85321 100644 --- a/common/stringsupport/string_convert.go +++ b/common/stringsupport/string_convert.go @@ -2,6 +2,7 @@ package stringsupport import ( "bytes" + "fmt" "io" "strconv" "strings" @@ -96,3 +97,23 @@ func CSVElems(csv string) []int { } return r } + +func CSVGetIndex(csv string, i int) int { + s := CSVElems(csv) + if i < len(s) { + return s[i] + } + return 0 +} + +func CSVSetIndex(csv string, i int, v int) string { + s := CSVElems(csv) + if i < len(s) { + s[i] = v + } + var r []string + for j := 0; j < len(s); j++ { + r = append(r, fmt.Sprintf(`%d`, s[j])) + } + return strings.Join(r, ",") +} diff --git a/config.json b/config.json index 2a62a3809..31629b894 100644 --- a/config.json +++ b/config.json @@ -11,13 +11,14 @@ "PatchServerFile": "", "ScreenshotAPIURL": "", "DeleteOnSaveCorruption": false, + "ClientMode": "ZZ", "DevMode": true, "DevModeOptions": { "AutoCreateAccount": true, "CleanDB": false, "MaxLauncherHR": false, - "LogInboundMessages": false, - "LogOutboundMessages": false, + "LogInboundMessages": true, + "LogOutboundMessages": true, "MaxHexdumpLength": 256, "DivaEvent": 0, "FestaEvent": -1, @@ -26,21 +27,47 @@ "MezFesAlt": false, "DisableTokenCheck": false, "QuestDebugTools": false, + "EarthStatusOverride": 0, + "EarthIDOverride": 0, + "EarthMonsterOverride": 0, "SaveDumps": { "Enabled": true, - "OutputDir": "savedata" + "OutputDir": "save-backups" } }, "GameplayOptions": { "FeaturedWeapons": 1, "MaximumNP": 100000, "MaximumRP": 50000, + "MaximumFP": 120000, + "TreasureHuntExpiry": 604800, "DisableLoginBoost": false, "DisableBoostTime": false, "BoostTimeDuration": 120, "GuildMealDuration": 60, "BonusQuestAllowance": 3, - "DailyQuestAllowance": 1 + "DailyQuestAllowance": 1, + "MezfesSoloTickets": 10, + "MezfesGroupTickets": 4, + "LowLatencyRaviente": false, + "RegularRavienteMaxPlayers": 8, + "ViolentRavienteMaxPlayers": 8, + "BerserkRavienteMaxPlayers": 32, + "ExtremeRavienteMaxPlayers": 32, + "SmallBerserkRavienteMaxPlayers": 8, + "GUrgentRate": 0.10, + "GCPMultiplier": 1.00, + "GRPMultiplier": 1.00, + "GSRPMultiplier": 1.00, + "GZennyMultiplier": 1.00, + "MaterialMultiplier": 1.00, + "ExtraCarves": 0, + "DisableHunterNavi": false, + "EnableKaijiEvent": false, + "EnableHiganjimaEvent": false, + "EnableNierEvent": false, + "DisableRoad": false, + "SeasonOverride": false }, "Discord": { "Enabled": false, @@ -51,31 +78,31 @@ { "Name": "Rights", "Enabled": false, - "Prefix": "!rights" + "Prefix": "rights" }, { "Name": "Raviente", "Enabled": true, - "Prefix": "!ravi" + "Prefix": "ravi" }, { "Name": "Teleport", "Enabled": false, - "Prefix": "!tele" + "Prefix": "tele" }, { "Name": "Reload", "Enabled": true, - "Prefix": "!reload" + "Prefix": "reload" }, { "Name": "KeyQuest", "Enabled": false, - "Prefix": "!kqf" + "Prefix": "kqf" }, { "Name": "Course", "Enabled": true, - "Prefix": "!course" + "Prefix": "course" }, { "Name": "PSN", "Enabled": true, - "Prefix": "!psn" + "Prefix": "psn" } ], "Courses": [ diff --git a/config/config.go b/config/config.go index 1e91b24b7..65c663511 100644 --- a/config/config.go +++ b/config/config.go @@ -1,15 +1,70 @@ -package config +package _config import ( "fmt" "log" "net" "os" + "strings" "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", "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"` @@ -22,6 +77,8 @@ type Config struct { PatchServerFile string // File patch server override ScreenshotAPIURL string // Destination for screenshots uploaded to BBS DeleteOnSaveCorruption bool // Attempts to save corrupted data will flag the save for deletion + ClientMode string + RealClientMode Mode DevMode bool DevModeOptions DevModeOptions @@ -38,20 +95,23 @@ type Config struct { // DevModeOptions holds various debug/temporary options for use while developing Erupe. type DevModeOptions struct { - AutoCreateAccount bool // Automatically create accounts if they don't exist - CleanDB bool // Automatically wipes the DB on server reset. - MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds. - LogInboundMessages bool // Log all messages sent to the server - LogOutboundMessages bool // Log all messages sent to the clients - MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled - DivaEvent int // Diva Defense event status - FestaEvent int // Hunter's Festa event status - TournamentEvent int // VS Tournament event status - MezFesEvent bool // MezFes status - MezFesAlt bool // Swaps out Volpakkun for Tokotoko - DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!) - QuestDebugTools bool // Enable various quest debug logs - SaveDumps SaveDumpOptions + AutoCreateAccount bool // Automatically create accounts if they don't exist + CleanDB bool // Automatically wipes the DB on server reset. + MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds. + LogInboundMessages bool // Log all messages sent to the server + LogOutboundMessages bool // Log all messages sent to the clients + MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled + DivaEvent int // Diva Defense event status + FestaEvent int // Hunter's Festa event status + TournamentEvent int // VS Tournament event status + MezFesEvent bool // MezFes status + MezFesAlt bool // Swaps out Volpakkun for Tokotoko + DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!) + QuestDebugTools bool // Enable various quest debug logs + EarthStatusOverride int32 + EarthIDOverride int32 + EarthMonsterOverride int32 + SaveDumps SaveDumpOptions } type SaveDumpOptions struct { @@ -61,15 +121,39 @@ type SaveDumpOptions struct { // GameplayOptions has various gameplay modifiers type GameplayOptions struct { - FeaturedWeapons int // Number of Active Feature weapons to generate daily - MaximumNP int // Maximum number of NP held by a player - MaximumRP uint16 // Maximum number of RP held by a player - DisableLoginBoost bool // Disables the Login Boost system - DisableBoostTime bool // Disables the daily NetCafe Boost Time - BoostTimeDuration int // The number of minutes NetCafe Boost Time lasts for - GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking - BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily - DailyQuestAllowance uint32 // Number of Daily Quests to allow daily + FeaturedWeapons int // Number of Active Feature weapons to generate daily + MaximumNP int // Maximum number of NP held by a player + MaximumRP uint16 // Maximum number of RP held by a player + MaximumFP uint32 // Maximum number of FP held by a player + TreasureHuntExpiry uint32 // Seconds until a Clan Treasure Hunt will expire + TreasureHuntPartnyaCooldown uint32 // Seconds until a Partnya can be assigned to another Clan Treasure Hunt + DisableLoginBoost bool // Disables the Login Boost system + DisableBoostTime bool // Disables the daily NetCafe Boost Time + BoostTimeDuration int // The number of minutes NetCafe Boost Time lasts for + GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking + BonusQuestAllowance uint32 // Number of Bonus Point Quests to allow daily + DailyQuestAllowance uint32 // Number of Daily Quests to allow daily + MezfesSoloTickets uint32 // Number of solo tickets given weekly + MezfesGroupTickets uint32 // Number of group tickets given weekly + LowLatencyRaviente bool // Toggles low latency mode for Raviente, can be network intensive + 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 + GRPMultiplier float32 // Adjusts the multiplier of G Rank Points rewarded for quest completion + GSRPMultiplier float32 // Adjusts the multiplier of G Skill Rank Points rewarded for quest completion + GZennyMultiplier float32 // Adjusts the multiplier of G Zenny rewarded for quest completion + MaterialMultiplier float32 // Adjusts the multiplier of Monster Materials rewarded for quest completion + ExtraCarves uint16 // Grant n extra chances to carve ALL carcasses + DisableHunterNavi bool // Disables the Hunter Navi + 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 } // Discord holds the discord integration config. @@ -154,7 +238,6 @@ func init() { if err != nil { preventClose(fmt.Sprintf("Failed to load config: %s", err.Error())) } - } // getOutboundIP4 gets the preferred outbound ip4 of this machine @@ -177,8 +260,8 @@ func LoadConfig() (*Config, error) { viper.AddConfigPath(".") viper.SetDefault("DevModeOptions.SaveDumps", SaveDumpOptions{ - Enabled: false, - OutputDir: "savedata", + Enabled: true, + OutputDir: "save-backups", }) err := viper.ReadInConfig() @@ -196,6 +279,20 @@ func LoadConfig() (*Config, error) { c.Host = getOutboundIP4().To4().String() } + for i := range versionStrings { + if strings.ToUpper(c.ClientMode) == versionStrings[i] { + c.RealClientMode = Mode(i + 1) + c.ClientMode = strings.ToUpper(c.ClientMode) + if c.RealClientMode <= G101 { + c.ClientMode += " (Debug only)" + } + } + } + if c.RealClientMode == 0 { + c.ClientMode = versionStrings[len(versionStrings)-1] + c.RealClientMode = ZZ + } + return c, nil } diff --git a/go.mod b/go.mod index 21ac00f07..93c8f83ad 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,35 @@ module erupe-ce -go 1.19 +go 1.21 require ( - github.com/bwmarrin/discordgo v0.23.2 + github.com/bwmarrin/discordgo v0.27.1 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 + github.com/jmoiron/sqlx v1.3.5 + github.com/lib/pq v1.10.9 + github.com/spf13/viper v1.16.0 + go.uber.org/zap v1.25.0 + golang.org/x/crypto v0.12.0 + golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 + golang.org/x/text v0.12.0 ) require ( - github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/pelletier/go-toml v1.9.3 // indirect - github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cast v1.3.1 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.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 - gopkg.in/ini.v1 v1.62.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/sys v0.11.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 863dc42a3..9078343f0 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ 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= @@ -15,9 +16,7 @@ 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.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 v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= 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= @@ -26,7 +25,6 @@ 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= @@ -36,19 +34,14 @@ 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/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/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/bwmarrin/discordgo v0.27.1 h1:ib9AIc/dom1E/fSIulrBwnez0CToJE113ZGt4HoliGY= +github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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= @@ -57,8 +50,6 @@ 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= @@ -67,21 +58,19 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m 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/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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/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.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/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 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= @@ -93,7 +82,6 @@ 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= @@ -108,9 +96,6 @@ 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= @@ -121,10 +106,9 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +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/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= @@ -137,157 +121,105 @@ 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-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/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/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/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/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/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/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 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.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/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= 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.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -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/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/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/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/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/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/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/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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= 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/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +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/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= -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.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= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= 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.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/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= @@ -298,8 +230,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-20221028150844-83b7d23a625f h1:Al51T6tzvuh3oiwX11vex3QgJ2XTedFPGmbEVh8cdoc= -golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/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= @@ -313,8 +245,6 @@ 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= @@ -325,11 +255,8 @@ 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/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= @@ -356,12 +283,10 @@ 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-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-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-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -371,9 +296,6 @@ 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= @@ -384,10 +306,7 @@ 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/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= @@ -397,7 +316,6 @@ 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= @@ -419,15 +337,13 @@ 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-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.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -435,9 +351,10 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/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= @@ -447,7 +364,6 @@ 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= @@ -457,8 +373,6 @@ 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= @@ -481,7 +395,6 @@ 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= @@ -490,10 +403,8 @@ 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-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/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.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= @@ -517,9 +428,6 @@ 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= @@ -550,7 +458,6 @@ 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= @@ -562,12 +469,8 @@ 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-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/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/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= @@ -581,13 +484,9 @@ 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= @@ -598,22 +497,16 @@ 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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +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/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.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= 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= diff --git a/main.go b/main.go index 0f104eccf..2a538b094 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + _config "erupe-ce/config" "fmt" "net" "os" @@ -9,7 +10,6 @@ import ( "syscall" "time" - "erupe-ce/config" "erupe-ce/server/channelserver" "erupe-ce/server/discordbot" "erupe-ce/server/entranceserver" @@ -45,7 +45,8 @@ func main() { var err error var zapLogger *zap.Logger - if config.ErupeConfig.DevMode { + config := _config.ErupeConfig + if config.DevMode { zapLogger, _ = zap.NewDevelopment() } else { zapLogger, _ = zap.NewProduction() @@ -55,20 +56,21 @@ func main() { logger := zapLogger.Named("main") logger.Info(fmt.Sprintf("Starting Erupe (9.3b-%s)", Commit())) + logger.Info(fmt.Sprintf("Client Mode: %s (%d)", config.ClientMode, config.RealClientMode)) - if config.ErupeConfig.Database.Password == "" { + if config.Database.Password == "" { preventClose("Database password is blank") } - if net.ParseIP(config.ErupeConfig.Host) == nil { - ips, _ := net.LookupIP(config.ErupeConfig.Host) + if net.ParseIP(config.Host) == nil { + ips, _ := net.LookupIP(config.Host) for _, ip := range ips { if ip != nil { - config.ErupeConfig.Host = ip.String() + config.Host = ip.String() break } } - if net.ParseIP(config.ErupeConfig.Host) == nil { + if net.ParseIP(config.Host) == nil { preventClose("Invalid host address") } } @@ -76,10 +78,10 @@ func main() { // Discord bot var discordBot *discordbot.DiscordBot = nil - if config.ErupeConfig.Discord.Enabled { + if config.Discord.Enabled { bot, err := discordbot.NewDiscordBot(discordbot.Options{ Logger: logger, - Config: config.ErupeConfig, + Config: _config.ErupeConfig, }) if err != nil { @@ -102,11 +104,11 @@ func main() { // 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, + config.Database.Host, + config.Database.Port, + config.Database.User, + config.Database.Password, + config.Database.Database, ) db, err := sqlx.Open("postgres", connectString) @@ -124,9 +126,10 @@ func main() { // Clear stale data _ = db.MustExec("DELETE FROM sign_sessions") _ = db.MustExec("DELETE FROM servers") + _ = db.MustExec(`UPDATE guild_characters SET treasure_hunt=NULL`) // Clean the DB if the option is on. - if config.ErupeConfig.DevMode && config.ErupeConfig.DevModeOptions.CleanDB { + if config.DevMode && config.DevModeOptions.CleanDB { logger.Info("Database: Started clearing...") cleanDB(db) logger.Info("Database: Finished clearing") @@ -139,11 +142,11 @@ func main() { // Entrance server. var entranceServer *entranceserver.Server - if config.ErupeConfig.Entrance.Enabled { + if config.Entrance.Enabled { entranceServer = entranceserver.NewServer( &entranceserver.Config{ Logger: logger.Named("entrance"), - ErupeConfig: config.ErupeConfig, + ErupeConfig: _config.ErupeConfig, DB: db, }) err = entranceServer.Start() @@ -158,11 +161,11 @@ func main() { // Sign server. var signServer *signserver.Server - if config.ErupeConfig.Sign.Enabled { + if config.Sign.Enabled { signServer = signserver.NewServer( &signserver.Config{ Logger: logger.Named("sign"), - ErupeConfig: config.ErupeConfig, + ErupeConfig: _config.ErupeConfig, DB: db, }) err = signServer.Start() @@ -176,11 +179,11 @@ func main() { // New Sign server var newSignServer *signv2server.Server - if config.ErupeConfig.SignV2.Enabled { + if config.SignV2.Enabled { newSignServer = signv2server.NewServer( &signv2server.Config{ Logger: logger.Named("sign"), - ErupeConfig: config.ErupeConfig, + ErupeConfig: _config.ErupeConfig, DB: db, }) err = newSignServer.Start() @@ -194,23 +197,23 @@ func main() { var channels []*channelserver.Server - if config.ErupeConfig.Channel.Enabled { + if config.Channel.Enabled { channelQuery := "" si := 0 ci := 0 count := 1 - for j, ee := range config.ErupeConfig.Entrance.Entries { + for j, ee := range config.Entrance.Entries { for i, ce := range ee.Channels { sid := (4096 + si*256) + (16 + ci) c := *channelserver.NewServer(&channelserver.Config{ ID: uint16(sid), Logger: logger.Named("channel-" + fmt.Sprint(count)), - ErupeConfig: config.ErupeConfig, + ErupeConfig: _config.ErupeConfig, DB: db, DiscordBot: discordBot, }) if ee.IP == "" { - c.IP = config.ErupeConfig.Host + c.IP = config.Host } else { c.IP = ee.IP } @@ -220,7 +223,7 @@ func main() { if err != nil { preventClose(fmt.Sprintf("Channel: Failed to start, %s", err.Error())) } else { - 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) + 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) channels = append(channels, &c) logger.Info(fmt.Sprintf("Channel %d (%d): Started successfully", count, ce.Port)) ci++ @@ -246,7 +249,7 @@ func main() { signal.Notify(c, os.Interrupt, syscall.SIGTERM) <-c - if !config.ErupeConfig.DisableSoftCrash { + if !config.DisableSoftCrash { for i := 0; i < 10; i++ { message := fmt.Sprintf("Shutting down in %d...", 10-i) for _, c := range channels { @@ -257,21 +260,21 @@ func main() { } } - if config.ErupeConfig.Channel.Enabled { + if config.Channel.Enabled { for _, c := range channels { c.Shutdown() } } - if config.ErupeConfig.Sign.Enabled { + if config.Sign.Enabled { signServer.Shutdown() } - if config.ErupeConfig.SignV2.Enabled { + if config.SignV2.Enabled { newSignServer.Shutdown() } - if config.ErupeConfig.Entrance.Enabled { + if config.Entrance.Enabled { entranceServer.Shutdown() } @@ -285,7 +288,7 @@ func wait() { } func preventClose(text string) { - if config.ErupeConfig.DisableSoftCrash { + if _config.ErupeConfig.DisableSoftCrash { os.Exit(0) } fmt.Println("\nFailed to start Erupe:\n" + text) diff --git a/network/crypt_conn.go b/network/crypt_conn.go index 439e9e3a0..2fc302b18 100644 --- a/network/crypt_conn.go +++ b/network/crypt_conn.go @@ -3,6 +3,7 @@ package network import ( "encoding/hex" "errors" + _config "erupe-ce/config" "fmt" "io" "net" @@ -48,7 +49,14 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) { } // Now read the encrypted packet body after getting its size from the header. - encryptedPacketBody := make([]byte, cph.DataSize) + 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.ErupeConfig.RealClientMode < _config.F1 { + encryptedPacketBody = make([]byte, cph.DataSize) + } else { + encryptedPacketBody = make([]byte, uint32(cph.DataSize)+(uint32(cph.Pf0-0x03)*0x1000)) + } _, err = io.ReadFull(cc.conn, encryptedPacketBody) if err != nil { return nil, err @@ -56,7 +64,7 @@ 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.Decrypt(encryptedPacketBody, cc.readKeyRot, nil) @@ -94,7 +102,7 @@ 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 diff --git a/network/mhfpacket/msg_mhf_acquire_cafe_item.go b/network/mhfpacket/msg_mhf_acquire_cafe_item.go index 8dcad0b53..04e603a44 100644 --- a/network/mhfpacket/msg_mhf_acquire_cafe_item.go +++ b/network/mhfpacket/msg_mhf_acquire_cafe_item.go @@ -2,10 +2,11 @@ package mhfpacket import ( "errors" + _config "erupe-ce/config" + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfAcquireCafeItem represents the MSG_MHF_ACQUIRE_CAFE_ITEM @@ -30,7 +31,11 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl m.ItemType = bf.ReadUint16() m.ItemID = bf.ReadUint16() m.Quant = bf.ReadUint16() - m.PointCost = bf.ReadUint32() + if _config.ErupeConfig.RealClientMode >= _config.G1 { + m.PointCost = bf.ReadUint32() + } else { + m.PointCost = uint32(bf.ReadUint16()) + } m.Unk0 = bf.ReadUint16() return nil } diff --git a/network/mhfpacket/msg_mhf_acquire_item.go b/network/mhfpacket/msg_mhf_acquire_item.go index 96d96ab11..de86ce846 100644 --- a/network/mhfpacket/msg_mhf_acquire_item.go +++ b/network/mhfpacket/msg_mhf_acquire_item.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfAcquireItem represents the MSG_MHF_ACQUIRE_ITEM -type MsgMhfAcquireItem struct{} +type MsgMhfAcquireItem struct { + AckHandle uint32 + Unk0 uint16 + Length uint16 + Unk1 []uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfAcquireItem) Opcode() network.PacketID { @@ -18,7 +23,13 @@ func (m *MsgMhfAcquireItem) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + 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 } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_acquire_tournament.go b/network/mhfpacket/msg_mhf_acquire_tournament.go index d1d293288..2e65e0984 100644 --- a/network/mhfpacket/msg_mhf_acquire_tournament.go +++ b/network/mhfpacket/msg_mhf_acquire_tournament.go @@ -1,15 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfAcquireTournament represents the MSG_MHF_ACQUIRE_TOURNAMENT -type MsgMhfAcquireTournament struct{} +type MsgMhfAcquireTournament struct { + AckHandle uint32 + TournamentID uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfAcquireTournament) Opcode() network.PacketID { @@ -18,7 +21,9 @@ func (m *MsgMhfAcquireTournament) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfAcquireTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.TournamentID = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_announce.go b/network/mhfpacket/msg_mhf_announce.go index 8e3971497..c4c9deb7f 100644 --- a/network/mhfpacket/msg_mhf_announce.go +++ b/network/mhfpacket/msg_mhf_announce.go @@ -28,7 +28,8 @@ func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon m.IPAddress = bf.ReadUint32() m.Port = bf.ReadUint16() _ = bf.ReadUint8() - _ = bf.ReadUint16() + _ = bf.ReadUint8() + _ = bf.ReadUint8() m.StageID = bf.ReadBytes(32) _ = bf.ReadUint32() m.Type = bf.ReadUint8() diff --git a/network/mhfpacket/msg_mhf_apply_campaign.go b/network/mhfpacket/msg_mhf_apply_campaign.go index 04f506a44..b39dab499 100644 --- a/network/mhfpacket/msg_mhf_apply_campaign.go +++ b/network/mhfpacket/msg_mhf_apply_campaign.go @@ -1,17 +1,18 @@ package mhfpacket import ( + "errors" + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfApplyCampaign represents the MSG_MHF_APPLY_CAMPAIGN type MsgMhfApplyCampaign struct { AckHandle uint32 - Unk0 uint8 - Unk1 uint8 - Unk2 uint16 + Unk0 uint32 + Unk1 uint16 + Unk2 []byte } // Opcode returns the ID associated with this packet type. @@ -22,17 +23,13 @@ func (m *MsgMhfApplyCampaign) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfApplyCampaign) 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.ReadUint32() + m.Unk1 = bf.ReadUint16() + m.Unk2 = bf.ReadBytes(16) return nil } // Build builds a binary packet from the current data. 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 + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_mhf_apply_dist_item.go b/network/mhfpacket/msg_mhf_apply_dist_item.go index 456d8fb12..f98dbb19a 100644 --- a/network/mhfpacket/msg_mhf_apply_dist_item.go +++ b/network/mhfpacket/msg_mhf_apply_dist_item.go @@ -1,18 +1,19 @@ package mhfpacket import ( + "errors" + "erupe-ce/common/byteframe" "erupe-ce/network" "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. @@ -32,10 +33,5 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie // Build builds a binary packet from the current data. 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 -} \ No newline at end of file + return errors.New("NOT IMPLEMENTED") +} diff --git a/network/mhfpacket/msg_mhf_caravan_my_rank.go b/network/mhfpacket/msg_mhf_caravan_my_rank.go index 3eb0074d4..d3e261caa 100644 --- a/network/mhfpacket/msg_mhf_caravan_my_rank.go +++ b/network/mhfpacket/msg_mhf_caravan_my_rank.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfCaravanMyRank represents the MSG_MHF_CARAVAN_MY_RANK -type MsgMhfCaravanMyRank struct{} +type MsgMhfCaravanMyRank struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfCaravanMyRank) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_caravan_my_score.go b/network/mhfpacket/msg_mhf_caravan_my_score.go index bb83d0992..dfa2333b4 100644 --- a/network/mhfpacket/msg_mhf_caravan_my_score.go +++ b/network/mhfpacket/msg_mhf_caravan_my_score.go @@ -1,15 +1,24 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfCaravanMyScore represents the MSG_MHF_CARAVAN_MY_SCORE -type MsgMhfCaravanMyScore struct{} +type MsgMhfCaravanMyScore struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 int32 + Unk3 int32 + Unk4 uint32 + Unk5 int32 + Unk6 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID { @@ -18,7 +27,15 @@ func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfCaravanMyScore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + 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 } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_caravan_ranking.go b/network/mhfpacket/msg_mhf_caravan_ranking.go index 7b5564bb6..1f86771af 100644 --- a/network/mhfpacket/msg_mhf_caravan_ranking.go +++ b/network/mhfpacket/msg_mhf_caravan_ranking.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfCaravanRanking represents the MSG_MHF_CARAVAN_RANKING -type MsgMhfCaravanRanking struct{} +type MsgMhfCaravanRanking struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfCaravanRanking) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfCaravanRanking) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfCaravanRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_entry_tournament.go b/network/mhfpacket/msg_mhf_entry_tournament.go index dbd600cab..6f6550cf0 100644 --- a/network/mhfpacket/msg_mhf_entry_tournament.go +++ b/network/mhfpacket/msg_mhf_entry_tournament.go @@ -1,15 +1,19 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfEntryTournament represents the MSG_MHF_ENTRY_TOURNAMENT -type MsgMhfEntryTournament struct{} +type MsgMhfEntryTournament struct { + AckHandle uint32 + TournamentID uint32 + Unk0 uint8 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfEntryTournament) Opcode() network.PacketID { @@ -18,7 +22,10 @@ func (m *MsgMhfEntryTournament) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfEntryTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.TournamentID = bf.ReadUint32() + m.Unk0 = bf.ReadUint8() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_enumerate_campaign.go b/network/mhfpacket/msg_mhf_enumerate_campaign.go index a5e39a1cd..d06075077 100644 --- a/network/mhfpacket/msg_mhf_enumerate_campaign.go +++ b/network/mhfpacket/msg_mhf_enumerate_campaign.go @@ -1,17 +1,16 @@ package mhfpacket import ( + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfEnumerateCampaign represents the MSG_MHF_ENUMERATE_CAMPAIGN type MsgMhfEnumerateCampaign struct { AckHandle uint32 - Unk0 uint8 - Unk1 uint8 - Unk2 uint16 + Unk0 uint16 + Unk1 uint16 } // Opcode returns the ID associated with this packet type. @@ -22,17 +21,15 @@ func (m *MsgMhfEnumerateCampaign) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfEnumerateCampaign) 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() return nil } // Build builds a binary packet from the current data. func (m *MsgMhfEnumerateCampaign) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { bf.WriteUint32(m.AckHandle) - bf.WriteUint8(m.Unk0) - bf.WriteUint8(m.Unk1) - bf.WriteUint16(m.Unk2) + bf.WriteUint16(m.Unk0) + bf.WriteUint16(m.Unk1) return nil } diff --git a/network/mhfpacket/msg_mhf_enumerate_dist_item.go b/network/mhfpacket/msg_mhf_enumerate_dist_item.go index 778a91ac6..6d0082ec8 100644 --- a/network/mhfpacket/msg_mhf_enumerate_dist_item.go +++ b/network/mhfpacket/msg_mhf_enumerate_dist_item.go @@ -1,17 +1,19 @@ package mhfpacket import ( + "errors" + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfEnumerateDistItem represents the MSG_MHF_ENUMERATE_DIST_ITEM type MsgMhfEnumerateDistItem struct { AckHandle uint32 Unk0 uint8 - Unk1 uint16 + Unk1 uint8 Unk2 uint16 + Unk3 []byte } // Opcode returns the ID associated with this packet type. @@ -23,16 +25,13 @@ func (m *MsgMhfEnumerateDistItem) Opcode() network.PacketID { func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Unk0 = bf.ReadUint8() - m.Unk1 = bf.ReadUint16() + m.Unk1 = bf.ReadUint8() m.Unk2 = bf.ReadUint16() + m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8())) return nil } // Build builds a binary packet from the current data. func (m *MsgMhfEnumerateDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - bf.WriteUint32(m.AckHandle) - bf.WriteUint8(m.Unk0) - bf.WriteUint16(m.Unk1) - bf.WriteUint16(m.Unk2) - return nil + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_mhf_enumerate_guacot.go b/network/mhfpacket/msg_mhf_enumerate_guacot.go index 4fcdba523..2f970f938 100644 --- a/network/mhfpacket/msg_mhf_enumerate_guacot.go +++ b/network/mhfpacket/msg_mhf_enumerate_guacot.go @@ -2,7 +2,6 @@ package mhfpacket import ( "errors" - "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" @@ -11,9 +10,8 @@ import ( // MsgMhfEnumerateGuacot represents the MSG_MHF_ENUMERATE_GUACOT type MsgMhfEnumerateGuacot struct { AckHandle uint32 - Unk0 uint16 // Hardcoded 0 in binary + Unk0 uint32 // Hardcoded 0 in binary Unk1 uint16 // Hardcoded 0 in binary - Unk2 uint16 // Hardcoded 0 in binary } // Opcode returns the ID associated with this packet type. @@ -24,9 +22,8 @@ func (m *MsgMhfEnumerateGuacot) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfEnumerateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() + m.Unk0 = bf.ReadUint32() m.Unk1 = bf.ReadUint16() - m.Unk2 = bf.ReadUint16() return nil } diff --git a/network/mhfpacket/msg_mhf_enumerate_guild.go b/network/mhfpacket/msg_mhf_enumerate_guild.go index 691f8241f..f90a7cc7b 100644 --- a/network/mhfpacket/msg_mhf_enumerate_guild.go +++ b/network/mhfpacket/msg_mhf_enumerate_guild.go @@ -2,9 +2,9 @@ package mhfpacket import ( "errors" - "io" - + "erupe-ce/common/bfutil" "erupe-ce/common/byteframe" + "erupe-ce/common/stringsupport" "erupe-ce/network" "erupe-ce/network/clientctx" ) @@ -12,28 +12,30 @@ import ( type EnumerateGuildType uint8 const ( - ENUMERATE_GUILD_TYPE_GUILD_NAME = 0x01 - ENUMERATE_GUILD_TYPE_LEADER_NAME = 0x02 - ENUMERATE_GUILD_TYPE_LEADER_ID = 0x03 - ENUMERATE_GUILD_TYPE_ORDER_MEMBERS = 0x04 - ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION = 0x05 - ENUMERATE_GUILD_TYPE_ORDER_RANK = 0x06 - ENUMERATE_GUILD_TYPE_MOTTO = 0x07 - ENUMERATE_GUILD_TYPE_RECRUITING = 0x08 - ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME = 0x09 - ENUMERATE_ALLIANCE_TYPE_LEADER_NAME = 0x0A - ENUMERATE_ALLIANCE_TYPE_LEADER_ID = 0x0B - ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS = 0x0C - ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION = 0x0D + ENUMERATE_GUILD_UNKNOWN = iota + ENUMERATE_GUILD_TYPE_GUILD_NAME + ENUMERATE_GUILD_TYPE_LEADER_NAME + ENUMERATE_GUILD_TYPE_LEADER_ID + ENUMERATE_GUILD_TYPE_ORDER_MEMBERS + ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION + ENUMERATE_GUILD_TYPE_ORDER_RANK + ENUMERATE_GUILD_TYPE_MOTTO + ENUMERATE_GUILD_TYPE_RECRUITING + ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME + ENUMERATE_ALLIANCE_TYPE_LEADER_NAME + ENUMERATE_ALLIANCE_TYPE_LEADER_ID + ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS + ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION ) // MsgMhfEnumerateGuild represents the MSG_MHF_ENUMERATE_GUILD type MsgMhfEnumerateGuild struct { - AckHandle uint32 - Type EnumerateGuildType - Page uint8 - Sorting bool - RawDataPayload []byte + AckHandle uint32 + Type EnumerateGuildType + Page uint8 + Sorting bool + Data1 []byte + Data2 string } // Opcode returns the ID associated with this packet type. @@ -47,9 +49,12 @@ func (m *MsgMhfEnumerateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli m.Type = EnumerateGuildType(bf.ReadUint8()) m.Page = bf.ReadUint8() m.Sorting = bf.ReadBool() - _ = bf.ReadUint8() - m.RawDataPayload = bf.DataFromCurrent() - bf.Seek(-2, io.SeekEnd) + _ = bf.ReadBytes(1) + m.Data1 = bf.ReadBytes(4) + _ = bf.ReadBytes(2) + lenData2 := uint(bf.ReadUint8()) + _ = bf.ReadBytes(1) + m.Data2 = stringsupport.SJISToUTF8(bfutil.UpToNull(bf.ReadBytes(lenData2))) return nil } diff --git a/network/mhfpacket/msg_mhf_enumerate_guild_tresure.go b/network/mhfpacket/msg_mhf_enumerate_guild_tresure.go index 61475d655..f03202bd4 100644 --- a/network/mhfpacket/msg_mhf_enumerate_guild_tresure.go +++ b/network/mhfpacket/msg_mhf_enumerate_guild_tresure.go @@ -12,7 +12,8 @@ import ( type MsgMhfEnumerateGuildTresure struct { AckHandle uint32 MaxHunts uint16 - Unk uint32 + Unk0 uint16 + Unk1 uint16 } // Opcode returns the ID associated with this packet type. @@ -24,9 +25,8 @@ func (m *MsgMhfEnumerateGuildTresure) Opcode() network.PacketID { func (m *MsgMhfEnumerateGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.MaxHunts = bf.ReadUint16() - // Changes with MaxHunts - // 0 if MaxHunts = 1, 1 if MaxHunts = 30 - m.Unk = bf.ReadUint32() + m.Unk0 = bf.ReadUint16() + m.Unk1 = bf.ReadUint16() return nil } diff --git a/network/mhfpacket/msg_mhf_enumerate_item.go b/network/mhfpacket/msg_mhf_enumerate_item.go index b12276703..fea4f3371 100644 --- a/network/mhfpacket/msg_mhf_enumerate_item.go +++ b/network/mhfpacket/msg_mhf_enumerate_item.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfEnumerateItem represents the MSG_MHF_ENUMERATE_ITEM -type MsgMhfEnumerateItem struct{} +type MsgMhfEnumerateItem struct { + AckHandle uint32 + Unk0 uint16 + Unk1 uint16 + CampaignID uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfEnumerateItem) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfEnumerateItem) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfEnumerateItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint16() + m.Unk1 = bf.ReadUint16() + m.CampaignID = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_enumerate_quest.go b/network/mhfpacket/msg_mhf_enumerate_quest.go index 7bf1e1355..243dffcfa 100644 --- a/network/mhfpacket/msg_mhf_enumerate_quest.go +++ b/network/mhfpacket/msg_mhf_enumerate_quest.go @@ -2,6 +2,7 @@ package mhfpacket import ( "errors" + _config "erupe-ce/config" "erupe-ce/common/byteframe" "erupe-ce/network" @@ -29,7 +30,11 @@ func (m *MsgMhfEnumerateQuest) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli m.Unk0 = bf.ReadUint8() m.World = bf.ReadUint8() m.Counter = bf.ReadUint16() - m.Offset = bf.ReadUint16() + if _config.ErupeConfig.RealClientMode <= _config.Z1 { + m.Offset = uint16(bf.ReadUint8()) + } else { + m.Offset = bf.ReadUint16() + } m.Unk4 = bf.ReadUint8() return nil } diff --git a/network/mhfpacket/msg_mhf_enumerate_shop.go b/network/mhfpacket/msg_mhf_enumerate_shop.go index 80ad5f432..153095db4 100644 --- a/network/mhfpacket/msg_mhf_enumerate_shop.go +++ b/network/mhfpacket/msg_mhf_enumerate_shop.go @@ -1,11 +1,12 @@ package mhfpacket -import ( - "errors" +import ( + "errors" + _config "erupe-ce/config" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfEnumerateShop represents the MSG_MHF_ENUMERATE_SHOP @@ -31,8 +32,10 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie m.ShopID = bf.ReadUint32() m.Unk2 = bf.ReadUint16() m.Unk3 = bf.ReadUint8() - m.Unk4 = bf.ReadUint8() - m.Unk5 = bf.ReadUint32() + if _config.ErupeConfig.RealClientMode >= _config.G2 { + m.Unk4 = bf.ReadUint8() + m.Unk5 = bf.ReadUint32() + } return nil } diff --git a/network/mhfpacket/msg_mhf_get_break_seibatu_level_reward.go b/network/mhfpacket/msg_mhf_get_break_seibatu_level_reward.go index e6f0e9a56..601dd5cb2 100644 --- a/network/mhfpacket/msg_mhf_get_break_seibatu_level_reward.go +++ b/network/mhfpacket/msg_mhf_get_break_seibatu_level_reward.go @@ -1,15 +1,19 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetBreakSeibatuLevelReward represents the MSG_MHF_GET_BREAK_SEIBATU_LEVEL_REWARD -type MsgMhfGetBreakSeibatuLevelReward struct{} +type MsgMhfGetBreakSeibatuLevelReward struct { + AckHandle uint32 + Unk0 uint32 + Unk1 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfGetBreakSeibatuLevelReward) Opcode() network.PacketID { @@ -18,7 +22,10 @@ func (m *MsgMhfGetBreakSeibatuLevelReward) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetBreakSeibatuLevelReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_get_fixed_seibatu_ranking_table.go b/network/mhfpacket/msg_mhf_get_fixed_seibatu_ranking_table.go index 52651c9d2..2d7cbbac4 100644 --- a/network/mhfpacket/msg_mhf_get_fixed_seibatu_ranking_table.go +++ b/network/mhfpacket/msg_mhf_get_fixed_seibatu_ranking_table.go @@ -1,15 +1,22 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetFixedSeibatuRankingTable represents the MSG_MHF_GET_FIXED_SEIBATU_RANKING_TABLE -type MsgMhfGetFixedSeibatuRankingTable struct{} +type MsgMhfGetFixedSeibatuRankingTable struct { + AckHandle uint32 + Unk0 uint32 + Unk1 int32 + Unk2 int32 + Unk3 int32 + Unk4 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfGetFixedSeibatuRankingTable) Opcode() network.PacketID { @@ -18,7 +25,13 @@ func (m *MsgMhfGetFixedSeibatuRankingTable) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetFixedSeibatuRankingTable) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadInt32() + m.Unk2 = bf.ReadInt32() + m.Unk3 = bf.ReadInt32() + m.Unk4 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_get_gem_info.go b/network/mhfpacket/msg_mhf_get_gem_info.go index 36eb7948e..28638bfd2 100644 --- a/network/mhfpacket/msg_mhf_get_gem_info.go +++ b/network/mhfpacket/msg_mhf_get_gem_info.go @@ -11,8 +11,13 @@ import ( // MsgMhfGetGemInfo represents the MSG_MHF_GET_GEM_INFO type MsgMhfGetGemInfo struct { AckHandle uint32 - Unk uint32 - Unk1 []byte + Unk0 uint32 + Unk1 uint32 + Unk2 int32 + Unk3 int32 + Unk4 int32 + Unk5 int32 + Unk6 int32 } // Opcode returns the ID associated with this packet type. @@ -23,8 +28,13 @@ func (m *MsgMhfGetGemInfo) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetGemInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk = bf.ReadUint32() - m.Unk1 = bf.ReadBytes(24) + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadInt32() + m.Unk3 = bf.ReadInt32() + m.Unk4 = bf.ReadInt32() + m.Unk5 = bf.ReadInt32() + m.Unk6 = bf.ReadInt32() return nil } diff --git a/network/mhfpacket/msg_mhf_get_notice.go b/network/mhfpacket/msg_mhf_get_notice.go index 75e18d9d5..843e71ddc 100644 --- a/network/mhfpacket/msg_mhf_get_notice.go +++ b/network/mhfpacket/msg_mhf_get_notice.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetNotice represents the MSG_MHF_GET_NOTICE -type MsgMhfGetNotice struct{} +type MsgMhfGetNotice struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfGetNotice) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfGetNotice) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetNotice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_get_rand_from_table.go b/network/mhfpacket/msg_mhf_get_rand_from_table.go index 6411a6f79..dac9bf14e 100644 --- a/network/mhfpacket/msg_mhf_get_rand_from_table.go +++ b/network/mhfpacket/msg_mhf_get_rand_from_table.go @@ -1,15 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetRandFromTable represents the MSG_MHF_GET_RAND_FROM_TABLE -type MsgMhfGetRandFromTable struct{} +type MsgMhfGetRandFromTable struct { + AckHandle uint32 + Results uint16 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfGetRandFromTable) Opcode() network.PacketID { @@ -18,7 +21,9 @@ func (m *MsgMhfGetRandFromTable) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetRandFromTable) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Results = bf.ReadUint16() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_get_ryoudama.go b/network/mhfpacket/msg_mhf_get_ryoudama.go index 2cffc3bdc..91d1566af 100644 --- a/network/mhfpacket/msg_mhf_get_ryoudama.go +++ b/network/mhfpacket/msg_mhf_get_ryoudama.go @@ -11,8 +11,8 @@ import ( // MsgMhfGetRyoudama represents the MSG_MHF_GET_RYOUDAMA type MsgMhfGetRyoudama struct { AckHandle uint32 - Unk0 uint8 - Unk1 uint8 + Request1 uint8 + Request2 uint8 GuildID uint32 Unk3 uint8 } @@ -25,8 +25,8 @@ func (m *MsgMhfGetRyoudama) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetRyoudama) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint8() - m.Unk1 = bf.ReadUint8() + m.Request1 = bf.ReadUint8() + m.Request2 = bf.ReadUint8() m.GuildID = bf.ReadUint32() m.Unk3 = bf.ReadUint8() return nil diff --git a/network/mhfpacket/msg_mhf_get_seibattle.go b/network/mhfpacket/msg_mhf_get_seibattle.go index 6a7a80380..1398b477d 100644 --- a/network/mhfpacket/msg_mhf_get_seibattle.go +++ b/network/mhfpacket/msg_mhf_get_seibattle.go @@ -1,20 +1,19 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetSeibattle represents the MSG_MHF_GET_SEIBATTLE type MsgMhfGetSeibattle struct { - // Communicator type, multi-format. This might be valid for only one type. AckHandle uint32 Unk0 uint8 - Unk1 uint8 - Unk2 uint32 // Some shared ID with MSG_SYS_RECORD_LOG, world ID? + Type uint8 + GuildID uint32 Unk3 uint8 Unk4 uint16 } @@ -28,8 +27,8 @@ func (m *MsgMhfGetSeibattle) Opcode() network.PacketID { func (m *MsgMhfGetSeibattle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Unk0 = bf.ReadUint8() - m.Unk1 = bf.ReadUint8() - m.Unk2 = bf.ReadUint32() + m.Type = bf.ReadUint8() + m.GuildID = bf.ReadUint32() m.Unk3 = bf.ReadUint8() m.Unk4 = bf.ReadUint16() return nil diff --git a/network/mhfpacket/msg_mhf_get_senyu_daily_count.go b/network/mhfpacket/msg_mhf_get_senyu_daily_count.go index c4d34089e..4bc9f41d2 100644 --- a/network/mhfpacket/msg_mhf_get_senyu_daily_count.go +++ b/network/mhfpacket/msg_mhf_get_senyu_daily_count.go @@ -1,15 +1,17 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetSenyuDailyCount represents the MSG_MHF_GET_SENYU_DAILY_COUNT -type MsgMhfGetSenyuDailyCount struct{} +type MsgMhfGetSenyuDailyCount struct { + AckHandle uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfGetSenyuDailyCount) Opcode() network.PacketID { @@ -18,7 +20,8 @@ func (m *MsgMhfGetSenyuDailyCount) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetSenyuDailyCount) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_get_tenrouirai.go b/network/mhfpacket/msg_mhf_get_tenrouirai.go index da460add9..a4784e39b 100644 --- a/network/mhfpacket/msg_mhf_get_tenrouirai.go +++ b/network/mhfpacket/msg_mhf_get_tenrouirai.go @@ -1,20 +1,21 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetTenrouirai represents the MSG_MHF_GET_TENROUIRAI type MsgMhfGetTenrouirai struct { - // Communicator type, multi-format. This might be valid for only one type. AckHandle uint32 - Unk0 uint16 - Unk1 uint32 - Unk2 uint16 + Unk0 uint8 + Unk1 uint8 + GuildID uint32 + Unk3 uint8 + Unk4 uint8 } // Opcode returns the ID associated with this packet type. @@ -25,9 +26,11 @@ func (m *MsgMhfGetTenrouirai) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetTenrouirai) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() - m.Unk1 = bf.ReadUint32() - m.Unk2 = bf.ReadUint16() + m.Unk0 = bf.ReadUint8() + m.Unk1 = bf.ReadUint8() + m.GuildID = bf.ReadUint32() + m.Unk3 = bf.ReadUint8() + m.Unk4 = bf.ReadUint8() return nil } diff --git a/network/mhfpacket/msg_mhf_get_tiny_bin.go b/network/mhfpacket/msg_mhf_get_tiny_bin.go index 8f76eb1a1..4db9b05b9 100644 --- a/network/mhfpacket/msg_mhf_get_tiny_bin.go +++ b/network/mhfpacket/msg_mhf_get_tiny_bin.go @@ -1,19 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfGetTinyBin represents the MSG_MHF_GET_TINY_BIN type MsgMhfGetTinyBin struct { // Communicator type, multi-format. This might be valid for only one type. AckHandle uint32 - Unk0 uint16 + Unk0 uint8 Unk1 uint8 + Unk2 uint8 } // Opcode returns the ID associated with this packet type. @@ -24,8 +25,9 @@ func (m *MsgMhfGetTinyBin) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfGetTinyBin) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() + m.Unk0 = bf.ReadUint8() m.Unk1 = bf.ReadUint8() + m.Unk2 = bf.ReadUint8() return nil } diff --git a/network/mhfpacket/msg_mhf_get_tower_info.go b/network/mhfpacket/msg_mhf_get_tower_info.go index a0b686485..4041e26e4 100644 --- a/network/mhfpacket/msg_mhf_get_tower_info.go +++ b/network/mhfpacket/msg_mhf_get_tower_info.go @@ -8,19 +8,8 @@ import ( "erupe-ce/network/clientctx" ) -// The server sends different responses based on these values. -const ( - TowerInfoTypeUnk0 = iota - TowerInfoTypeTowerRankPoint - TowerInfoTypeGetOwnTowerSkill - TowerInfoTypeGetOwnTowerLevelV3 - TowerInfoTypeTowerTouhaHistory - TowerInfoTypeUnk5 -) - // MsgMhfGetTowerInfo represents the MSG_MHF_GET_TOWER_INFO type MsgMhfGetTowerInfo struct { - // Communicator type, multi-format. This might be valid for only one type. AckHandle uint32 InfoType uint32 // Requested response type Unk0 uint32 diff --git a/network/mhfpacket/msg_mhf_operate_guild.go b/network/mhfpacket/msg_mhf_operate_guild.go index a79719290..96803e89c 100644 --- a/network/mhfpacket/msg_mhf_operate_guild.go +++ b/network/mhfpacket/msg_mhf_operate_guild.go @@ -11,33 +11,33 @@ import ( type OperateGuildAction uint8 const ( - OPERATE_GUILD_DISBAND = 0x01 - OPERATE_GUILD_APPLY = 0x02 - OPERATE_GUILD_LEAVE = 0x03 - OPERATE_GUILD_RESIGN = 0x04 - OPERATE_GUILD_SET_APPLICATION_DENY = 0x05 - OPERATE_GUILD_SET_APPLICATION_ALLOW = 0x06 - OPERATE_GUILD_SET_AVOID_LEADERSHIP_TRUE = 0x07 - OPERATE_GUILD_SET_AVOID_LEADERSHIP_FALSE = 0x08 - OPERATE_GUILD_UPDATE_COMMENT = 0x09 - OPERATE_GUILD_DONATE_RANK = 0x0a - OPERATE_GUILD_UPDATE_MOTTO = 0x0b - OPERATE_GUILD_RENAME_PUGI_1 = 0x0c - OPERATE_GUILD_RENAME_PUGI_2 = 0x0d - OPERATE_GUILD_RENAME_PUGI_3 = 0x0e - OPERATE_GUILD_CHANGE_PUGI_1 = 0x0f - OPERATE_GUILD_CHANGE_PUGI_2 = 0x10 - OPERATE_GUILD_CHANGE_PUGI_3 = 0x11 - OPERATE_GUILD_UNLOCK_OUTFIT = 0x12 - // 0x13 Unk - // 0x14 Unk - OPERATE_GUILD_DONATE_EVENT = 0x15 - OPERATE_GUILD_EVENT_EXCHANGE = 0x16 - // 0x17 Unk - // 0x18 Unk - OPERATE_GUILD_CHANGE_DIVA_PUGI_1 = 0x19 - OPERATE_GUILD_CHANGE_DIVA_PUGI_2 = 0x1a - OPERATE_GUILD_CHANGE_DIVA_PUGI_3 = 0x1b + OperateGuildDisband = iota + 1 + OperateGuildApply + OperateGuildLeave + OperateGuildResign + OperateGuildSetApplicationDeny + OperateGuildSetApplicationAllow + OperateGuildSetAvoidLeadershipTrue + OperateGuildSetAvoidLeadershipFalse + OperateGuildUpdateComment + OperateGuildDonateRank + OperateGuildUpdateMotto + OperateGuildRenamePugi1 + OperateGuildRenamePugi2 + OperateGuildRenamePugi3 + OperateGuildChangePugi1 + OperateGuildChangePugi2 + OperateGuildChangePugi3 + OperateGuildUnlockOutfit + OperateGuildDonateRoom + OperateGuildGraduateRookie + OperateGuildDonateEvent + OperateGuildEventExchange + OperateGuildUnknown // I don't think this op exists + OperateGuildGraduateReturn + OperateGuildChangeDivaPugi1 + OperateGuildChangeDivaPugi2 + OperateGuildChangeDivaPugi3 ) // MsgMhfOperateGuild represents the MSG_MHF_OPERATE_GUILD diff --git a/network/mhfpacket/msg_mhf_post_boost_time_limit.go b/network/mhfpacket/msg_mhf_post_boost_time_limit.go index 3f0bc53b8..259712ac8 100644 --- a/network/mhfpacket/msg_mhf_post_boost_time_limit.go +++ b/network/mhfpacket/msg_mhf_post_boost_time_limit.go @@ -1,15 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostBoostTimeLimit represents the MSG_MHF_POST_BOOST_TIME_LIMIT -type MsgMhfPostBoostTimeLimit struct{} +type MsgMhfPostBoostTimeLimit struct { + AckHandle uint32 + Expiration uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID { @@ -18,7 +21,9 @@ func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostBoostTimeLimit) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Expiration = bf.ReadUint32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_post_gem_info.go b/network/mhfpacket/msg_mhf_post_gem_info.go index 13a0a9a0d..d487670fc 100644 --- a/network/mhfpacket/msg_mhf_post_gem_info.go +++ b/network/mhfpacket/msg_mhf_post_gem_info.go @@ -1,15 +1,24 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostGemInfo represents the MSG_MHF_POST_GEM_INFO -type MsgMhfPostGemInfo struct{} +type MsgMhfPostGemInfo struct { + AckHandle uint32 + Op uint32 + Unk1 uint32 + Gem int32 + Quantity int32 + CID int32 + Message int32 + Unk6 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfPostGemInfo) Opcode() network.PacketID { @@ -18,7 +27,15 @@ func (m *MsgMhfPostGemInfo) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostGemInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Op = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Gem = bf.ReadInt32() + m.Quantity = bf.ReadInt32() + m.CID = bf.ReadInt32() + m.Message = bf.ReadInt32() + m.Unk6 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_post_notice.go b/network/mhfpacket/msg_mhf_post_notice.go index c599d2afc..51eb945fa 100644 --- a/network/mhfpacket/msg_mhf_post_notice.go +++ b/network/mhfpacket/msg_mhf_post_notice.go @@ -1,15 +1,21 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostNotice represents the MSG_MHF_POST_NOTICE -type MsgMhfPostNotice struct{} +type MsgMhfPostNotice struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 int32 + Unk3 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfPostNotice) Opcode() network.PacketID { @@ -18,7 +24,12 @@ func (m *MsgMhfPostNotice) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostNotice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadInt32() + m.Unk3 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_post_tenrouirai.go b/network/mhfpacket/msg_mhf_post_tenrouirai.go index d4b4fdc71..bc91279b4 100644 --- a/network/mhfpacket/msg_mhf_post_tenrouirai.go +++ b/network/mhfpacket/msg_mhf_post_tenrouirai.go @@ -1,22 +1,34 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostTenrouirai represents the MSG_MHF_POST_TENROUIRAI -type MsgMhfPostTenrouirai struct{ - AckHandle uint32 - Unk0 uint16 - Unk1 uint32 - Unk2 uint32 - Unk3 uint32 - Unk4 uint32 - Unk5 uint8 +type MsgMhfPostTenrouirai struct { + AckHandle uint32 + Unk0 uint8 + Op uint8 + GuildID uint32 + Unk1 uint8 + + Floors uint16 + Antiques uint16 + Chests uint16 + Cats uint16 + TRP uint16 + Slays uint16 + + DonatedRP uint16 + PreviousRP uint16 + Unk2_0 uint16 + Unk2_1 uint16 + Unk2_2 uint16 + Unk2_3 uint16 } // Opcode returns the ID associated with this packet type. @@ -27,12 +39,28 @@ func (m *MsgMhfPostTenrouirai) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostTenrouirai) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() - m.Unk1 = bf.ReadUint32() - m.Unk2 = bf.ReadUint32() - m.Unk3 = bf.ReadUint32() - m.Unk4 = bf.ReadUint32() - m.Unk5 = bf.ReadUint8() + m.Unk0 = bf.ReadUint8() + m.Op = bf.ReadUint8() + m.GuildID = bf.ReadUint32() + m.Unk1 = bf.ReadUint8() + + switch m.Op { + case 1: + m.Floors = bf.ReadUint16() + m.Antiques = bf.ReadUint16() + m.Chests = bf.ReadUint16() + m.Cats = bf.ReadUint16() + m.TRP = bf.ReadUint16() + m.Slays = bf.ReadUint16() + case 2: + m.DonatedRP = bf.ReadUint16() + m.PreviousRP = bf.ReadUint16() + m.Unk2_0 = bf.ReadUint16() + m.Unk2_1 = bf.ReadUint16() + m.Unk2_2 = bf.ReadUint16() + m.Unk2_3 = bf.ReadUint16() + } + return nil } diff --git a/network/mhfpacket/msg_mhf_post_tiny_bin.go b/network/mhfpacket/msg_mhf_post_tiny_bin.go index 7c709d1e4..dd464d18d 100644 --- a/network/mhfpacket/msg_mhf_post_tiny_bin.go +++ b/network/mhfpacket/msg_mhf_post_tiny_bin.go @@ -11,9 +11,10 @@ import ( // MsgMhfPostTinyBin represents the MSG_MHF_POST_TINY_BIN type MsgMhfPostTinyBin struct { AckHandle uint32 - Unk0 uint16 + Unk0 uint8 Unk1 uint8 Unk2 uint8 + Unk3 uint8 Data []byte } @@ -25,9 +26,10 @@ func (m *MsgMhfPostTinyBin) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostTinyBin) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint16() + m.Unk0 = bf.ReadUint8() m.Unk1 = bf.ReadUint8() m.Unk2 = bf.ReadUint8() + m.Unk3 = bf.ReadUint8() m.Data = bf.ReadBytes(uint(bf.ReadUint16())) return nil } diff --git a/network/mhfpacket/msg_mhf_post_tower_info.go b/network/mhfpacket/msg_mhf_post_tower_info.go index 7719086ff..3808777e5 100644 --- a/network/mhfpacket/msg_mhf_post_tower_info.go +++ b/network/mhfpacket/msg_mhf_post_tower_info.go @@ -1,28 +1,26 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfPostTowerInfo represents the MSG_MHF_POST_TOWER_INFO type MsgMhfPostTowerInfo struct { - // Communicator type, multi-format. This might be valid for only one type. AckHandle uint32 - Unk0 uint32 + InfoType uint32 Unk1 uint32 - Unk2 uint32 - Unk3 uint32 - Unk4 uint32 - Unk5 uint32 - Unk6 uint32 - Unk7 uint32 - Unk8 uint32 - Unk9 uint32 - Unk10 uint32 + Skill int32 + TR int32 + TRP int32 + Cost int32 + Unk6 int32 + Unk7 int32 + Block1 int32 + Unk9 int64 } // Opcode returns the ID associated with this packet type. @@ -33,17 +31,16 @@ func (m *MsgMhfPostTowerInfo) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfPostTowerInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint32() + m.InfoType = bf.ReadUint32() m.Unk1 = bf.ReadUint32() - m.Unk2 = bf.ReadUint32() - m.Unk3 = bf.ReadUint32() - m.Unk4 = bf.ReadUint32() - m.Unk5 = bf.ReadUint32() - m.Unk6 = bf.ReadUint32() - m.Unk7 = bf.ReadUint32() - m.Unk8 = bf.ReadUint32() - m.Unk9 = bf.ReadUint32() - m.Unk10 = bf.ReadUint32() + m.Skill = bf.ReadInt32() + m.TR = bf.ReadInt32() + m.TRP = bf.ReadInt32() + m.Cost = bf.ReadInt32() + m.Unk6 = bf.ReadInt32() + m.Unk7 = bf.ReadInt32() + m.Block1 = bf.ReadInt32() + m.Unk9 = bf.ReadInt64() return nil } diff --git a/network/mhfpacket/msg_mhf_present_box.go b/network/mhfpacket/msg_mhf_present_box.go index c3da92e31..d0064799c 100644 --- a/network/mhfpacket/msg_mhf_present_box.go +++ b/network/mhfpacket/msg_mhf_present_box.go @@ -18,8 +18,7 @@ type MsgMhfPresentBox struct { Unk4 uint32 Unk5 uint32 Unk6 uint32 - Unk7 uint32 - Unk8 uint32 + Unk7 []uint32 } // Opcode returns the ID associated with this packet type. @@ -37,8 +36,9 @@ func (m *MsgMhfPresentBox) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientC m.Unk4 = bf.ReadUint32() m.Unk5 = bf.ReadUint32() m.Unk6 = bf.ReadUint32() - m.Unk7 = bf.ReadUint32() - m.Unk8 = bf.ReadUint32() + for i := uint32(0); i < m.Unk2; i++ { + m.Unk7 = append(m.Unk7, bf.ReadUint32()) + } return nil } diff --git a/network/mhfpacket/msg_mhf_read_beat_level_all_ranking.go b/network/mhfpacket/msg_mhf_read_beat_level_all_ranking.go index 4d97df0d5..d9bf48a2c 100644 --- a/network/mhfpacket/msg_mhf_read_beat_level_all_ranking.go +++ b/network/mhfpacket/msg_mhf_read_beat_level_all_ranking.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfReadBeatLevelAllRanking represents the MSG_MHF_READ_BEAT_LEVEL_ALL_RANKING -type MsgMhfReadBeatLevelAllRanking struct{} +type MsgMhfReadBeatLevelAllRanking struct { + AckHandle uint32 + Unk0 uint32 + GuildID int32 + Unk2 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfReadBeatLevelAllRanking) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfReadBeatLevelAllRanking) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfReadBeatLevelAllRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.GuildID = bf.ReadInt32() + m.Unk2 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_read_beat_level_my_ranking.go b/network/mhfpacket/msg_mhf_read_beat_level_my_ranking.go index 4b713e8e7..e51bba318 100644 --- a/network/mhfpacket/msg_mhf_read_beat_level_my_ranking.go +++ b/network/mhfpacket/msg_mhf_read_beat_level_my_ranking.go @@ -1,15 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfReadBeatLevelMyRanking represents the MSG_MHF_READ_BEAT_LEVEL_MY_RANKING -type MsgMhfReadBeatLevelMyRanking struct{} +type MsgMhfReadBeatLevelMyRanking struct { + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Unk2 []int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfReadBeatLevelMyRanking) Opcode() network.PacketID { @@ -18,7 +23,13 @@ func (m *MsgMhfReadBeatLevelMyRanking) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfReadBeatLevelMyRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + for i := 0; i < 16; i++ { + m.Unk2 = append(m.Unk2, bf.ReadInt32()) + } + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_read_last_week_beat_ranking.go b/network/mhfpacket/msg_mhf_read_last_week_beat_ranking.go index 90635dd3f..b52195578 100644 --- a/network/mhfpacket/msg_mhf_read_last_week_beat_ranking.go +++ b/network/mhfpacket/msg_mhf_read_last_week_beat_ranking.go @@ -1,15 +1,19 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfReadLastWeekBeatRanking represents the MSG_MHF_READ_LAST_WEEK_BEAT_RANKING -type MsgMhfReadLastWeekBeatRanking struct{} +type MsgMhfReadLastWeekBeatRanking struct { + AckHandle uint32 + Unk0 uint32 + Unk1 int32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfReadLastWeekBeatRanking) Opcode() network.PacketID { @@ -18,7 +22,10 @@ func (m *MsgMhfReadLastWeekBeatRanking) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfReadLastWeekBeatRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint32() + m.Unk1 = bf.ReadInt32() + return nil } // Build builds a binary packet from the current data. diff --git a/network/mhfpacket/msg_mhf_read_mercenary_w.go b/network/mhfpacket/msg_mhf_read_mercenary_w.go index 3aa9597d9..d70ef4f38 100644 --- a/network/mhfpacket/msg_mhf_read_mercenary_w.go +++ b/network/mhfpacket/msg_mhf_read_mercenary_w.go @@ -13,7 +13,6 @@ type MsgMhfReadMercenaryW struct { AckHandle uint32 Op uint8 Unk1 uint8 - Unk2 uint16 // Hardcoded 0 in the binary } // Opcode returns the ID associated with this packet type. @@ -25,8 +24,9 @@ func (m *MsgMhfReadMercenaryW) Opcode() network.PacketID { func (m *MsgMhfReadMercenaryW) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Op = bf.ReadUint8() - m.Unk1 = bf.ReadUint8() - m.Unk2 = bf.ReadUint16() + m.Unk1 = bf.ReadUint8() // Supposed to be 0 or 1, but always 1 + bf.ReadUint8() // Zeroed + bf.ReadUint8() // Zeroed return nil } diff --git a/network/mhfpacket/msg_mhf_register_event.go b/network/mhfpacket/msg_mhf_register_event.go index aaa5b51a8..956c4a399 100644 --- a/network/mhfpacket/msg_mhf_register_event.go +++ b/network/mhfpacket/msg_mhf_register_event.go @@ -1,20 +1,19 @@ package mhfpacket import ( + "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" - "erupe-ce/common/byteframe" ) // MsgMhfRegisterEvent represents the MSG_MHF_REGISTER_EVENT type MsgMhfRegisterEvent struct { AckHandle uint32 Unk0 uint16 - Unk1 uint8 - Unk2 uint8 + WorldID uint16 + LandID uint16 Unk3 uint8 Unk4 uint8 - Unk5 uint16 } // Opcode returns the ID associated with this packet type. @@ -26,11 +25,10 @@ func (m *MsgMhfRegisterEvent) Opcode() network.PacketID { func (m *MsgMhfRegisterEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Unk0 = bf.ReadUint16() - m.Unk1 = bf.ReadUint8() - m.Unk2 = bf.ReadUint8() + m.WorldID = bf.ReadUint16() + m.LandID = bf.ReadUint16() m.Unk3 = bf.ReadUint8() m.Unk4 = bf.ReadUint8() - m.Unk5 = bf.ReadUint16() return nil } diff --git a/network/mhfpacket/msg_mhf_release_event.go b/network/mhfpacket/msg_mhf_release_event.go index 08e507c81..52178279b 100644 --- a/network/mhfpacket/msg_mhf_release_event.go +++ b/network/mhfpacket/msg_mhf_release_event.go @@ -11,7 +11,7 @@ import ( // MsgMhfReleaseEvent represents the MSG_MHF_RELEASE_EVENT type MsgMhfReleaseEvent struct { AckHandle uint32 - Unk0 uint32 + RaviID uint32 Unk1 uint32 } @@ -23,7 +23,7 @@ func (m *MsgMhfReleaseEvent) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfReleaseEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint32() + m.RaviID = bf.ReadUint32() m.Unk1 = bf.ReadUint32() return nil } diff --git a/network/mhfpacket/msg_mhf_savedata.go b/network/mhfpacket/msg_mhf_savedata.go index e0fca29c5..cf41416f3 100644 --- a/network/mhfpacket/msg_mhf_savedata.go +++ b/network/mhfpacket/msg_mhf_savedata.go @@ -1,11 +1,12 @@ package mhfpacket -import ( - "errors" +import ( + "errors" + _config "erupe-ce/config" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfSavedata represents the MSG_MHF_SAVEDATA @@ -29,7 +30,9 @@ func (m *MsgMhfSavedata) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon m.AllocMemSize = bf.ReadUint32() m.SaveType = bf.ReadUint8() m.Unk1 = bf.ReadUint32() - m.DataSize = bf.ReadUint32() + if _config.ErupeConfig.RealClientMode >= _config.G1 { + m.DataSize = bf.ReadUint32() + } if m.DataSize == 0 { // seems to be used when DataSize = 0 rather than on savetype? m.RawDataPayload = bf.ReadBytes(uint(m.AllocMemSize)) } else { diff --git a/network/mhfpacket/msg_mhf_set_ca_achievement_hist.go b/network/mhfpacket/msg_mhf_set_ca_achievement_hist.go index a04d6b89f..0b4fad343 100644 --- a/network/mhfpacket/msg_mhf_set_ca_achievement_hist.go +++ b/network/mhfpacket/msg_mhf_set_ca_achievement_hist.go @@ -1,18 +1,24 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) -// MsgMhfSetCaAchievementHist represents the MSG_MHF_SET_CA_ACHIEVEMENT_HIST -type MsgMhfSetCaAchievementHist struct{ - AckHandle uint32 +type CaAchievementHist struct { Unk0 uint32 - Unk1 uint32 + Unk1 uint8 +} + +// MsgMhfSetCaAchievementHist represents the MSG_MHF_SET_CA_ACHIEVEMENT_HIST +type MsgMhfSetCaAchievementHist struct { + AckHandle uint32 + Unk0 uint16 + Unk1 uint8 + Unk2 []CaAchievementHist } // Opcode returns the ID associated with this packet type. @@ -23,8 +29,14 @@ func (m *MsgMhfSetCaAchievementHist) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfSetCaAchievementHist) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint32() - m.Unk1 = bf.ReadUint32() + m.Unk0 = bf.ReadUint16() + m.Unk1 = bf.ReadUint8() + for i := 0; i < int(m.Unk1); i++ { + var temp CaAchievementHist + temp.Unk0 = bf.ReadUint32() + temp.Unk1 = bf.ReadUint8() + m.Unk2 = append(m.Unk2, temp) + } return nil } diff --git a/network/mhfpacket/msg_mhf_sex_changer.go b/network/mhfpacket/msg_mhf_sex_changer.go index 74186d84b..a8754feca 100644 --- a/network/mhfpacket/msg_mhf_sex_changer.go +++ b/network/mhfpacket/msg_mhf_sex_changer.go @@ -1,17 +1,20 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfSexChanger represents the MSG_MHF_SEX_CHANGER type MsgMhfSexChanger struct { AckHandle uint32 Gender uint8 + Unk0 uint8 + Unk1 uint8 + Unk2 uint8 } // Opcode returns the ID associated with this packet type. @@ -23,6 +26,9 @@ func (m *MsgMhfSexChanger) Opcode() network.PacketID { func (m *MsgMhfSexChanger) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Gender = bf.ReadUint8() + m.Unk0 = bf.ReadUint8() + m.Unk1 = bf.ReadUint8() + m.Unk2 = bf.ReadUint8() return nil } diff --git a/network/mhfpacket/msg_mhf_stampcard_stamp.go b/network/mhfpacket/msg_mhf_stampcard_stamp.go index 8d18ae971..5ac650ad2 100644 --- a/network/mhfpacket/msg_mhf_stampcard_stamp.go +++ b/network/mhfpacket/msg_mhf_stampcard_stamp.go @@ -2,6 +2,7 @@ package mhfpacket import ( "errors" + _config "erupe-ce/config" "erupe-ce/common/byteframe" "erupe-ce/network" @@ -34,12 +35,14 @@ func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli m.GR = bf.ReadUint16() m.Stamps = bf.ReadUint16() _ = bf.ReadUint16() - m.Reward1 = uint16(bf.ReadUint32()) - m.Reward2 = uint16(bf.ReadUint32()) - m.Item1 = uint16(bf.ReadUint32()) - m.Item2 = uint16(bf.ReadUint32()) - m.Quantity1 = uint16(bf.ReadUint32()) - m.Quantity2 = uint16(bf.ReadUint32()) + if _config.ErupeConfig.RealClientMode > _config.Z1 { + m.Reward1 = uint16(bf.ReadUint32()) + m.Reward2 = uint16(bf.ReadUint32()) + m.Item1 = uint16(bf.ReadUint32()) + m.Item2 = uint16(bf.ReadUint32()) + m.Quantity1 = uint16(bf.ReadUint32()) + m.Quantity2 = uint16(bf.ReadUint32()) + } return nil } diff --git a/network/mhfpacket/msg_mhf_state_campaign.go b/network/mhfpacket/msg_mhf_state_campaign.go index 35cca070d..ab6342c55 100644 --- a/network/mhfpacket/msg_mhf_state_campaign.go +++ b/network/mhfpacket/msg_mhf_state_campaign.go @@ -1,18 +1,18 @@ package mhfpacket import ( + "errors" "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" ) // MsgMhfStateCampaign represents the MSG_MHF_STATE_CAMPAIGN type MsgMhfStateCampaign struct { - AckHandle uint32 - Unk0 uint8 - Unk1 uint8 - Unk2 uint16 + AckHandle uint32 + CampaignID uint32 + Unk1 uint16 } // Opcode returns the ID associated with this packet type. @@ -23,17 +23,12 @@ func (m *MsgMhfStateCampaign) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfStateCampaign) 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.CampaignID = bf.ReadUint32() + m.Unk1 = bf.ReadUint16() return nil } // Build builds a binary packet from the current data. func (m *MsgMhfStateCampaign) 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 + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_mhf_update_beat_level.go b/network/mhfpacket/msg_mhf_update_beat_level.go index 84f41ae61..e00d50c93 100644 --- a/network/mhfpacket/msg_mhf_update_beat_level.go +++ b/network/mhfpacket/msg_mhf_update_beat_level.go @@ -1,45 +1,42 @@ package mhfpacket import ( - "errors" + "errors" - "erupe-ce/common/byteframe" - "erupe-ce/network" - "erupe-ce/network/clientctx" + "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfUpdateBeatLevel represents the MSG_MHF_UPDATE_BEAT_LEVEL type MsgMhfUpdateBeatLevel struct { - AckHandle uint32 - Unk1 uint32 - Unk2 uint32 - MonsterData []byte - Unk3 uint8 - Unk4 uint32 - Unk5 uint16 - Unk6 uint8 - + AckHandle uint32 + Unk1 uint32 + Unk2 uint32 + Data1 []int32 + Data2 []int32 } // Opcode returns the ID associated with this packet type. func (m *MsgMhfUpdateBeatLevel) Opcode() network.PacketID { - return network.MSG_MHF_UPDATE_BEAT_LEVEL + return network.MSG_MHF_UPDATE_BEAT_LEVEL } // Parse parses the packet from binary func (m *MsgMhfUpdateBeatLevel) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - m.AckHandle = bf.ReadUint32() - m.Unk1 = bf.ReadUint32() - m.Unk2 = bf.ReadUint32() - m.MonsterData = bf.ReadBytes(uint(120)) - m.Unk3 = bf.ReadUint8() - m.Unk4 = bf.ReadUint32() - m.Unk5 = bf.ReadUint16() - m.Unk6 = bf.ReadUint8() - return nil + m.AckHandle = bf.ReadUint32() + m.Unk1 = bf.ReadUint32() + m.Unk2 = bf.ReadUint32() + for i := 0; i < 16; i++ { + m.Data1 = append(m.Data1, bf.ReadInt32()) + } + for i := 0; i < 16; i++ { + m.Data2 = append(m.Data2, bf.ReadInt32()) + } + return nil } // Build builds a binary packet from the current data. func (m *MsgMhfUpdateBeatLevel) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_mhf_update_guacot.go b/network/mhfpacket/msg_mhf_update_guacot.go index 99aa215e2..433854ae3 100644 --- a/network/mhfpacket/msg_mhf_update_guacot.go +++ b/network/mhfpacket/msg_mhf_update_guacot.go @@ -2,27 +2,23 @@ package mhfpacket import ( "errors" - "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" ) -type Gook struct { - Exists bool - Index uint32 - Type uint16 - Data []byte - NameLen uint8 - Name []byte +type Goocoo struct { + Index uint32 + Data1 []uint16 + Data2 []uint32 + Name []byte } // MsgMhfUpdateGuacot represents the MSG_MHF_UPDATE_GUACOT type MsgMhfUpdateGuacot struct { AckHandle uint32 EntryCount uint16 - Unk0 uint16 // Hardcoded 0 in binary - Gooks []Gook + Goocoos []Goocoo } // Opcode returns the ID associated with this packet type. @@ -34,20 +30,18 @@ func (m *MsgMhfUpdateGuacot) Opcode() network.PacketID { func (m *MsgMhfUpdateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.EntryCount = bf.ReadUint16() - m.Unk0 = bf.ReadUint16() + _ = bf.ReadUint16() // Zero + var temp Goocoo for i := 0; i < int(m.EntryCount); i++ { - e := Gook{} - e.Index = bf.ReadUint32() - e.Type = bf.ReadUint16() - e.Data = bf.ReadBytes(50) - e.NameLen = bf.ReadUint8() - e.Name = bf.ReadBytes(uint(e.NameLen)) - if e.Type > 0 { - e.Exists = true - } else { - e.Exists = false + temp.Index = bf.ReadUint32() + for j := 0; j < 22; j++ { + temp.Data1 = append(temp.Data1, bf.ReadUint16()) } - m.Gooks = append(m.Gooks, e) + for j := 0; j < 2; j++ { + temp.Data2 = append(temp.Data2, bf.ReadUint32()) + } + temp.Name = bf.ReadBytes(uint(bf.ReadUint8())) + m.Goocoos = append(m.Goocoos, temp) } return nil } diff --git a/network/mhfpacket/msg_mhf_update_myhouse_info.go b/network/mhfpacket/msg_mhf_update_myhouse_info.go index 469920127..c5bf26d7a 100644 --- a/network/mhfpacket/msg_mhf_update_myhouse_info.go +++ b/network/mhfpacket/msg_mhf_update_myhouse_info.go @@ -1,17 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + _config "erupe-ce/config" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfUpdateMyhouseInfo represents the MSG_MHF_UPDATE_MYHOUSE_INFO type MsgMhfUpdateMyhouseInfo struct { AckHandle uint32 - Unk0 []byte + Data []byte } // Opcode returns the ID associated with this packet type. @@ -22,7 +23,16 @@ func (m *MsgMhfUpdateMyhouseInfo) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfUpdateMyhouseInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadBytes(0x16A) + if _config.ErupeConfig.RealClientMode >= _config.G10 { + m.Data = bf.ReadBytes(362) + } else if _config.ErupeConfig.RealClientMode >= _config.GG { + m.Data = bf.ReadBytes(338) + } else if _config.ErupeConfig.RealClientMode >= _config.F5 { + // G1 is a guess + m.Data = bf.ReadBytes(314) + } else { + m.Data = bf.ReadBytes(290) + } return nil } diff --git a/network/mhfpacket/msg_mhf_update_use_trend_weapon_log.go b/network/mhfpacket/msg_mhf_update_use_trend_weapon_log.go index d4321444d..952ee85ec 100644 --- a/network/mhfpacket/msg_mhf_update_use_trend_weapon_log.go +++ b/network/mhfpacket/msg_mhf_update_use_trend_weapon_log.go @@ -1,18 +1,18 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgMhfUpdateUseTrendWeaponLog represents the MSG_MHF_UPDATE_USE_TREND_WEAPON_LOG type MsgMhfUpdateUseTrendWeaponLog struct { - AckHandle uint32 - Unk0 uint8 - Unk1 uint16 // Weapon/item ID probably? + AckHandle uint32 + WeaponType uint8 + WeaponID uint16 } // Opcode returns the ID associated with this packet type. @@ -23,8 +23,8 @@ func (m *MsgMhfUpdateUseTrendWeaponLog) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfUpdateUseTrendWeaponLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() - m.Unk0 = bf.ReadUint8() - m.Unk1 = bf.ReadUint16() + m.WeaponType = bf.ReadUint8() + m.WeaponID = bf.ReadUint16() return nil } diff --git a/network/mhfpacket/msg_sys_create_acquire_semaphore.go b/network/mhfpacket/msg_sys_create_acquire_semaphore.go index 9f014ced7..694aaaeed 100644 --- a/network/mhfpacket/msg_sys_create_acquire_semaphore.go +++ b/network/mhfpacket/msg_sys_create_acquire_semaphore.go @@ -2,10 +2,9 @@ package mhfpacket import ( "errors" - "fmt" - - "erupe-ce/common/byteframe" "erupe-ce/common/bfutil" + "erupe-ce/common/byteframe" + _config "erupe-ce/config" "erupe-ce/network" "erupe-ce/network/clientctx" ) @@ -27,8 +26,9 @@ func (m *MsgSysCreateAcquireSemaphore) Opcode() network.PacketID { func (m *MsgSysCreateAcquireSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Unk0 = bf.ReadUint16() - m.PlayerCount = bf.ReadUint8() - fmt.Printf("PLAYER COUNT :: %d", m.PlayerCount) + if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi? + m.PlayerCount = bf.ReadUint8() + } SemaphoreIDLength := bf.ReadUint8() m.SemaphoreID = string(bfutil.UpToNull(bf.ReadBytes(uint(SemaphoreIDLength)))) return nil diff --git a/network/mhfpacket/msg_sys_delete_semaphore.go b/network/mhfpacket/msg_sys_delete_semaphore.go index a976a708b..d10148cf6 100644 --- a/network/mhfpacket/msg_sys_delete_semaphore.go +++ b/network/mhfpacket/msg_sys_delete_semaphore.go @@ -10,7 +10,7 @@ import ( // MsgSysDeleteSemaphore represents the MSG_SYS_DELETE_SEMAPHORE type MsgSysDeleteSemaphore struct { - AckHandle uint32 + SemaphoreID uint32 } // Opcode returns the ID associated with this packet type. @@ -20,7 +20,7 @@ func (m *MsgSysDeleteSemaphore) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgSysDeleteSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - m.AckHandle = bf.ReadUint32() + m.SemaphoreID = bf.ReadUint32() return nil } diff --git a/network/mhfpacket/msg_sys_load_register.go b/network/mhfpacket/msg_sys_load_register.go index 24dc54052..7e1ac5950 100644 --- a/network/mhfpacket/msg_sys_load_register.go +++ b/network/mhfpacket/msg_sys_load_register.go @@ -1,8 +1,7 @@ package mhfpacket import ( - "fmt" - + "errors" "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" @@ -12,7 +11,7 @@ import ( type MsgSysLoadRegister struct { AckHandle uint32 RegisterID uint32 - Unk1 uint8 + Values uint8 } // Opcode returns the ID associated with this packet type. @@ -24,23 +23,13 @@ func (m *MsgSysLoadRegister) Opcode() network.PacketID { func (m *MsgSysLoadRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.RegisterID = bf.ReadUint32() - m.Unk1 = bf.ReadUint8() - fixedZero0 := bf.ReadUint16() - fixedZero1 := bf.ReadUint8() - - if fixedZero0 != 0 || fixedZero1 != 0 { - return fmt.Errorf("expected fixed-0 values, got %d %d", fixedZero0, fixedZero1) - } + m.Values = bf.ReadUint8() + _ = bf.ReadUint8() + _ = bf.ReadUint16() return nil } // Build builds a binary packet from the current data. func (m *MsgSysLoadRegister) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - bf.WriteUint32(m.AckHandle) - bf.WriteUint32(m.RegisterID) - bf.WriteUint8(m.Unk1) - bf.WriteUint16(0) - bf.WriteUint8(0) - - return nil + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_sys_operate_register.go b/network/mhfpacket/msg_sys_operate_register.go index e4213d45d..6978609b1 100644 --- a/network/mhfpacket/msg_sys_operate_register.go +++ b/network/mhfpacket/msg_sys_operate_register.go @@ -1,8 +1,7 @@ package mhfpacket import ( - "fmt" - + "errors" "erupe-ce/common/byteframe" "erupe-ce/network" "erupe-ce/network/clientctx" @@ -12,7 +11,6 @@ import ( type MsgSysOperateRegister struct { AckHandle uint32 SemaphoreID uint32 - fixedZero uint16 RawDataPayload []byte } @@ -25,12 +23,7 @@ func (m *MsgSysOperateRegister) Opcode() network.PacketID { func (m *MsgSysOperateRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.SemaphoreID = bf.ReadUint32() - m.fixedZero = bf.ReadUint16() - - if m.fixedZero != 0 { - return fmt.Errorf("expected fixed-0 values, got %d", m.fixedZero) - } - + _ = bf.ReadUint16() dataSize := bf.ReadUint16() m.RawDataPayload = bf.ReadBytes(uint(dataSize)) return nil @@ -38,11 +31,5 @@ func (m *MsgSysOperateRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl // Build builds a binary packet from the current data. func (m *MsgSysOperateRegister) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - bf.WriteUint32(m.AckHandle) - bf.WriteUint32(m.SemaphoreID) - bf.WriteUint16(0) - bf.WriteUint16(uint16(len(m.RawDataPayload))) - bf.WriteBytes(m.RawDataPayload) - - return nil + return errors.New("NOT IMPLEMENTED") } diff --git a/network/mhfpacket/msg_sys_record_log.go b/network/mhfpacket/msg_sys_record_log.go index 4266ec774..dcdf3e5a2 100644 --- a/network/mhfpacket/msg_sys_record_log.go +++ b/network/mhfpacket/msg_sys_record_log.go @@ -1,21 +1,19 @@ package mhfpacket -import ( - "errors" +import ( + "errors" - "erupe-ce/network/clientctx" - "erupe-ce/network" "erupe-ce/common/byteframe" + "erupe-ce/network" + "erupe-ce/network/clientctx" ) // MsgSysRecordLog represents the MSG_SYS_RECORD_LOG type MsgSysRecordLog struct { - AckHandle uint32 - Unk0 uint32 - Unk1 uint16 // Hardcoded 0 - HardcodedDataSize uint16 // Hardcoded 0x4AC - Unk3 uint32 // Some shared ID with MSG_MHF_GET_SEIBATTLE. World ID?? - DataBuf []byte + AckHandle uint32 + Unk0 uint32 + Unk1 uint32 + Data []byte } // Opcode returns the ID associated with this packet type. @@ -27,10 +25,10 @@ func (m *MsgSysRecordLog) Opcode() network.PacketID { func (m *MsgSysRecordLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.Unk0 = bf.ReadUint32() - m.Unk1 = bf.ReadUint16() - m.HardcodedDataSize = bf.ReadUint16() - m.Unk3 = bf.ReadUint32() - m.DataBuf = bf.ReadBytes(uint(m.HardcodedDataSize)) + bf.ReadUint16() // Zeroed + size := bf.ReadUint16() + m.Unk1 = bf.ReadUint32() + m.Data = bf.ReadBytes(uint(size)) return nil } diff --git a/network/mhfpacket/msg_sys_terminal_log.go b/network/mhfpacket/msg_sys_terminal_log.go index 536d35f18..bc8f3f7c5 100644 --- a/network/mhfpacket/msg_sys_terminal_log.go +++ b/network/mhfpacket/msg_sys_terminal_log.go @@ -2,6 +2,7 @@ package mhfpacket import ( "errors" + _config "erupe-ce/config" "erupe-ce/common/byteframe" "erupe-ce/network" @@ -13,7 +14,11 @@ type TerminalLogEntry struct { Index uint32 Type1 uint8 Type2 uint8 - Data []int16 + Unk0 int16 + Unk1 int32 + Unk2 int32 + Unk3 int32 + Unk4 []int32 } // MsgSysTerminalLog represents the MSG_SYS_TERMINAL_LOG @@ -42,8 +47,14 @@ func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client e.Index = bf.ReadUint32() e.Type1 = bf.ReadUint8() e.Type2 = bf.ReadUint8() - for j := 0; j < 15; j++ { - e.Data = append(e.Data, bf.ReadInt16()) + e.Unk0 = bf.ReadInt16() + e.Unk1 = bf.ReadInt32() + e.Unk2 = bf.ReadInt32() + e.Unk3 = bf.ReadInt32() + if _config.ErupeConfig.RealClientMode >= _config.G1 { + for j := 0; j < 4; j++ { + e.Unk4 = append(e.Unk4, bf.ReadInt32()) + } } m.Entries = append(m.Entries, e) } diff --git a/patch-schema/psn-id.sql b/patch-schema/00-psn-id.sql similarity index 100% rename from patch-schema/psn-id.sql rename to patch-schema/00-psn-id.sql diff --git a/patch-schema/01-wiiu-key.sql b/patch-schema/01-wiiu-key.sql new file mode 100644 index 000000000..2dfe06203 --- /dev/null +++ b/patch-schema/01-wiiu-key.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE public.users ADD COLUMN IF NOT EXISTS wiiu_key TEXT; + +END; diff --git a/patch-schema/02-tower.sql b/patch-schema/02-tower.sql new file mode 100644 index 000000000..0697fc2be --- /dev/null +++ b/patch-schema/02-tower.sql @@ -0,0 +1,29 @@ +BEGIN; + +CREATE TABLE IF NOT EXISTS tower ( + char_id INT, + tr INT, + trp INT, + tsp INT, + block1 INT, + block2 INT, + skills TEXT DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0', + gems TEXT DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0' +); + +ALTER TABLE IF EXISTS guild_characters + ADD COLUMN IF NOT EXISTS tower_mission_1 INT; + +ALTER TABLE IF EXISTS guild_characters + ADD COLUMN IF NOT EXISTS tower_mission_2 INT; + +ALTER TABLE IF EXISTS guild_characters + ADD COLUMN IF NOT EXISTS tower_mission_3 INT; + +ALTER TABLE IF EXISTS guilds + ADD COLUMN IF NOT EXISTS tower_mission_page INT DEFAULT 1; + +ALTER TABLE IF EXISTS guilds + ADD COLUMN IF NOT EXISTS tower_rp INT DEFAULT 0; + +END; \ No newline at end of file diff --git a/patch-schema/03-event_quests.sql b/patch-schema/03-event_quests.sql new file mode 100644 index 000000000..94aac0c65 --- /dev/null +++ b/patch-schema/03-event_quests.sql @@ -0,0 +1,14 @@ +BEGIN; + +create table if not exists event_quests +( + id serial primary key, + max_players integer, + quest_type integer not null, + quest_id integer not null, + mark integer +); + +ALTER TABLE IF EXISTS public.servers DROP COLUMN IF EXISTS season; + +END; \ No newline at end of file diff --git a/patch-schema/04-trend-weapons.sql b/patch-schema/04-trend-weapons.sql new file mode 100644 index 000000000..15a7b86c4 --- /dev/null +++ b/patch-schema/04-trend-weapons.sql @@ -0,0 +1,7 @@ +CREATE TABLE public.trend_weapons +( + weapon_id integer NOT NULL, + weapon_type integer NOT NULL, + count integer DEFAULT 0, + PRIMARY KEY (weapon_id) +); \ No newline at end of file diff --git a/patch-schema/05-gacha-roll-name.sql b/patch-schema/05-gacha-roll-name.sql new file mode 100644 index 000000000..ee4b11269 --- /dev/null +++ b/patch-schema/05-gacha-roll-name.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE IF EXISTS public.gacha_entries + ADD COLUMN name text; + +END; \ No newline at end of file diff --git a/patch-schema/06-goocoo-rename.sql b/patch-schema/06-goocoo-rename.sql new file mode 100644 index 000000000..e72585ab3 --- /dev/null +++ b/patch-schema/06-goocoo-rename.sql @@ -0,0 +1,11 @@ +BEGIN; + +ALTER TABLE gook RENAME TO goocoo; + +ALTER TABLE goocoo RENAME COLUMN gook0 TO goocoo0; +ALTER TABLE goocoo RENAME COLUMN gook1 TO goocoo1; +ALTER TABLE goocoo RENAME COLUMN gook2 TO goocoo2; +ALTER TABLE goocoo RENAME COLUMN gook3 TO goocoo3; +ALTER TABLE goocoo RENAME COLUMN gook4 TO goocoo4; + +END; \ No newline at end of file diff --git a/patch-schema/07-scenarios-counter.sql b/patch-schema/07-scenarios-counter.sql new file mode 100644 index 000000000..3ea2c65b2 --- /dev/null +++ b/patch-schema/07-scenarios-counter.sql @@ -0,0 +1,9 @@ +BEGIN; + +CREATE TABLE IF NOT EXISTS scenario_counter ( + id serial primary key, + scenario_id numeric not null, + category_id numeric not null +); + +END; \ No newline at end of file diff --git a/patch-schema/08-kill-counts.sql b/patch-schema/08-kill-counts.sql new file mode 100644 index 000000000..1c170cedd --- /dev/null +++ b/patch-schema/08-kill-counts.sql @@ -0,0 +1,12 @@ +CREATE TABLE public.kill_logs +( + id serial, + character_id integer NOT NULL, + monster integer NOT NULL, + quantity integer NOT NULL, + timestamp timestamp with time zone NOT NULL, + PRIMARY KEY (id) +); + +ALTER TABLE IF EXISTS public.guild_characters + ADD COLUMN box_claimed timestamp with time zone DEFAULT now(); \ No newline at end of file diff --git a/patch-schema/09-fix-guild-treasure.sql b/patch-schema/09-fix-guild-treasure.sql new file mode 100644 index 000000000..1c022292f --- /dev/null +++ b/patch-schema/09-fix-guild-treasure.sql @@ -0,0 +1,26 @@ +BEGIN; + +ALTER TABLE IF EXISTS public.guild_hunts DROP COLUMN IF EXISTS hunters; + +ALTER TABLE IF EXISTS public.guild_characters + ADD COLUMN treasure_hunt integer; + +ALTER TABLE IF EXISTS public.guild_hunts + ADD COLUMN start timestamp with time zone NOT NULL DEFAULT now(); + +UPDATE guild_hunts SET start=to_timestamp(return); + +ALTER TABLE IF EXISTS public.guild_hunts DROP COLUMN IF EXISTS "return"; + +ALTER TABLE IF EXISTS public.guild_hunts + RENAME claimed TO collected; + +CREATE TABLE public.guild_hunts_claimed +( + hunt_id integer NOT NULL, + character_id integer NOT NULL +); + +ALTER TABLE IF EXISTS public.guild_hunts DROP COLUMN IF EXISTS treasure; + +END; \ No newline at end of file diff --git a/patch-schema/psn-link.sql b/patch-schema/psn-link.sql new file mode 100644 index 000000000..fc22e9046 --- /dev/null +++ b/patch-schema/psn-link.sql @@ -0,0 +1,11 @@ +BEGIN; + +ALTER TABLE public.sign_sessions ADD COLUMN id SERIAL; + +ALTER TABLE public.sign_sessions ADD CONSTRAINT sign_sessions_pkey PRIMARY KEY (id); + +ALTER TABLE public.sign_sessions ALTER COLUMN user_id DROP NOT NULL; + +ALTER TABLE public.sign_sessions ADD COLUMN psn_id TEXT; + +END; \ No newline at end of file diff --git a/server/channelserver/handlers.go b/server/channelserver/handlers.go index eda406911..f6c88ba42 100644 --- a/server/channelserver/handlers.go +++ b/server/channelserver/handlers.go @@ -4,8 +4,10 @@ import ( "encoding/binary" "encoding/hex" "erupe-ce/common/mhfcourse" + "erupe-ce/common/mhfmon" ps "erupe-ce/common/pascalstring" "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "fmt" "io" "net" @@ -15,8 +17,9 @@ import ( "crypto/rand" "erupe-ce/common/byteframe" "erupe-ce/network/mhfpacket" - "go.uber.org/zap" "math/bits" + + "go.uber.org/zap" ) // Temporary function to just return no results for a MSG_MHF_ENUMERATE* packet @@ -27,15 +30,16 @@ func stubEnumerateNoResults(s *Session, ackHandle uint32) { doAckBufSucceed(s, ackHandle, enumBf.Data()) } -// Temporary function to just return no results for many MSG_MHF_GET* packets. -func stubGetNoResults(s *Session, ackHandle uint32) { - resp := byteframe.NewByteFrame() - resp.WriteUint32(0x0A218EAD) // Unk shared ID. Sent in response of MSG_MHF_GET_TOWER_INFO, MSG_MHF_GET_PAPER_DATA etc. (World ID?) - resp.WriteUint32(0) // Unk - resp.WriteUint32(0) // Unk - resp.WriteUint32(0) // Entry count - - doAckBufSucceed(s, ackHandle, resp.Data()) +func doAckEarthSucceed(s *Session, ackHandle uint32, data []*byteframe.ByteFrame) { + bf := byteframe.NewByteFrame() + bf.WriteUint32(uint32(s.server.erupeConfig.DevModeOptions.EarthIDOverride)) + bf.WriteUint32(0) + bf.WriteUint32(0) + bf.WriteUint32(uint32(len(data))) + for i := range data { + bf.WriteBytes(data[i].Data()) + } + doAckBufSucceed(s, ackHandle, bf.Data()) } func doAckBufSucceed(s *Session, ackHandle uint32, data []byte) { @@ -109,7 +113,12 @@ func handleMsgSysTerminalLog(s *Session, p mhfpacket.MHFPacket) { s.server.logger.Info("SysTerminalLog", zap.Uint8("Type1", pkt.Entries[i].Type1), zap.Uint8("Type2", pkt.Entries[i].Type2), - zap.Int16s("Data", pkt.Entries[i].Data)) + zap.Int16("Unk0", pkt.Entries[i].Unk0), + zap.Int32("Unk1", pkt.Entries[i].Unk1), + zap.Int32("Unk2", pkt.Entries[i].Unk2), + zap.Int32("Unk3", pkt.Entries[i].Unk3), + zap.Int32s("Unk4", pkt.Entries[i].Unk4), + ) } resp := byteframe.NewByteFrame() resp.WriteUint32(pkt.LogID + 1) // LogID to use for requests after this. @@ -175,6 +184,7 @@ func logoutPlayer(s *Session) { delete(s.server.sessions, s.rawConn) } s.rawConn.Close() + delete(s.server.objectIDs, s) s.server.Unlock() for _, stage := range s.server.stages { @@ -223,7 +233,7 @@ func logoutPlayer(s *Session) { s.server.db.Exec("UPDATE characters SET time_played = $1 WHERE id = $2", timePlayed, s.charID) - treasureHuntUnregister(s) + s.server.db.Exec(`UPDATE guild_characters SET treasure_hunt=NULL WHERE character_id=$1`, s.charID) if s.stage == nil { return @@ -245,7 +255,7 @@ func logoutPlayer(s *Session) { removeSessionFromStage(s) saveData, err := GetCharacterSaveData(s, s.charID) - if err != nil { + if err != nil || saveData == nil { s.logger.Error("Failed to get savedata") return } @@ -264,13 +274,12 @@ func handleMsgSysPing(s *Session, p mhfpacket.MHFPacket) { } func handleMsgSysTime(s *Session, p mhfpacket.MHFPacket) { - //pkt := p.(*mhfpacket.MsgSysTime) - resp := &mhfpacket.MsgSysTime{ GetRemoteTime: false, Timestamp: uint32(TimeAdjusted().Unix()), // JP timezone } s.QueueSendMHF(resp) + s.notifyRavi() } func handleMsgSysIssueLogkey(s *Session, p mhfpacket.MHFPacket) { @@ -297,9 +306,20 @@ func handleMsgSysIssueLogkey(s *Session, p mhfpacket.MHFPacket) { func handleMsgSysRecordLog(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgSysRecordLog) + if _config.ErupeConfig.RealClientMode == _config.ZZ { + bf := byteframe.NewByteFrameFromBytes(pkt.Data) + bf.Seek(32, 0) + var val uint8 + for i := 0; i < 176; i++ { + val = bf.ReadUint8() + if val > 0 && mhfmon.Monsters[i].Large { + s.server.db.Exec(`INSERT INTO kill_logs (character_id, monster, quantity, timestamp) VALUES ($1, $2, $3, $4)`, s.charID, i, val, TimeAdjusted()) + } + } + } // remove a client returning to town from reserved slots to make sure the stage is hidden from board delete(s.stage.reservedClientSlots, s.charID) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } func handleMsgSysEcho(s *Session, p mhfpacket.MHFPacket) {} @@ -446,48 +466,110 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) { } } case 4: // Find Party + type FindPartyParams struct { + StagePrefix string + RankRestriction uint16 + Targets []uint16 + Unk0 []uint16 + Unk1 []uint16 + QuestID []uint16 + } + findPartyParams := FindPartyParams{ + StagePrefix: "sl2Ls210", + } bf := byteframe.NewByteFrameFromBytes(pkt.MessageData) - setting := bf.ReadUint8() + numParams := int(bf.ReadUint8()) maxResults := bf.ReadUint16() - bf.Seek(2, 1) - partyType := bf.ReadUint16() - rankRestriction := uint16(0) - if setting >= 2 { - bf.Seek(2, 1) - rankRestriction = bf.ReadUint16() - } - targets := make([]uint16, 4) - if setting >= 3 { - bf.Seek(1, 1) - lenTargets := int(bf.ReadUint8()) - for i := 0; i < lenTargets; i++ { - targets[i] = bf.ReadUint16() + for i := 0; i < numParams; i++ { + switch bf.ReadUint8() { + case 0: + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + findPartyParams.RankRestriction = bf.ReadUint16() + } else { + findPartyParams.RankRestriction = uint16(bf.ReadInt8()) + } + } + case 1: + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + findPartyParams.Targets = append(findPartyParams.Targets, bf.ReadUint16()) + } else { + findPartyParams.Targets = append(findPartyParams.Targets, uint16(bf.ReadInt8())) + } + } + case 2: + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + var value int16 + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + value = bf.ReadInt16() + } else { + value = int16(bf.ReadInt8()) + } + switch value { + case 0: // Public Bar + findPartyParams.StagePrefix = "sl2Ls210" + case 1: // Tokotoko Partnya + findPartyParams.StagePrefix = "sl2Ls463" + case 2: // Hunting Prowess Match + findPartyParams.StagePrefix = "sl2Ls286" + case 3: // Volpakkun Together + findPartyParams.StagePrefix = "sl2Ls465" + case 5: // Quick Party + // Unk + } + } + case 3: // Unknown + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + findPartyParams.Unk0 = append(findPartyParams.Unk0, bf.ReadUint16()) + } else { + findPartyParams.Unk0 = append(findPartyParams.Unk0, uint16(bf.ReadInt8())) + } + } + case 4: // Looking for n or already have n + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + findPartyParams.Unk1 = append(findPartyParams.Unk1, bf.ReadUint16()) + } else { + findPartyParams.Unk1 = append(findPartyParams.Unk1, uint16(bf.ReadInt8())) + } + } + case 5: + values := int(bf.ReadUint8()) + for i := 0; i < values; i++ { + if _config.ErupeConfig.RealClientMode >= _config.Z1 { + findPartyParams.QuestID = append(findPartyParams.QuestID, bf.ReadUint16()) + } else { + findPartyParams.QuestID = append(findPartyParams.QuestID, uint16(bf.ReadInt8())) + } + } } } - var stagePrefix string - switch partyType { - case 0: // Public Bar - stagePrefix = "sl2Ls210" - case 1: // Tokotoko Partnya - stagePrefix = "sl2Ls463" - case 2: // Hunting Prowess Match - stagePrefix = "sl2Ls286" - case 3: // Volpakkun Together - stagePrefix = "sl2Ls465" - case 5: // Quick Party - // Unk - } for _, c := range s.server.Channels { for _, stage := range c.stages { if count == maxResults { break } - if strings.HasPrefix(stage.id, stagePrefix) { + if strings.HasPrefix(stage.id, findPartyParams.StagePrefix) { sb3 := byteframe.NewByteFrameFromBytes(stage.rawBinaryData[stageBinaryKey{1, 3}]) sb3.Seek(4, 0) stageRankRestriction := sb3.ReadUint16() stageTarget := sb3.ReadUint16() - if rankRestriction != 0xFFFF && stageRankRestriction < rankRestriction { + if stageRankRestriction > findPartyParams.RankRestriction { + continue + } + if len(findPartyParams.Targets) > 0 { + for _, target := range findPartyParams.Targets { + if target == stageTarget { + break + } + } continue } count++ @@ -551,10 +633,6 @@ func handleMsgSysInfokyserver(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfGetCaUniqueID(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfEnumerateItem(s *Session, p mhfpacket.MHFPacket) {} - -func handleMsgMhfAcquireItem(s *Session, p mhfpacket.MHFPacket) {} - func handleMsgMhfTransferItem(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfTransferItem) doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) @@ -724,20 +802,20 @@ func getGookData(s *Session, cid uint32) (uint16, []byte) { var count uint16 bf := byteframe.NewByteFrame() for i := 0; i < 5; i++ { - err := s.server.db.QueryRow(fmt.Sprintf("SELECT gook%d FROM gook WHERE id=$1", i), cid).Scan(&data) + err := s.server.db.QueryRow(fmt.Sprintf("SELECT goocoo%d FROM goocoo WHERE id=$1", i), cid).Scan(&data) if err != nil { - s.server.db.Exec("INSERT INTO gook (id) VALUES ($1)", s.charID) + s.server.db.Exec("INSERT INTO goocoo (id) VALUES ($1)", s.charID) return 0, bf.Data() } if err == nil && data != nil { count++ if s.charID == cid && count == 1 { - gook := byteframe.NewByteFrameFromBytes(data) - bf.WriteBytes(gook.ReadBytes(4)) - d := gook.ReadBytes(2) + goocoo := byteframe.NewByteFrameFromBytes(data) + bf.WriteBytes(goocoo.ReadBytes(4)) + d := goocoo.ReadBytes(2) bf.WriteBytes(d) bf.WriteBytes(d) - bf.WriteBytes(gook.DataFromCurrent()) + bf.WriteBytes(goocoo.DataFromCurrent()) } else { bf.WriteBytes(data) } @@ -757,744 +835,75 @@ func handleMsgMhfEnumerateGuacot(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfUpdateGuacot(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfUpdateGuacot) - for _, gook := range pkt.Gooks { - if !gook.Exists { - s.server.db.Exec(fmt.Sprintf("UPDATE gook SET gook%d=NULL WHERE id=$1", gook.Index), s.charID) + for _, goocoo := range pkt.Goocoos { + if goocoo.Data1[0] == 0 { + s.server.db.Exec(fmt.Sprintf("UPDATE goocoo SET goocoo%d=NULL WHERE id=$1", goocoo.Index), s.charID) } else { bf := byteframe.NewByteFrame() - bf.WriteUint32(gook.Index) - bf.WriteUint16(gook.Type) - bf.WriteBytes(gook.Data) - bf.WriteUint8(gook.NameLen) - bf.WriteBytes(gook.Name) - s.server.db.Exec(fmt.Sprintf("UPDATE gook SET gook%d=$1 WHERE id=$2", gook.Index), bf.Data(), s.charID) - dumpSaveData(s, bf.Data(), fmt.Sprintf("goocoo-%d", gook.Index)) + bf.WriteUint32(goocoo.Index) + for i := range goocoo.Data1 { + bf.WriteUint16(goocoo.Data1[i]) + } + for i := range goocoo.Data2 { + bf.WriteUint32(goocoo.Data2[i]) + } + bf.WriteUint8(uint8(len(goocoo.Name))) + bf.WriteBytes(goocoo.Name) + s.server.db.Exec(fmt.Sprintf("UPDATE goocoo SET goocoo%d=$1 WHERE id=$2", goocoo.Index), bf.Data(), s.charID) + dumpSaveData(s, bf.Data(), fmt.Sprintf("goocoo-%d", goocoo.Index)) } } - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} + +type Scenario struct { + MainID uint32 + // 0 = Basic + // 1 = Veteran + // 3 = Other + // 6 = Pallone + // 7 = Diva + CategoryID uint8 } func handleMsgMhfInfoScenarioCounter(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfInfoScenarioCounter) - scenarioCounter := []struct { - MainID uint32 - Unk1 uint8 // Bool item exchange? - // 0 = basic, 1 = veteran, 3 = other, 6 = pallone, 7 = diva - CategoryID uint8 - }{ - //000000110000 - { - MainID: 0x00000011, Unk1: 0, CategoryID: 0, - }, - // 0000005D0001 - { - MainID: 0x0000005D, Unk1: 0, CategoryID: 1, - }, - // 0000005C0001 - { - MainID: 0x0000005C, Unk1: 0, CategoryID: 1, - }, - // 000000510001 - { - MainID: 0x00000051, Unk1: 0, CategoryID: 1, - }, - // 0000005B0001 - { - MainID: 0x0000005B, Unk1: 0, CategoryID: 1, - }, - // 0000005A0001 - { - MainID: 0x0000005A, Unk1: 0, CategoryID: 1, - }, - // 000000590001 - { - MainID: 0x00000059, Unk1: 0, CategoryID: 1, - }, - // 000000580001 - { - MainID: 0x00000058, Unk1: 0, CategoryID: 1, - }, - // 000000570001 - { - MainID: 0x00000057, Unk1: 0, CategoryID: 1, - }, - // 000000560001 - { - MainID: 0x00000056, Unk1: 0, CategoryID: 1, - }, - // 000000550001 - { - MainID: 0x00000055, Unk1: 0, CategoryID: 1, - }, - // 000000540001 - { - MainID: 0x00000054, Unk1: 0, CategoryID: 1, - }, - // 000000530001 - { - MainID: 0x00000053, Unk1: 0, CategoryID: 1, - }, - // 000000520001 - { - MainID: 0x00000052, Unk1: 0, CategoryID: 1, - }, - // 000000570103 - { - MainID: 0x00000057, Unk1: 1, CategoryID: 3, - }, - // 000000580103 - { - MainID: 0x00000058, Unk1: 1, CategoryID: 3, - }, - // 000000590103 - { - MainID: 0x00000059, Unk1: 1, CategoryID: 3, - }, - // 0000005A0103 - { - MainID: 0x0000005A, Unk1: 1, CategoryID: 3, - }, - // 0000005B0103 - { - MainID: 0x0000005B, Unk1: 1, CategoryID: 3, - }, - // 0000005C0103 - { - MainID: 0x0000005C, Unk1: 1, CategoryID: 3, - }, - // 000000530103 - { - MainID: 0x00000053, Unk1: 1, CategoryID: 3, - }, - // 000000560103 - { - MainID: 0x00000056, Unk1: 1, CategoryID: 3, - }, - // 0000003C0103 - { - MainID: 0x0000003C, Unk1: 1, CategoryID: 3, - }, - // 0000003A0103 - { - MainID: 0x0000003A, Unk1: 1, CategoryID: 3, - }, - // 0000003B0103 - { - MainID: 0x0000003B, Unk1: 1, CategoryID: 3, - }, - // 0000001B0103 - { - MainID: 0x0000001B, Unk1: 1, CategoryID: 3, - }, - // 000000190103 - { - MainID: 0x00000019, Unk1: 1, CategoryID: 3, - }, - // 0000001A0103 - { - MainID: 0x0000001A, Unk1: 1, CategoryID: 3, - }, - // 000000170103 - { - MainID: 0x00000017, Unk1: 1, CategoryID: 3, - }, - // 000000020103 - { - MainID: 0x00000002, Unk1: 1, CategoryID: 3, - }, - // 000000030103 - { - MainID: 0x00000003, Unk1: 1, CategoryID: 3, - }, - // 000000040103 - { - MainID: 0x00000004, Unk1: 1, CategoryID: 3, - }, - // 0000001F0103 - { - MainID: 0x0000001F, Unk1: 1, CategoryID: 3, - }, - // 000000200103 - { - MainID: 0x00000020, Unk1: 1, CategoryID: 3, - }, - // 000000210103 - { - MainID: 0x00000021, Unk1: 1, CategoryID: 3, - }, - // 000000220103 - { - MainID: 0x00000022, Unk1: 1, CategoryID: 3, - }, - // 000000230103 - { - MainID: 0x00000023, Unk1: 1, CategoryID: 3, - }, - // 000000240103 - { - MainID: 0x00000024, Unk1: 1, CategoryID: 3, - }, - // 000000250103 - { - MainID: 0x00000025, Unk1: 1, CategoryID: 3, - }, - // 000000280103 - { - MainID: 0x00000028, Unk1: 1, CategoryID: 3, - }, - // 000000260103 - { - MainID: 0x00000026, Unk1: 1, CategoryID: 3, - }, - // 000000270103 - { - MainID: 0x00000027, Unk1: 1, CategoryID: 3, - }, - // 000000300103 - { - MainID: 0x00000030, Unk1: 1, CategoryID: 3, - }, - // 0000000C0103 - { - MainID: 0x0000000C, Unk1: 1, CategoryID: 3, - }, - // 0000000D0103 - { - MainID: 0x0000000D, Unk1: 1, CategoryID: 3, - }, - // 0000001E0103 - { - MainID: 0x0000001E, Unk1: 1, CategoryID: 3, - }, - // 0000001D0103 - { - MainID: 0x0000001D, Unk1: 1, CategoryID: 3, - }, - // 0000002E0003 - { - MainID: 0x0000002E, Unk1: 0, CategoryID: 3, - }, - // 000000000004 - { - MainID: 0x00000000, Unk1: 0, CategoryID: 4, - }, - // 000000010004 - { - MainID: 0x00000001, Unk1: 0, CategoryID: 4, - }, - // 000000020004 - { - MainID: 0x00000002, Unk1: 0, CategoryID: 4, - }, - // 000000030004 - { - MainID: 0x00000003, Unk1: 0, CategoryID: 4, - }, - // 000000040004 - { - MainID: 0x00000004, Unk1: 0, CategoryID: 4, - }, - // 000000050004 - { - MainID: 0x00000005, Unk1: 0, CategoryID: 4, - }, - // 000000060004 - { - MainID: 0x00000006, Unk1: 0, CategoryID: 4, - }, - // 000000070004 - { - MainID: 0x00000007, Unk1: 0, CategoryID: 4, - }, - // 000000080004 - { - MainID: 0x00000008, Unk1: 0, CategoryID: 4, - }, - // 000000090004 - { - MainID: 0x00000009, Unk1: 0, CategoryID: 4, - }, - // 0000000A0004 - { - MainID: 0x0000000A, Unk1: 0, CategoryID: 4, - }, - // 0000000B0004 - { - MainID: 0x0000000B, Unk1: 0, CategoryID: 4, - }, - // 0000000C0004 - { - MainID: 0x0000000C, Unk1: 0, CategoryID: 4, - }, - // 0000000D0004 - { - MainID: 0x0000000D, Unk1: 0, CategoryID: 4, - }, - // 0000000E0004 - { - MainID: 0x0000000E, Unk1: 0, CategoryID: 4, - }, - // 000000320005 - { - MainID: 0x00000032, Unk1: 0, CategoryID: 5, - }, - // 000000330005 - { - MainID: 0x00000033, Unk1: 0, CategoryID: 5, - }, - // 000000340005 - { - MainID: 0x00000034, Unk1: 0, CategoryID: 5, - }, - // 000000350005 - { - MainID: 0x00000035, Unk1: 0, CategoryID: 5, - }, - // 000000360005 - { - MainID: 0x00000036, Unk1: 0, CategoryID: 5, - }, - // 000000370005 - { - MainID: 0x00000037, Unk1: 0, CategoryID: 5, - }, - // 000000380005 - { - MainID: 0x00000038, Unk1: 0, CategoryID: 5, - }, - // 0000003A0005 - { - MainID: 0x0000003A, Unk1: 0, CategoryID: 5, - }, - // 0000003F0005 - { - MainID: 0x0000003F, Unk1: 0, CategoryID: 5, - }, - // 000000400005 - { - MainID: 0x00000040, Unk1: 0, CategoryID: 5, - }, - // 000000410005 - { - MainID: 0x00000041, Unk1: 0, CategoryID: 5, - }, - // 000000430005 - { - MainID: 0x00000043, Unk1: 0, CategoryID: 5, - }, - // 000000470005 - { - MainID: 0x00000047, Unk1: 0, CategoryID: 5, - }, - // 0000004B0005 - { - MainID: 0x0000004B, Unk1: 0, CategoryID: 5, - }, - // 0000003D0005 - { - MainID: 0x0000003D, Unk1: 0, CategoryID: 5, - }, - // 000000440005 - { - MainID: 0x00000044, Unk1: 0, CategoryID: 5, - }, - // 000000420005 - { - MainID: 0x00000042, Unk1: 0, CategoryID: 5, - }, - // 0000004C0005 - { - MainID: 0x0000004C, Unk1: 0, CategoryID: 5, - }, - // 000000460005 - { - MainID: 0x00000046, Unk1: 0, CategoryID: 5, - }, - // 0000004D0005 - { - MainID: 0x0000004D, Unk1: 0, CategoryID: 5, - }, - // 000000480005 - { - MainID: 0x00000048, Unk1: 0, CategoryID: 5, - }, - // 0000004A0005 - { - MainID: 0x0000004A, Unk1: 0, CategoryID: 5, - }, - // 000000490005 - { - MainID: 0x00000049, Unk1: 0, CategoryID: 5, - }, - // 0000004E0005 - { - MainID: 0x0000004E, Unk1: 0, CategoryID: 5, - }, - // 000000450005 - { - MainID: 0x00000045, Unk1: 0, CategoryID: 5, - }, - // 0000003E0005 - { - MainID: 0x0000003E, Unk1: 0, CategoryID: 5, - }, - // 0000004F0005 - { - MainID: 0x0000004F, Unk1: 0, CategoryID: 5, - }, - // 000000000106 - { - MainID: 0x00000000, Unk1: 1, CategoryID: 6, - }, - // 000000010106 - { - MainID: 0x00000001, Unk1: 1, CategoryID: 6, - }, - // 000000020106 - { - MainID: 0x00000002, Unk1: 1, CategoryID: 6, - }, - // 000000030106 - { - MainID: 0x00000003, Unk1: 1, CategoryID: 6, - }, - // 000000040106 - { - MainID: 0x00000004, Unk1: 1, CategoryID: 6, - }, - // 000000050106 - { - MainID: 0x00000005, Unk1: 1, CategoryID: 6, - }, - // 000000060106 - { - MainID: 0x00000006, Unk1: 1, CategoryID: 6, - }, - // 000000070106 - { - MainID: 0x00000007, Unk1: 1, CategoryID: 6, - }, - // 000000080106 - { - MainID: 0x00000008, Unk1: 1, CategoryID: 6, - }, - // 000000090106 - { - MainID: 0x00000009, Unk1: 1, CategoryID: 6, - }, - // 000000110106 - { - MainID: 0x00000011, Unk1: 1, CategoryID: 6, - }, - // 0000000A0106 - { - MainID: 0x0000000A, Unk1: 1, CategoryID: 6, - }, - // 0000000B0106 - { - MainID: 0x0000000B, Unk1: 1, CategoryID: 6, - }, - // 0000000C0106 - { - MainID: 0x0000000C, Unk1: 1, CategoryID: 6, - }, - // 0000000D0106 - { - MainID: 0x0000000D, Unk1: 1, CategoryID: 6, - }, - // 0000000E0106 - { - MainID: 0x0000000E, Unk1: 1, CategoryID: 6, - }, - // 0000000F0106 - { - MainID: 0x0000000F, Unk1: 1, CategoryID: 6, - }, - // 000000100106 - { - MainID: 0x00000010, Unk1: 1, CategoryID: 6, - }, - // 000000320107 - { - MainID: 0x00000032, Unk1: 1, CategoryID: 7, - }, - // 000000350107 - { - MainID: 0x00000035, Unk1: 1, CategoryID: 7, - }, - // 0000003E0107 - { - MainID: 0x0000003E, Unk1: 1, CategoryID: 7, - }, - // 000000340107 - { - MainID: 0x00000034, Unk1: 1, CategoryID: 7, - }, - // 000000380107 - { - MainID: 0x00000038, Unk1: 1, CategoryID: 7, - }, - // 000000330107 - { - MainID: 0x00000033, Unk1: 1, CategoryID: 7, - }, - // 000000310107 - { - MainID: 0x00000031, Unk1: 1, CategoryID: 7, - }, - // 000000360107 - { - MainID: 0x00000036, Unk1: 1, CategoryID: 7, - }, - // 000000390107 - { - MainID: 0x00000039, Unk1: 1, CategoryID: 7, - }, - // 000000370107 - { - MainID: 0x00000037, Unk1: 1, CategoryID: 7, - }, - // 0000003D0107 - { - MainID: 0x0000003D, Unk1: 1, CategoryID: 7, - }, - // 0000003A0107 - { - MainID: 0x0000003A, Unk1: 1, CategoryID: 7, - }, - // 0000003C0107 - { - MainID: 0x0000003C, Unk1: 1, CategoryID: 7, - }, - // 0000003B0107 - { - MainID: 0x0000003B, Unk1: 1, CategoryID: 7, - }, - // 0000002A0107 - { - MainID: 0x0000002A, Unk1: 1, CategoryID: 7, - }, - // 000000300107 - { - MainID: 0x00000030, Unk1: 1, CategoryID: 7, - }, - // 000000280107 - { - MainID: 0x00000028, Unk1: 1, CategoryID: 7, - }, - // 000000270107 - { - MainID: 0x00000027, Unk1: 1, CategoryID: 7, - }, - // 0000002B0107 - { - MainID: 0x0000002B, Unk1: 1, CategoryID: 7, - }, - // 0000002E0107 - { - MainID: 0x0000002E, Unk1: 1, CategoryID: 7, - }, - // 000000290107 - { - MainID: 0x00000029, Unk1: 1, CategoryID: 7, - }, - // 0000002C0107 - { - MainID: 0x0000002C, Unk1: 1, CategoryID: 7, - }, - // 0000002D0107 - { - MainID: 0x0000002D, Unk1: 1, CategoryID: 7, - }, - // 0000002F0107 - { - MainID: 0x0000002F, Unk1: 1, CategoryID: 7, - }, - // 000000250107 - { - MainID: 0x00000025, Unk1: 1, CategoryID: 7, - }, - // 000000220107 - { - MainID: 0x00000022, Unk1: 1, CategoryID: 7, - }, - // 000000210107 - { - MainID: 0x00000021, Unk1: 1, CategoryID: 7, - }, - // 000000200107 - { - MainID: 0x00000020, Unk1: 1, CategoryID: 7, - }, - // 0000001C0107 - { - MainID: 0x0000001C, Unk1: 1, CategoryID: 7, - }, - // 0000001A0107 - { - MainID: 0x0000001A, Unk1: 1, CategoryID: 7, - }, - // 000000240107 - { - MainID: 0x00000024, Unk1: 1, CategoryID: 7, - }, - // 000000260107 - { - MainID: 0x00000026, Unk1: 1, CategoryID: 7, - }, - // 000000230107 - { - MainID: 0x00000023, Unk1: 1, CategoryID: 7, - }, - // 0000001B0107 - { - MainID: 0x0000001B, Unk1: 1, CategoryID: 7, - }, - // 0000001E0107 - { - MainID: 0x0000001E, Unk1: 1, CategoryID: 7, - }, - // 0000001F0107 - { - MainID: 0x0000001F, Unk1: 1, CategoryID: 7, - }, - // 0000001D0107 - { - MainID: 0x0000001D, Unk1: 1, CategoryID: 7, - }, - // 000000180107 - { - MainID: 0x00000018, Unk1: 1, CategoryID: 7, - }, - // 000000170107 - { - MainID: 0x00000017, Unk1: 1, CategoryID: 7, - }, - // 000000160107 - { - MainID: 0x00000016, Unk1: 1, CategoryID: 7, - }, - // 000000150107 - // Missing file - // { - // MainID: 0x00000015, Unk1: 1, CategoryID: 7, - // }, - // 000000190107 - { - MainID: 0x00000019, Unk1: 1, CategoryID: 7, - }, - // 000000140107 - // Missing file - // { - // MainID: 0x00000014, Unk1: 1, CategoryID: 7, - // }, - // 000000070107 - // Missing file - // { - // MainID: 0x00000007, Unk1: 1, CategoryID: 7, - // }, - // 000000090107 - // Missing file - // { - // MainID: 0x00000009, Unk1: 1, CategoryID: 7, - // }, - // 0000000D0107 - // Missing file - // { - // MainID: 0x0000000D, Unk1: 1, CategoryID: 7, - // }, - // 000000100107 - // Missing file - // { - // MainID: 0x00000010, Unk1: 1, CategoryID: 7, - // }, - // 0000000C0107 - // Missing file - // { - // MainID: 0x0000000C, Unk1: 1, CategoryID: 7, - // }, - // 0000000E0107 - // Missing file - // { - // MainID: 0x0000000E, Unk1: 1, CategoryID: 7, - // }, - // 0000000F0107 - // Missing file - // { - // MainID: 0x0000000F, Unk1: 1, CategoryID: 7, - // }, - // 000000130107 - // Missing file - // { - // MainID: 0x00000013, Unk1: 1, CategoryID: 7, - // }, - // 0000000A0107 - // Missing file - // { - // MainID: 0x0000000A, Unk1: 1, CategoryID: 7, - // }, - // 000000080107 - // Missing file - // { - // MainID: 0x00000008, Unk1: 1, CategoryID: 7, - // }, - // 0000000B0107 - // Missing file - // { - // MainID: 0x0000000B, Unk1: 1, CategoryID: 7, - // }, - // 000000120107 - // Missing file - // { - // MainID: 0x00000012, Unk1: 1, CategoryID: 7, - // }, - // 000000110107 - // Missing file - // { - // MainID: 0x00000011, Unk1: 1, CategoryID: 7, - // }, - // 000000060107 - // Missing file - // { - // MainID: 0x00000006, Unk1: 1, CategoryID: 7, - // }, - // 000000050107 - // Missing file - // { - // MainID: 0x00000005, Unk1: 1, CategoryID: 7, - // }, - // 000000040107 - // Missing file - // { - // MainID: 0x00000004, Unk1: 1, CategoryID: 7, - // }, - // 000000030107 - { - MainID: 0x00000003, Unk1: 1, CategoryID: 7, - }, - // 000000020107 - { - MainID: 0x00000002, Unk1: 1, CategoryID: 7, - }, - // 000000010107 - { - MainID: 0x00000001, Unk1: 1, CategoryID: 7, - }, - // 000000000107 - { - MainID: 0x00000000, Unk1: 1, CategoryID: 7, - }, + var scenarios []Scenario + var scenario Scenario + scenarioData, err := s.server.db.Queryx("SELECT scenario_id, category_id FROM scenario_counter") + if err != nil { + scenarioData.Close() + s.logger.Error("Failed to get scenario counter info from db", zap.Error(err)) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 1)) + return + } + for scenarioData.Next() { + err = scenarioData.Scan(&scenario.MainID, &scenario.CategoryID) + if err != nil { + continue + } + scenarios = append(scenarios, scenario) } - resp := byteframe.NewByteFrame() - resp.WriteUint8(uint8(len(scenarioCounter))) // Entry count - for _, entry := range scenarioCounter { - resp.WriteUint32(entry.MainID) - resp.WriteUint8(entry.Unk1) - resp.WriteUint8(entry.CategoryID) + // Trim excess scenarios + if len(scenarios) > 128 { + scenarios = scenarios[:128] } - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) + bf := byteframe.NewByteFrame() + bf.WriteUint8(uint8(len(scenarios))) + for _, scenario := range scenarios { + bf.WriteUint32(scenario.MainID) + // If item exchange + switch scenario.CategoryID { + case 3, 6, 7: + bf.WriteBool(true) + default: + bf.WriteBool(false) + } + bf.WriteUint8(scenario.CategoryID) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfGetEtcPoints(s *Session, p mhfpacket.MHFPacket) { @@ -1574,138 +983,216 @@ func handleMsgMhfStampcardPrize(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfUnreserveSrg(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfReadBeatLevel(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgMhfReadBeatLevel) - - // This response is fixed and will never change on JP, - // but I've left it dynamic for possible other client differences. - resp := byteframe.NewByteFrame() - for i := 0; i < int(pkt.ValidIDCount); i++ { - resp.WriteUint32(pkt.IDs[i]) - resp.WriteUint32(1) - resp.WriteUint32(1) - resp.WriteUint32(1) - } - - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) -} - -func handleMsgMhfUpdateBeatLevel(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgMhfUpdateBeatLevel) - - doAckBufSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) -} - -func handleMsgMhfReadBeatLevelAllRanking(s *Session, p mhfpacket.MHFPacket) {} - -func handleMsgMhfReadBeatLevelMyRanking(s *Session, p mhfpacket.MHFPacket) {} - -func handleMsgMhfReadLastWeekBeatRanking(s *Session, p mhfpacket.MHFPacket) {} - -func handleMsgMhfGetFixedSeibatuRankingTable(s *Session, p mhfpacket.MHFPacket) {} - func handleMsgMhfKickExportForce(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetEarthStatus) - - // TODO(Andoryuuta): Track down format for this data, - // it can somehow be parsed as 8*uint32 chunks if the header is right. - /* - BEFORE ack-refactor: - resp := byteframe.NewByteFrame() - resp.WriteUint32(0) - resp.WriteUint32(0) - - s.QueueAck(pkt.AckHandle, resp.Data()) - */ - doAckBufSucceed(s, pkt.AckHandle, []byte{}) + bf := byteframe.NewByteFrame() + bf.WriteUint32(uint32(TimeWeekStart().Add(time.Hour * -24).Unix())) // Start + bf.WriteUint32(uint32(TimeWeekNext().Add(time.Hour * 24).Unix())) // End + bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthStatusOverride) + bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthIDOverride) + bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthMonsterOverride) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfRegistSpabiTime(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetEarthValue) - var earthValues []struct{ Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32 } - if pkt.ReqType == 3 { - earthValues = []struct { - Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32 - }{ - // TW identical to JP - { - Unk0: 0x03E9, - Unk1: 0x24, - }, - { - Unk0: 0x2329, - Unk1: 0x03, - }, - { - Unk0: 0x232A, - Unk1: 0x0A, - Unk2: 0x012C, - }, + type EarthValues struct { + Value []uint32 + } + + var earthValues []EarthValues + switch pkt.ReqType { + case 1: + earthValues = []EarthValues{ + {[]uint32{1, 312, 0, 0, 0, 0}}, + {[]uint32{2, 99, 0, 0, 0, 0}}, } - } else if pkt.ReqType == 2 { - earthValues = []struct { - Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32 - }{ - // JP response was empty - { - Unk0: 0x01, - Unk1: 0x168B, - }, - { - Unk0: 0x02, - Unk1: 0x0737, - }, + case 2: + earthValues = []EarthValues{ + {[]uint32{1, 5771, 0, 0, 0, 0}}, + {[]uint32{2, 1847, 0, 0, 0, 0}}, } - } else if pkt.ReqType == 1 { - earthValues = []struct { - Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32 - }{ - // JP simply sent 01 and 02 respectively - { - Unk0: 0x01, - Unk1: 0x0138, - }, - { - Unk0: 0x02, - Unk1: 0x63, - }, + case 3: + earthValues = []EarthValues{ + {[]uint32{1001, 36, 0, 0, 0, 0}}, + {[]uint32{9001, 3, 0, 0, 0, 0}}, + {[]uint32{9002, 10, 300, 0, 0, 0}}, } } - resp := byteframe.NewByteFrame() - resp.WriteUint32(0x0A218EAD) // Unk shared ID. Sent in response of MSG_MHF_GET_TOWER_INFO, MSG_MHF_GET_PAPER_DATA etc. - resp.WriteUint32(0) // Unk - resp.WriteUint32(0) // Unk - resp.WriteUint32(uint32(len(earthValues))) // value count - for _, v := range earthValues { - resp.WriteUint32(v.Unk0) - resp.WriteUint32(v.Unk1) - resp.WriteUint32(v.Unk2) - resp.WriteUint32(v.Unk3) - resp.WriteUint32(v.Unk4) - resp.WriteUint32(v.Unk5) + var data []*byteframe.ByteFrame + for _, i := range earthValues { + bf := byteframe.NewByteFrame() + for _, j := range i.Value { + bf.WriteUint32(j) + } + data = append(data, bf) } - - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) + doAckEarthSucceed(s, pkt.AckHandle, data) } func handleMsgMhfDebugPostValue(s *Session, p mhfpacket.MHFPacket) {} -func handleMsgMhfGetNotice(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfGetRandFromTable(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetRandFromTable) + bf := byteframe.NewByteFrame() + for i := uint16(0); i < pkt.Results; i++ { + bf.WriteUint32(0) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} -func handleMsgMhfPostNotice(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfGetSenyuDailyCount(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetSenyuDailyCount) + bf := byteframe.NewByteFrame() + bf.WriteUint16(0) + bf.WriteUint16(0) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} -func handleMsgMhfGetRandFromTable(s *Session, p mhfpacket.MHFPacket) {} +type SeibattleTimetable struct { + Start time.Time + End time.Time +} -func handleMsgMhfGetSenyuDailyCount(s *Session, p mhfpacket.MHFPacket) {} +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 +} func handleMsgMhfGetSeibattle(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetSeibattle) - stubGetNoResults(s, pkt.AckHandle) + var data []*byteframe.ByteFrame + seibattle := Seibattle{ + Timetable: []SeibattleTimetable{ + {TimeMidnight(), TimeMidnight().Add(time.Hour * 8)}, + {TimeMidnight().Add(time.Hour * 8), TimeMidnight().Add(time.Hour * 16)}, + {TimeMidnight().Add(time.Hour * 16), TimeMidnight().Add(time.Hour * 24)}, + }, + KeyScore: []SeibattleKeyScore{ + {0, 0}, + }, + Career: []SeibattleCareer{ + {0, 0, 0}, + }, + Opponent: []SeibattleOpponent{ + {1, 1}, + }, + ConventionResult: []SeibattleConventionResult{ + {0, 0, 0, 0, 0}, + }, + CharScore: []SeibattleCharScore{ + {0}, + }, + CurResult: []SeibattleCurResult{ + {0, 0, 0, 0}, + }, + } + + switch pkt.Type { + case 1: + for _, timetable := range seibattle.Timetable { + bf := byteframe.NewByteFrame() + bf.WriteUint32(uint32(timetable.Start.Unix())) + bf.WriteUint32(uint32(timetable.End.Unix())) + data = append(data, bf) + } + case 3: // Key score? + for _, keyScore := range seibattle.KeyScore { + bf := byteframe.NewByteFrame() + bf.WriteUint8(keyScore.Unk0) + bf.WriteInt32(keyScore.Unk1) + data = append(data, bf) + } + case 4: // Career? + for _, career := range seibattle.Career { + bf := byteframe.NewByteFrame() + bf.WriteUint16(career.Unk0) + bf.WriteUint16(career.Unk1) + bf.WriteUint16(career.Unk2) + data = append(data, bf) + } + case 5: // Opponent? + for _, opponent := range seibattle.Opponent { + bf := byteframe.NewByteFrame() + bf.WriteInt32(opponent.Unk0) + bf.WriteInt8(opponent.Unk1) + data = append(data, bf) + } + case 6: // Convention result? + for _, conventionResult := range seibattle.ConventionResult { + bf := byteframe.NewByteFrame() + bf.WriteUint32(conventionResult.Unk0) + bf.WriteUint16(conventionResult.Unk1) + bf.WriteUint16(conventionResult.Unk2) + bf.WriteUint16(conventionResult.Unk3) + bf.WriteUint16(conventionResult.Unk4) + data = append(data, bf) + } + case 7: // Char score? + for _, charScore := range seibattle.CharScore { + bf := byteframe.NewByteFrame() + bf.WriteUint32(charScore.Unk0) + data = append(data, bf) + } + case 8: // Cur result? + for _, curResult := range seibattle.CurResult { + bf := byteframe.NewByteFrame() + bf.WriteUint32(curResult.Unk0) + bf.WriteUint16(curResult.Unk1) + bf.WriteUint16(curResult.Unk2) + bf.WriteUint16(curResult.Unk3) + data = append(data, bf) + } + } + doAckEarthSucceed(s, pkt.AckHandle, data) } func handleMsgMhfPostSeibattle(s *Session, p mhfpacket.MHFPacket) {} @@ -1716,61 +1203,49 @@ func handleMsgMhfGetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {} func handleMsgMhfSetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {} +func equipSkinHistSize() int { + size := 3200 + if _config.ErupeConfig.RealClientMode <= _config.Z2 { + size = 2560 + } + if _config.ErupeConfig.RealClientMode <= _config.Z1 { + size = 1280 + } + return size +} + func handleMsgMhfGetEquipSkinHist(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetEquipSkinHist) - // Transmog / reskin system, bitmask of 3200 bytes length - // presumably divided by 5 sections for 5120 armour IDs covered - // +10,000 for actual ID to be unlocked by each bit - // Returning 3200 bytes of FF just unlocks everything for now + size := equipSkinHistSize() var data []byte - err := s.server.db.QueryRow("SELECT COALESCE(skin_hist::bytea, $2::bytea) FROM characters WHERE id = $1", s.charID, make([]byte, 0xC80)).Scan(&data) + err := s.server.db.QueryRow("SELECT COALESCE(skin_hist::bytea, $2::bytea) FROM characters WHERE id = $1", s.charID, make([]byte, size)).Scan(&data) if err != nil { s.logger.Error("Failed to load skin_hist", zap.Error(err)) - data = make([]byte, 3200) + data = make([]byte, size) } doAckBufSucceed(s, pkt.AckHandle, data) } func handleMsgMhfUpdateEquipSkinHist(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfUpdateEquipSkinHist) - // sends a raw armour ID back that needs to be mapped into the persistent bitmask above (-10,000) + size := equipSkinHistSize() var data []byte - err := s.server.db.QueryRow("SELECT COALESCE(skin_hist, $2) FROM characters WHERE id = $1", s.charID, make([]byte, 0xC80)).Scan(&data) + err := s.server.db.QueryRow("SELECT COALESCE(skin_hist, $2) FROM characters WHERE id = $1", s.charID, make([]byte, size)).Scan(&data) if err != nil { - s.logger.Error("Failed to save skin_hist", zap.Error(err)) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + s.logger.Error("Failed to get skin_hist", zap.Error(err)) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) return } - var bit int - var startByte int - switch pkt.MogType { - case 0: // legs - bit = int(pkt.ArmourID) - 10000 - startByte = 0 - case 1: - bit = int(pkt.ArmourID) - 10000 - startByte = 640 - case 2: - bit = int(pkt.ArmourID) - 10000 - startByte = 1280 - case 3: - bit = int(pkt.ArmourID) - 10000 - startByte = 1920 - case 4: - bit = int(pkt.ArmourID) - 10000 - startByte = 2560 - } + bit := int(pkt.ArmourID) - 10000 + startByte := (size / 5) * int(pkt.MogType) // psql set_bit could also work but I couldn't get it working - byteInd := (bit / 8) + byteInd := bit / 8 bitInByte := bit % 8 - data[startByte+byteInd] |= bits.Reverse8((1 << uint(bitInByte))) + data[startByte+byteInd] |= bits.Reverse8(1 << uint(bitInByte)) dumpSaveData(s, data, "skinhist") - _, err = s.server.db.Exec("UPDATE characters SET skin_hist=$1 WHERE id=$2", data, s.charID) - if err != nil { - panic(err) - } - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + s.server.db.Exec("UPDATE characters SET skin_hist=$1 WHERE id=$2", data, s.charID) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } func handleMsgMhfGetUdShopCoin(s *Session, p mhfpacket.MHFPacket) { @@ -1819,20 +1294,45 @@ func handleMsgMhfGetLobbyCrowd(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, make([]byte, 0x320)) } +type TrendWeapon struct { + WeaponType uint8 + WeaponID uint16 +} + func handleMsgMhfGetTrendWeapon(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetTrendWeapon) - // TODO (Fist): Work out actual format limitations, seems to be final upgrade - // for weapons and it traverses its upgrade tree to recommend base as final - // 423C correlates with most popular magnet spike in use on JP - // 2A 00 3C 44 00 3C 76 00 3F EA 01 0F 20 01 0F 50 01 0F F8 02 3C 7E 02 3D - // F3 02 40 2A 03 3D 65 03 3F 2A 03 40 36 04 3D 59 04 41 E7 04 43 3E 05 0A - // ED 05 0F 4C 05 0F F2 06 3A FE 06 41 E8 06 41 FA 07 3B 02 07 3F ED 07 40 - // 24 08 3D 37 08 3F 66 08 41 EC 09 3D 38 09 3F 8A 09 41 EE 0A 0E 78 0A 0F - // AA 0A 0F F9 0B 3E 2E 0B 41 EF 0B 42 FB 0C 41 F0 0C 43 3F 0C 43 EE 0D 41 F1 0D 42 10 0D 42 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 0xA9)) + trendWeapons := [14][3]TrendWeapon{} + for i := uint8(0); i < 14; i++ { + rows, err := s.server.db.Query(`SELECT weapon_id FROM trend_weapons WHERE weapon_type=$1 ORDER BY count DESC LIMIT 3`, i) + if err != nil { + continue + } + j := 0 + for rows.Next() { + trendWeapons[i][j].WeaponType = i + rows.Scan(&trendWeapons[i][j].WeaponID) + j++ + } + } + + x := uint8(0) + bf := byteframe.NewByteFrame() + bf.WriteUint8(0) + for _, weaponType := range trendWeapons { + for _, weapon := range weaponType { + bf.WriteUint8(weapon.WeaponType) + bf.WriteUint16(weapon.WeaponID) + x++ + } + } + bf.Seek(0, 0) + bf.WriteUint8(x) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfUpdateUseTrendWeaponLog(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfUpdateUseTrendWeaponLog) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + s.server.db.Exec(`INSERT INTO trend_weapons (weapon_id, weapon_type, count) VALUES ($1, $2, 1) ON CONFLICT (weapon_id) DO + UPDATE SET count = trend_weapons.count+1`, pkt.WeaponID, pkt.WeaponType) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } diff --git a/server/channelserver/handlers_cafe.go b/server/channelserver/handlers_cafe.go index 46a6425a0..67b7c3807 100644 --- a/server/channelserver/handlers_cafe.go +++ b/server/channelserver/handlers_cafe.go @@ -270,6 +270,12 @@ func handleMsgMhfPostBoostTimeQuestReturn(s *Session, p mhfpacket.MHFPacket) { doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) } -func handleMsgMhfPostBoostTime(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfPostBoostTime(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostBoostTime) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} -func handleMsgMhfPostBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfPostBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostBoostTimeLimit) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} diff --git a/server/channelserver/handlers_campaign.go b/server/channelserver/handlers_campaign.go index 8522adab2..ed8fc7c3e 100644 --- a/server/channelserver/handlers_campaign.go +++ b/server/channelserver/handlers_campaign.go @@ -1,18 +1,176 @@ package channelserver -import "erupe-ce/network/mhfpacket" +import ( + "erupe-ce/common/byteframe" + ps "erupe-ce/common/pascalstring" + "erupe-ce/common/stringsupport" + _config "erupe-ce/config" + "erupe-ce/network/mhfpacket" + "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 +} func handleMsgMhfEnumerateCampaign(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfEnumerateCampaign) - doAckSimpleFail(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + bf := byteframe.NewByteFrame() + + events := []CampaignEvent{} + categories := []CampaignCategory{} + var campaignLinks []CampaignLink + + if len(events) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(events))) + } else { + bf.WriteUint8(uint8(len(events))) + } + for _, event := range events { + bf.WriteUint32(event.ID) + bf.WriteUint32(event.Unk0) + bf.WriteInt16(event.MinHR) + bf.WriteInt16(event.MaxHR) + bf.WriteInt16(event.MinSR) + bf.WriteInt16(event.MaxSR) + if _config.ErupeConfig.RealClientMode >= _config.G3 { + bf.WriteInt16(event.MinGR) + bf.WriteInt16(event.MaxGR) + } + bf.WriteUint16(event.Unk1) + bf.WriteUint8(event.Unk2) + bf.WriteUint8(event.Unk3) + bf.WriteUint16(event.Unk4) + bf.WriteUint16(event.Unk5) + bf.WriteUint32(uint32(event.Start.Unix())) + bf.WriteUint32(uint32(event.End.Unix())) + bf.WriteUint8(event.Unk6) + ps.Uint8(bf, event.String0, true) + ps.Uint8(bf, event.String1, true) + ps.Uint8(bf, event.String2, true) + ps.Uint8(bf, event.String3, true) + ps.Uint8(bf, event.Link, true) + for i := range event.Categories { + campaignLinks = append(campaignLinks, CampaignLink{event.Categories[i], event.ID}) + } + } + + if len(events) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(events))) + } else { + bf.WriteUint8(uint8(len(events))) + } + for _, event := range events { + bf.WriteUint32(event.ID) + bf.WriteUint8(1) // Always 1? + bf.WriteBytes([]byte(event.Prefix)) + } + + if len(categories) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(categories))) + } else { + bf.WriteUint8(uint8(len(categories))) + } + for _, category := range categories { + bf.WriteUint16(category.ID) + bf.WriteUint8(category.Type) + xTitle := stringsupport.UTF8ToSJIS(category.Title) + xDescription := stringsupport.UTF8ToSJIS(category.Description) + bf.WriteUint8(uint8(len(xTitle))) + bf.WriteUint8(uint8(len(xDescription))) + bf.WriteBytes(xTitle) + bf.WriteBytes(xDescription) + } + + if len(campaignLinks) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(campaignLinks))) + } else { + bf.WriteUint8(uint8(len(campaignLinks))) + } + for _, link := range campaignLinks { + bf.WriteUint16(link.CategoryID) + bf.WriteUint32(link.CampaignID) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfStateCampaign(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfStateCampaign) - doAckSimpleFail(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + bf := byteframe.NewByteFrame() + bf.WriteUint16(1) + bf.WriteUint16(0) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfApplyCampaign(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfApplyCampaign) - doAckSimpleFail(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + bf := byteframe.NewByteFrame() + bf.WriteUint32(1) + doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfEnumerateItem(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfEnumerateItem) + items := []struct { + Unk0 uint32 + Unk1 uint16 + Unk2 uint16 + Unk3 uint16 + Unk4 uint32 + Unk5 uint32 + }{} + bf := byteframe.NewByteFrame() + bf.WriteUint16(uint16(len(items))) + for _, item := range items { + bf.WriteUint32(item.Unk0) + bf.WriteUint16(item.Unk1) + bf.WriteUint16(item.Unk2) + bf.WriteUint16(item.Unk3) + bf.WriteUint32(item.Unk4) + bf.WriteUint32(item.Unk5) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfAcquireItem(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfAcquireItem) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } diff --git a/server/channelserver/handlers_caravan.go b/server/channelserver/handlers_caravan.go index 86cf73249..c90f44812 100644 --- a/server/channelserver/handlers_caravan.go +++ b/server/channelserver/handlers_caravan.go @@ -1,21 +1,73 @@ package channelserver import ( - "encoding/hex" + "erupe-ce/common/byteframe" + "erupe-ce/common/stringsupport" "erupe-ce/network/mhfpacket" + "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 +} + func handleMsgMhfGetRyoudama(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetRyoudama) - // likely guild related - // REQ: 00 04 13 53 8F 18 00 - // RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 01 00 01 FE 4E - // REQ: 00 06 13 53 8F 18 00 - // RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 - // REQ: 00 05 13 53 8F 18 00 - // RSP: 0A 21 8E AD 00 00 00 00 00 00 00 00 00 00 00 0E 2A 15 9E CC 00 00 00 01 82 79 83 4E 83 8A 81 5B 83 69 00 00 00 00 1E 55 B0 2F 00 00 00 01 8D F7 00 00 00 00 00 00 00 00 00 00 00 00 2A 15 9E CC 00 00 00 02 82 79 83 4E 83 8A 81 5B 83 69 00 00 00 00 03 D5 30 56 00 00 00 02 95 BD 91 F2 97 42 00 00 00 00 00 00 00 00 3F 57 76 9F 00 00 00 03 93 56 92 6E 96 B3 97 70 00 00 00 00 00 00 38 D9 0E C4 00 00 00 03 87 64 83 78 83 42 00 00 00 00 00 00 00 00 23 F3 B9 77 00 00 00 04 82 B3 82 CC 82 DC 82 E9 81 99 00 00 00 00 3F 1B 17 9C 00 00 00 04 82 B1 82 A4 82 BD 00 00 00 00 00 00 00 00 00 B9 F9 C0 00 00 00 05 82 CD 82 E9 82 A9 00 00 00 00 00 00 00 00 23 9F 9A EA 00 00 00 05 83 70 83 62 83 4C 83 83 83 49 00 00 00 00 38 D9 0E C4 00 00 00 06 87 64 83 78 83 42 00 00 00 00 00 00 00 00 1E 55 B0 2F 00 00 00 06 8D F7 00 00 00 00 00 00 00 00 00 00 00 00 03 D5 30 56 00 00 00 07 95 BD 91 F2 97 42 00 00 00 00 00 00 00 00 02 D3 B8 77 00 00 00 07 6F 77 6C 32 35 32 35 00 00 00 00 00 00 00 - data, _ := hex.DecodeString("0A218EAD0000000000000000000000010000000000000000") - doAckBufSucceed(s, pkt.AckHandle, data) + var data []*byteframe.ByteFrame + ryoudama := Ryoudama{Score: []int32{0}} + switch pkt.Request2 { + case 4: + for _, score := range ryoudama.Score { + bf := byteframe.NewByteFrame() + bf.WriteInt32(score) + data = append(data, bf) + } + case 5: + for _, info := range ryoudama.CharInfo { + bf := byteframe.NewByteFrame() + bf.WriteUint32(info.CID) + bf.WriteInt32(info.Unk0) + bf.WriteBytes(stringsupport.PaddedString(info.Name, 14, true)) + data = append(data, bf) + } + case 6: + for _, info := range ryoudama.BoostInfo { + bf := byteframe.NewByteFrame() + bf.WriteUint32(uint32(info.Start.Unix())) + bf.WriteUint32(uint32(info.End.Unix())) + data = append(data, bf) + } + } + doAckEarthSucceed(s, pkt.AckHandle, data) } func handleMsgMhfPostRyoudama(s *Session, p mhfpacket.MHFPacket) {} @@ -31,8 +83,41 @@ func handleMsgMhfPostTinyBin(s *Session, p mhfpacket.MHFPacket) { doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } -func handleMsgMhfCaravanMyScore(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfCaravanMyScore(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfCaravanMyScore) + var data []*byteframe.ByteFrame + /* + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + */ + doAckEarthSucceed(s, pkt.AckHandle, data) +} -func handleMsgMhfCaravanRanking(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfCaravanRanking(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfCaravanRanking) + var data []*byteframe.ByteFrame + /* RYOUDAN + bf.WriteInt32(1) + bf.WriteUint32(2) + bf.WriteBytes(stringsupport.PaddedString("Test", 26, true)) + */ -func handleMsgMhfCaravanMyRank(s *Session, p mhfpacket.MHFPacket) {} + /* PERSONAL + bf.WriteInt32(1) + bf.WriteBytes(stringsupport.PaddedString("Test", 14, true)) + */ + doAckEarthSucceed(s, pkt.AckHandle, data) +} + +func handleMsgMhfCaravanMyRank(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfCaravanMyRank) + var data []*byteframe.ByteFrame + /* + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + */ + doAckEarthSucceed(s, pkt.AckHandle, data) +} diff --git a/server/channelserver/handlers_cast_binary.go b/server/channelserver/handlers_cast_binary.go index 7c961b5e9..30a377b82 100644 --- a/server/channelserver/handlers_cast_binary.go +++ b/server/channelserver/handlers_cast_binary.go @@ -11,6 +11,7 @@ import ( "fmt" "golang.org/x/exp/slices" "math" + "strconv" "strings" "time" @@ -35,16 +36,16 @@ const ( BroadcastTypeWorld = 0x0a ) -var commands map[string]config.Command +var commands map[string]_config.Command func init() { - commands = make(map[string]config.Command) + commands = make(map[string]_config.Command) zapConfig := zap.NewDevelopmentConfig() zapConfig.DisableCaller = true zapLogger, _ := zapConfig.Build() defer zapLogger.Sync() logger := zapLogger.Named("commands") - cmds := config.ErupeConfig.Commands + cmds := _config.ErupeConfig.Commands for _, cmd := range cmds { commands[cmd.Name] = cmd if cmd.Enabled { @@ -55,7 +56,7 @@ func init() { } } -func sendDisabledCommandMessage(s *Session, cmd config.Command) { +func sendDisabledCommandMessage(s *Session, cmd _config.Command) { sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandDisabled"], cmd.Name)) } @@ -82,23 +83,28 @@ func sendServerChatMessage(s *Session, message string) { } func parseChatCommand(s *Session, command string) { - if strings.HasPrefix(command, commands["PSN"].Prefix) { + args := strings.Split(command[1:], " ") + switch args[0] { + case commands["PSN"].Prefix: if commands["PSN"].Enabled { - var id string - n, err := fmt.Sscanf(command, fmt.Sprintf("%s %%s", commands["PSN"].Prefix), &id) - if err != nil || n != 1 { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandPSNError"], commands["PSN"].Prefix)) - } else { - _, err = s.server.db.Exec(`UPDATE users u SET psn_id=$1 WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$2)`, id, s.charID) - if err == nil { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandPSNSuccess"], id)) + if len(args) > 1 { + var exists int + s.server.db.QueryRow(`SELECT count(*) FROM users WHERE psn_id = $1`, args[1]).Scan(&exists) + if exists == 0 { + _, err := s.server.db.Exec(`UPDATE users u SET psn_id=$1 WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$2)`, args[1], s.charID) + if err == nil { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandPSNSuccess"], args[1])) + } + } else { + sendServerChatMessage(s, s.server.dict["commandPSNExists"]) } + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandPSNError"], commands["PSN"].Prefix)) } + } else { + sendDisabledCommandMessage(s, commands["PSN"]) } - } - - if strings.HasPrefix(command, commands["Reload"].Prefix) { - // Flush all objects and users and reload + case commands["Reload"].Prefix: if commands["Reload"].Enabled { sendServerChatMessage(s, s.server.dict["commandReload"]) var temp mhfpacket.MHFPacket @@ -159,64 +165,53 @@ func parseChatCommand(s *Session, command string) { } else { sendDisabledCommandMessage(s, commands["Reload"]) } - } - - if strings.HasPrefix(command, commands["KeyQuest"].Prefix) { + case commands["KeyQuest"].Prefix: if commands["KeyQuest"].Enabled { - if strings.HasPrefix(command, fmt.Sprintf("%s get", commands["KeyQuest"].Prefix)) { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfGet"], s.kqf)) - } else if strings.HasPrefix(command, fmt.Sprintf("%s set", commands["KeyQuest"].Prefix)) { - var hexs string - n, numerr := fmt.Sscanf(command, fmt.Sprintf("%s set %%s", commands["KeyQuest"].Prefix), &hexs) - if numerr != nil || n != 1 || len(hexs) != 16 { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfSetError"], commands["KeyQuest"].Prefix)) - } else { - hexd, _ := hex.DecodeString(hexs) - s.kqf = hexd - s.kqfOverride = true - sendServerChatMessage(s, s.server.dict["commandKqfSetSuccess"]) + if len(args) > 1 { + if args[1] == "get" { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfGet"], s.kqf)) + } else if args[1] == "set" { + if len(args) > 2 && len(args[2]) == 16 { + hexd, _ := hex.DecodeString(args[2]) + s.kqf = hexd + s.kqfOverride = true + sendServerChatMessage(s, s.server.dict["commandKqfSetSuccess"]) + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfSetError"], commands["KeyQuest"].Prefix)) + } } } } else { sendDisabledCommandMessage(s, commands["KeyQuest"]) } - } - - if strings.HasPrefix(command, commands["Rights"].Prefix) { - // Set account rights + case commands["Rights"].Prefix: if commands["Rights"].Enabled { - var v uint32 - n, err := fmt.Sscanf(command, fmt.Sprintf("%s %%d", commands["Rights"].Prefix), &v) - if err != nil || n != 1 { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRightsError"], commands["Rights"].Prefix)) - } else { - _, err = s.server.db.Exec("UPDATE users u SET rights=$1 WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$2)", v, s.charID) + if len(args) > 1 { + v, _ := strconv.Atoi(args[1]) + _, err := s.server.db.Exec("UPDATE users u SET rights=$1 WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$2)", v, s.charID) if err == nil { sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRightsSuccess"], v)) + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRightsError"], commands["Rights"].Prefix)) } + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRightsError"], commands["Rights"].Prefix)) } } else { sendDisabledCommandMessage(s, commands["Rights"]) } - } - - if strings.HasPrefix(command, commands["Course"].Prefix) { + case commands["Course"].Prefix: if commands["Course"].Enabled { - var name string - n, err := fmt.Sscanf(command, fmt.Sprintf("%s %%s", commands["Course"].Prefix), &name) - if err != nil || n != 1 { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandCourseError"], commands["Course"].Prefix)) - } else { - name = strings.ToLower(name) + if len(args) > 1 { for _, course := range mhfcourse.Courses() { for _, alias := range course.Aliases() { - if strings.ToLower(name) == strings.ToLower(alias) { - if slices.Contains(s.server.erupeConfig.Courses, config.Course{Name: course.Aliases()[0], Enabled: true}) { + if strings.ToLower(args[1]) == strings.ToLower(alias) { + if slices.Contains(s.server.erupeConfig.Courses, _config.Course{Name: course.Aliases()[0], Enabled: true}) { var delta, rightsInt uint32 if mhfcourse.CourseExists(course.ID, s.courses) { ei := slices.IndexFunc(s.courses, func(c mhfcourse.Course) bool { for _, alias := range c.Aliases() { - if strings.ToLower(name) == strings.ToLower(alias) { + if strings.ToLower(args[1]) == strings.ToLower(alias) { return true } } @@ -230,7 +225,7 @@ func parseChatCommand(s *Session, command string) { delta = uint32(math.Pow(2, float64(course.ID))) sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandCourseEnabled"], course.Aliases()[0])) } - err = s.server.db.QueryRow("SELECT rights FROM users u INNER JOIN characters c ON u.id = c.user_id WHERE c.id = $1", s.charID).Scan(&rightsInt) + err := s.server.db.QueryRow("SELECT rights FROM users u INNER JOIN characters c ON u.id = c.user_id WHERE c.id = $1", s.charID).Scan(&rightsInt) if err == nil { s.server.db.Exec("UPDATE users u SET rights=$1 WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$2)", rightsInt+delta, s.charID) } @@ -242,82 +237,82 @@ func parseChatCommand(s *Session, command string) { } } } + } else { sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandCourseError"], commands["Course"].Prefix)) } } else { sendDisabledCommandMessage(s, commands["Course"]) } - } - - if strings.HasPrefix(command, commands["Raviente"].Prefix) { + case commands["Raviente"].Prefix: if commands["Raviente"].Enabled { - if getRaviSemaphore(s.server) != nil { - s.server.raviente.Lock() - if !strings.HasPrefix(command, "!ravi ") { - sendServerChatMessage(s, s.server.dict["commandRaviNoCommand"]) - } else { - if strings.HasPrefix(command, "!ravi start") { - if s.server.raviente.register.startTime == 0 { - s.server.raviente.register.startTime = s.server.raviente.register.postTime + if len(args) > 1 { + if s.server.getRaviSemaphore() != nil { + switch args[1] { + case "start": + if s.server.raviente.register[1] == 0 { + s.server.raviente.register[1] = s.server.raviente.register[3] sendServerChatMessage(s, s.server.dict["commandRaviStartSuccess"]) s.notifyRavi() } else { sendServerChatMessage(s, s.server.dict["commandRaviStartError"]) } - } else if strings.HasPrefix(command, "!ravi cm") || strings.HasPrefix(command, "!ravi checkmultiplier") { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRaviMultiplier"], s.server.raviente.GetRaviMultiplier(s.server))) - } else if strings.HasPrefix(command, "!ravi sr") || strings.HasPrefix(command, "!ravi sendres") { - if s.server.raviente.state.stateData[28] > 0 { - sendServerChatMessage(s, s.server.dict["commandRaviResSuccess"]) - s.server.raviente.state.stateData[28] = 0 + case "cm", "check", "checkmultiplier", "multiplier": + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandRaviMultiplier"], s.server.GetRaviMultiplier())) + case "sr", "sendres", "resurrection", "ss", "sendsed", "rs", "reqsed": + if s.server.erupeConfig.RealClientMode == _config.ZZ { + switch args[1] { + case "sr", "sendres", "resurrection": + if s.server.raviente.state[28] > 0 { + sendServerChatMessage(s, s.server.dict["commandRaviResSuccess"]) + s.server.raviente.state[28] = 0 + } else { + sendServerChatMessage(s, s.server.dict["commandRaviResError"]) + } + case "ss", "sendsed": + sendServerChatMessage(s, s.server.dict["commandRaviSedSuccess"]) + // Total BerRavi HP + HP := s.server.raviente.state[0] + s.server.raviente.state[1] + s.server.raviente.state[2] + s.server.raviente.state[3] + s.server.raviente.state[4] + s.server.raviente.support[1] = HP + case "rs", "reqsed": + sendServerChatMessage(s, s.server.dict["commandRaviRequest"]) + // Total BerRavi HP + HP := s.server.raviente.state[0] + s.server.raviente.state[1] + s.server.raviente.state[2] + s.server.raviente.state[3] + s.server.raviente.state[4] + s.server.raviente.support[1] = HP + 1 + } } else { - sendServerChatMessage(s, s.server.dict["commandRaviResError"]) + sendServerChatMessage(s, s.server.dict["commandRaviVersion"]) } - } else if strings.HasPrefix(command, "!ravi ss") || strings.HasPrefix(command, "!ravi sendsed") { - sendServerChatMessage(s, s.server.dict["commandRaviSedSuccess"]) - // Total BerRavi HP - HP := s.server.raviente.state.stateData[0] + s.server.raviente.state.stateData[1] + s.server.raviente.state.stateData[2] + s.server.raviente.state.stateData[3] + s.server.raviente.state.stateData[4] - s.server.raviente.support.supportData[1] = HP - } else if strings.HasPrefix(command, "!ravi rs") || strings.HasPrefix(command, "!ravi reqsed") { - sendServerChatMessage(s, s.server.dict["commandRaviRequest"]) - // Total BerRavi HP - HP := s.server.raviente.state.stateData[0] + s.server.raviente.state.stateData[1] + s.server.raviente.state.stateData[2] + s.server.raviente.state.stateData[3] + s.server.raviente.state.stateData[4] - s.server.raviente.support.supportData[1] = HP + 12 - } else { + default: sendServerChatMessage(s, s.server.dict["commandRaviError"]) } + } else { + sendServerChatMessage(s, s.server.dict["commandRaviNoPlayers"]) } - s.server.raviente.Unlock() } else { - sendServerChatMessage(s, s.server.dict["commandRaviNoPlayers"]) + sendServerChatMessage(s, s.server.dict["commandRaviError"]) } } else { sendDisabledCommandMessage(s, commands["Raviente"]) } - } - - if strings.HasPrefix(command, commands["Teleport"].Prefix) { + case commands["Teleport"].Prefix: if commands["Teleport"].Enabled { - var x, y int16 - n, err := fmt.Sscanf(command, fmt.Sprintf("%s %%d %%d", commands["Teleport"].Prefix), &x, &y) - if err != nil || n != 2 { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandTeleportError"], commands["Teleport"].Prefix)) - } else { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandTeleportSuccess"], x, y)) - - // Make the inside of the casted binary + if len(args) > 2 { + x, _ := strconv.Atoi(args[1]) + y, _ := strconv.Atoi(args[2]) payload := byteframe.NewByteFrame() payload.SetLE() - payload.WriteUint8(2) // SetState type(position == 2) - payload.WriteInt16(x) // X - payload.WriteInt16(y) // Y + payload.WriteUint8(2) // SetState type(position == 2) + payload.WriteInt16(int16(x)) // X + payload.WriteInt16(int16(y)) // Y payloadBytes := payload.Data() - s.QueueSendMHF(&mhfpacket.MsgSysCastedBinary{ CharID: s.charID, MessageType: BinaryMessageTypeState, RawDataPayload: payloadBytes, }) + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandTeleportSuccess"], x, y)) + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandTeleportError"], commands["Teleport"].Prefix)) } } else { sendDisabledCommandMessage(s, commands["Teleport"]) @@ -425,8 +420,9 @@ func handleMsgSysCastBinary(s *Session, p mhfpacket.MHFPacket) { } case BroadcastTypeServer: if pkt.MessageType == 1 { - if getRaviSemaphore(s.server) != nil { - s.server.BroadcastMHF(resp, s) + raviSema := s.server.getRaviSemaphore() + if raviSema != nil { + raviSema.BroadcastMHF(resp, s) } } else { s.server.BroadcastMHF(resp, s) diff --git a/server/channelserver/handlers_character.go b/server/channelserver/handlers_character.go index 165580fe7..4c5802293 100644 --- a/server/channelserver/handlers_character.go +++ b/server/channelserver/handlers_character.go @@ -5,33 +5,37 @@ import ( "errors" "erupe-ce/common/bfutil" "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "erupe-ce/network/mhfpacket" "erupe-ce/server/channelserver/compression/nullcomp" "go.uber.org/zap" ) +type SavePointer int + const ( - pointerGender = 0x51 // +1 - pointerRP = 0x22D16 // +2 - pointerHouseTier = 0x1FB6C // +5 - pointerHouseData = 0x1FE01 // +195 - pointerBookshelfData = 0x22298 // +5576 - // Gallery data also exists at 0x21578, is this the contest submission? - pointerGalleryData = 0x22320 // +1748 - pointerToreData = 0x1FCB4 // +240 - pointerGardenData = 0x22C58 // +68 - pointerWeaponType = 0x1F715 // +1 - pointerWeaponID = 0x1F60A // +2 - pointerHRP = 0x1FDF6 // +2 - pointerGRP = 0x1FDFC // +4 - pointerKQF = 0x23D20 // +8 + pGender = iota // +1 + pRP // +2 + pHouseTier // +5 + pHouseData // +195 + pBookshelfData // +lBookshelfData + pGalleryData // +1748 + pToreData // +240 + pGardenData // +68 + pWeaponType // +1 + pWeaponID // +2 + pHRP // +2 + pGRP // +4 + pKQF // +8 + lBookshelfData ) type CharacterSaveData struct { CharID uint32 Name string IsNewCharacter bool + Pointers map[SavePointer]int Gender bool RP uint16 @@ -51,6 +55,55 @@ type CharacterSaveData struct { decompSave []byte } +func getPointers() map[SavePointer]int { + pointers := map[SavePointer]int{pGender: 81, lBookshelfData: 5576} + switch _config.ErupeConfig.RealClientMode { + case _config.ZZ: + pointers[pWeaponID] = 128522 + pointers[pWeaponType] = 128789 + pointers[pHouseTier] = 129900 + pointers[pToreData] = 130228 + pointers[pHRP] = 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: + pointers[pWeaponID] = 92522 + pointers[pWeaponType] = 92789 + pointers[pHouseTier] = 93900 + pointers[pToreData] = 94228 + pointers[pHRP] = 94550 + pointers[pGRP] = 94556 + pointers[pHouseData] = 94561 + pointers[pBookshelfData] = 103928 + 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[pHRP] = 62550 + pointers[pHouseData] = 62561 + pointers[pBookshelfData] = 57118 // This pointer only half works + pointers[pGalleryData] = 72064 + pointers[pGardenData] = 74424 + pointers[pRP] = 74614 + } + if _config.ErupeConfig.RealClientMode == _config.G5 { + pointers[lBookshelfData] = 5548 + } else if _config.ErupeConfig.RealClientMode <= _config.GG { + pointers[lBookshelfData] = 4520 + } + return pointers +} + func GetCharacterSaveData(s *Session, charID uint32) (*CharacterSaveData, error) { result, err := s.server.db.Query("SELECT id, savedata, is_new_character, name FROM characters WHERE id = $1", charID) if err != nil { @@ -64,7 +117,9 @@ func GetCharacterSaveData(s *Session, charID uint32) (*CharacterSaveData, error) return nil, err } - saveData := &CharacterSaveData{} + saveData := &CharacterSaveData{ + Pointers: getPointers(), + } err = result.Scan(&saveData.CharID, &saveData.compSave, &saveData.IsNewCharacter, &saveData.Name) if err != nil { s.logger.Error("Failed to scan savedata", zap.Error(err), zap.Uint32("charID", charID)) @@ -95,13 +150,18 @@ func (save *CharacterSaveData) Save(s *Session) { save.updateSaveDataWithStruct() - err := save.Compress() - if err != nil { - s.logger.Error("Failed to compress savedata", zap.Error(err)) - return + if _config.ErupeConfig.RealClientMode >= _config.G1 { + err := save.Compress() + if err != nil { + s.logger.Error("Failed to compress savedata", zap.Error(err)) + return + } + } else { + // Saves were not compressed + save.compSave = save.decompSave } - _, err = s.server.db.Exec(`UPDATE characters SET savedata=$1, is_new_character=false, hrp=$2, gr=$3, is_female=$4, weapon_type=$5, weapon_id=$6 WHERE id=$7 + _, err := s.server.db.Exec(`UPDATE characters SET savedata=$1, is_new_character=false, hrp=$2, gr=$3, is_female=$4, weapon_type=$5, weapon_id=$6 WHERE id=$7 `, save.compSave, save.HRP, save.GR, save.Gender, save.WeaponType, save.WeaponID, save.CharID) if err != nil { s.logger.Error("Failed to update savedata", zap.Error(err), zap.Uint32("charID", save.CharID)) @@ -133,38 +193,47 @@ func (save *CharacterSaveData) Decompress() error { func (save *CharacterSaveData) updateSaveDataWithStruct() { rpBytes := make([]byte, 2) binary.LittleEndian.PutUint16(rpBytes, save.RP) - copy(save.decompSave[pointerRP:pointerRP+2], rpBytes) - copy(save.decompSave[pointerKQF:pointerKQF+8], save.KQF) + if _config.ErupeConfig.RealClientMode >= _config.G10 { + copy(save.decompSave[save.Pointers[pRP]:save.Pointers[pRP]+2], rpBytes) + copy(save.decompSave[save.Pointers[pKQF]:save.Pointers[pKQF]+8], save.KQF) + } else if _config.ErupeConfig.RealClientMode == _config.F5 || _config.ErupeConfig.RealClientMode == _config.F4 { + copy(save.decompSave[save.Pointers[pRP]:save.Pointers[pRP]+2], rpBytes) + } } // 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[pointerGender] == 1 { + if save.decompSave[save.Pointers[pGender]] == 1 { save.Gender = true } else { save.Gender = false } if !save.IsNewCharacter { - save.RP = binary.LittleEndian.Uint16(save.decompSave[pointerRP : pointerRP+2]) - save.HouseTier = save.decompSave[pointerHouseTier : pointerHouseTier+5] - save.HouseData = save.decompSave[pointerHouseData : pointerHouseData+195] - save.BookshelfData = save.decompSave[pointerBookshelfData : pointerBookshelfData+5576] - save.GalleryData = save.decompSave[pointerGalleryData : pointerGalleryData+1748] - save.ToreData = save.decompSave[pointerToreData : pointerToreData+240] - save.GardenData = save.decompSave[pointerGardenData : pointerGardenData+68] - save.WeaponType = save.decompSave[pointerWeaponType] - save.WeaponID = binary.LittleEndian.Uint16(save.decompSave[pointerWeaponID : pointerWeaponID+2]) - save.HRP = binary.LittleEndian.Uint16(save.decompSave[pointerHRP : pointerHRP+2]) - if save.HRP == uint16(999) { - save.GR = grpToGR(binary.LittleEndian.Uint32(save.decompSave[pointerGRP : pointerGRP+4])) + if (_config.ErupeConfig.RealClientMode >= _config.F4 && _config.ErupeConfig.RealClientMode <= _config.F5) || _config.ErupeConfig.RealClientMode >= _config.G10 { + 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.HRP = binary.LittleEndian.Uint16(save.decompSave[save.Pointers[pHRP] : save.Pointers[pHRP]+2]) + } + + if _config.ErupeConfig.RealClientMode >= _config.G10 { + save.KQF = save.decompSave[save.Pointers[pKQF] : save.Pointers[pKQF]+8] + if save.HRP == uint16(999) { + save.GR = grpToGR(binary.LittleEndian.Uint32(save.decompSave[save.Pointers[pGRP] : save.Pointers[pGRP]+4])) + } } - save.KQF = save.decompSave[pointerKQF : pointerKQF+8] } return } func handleMsgMhfSexChanger(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfSexChanger) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } diff --git a/server/channelserver/handlers_data.go b/server/channelserver/handlers_data.go index 64b14072c..81102b42d 100644 --- a/server/channelserver/handlers_data.go +++ b/server/channelserver/handlers_data.go @@ -1,12 +1,13 @@ package channelserver import ( - "encoding/hex" "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "fmt" "io" "os" "path/filepath" + "time" "erupe-ce/common/byteframe" "erupe-ce/network/mhfpacket" @@ -54,7 +55,7 @@ func handleMsgMhfSavedata(s *Session, p mhfpacket.MHFPacket) { s.Name = characterSaveData.Name } - if characterSaveData.Name == s.Name { + if characterSaveData.Name == s.Name || _config.ErupeConfig.RealClientMode <= _config.S10 { characterSaveData.Save(s) s.logger.Info("Wrote recompressed savedata back to DB.") } else { @@ -239,19 +240,19 @@ func dumpSaveData(s *Session, data []byte, suffix string) { _, err := os.Stat(dir) if err != nil { if os.IsNotExist(err) { - err = os.Mkdir(dir, os.ModePerm) + err = os.MkdirAll(dir, os.ModePerm) if err != nil { - s.logger.Warn("Error dumping savedata, could not create folder") + s.logger.Error("Error dumping savedata, could not create folder") return } } else { - s.logger.Warn("Error dumping savedata") + s.logger.Error("Error dumping savedata") return } } err = os.WriteFile(path, data, 0644) if err != nil { - s.logger.Warn("Error dumping savedata, could not write file", zap.Error(err)) + s.logger.Error("Error dumping savedata, could not write file", zap.Error(err)) } } } @@ -310,43 +311,1373 @@ func handleMsgMhfLoadScenarioData(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } +var paperGiftData = map[uint32][]PaperGift{ + 6001: { + {11159, 1, 1, 5000}, + {11160, 1, 1, 3350}, + {11161, 1, 1, 1500}, + {11162, 1, 1, 100}, + {11163, 1, 1, 50}, + }, + 6002: { + {11159, 2, 1, 1800}, + {11160, 2, 1, 1200}, + {11161, 2, 1, 500}, + {11162, 1, 1, 50}, + {11037, 1, 1, 150}, + {11038, 1, 1, 150}, + {11044, 1, 1, 150}, + {11057, 1, 1, 150}, + {11059, 1, 1, 150}, + {11079, 1, 1, 150}, + {11098, 1, 1, 150}, + {11104, 1, 1, 150}, + {11117, 1, 1, 150}, + {11128, 1, 1, 150}, + {11133, 1, 1, 150}, + {11137, 1, 1, 150}, + {11143, 1, 1, 150}, + {11132, 1, 1, 150}, + {11039, 1, 1, 150}, + {11040, 1, 1, 150}, + {11049, 1, 1, 150}, + {11061, 1, 1, 150}, + {11063, 1, 1, 150}, + {11077, 1, 1, 150}, + {11099, 1, 1, 150}, + {11105, 1, 1, 150}, + {11129, 1, 1, 150}, + {11130, 1, 1, 150}, + {11131, 1, 1, 150}, + {11139, 1, 1, 150}, + {11145, 1, 1, 150}, + {11096, 1, 1, 150}, + {11041, 1, 1, 150}, + {11047, 1, 1, 150}, + {11054, 1, 1, 150}, + {11065, 1, 1, 150}, + {11068, 1, 1, 150}, + {11075, 1, 1, 150}, + {11100, 1, 1, 150}, + {11106, 1, 1, 150}, + {11119, 1, 1, 150}, + {11135, 1, 1, 150}, + {11136, 1, 1, 150}, + {11138, 1, 1, 150}, + {11088, 1, 1, 150}, + {10370, 1, 1, 150}, + {10368, 1, 1, 150}, + }, + 6010: { + {11159, 1, 1, 3700}, + {11160, 1, 1, 2900}, + {11161, 1, 1, 1300}, + {11453, 1, 1, 250}, + {11454, 1, 1, 250}, + {12055, 1, 1, 250}, + {12065, 1, 1, 250}, + {12058, 1, 1, 250}, + {12068, 1, 1, 250}, + {11774, 1, 1, 200}, + {11773, 1, 1, 400}, + }, + 6011: { + {11159, 1, 1, 3700}, + {11160, 1, 1, 2900}, + {11161, 1, 1, 1300}, + {11453, 1, 1, 250}, + {11454, 1, 1, 250}, + {12055, 1, 1, 250}, + {12065, 1, 1, 250}, + {12058, 1, 1, 250}, + {12068, 1, 1, 250}, + {11774, 1, 1, 200}, + {11773, 1, 1, 400}, + }, + 6012: { + {11159, 2, 1, 3500}, + {11160, 2, 1, 2900}, + {11161, 2, 1, 1300}, + {12508, 1, 1, 400}, + {11453, 1, 1, 200}, + {11454, 1, 1, 200}, + {12055, 1, 1, 200}, + {12065, 1, 1, 200}, + {12058, 1, 1, 200}, + {12068, 1, 1, 200}, + {11775, 1, 1, 400}, + {11776, 1, 1, 200}, + {11777, 1, 1, 100}, + }, + 7001: { + {11037, 1, 1, 290}, + {11038, 1, 1, 270}, + {11044, 1, 1, 270}, + {11057, 1, 1, 290}, + {11059, 1, 1, 290}, + {11079, 1, 1, 290}, + {11098, 1, 1, 280}, + {11104, 1, 1, 300}, + {11117, 1, 1, 280}, + {11128, 1, 1, 290}, + {11133, 1, 1, 290}, + {11137, 1, 1, 300}, + {11143, 1, 1, 290}, + {11132, 1, 1, 270}, + {11042, 1, 1, 47}, + {11045, 1, 1, 47}, + {11064, 1, 1, 47}, + {11062, 1, 1, 47}, + {11070, 1, 1, 48}, + {11101, 1, 1, 47}, + {11108, 1, 1, 47}, + {11109, 1, 1, 47}, + {11120, 1, 1, 47}, + {11122, 1, 1, 47}, + {11134, 1, 1, 47}, + {11141, 1, 1, 47}, + {11084, 1, 1, 47}, + {11087, 1, 1, 47}, + {11094, 1, 1, 47}, + {10374, 1, 1, 47}, + {10375, 1, 1, 47}, + {11051, 1, 1, 17}, + {11071, 1, 1, 16}, + {11076, 1, 1, 16}, + {11102, 1, 1, 17}, + {11124, 1, 1, 17}, + {11090, 1, 1, 17}, + {11159, 1, 1, 1200}, + {11159, 2, 1, 650}, + {11160, 1, 1, 800}, + {11160, 2, 1, 300}, + {11161, 1, 1, 100}, + {11161, 2, 1, 50}, + {11164, 1, 1, 100}, + {11162, 1, 1, 100}, + {11163, 1, 1, 100}, + {11158, 1, 1, 300}, + {11463, 1, 1, 300}, + {11356, 1, 1, 300}, + {11464, 1, 1, 300}, + {11357, 1, 1, 500}, + {11039, 1, 2, 300}, + {11040, 1, 2, 270}, + {11049, 1, 2, 300}, + {11061, 1, 2, 290}, + {11063, 1, 2, 290}, + {11077, 1, 2, 290}, + {11099, 1, 2, 280}, + {11105, 1, 2, 300}, + {11129, 1, 2, 250}, + {11130, 1, 2, 300}, + {11131, 1, 2, 280}, + {11139, 1, 2, 290}, + {11145, 1, 2, 260}, + {11096, 1, 2, 300}, + {11046, 1, 2, 47}, + {11066, 1, 2, 47}, + {11067, 1, 2, 47}, + {11072, 1, 2, 47}, + {11082, 1, 2, 47}, + {11103, 1, 2, 47}, + {11110, 1, 2, 47}, + {11112, 1, 2, 47}, + {11114, 1, 2, 47}, + {11115, 1, 2, 47}, + {11121, 1, 2, 47}, + {11144, 1, 2, 48}, + {11085, 1, 2, 47}, + {11089, 1, 2, 47}, + {11091, 1, 2, 47}, + {10376, 1, 2, 47}, + {10377, 1, 2, 47}, + {11127, 1, 2, 17}, + {11069, 1, 2, 17}, + {11142, 1, 2, 17}, + {11078, 1, 2, 17}, + {11056, 1, 2, 16}, + {11092, 1, 2, 16}, + {11159, 1, 2, 1200}, + {11159, 2, 2, 650}, + {11160, 1, 2, 800}, + {11160, 2, 2, 300}, + {11161, 1, 2, 100}, + {11161, 2, 2, 50}, + {11164, 1, 2, 100}, + {11162, 1, 2, 100}, + {11163, 1, 2, 100}, + {11158, 1, 2, 300}, + {11463, 1, 2, 300}, + {11356, 1, 2, 300}, + {11464, 1, 2, 300}, + {11357, 1, 2, 500}, + {11041, 1, 3, 266}, + {11047, 1, 3, 266}, + {11054, 1, 3, 266}, + {11065, 1, 3, 266}, + {11068, 1, 3, 266}, + {11075, 1, 3, 266}, + {11100, 1, 3, 266}, + {11106, 1, 3, 266}, + {11119, 1, 3, 266}, + {11135, 1, 3, 268}, + {11136, 1, 3, 268}, + {11138, 1, 3, 268}, + {11088, 1, 3, 268}, + {10370, 1, 3, 266}, + {10368, 1, 3, 268}, + {11043, 1, 3, 50}, + {11048, 1, 3, 50}, + {11050, 1, 3, 50}, + {11058, 1, 3, 50}, + {11060, 1, 3, 50}, + {11074, 1, 3, 50}, + {11107, 1, 3, 50}, + {11111, 1, 3, 50}, + {11113, 1, 3, 50}, + {11118, 1, 3, 50}, + {11126, 1, 3, 50}, + {11140, 1, 3, 50}, + {11086, 1, 3, 50}, + {11095, 1, 3, 50}, + {11055, 1, 3, 50}, + {10378, 1, 3, 50}, + {11052, 1, 3, 15}, + {11073, 1, 3, 15}, + {11146, 1, 3, 15}, + {11116, 1, 3, 15}, + {11123, 1, 3, 15}, + {11097, 1, 3, 15}, + {10367, 1, 3, 15}, + {10371, 1, 3, 15}, + {10373, 1, 3, 15}, + {10778, 1, 3, 375}, + {11209, 1, 3, 375}, + {10813, 1, 3, 375}, + {11389, 1, 3, 375}, + {11159, 1, 3, 1000}, + {11159, 2, 3, 250}, + {11160, 1, 3, 700}, + {11160, 2, 3, 175}, + {11161, 1, 3, 300}, + {11161, 2, 3, 75}, + {11465, 1, 3, 53}, + {11466, 1, 3, 27}, + {11467, 1, 3, 266}, + {11468, 1, 3, 533}, + {11469, 1, 3, 186}, + }, + 7002: { + {11037, 1, 1, 100}, + {11038, 1, 1, 100}, + {11044, 1, 1, 100}, + {11057, 1, 1, 100}, + {11059, 1, 1, 100}, + {11079, 1, 1, 100}, + {11098, 1, 1, 100}, + {11104, 1, 1, 100}, + {11117, 1, 1, 100}, + {11128, 1, 1, 100}, + {11133, 1, 1, 100}, + {11137, 1, 1, 100}, + {11143, 1, 1, 100}, + {11132, 1, 1, 100}, + {11042, 1, 1, 60}, + {11045, 1, 1, 60}, + {11064, 1, 1, 60}, + {11062, 1, 1, 60}, + {11070, 1, 1, 60}, + {11101, 1, 1, 60}, + {11108, 1, 1, 60}, + {11109, 1, 1, 60}, + {11120, 1, 1, 60}, + {11122, 1, 1, 60}, + {11134, 1, 1, 60}, + {11141, 1, 1, 60}, + {11084, 1, 1, 60}, + {11087, 1, 1, 60}, + {11094, 1, 1, 60}, + {10374, 1, 1, 60}, + {10375, 1, 1, 60}, + {11051, 1, 1, 20}, + {11071, 1, 1, 20}, + {11076, 1, 1, 20}, + {11102, 1, 1, 20}, + {11124, 1, 1, 20}, + {11090, 1, 1, 20}, + {11164, 1, 1, 400}, + {11162, 1, 1, 200}, + {11163, 1, 1, 200}, + {11463, 1, 1, 100}, + {11464, 1, 1, 150}, + {10355, 1, 1, 150}, + {12506, 1, 1, 200}, + {12507, 1, 1, 300}, + {12508, 1, 1, 900}, + {13629, 1, 1, 350}, + {13628, 1, 1, 200}, + {11356, 1, 1, 100}, + {11357, 1, 1, 150}, + {12014, 1, 1, 250}, + {12016, 1, 1, 400}, + {12015, 1, 1, 410}, + {11159, 2, 1, 500}, + {11159, 4, 1, 500}, + {11159, 6, 1, 500}, + {11160, 2, 1, 400}, + {11160, 4, 1, 400}, + {11160, 6, 1, 400}, + {11161, 2, 1, 100}, + {11161, 4, 1, 100}, + {11161, 6, 1, 100}, + {11039, 1, 2, 100}, + {11040, 1, 2, 100}, + {11049, 1, 2, 100}, + {11061, 1, 2, 100}, + {11063, 1, 2, 100}, + {11077, 1, 2, 100}, + {11099, 1, 2, 100}, + {11105, 1, 2, 100}, + {11129, 1, 2, 100}, + {11130, 1, 2, 100}, + {11131, 1, 2, 100}, + {11139, 1, 2, 100}, + {11145, 1, 2, 100}, + {11096, 1, 2, 100}, + {11046, 1, 2, 60}, + {11066, 1, 2, 60}, + {11067, 1, 2, 60}, + {11072, 1, 2, 60}, + {11082, 1, 2, 60}, + {11103, 1, 2, 60}, + {11110, 1, 2, 60}, + {11112, 1, 2, 60}, + {11114, 1, 2, 60}, + {11115, 1, 2, 60}, + {11121, 1, 2, 60}, + {11144, 1, 2, 60}, + {11085, 1, 2, 60}, + {11089, 1, 2, 60}, + {11091, 1, 2, 60}, + {10376, 1, 2, 60}, + {10377, 1, 2, 60}, + {11127, 1, 2, 20}, + {11069, 1, 2, 20}, + {11142, 1, 2, 20}, + {11078, 1, 2, 20}, + {11056, 1, 2, 20}, + {11092, 1, 2, 20}, + {11164, 1, 2, 400}, + {11162, 1, 2, 200}, + {11163, 1, 2, 200}, + {11463, 1, 2, 250}, + {11464, 1, 2, 350}, + {12506, 1, 2, 150}, + {12507, 1, 2, 200}, + {12508, 1, 2, 350}, + {13629, 1, 2, 250}, + {13628, 1, 2, 200}, + {10355, 1, 2, 400}, + {11158, 1, 2, 100}, + {11356, 1, 2, 100}, + {11357, 1, 2, 100}, + {12014, 1, 2, 300}, + {12016, 1, 2, 450}, + {12015, 1, 2, 460}, + {11159, 2, 2, 500}, + {11159, 4, 2, 500}, + {11159, 6, 2, 500}, + {11160, 2, 2, 400}, + {11160, 4, 2, 400}, + {11160, 6, 2, 400}, + {11161, 2, 2, 100}, + {11161, 4, 2, 100}, + {11161, 6, 2, 100}, + {11041, 1, 3, 120}, + {11047, 1, 3, 120}, + {11054, 1, 3, 120}, + {11065, 1, 3, 120}, + {11068, 1, 3, 120}, + {11075, 1, 3, 120}, + {11100, 1, 3, 120}, + {11106, 1, 3, 120}, + {11119, 1, 3, 120}, + {11135, 1, 3, 120}, + {11136, 1, 3, 120}, + {11138, 1, 3, 120}, + {11088, 1, 3, 120}, + {10370, 1, 3, 120}, + {10368, 1, 3, 120}, + {11043, 1, 3, 65}, + {11048, 1, 3, 65}, + {11050, 1, 3, 65}, + {11058, 1, 3, 65}, + {11060, 1, 3, 65}, + {11074, 1, 3, 65}, + {11107, 1, 3, 65}, + {11111, 1, 3, 65}, + {11113, 1, 3, 65}, + {11118, 1, 3, 65}, + {11126, 1, 3, 65}, + {11140, 1, 3, 65}, + {11086, 1, 3, 65}, + {11095, 1, 3, 65}, + {11055, 1, 3, 65}, + {10378, 1, 3, 65}, + {11052, 1, 3, 15}, + {11073, 1, 3, 15}, + {11146, 1, 3, 15}, + {11116, 1, 3, 15}, + {11123, 1, 3, 15}, + {11097, 1, 3, 15}, + {10367, 1, 3, 15}, + {10371, 1, 3, 15}, + {10373, 1, 3, 15}, + {10778, 3, 3, 490}, + {11209, 3, 3, 490}, + {10813, 3, 3, 490}, + {11389, 3, 3, 490}, + {12046, 3, 3, 500}, + {12503, 3, 3, 500}, + {11159, 2, 3, 500}, + {11159, 4, 3, 500}, + {11159, 6, 3, 500}, + {11160, 2, 3, 400}, + {11160, 4, 3, 400}, + {11160, 6, 3, 400}, + {11161, 2, 3, 100}, + {11161, 4, 3, 100}, + {11161, 6, 3, 100}, + {11465, 1, 3, 53}, + {11466, 1, 3, 27}, + {11467, 1, 3, 266}, + {11468, 1, 3, 533}, + {11469, 1, 3, 186}, + }, + 7011: { + {11037, 1, 1, 290}, + {11038, 1, 1, 270}, + {11044, 1, 1, 270}, + {11057, 1, 1, 290}, + {11059, 1, 1, 290}, + {11079, 1, 1, 290}, + {11098, 1, 1, 280}, + {11104, 1, 1, 300}, + {11117, 1, 1, 280}, + {11128, 1, 1, 290}, + {11133, 1, 1, 290}, + {11137, 1, 1, 300}, + {11143, 1, 1, 290}, + {11132, 1, 1, 270}, + {11042, 1, 1, 47}, + {11045, 1, 1, 47}, + {11064, 1, 1, 47}, + {11062, 1, 1, 47}, + {11070, 1, 1, 48}, + {11101, 1, 1, 47}, + {11108, 1, 1, 47}, + {11109, 1, 1, 47}, + {11120, 1, 1, 47}, + {11122, 1, 1, 47}, + {11134, 1, 1, 47}, + {11141, 1, 1, 47}, + {11084, 1, 1, 47}, + {11087, 1, 1, 47}, + {11094, 1, 1, 47}, + {10374, 1, 1, 47}, + {10375, 1, 1, 47}, + {11051, 1, 1, 17}, + {11071, 1, 1, 16}, + {11076, 1, 1, 16}, + {11102, 1, 1, 17}, + {11124, 1, 1, 17}, + {11090, 1, 1, 17}, + {11159, 1, 1, 1200}, + {11159, 2, 1, 650}, + {11160, 1, 1, 800}, + {11160, 2, 1, 300}, + {11161, 1, 1, 100}, + {11161, 2, 1, 50}, + {11164, 1, 1, 100}, + {11162, 1, 1, 100}, + {11163, 1, 1, 100}, + {11158, 1, 1, 300}, + {11463, 1, 1, 300}, + {11356, 1, 1, 300}, + {11464, 1, 1, 300}, + {11357, 1, 1, 500}, + {11039, 1, 2, 300}, + {11040, 1, 2, 270}, + {11049, 1, 2, 300}, + {11061, 1, 2, 290}, + {11063, 1, 2, 290}, + {11077, 1, 2, 290}, + {11099, 1, 2, 280}, + {11105, 1, 2, 300}, + {11129, 1, 2, 250}, + {11130, 1, 2, 300}, + {11131, 1, 2, 280}, + {11139, 1, 2, 290}, + {11145, 1, 2, 260}, + {11096, 1, 2, 300}, + {11046, 1, 2, 47}, + {11066, 1, 2, 47}, + {11067, 1, 2, 47}, + {11072, 1, 2, 47}, + {11082, 1, 2, 47}, + {11103, 1, 2, 47}, + {11110, 1, 2, 47}, + {11112, 1, 2, 47}, + {11114, 1, 2, 47}, + {11115, 1, 2, 47}, + {11121, 1, 2, 47}, + {11144, 1, 2, 48}, + {11085, 1, 2, 47}, + {11089, 1, 2, 47}, + {11091, 1, 2, 47}, + {10376, 1, 2, 47}, + {10377, 1, 2, 47}, + {11127, 1, 2, 17}, + {11069, 1, 2, 17}, + {11142, 1, 2, 17}, + {11078, 1, 2, 17}, + {11056, 1, 2, 16}, + {11092, 1, 2, 16}, + {11159, 1, 2, 1200}, + {11159, 2, 2, 650}, + {11160, 1, 2, 800}, + {11160, 2, 2, 300}, + {11161, 1, 2, 100}, + {11161, 2, 2, 50}, + {11164, 1, 2, 100}, + {11162, 1, 2, 100}, + {11163, 1, 2, 100}, + {11158, 1, 2, 300}, + {11463, 1, 2, 300}, + {11356, 1, 2, 300}, + {11464, 1, 2, 300}, + {11357, 1, 2, 500}, + {11041, 1, 3, 266}, + {11047, 1, 3, 266}, + {11054, 1, 3, 266}, + {11065, 1, 3, 266}, + {11068, 1, 3, 266}, + {11075, 1, 3, 266}, + {11100, 1, 3, 266}, + {11106, 1, 3, 266}, + {11119, 1, 3, 266}, + {11135, 1, 3, 268}, + {11136, 1, 3, 268}, + {11138, 1, 3, 268}, + {11088, 1, 3, 268}, + {10370, 1, 3, 266}, + {10368, 1, 3, 268}, + {11043, 1, 3, 50}, + {11048, 1, 3, 50}, + {11050, 1, 3, 50}, + {11058, 1, 3, 50}, + {11060, 1, 3, 50}, + {11074, 1, 3, 50}, + {11107, 1, 3, 50}, + {11111, 1, 3, 50}, + {11113, 1, 3, 50}, + {11118, 1, 3, 50}, + {11126, 1, 3, 50}, + {11140, 1, 3, 50}, + {11086, 1, 3, 50}, + {11095, 1, 3, 50}, + {11055, 1, 3, 50}, + {10378, 1, 3, 50}, + {11052, 1, 3, 15}, + {11073, 1, 3, 15}, + {11146, 1, 3, 15}, + {11116, 1, 3, 15}, + {11123, 1, 3, 15}, + {11097, 1, 3, 15}, + {10367, 1, 3, 15}, + {10371, 1, 3, 15}, + {10373, 1, 3, 15}, + {10778, 1, 3, 375}, + {11209, 1, 3, 375}, + {10813, 1, 3, 375}, + {11389, 1, 3, 375}, + {11159, 1, 3, 1000}, + {11159, 2, 3, 250}, + {11160, 1, 3, 700}, + {11160, 2, 3, 175}, + {11161, 1, 3, 300}, + {11161, 2, 3, 75}, + {11465, 1, 3, 53}, + {11466, 1, 3, 27}, + {11467, 1, 3, 266}, + {11468, 1, 3, 533}, + {11469, 1, 3, 186}, + }, + 7012: { + {11037, 1, 1, 290}, + {11038, 1, 1, 270}, + {11044, 1, 1, 270}, + {11057, 1, 1, 290}, + {11059, 1, 1, 290}, + {11079, 1, 1, 290}, + {11098, 1, 1, 280}, + {11104, 1, 1, 300}, + {11117, 1, 1, 280}, + {11128, 1, 1, 290}, + {11133, 1, 1, 290}, + {11137, 1, 1, 300}, + {11143, 1, 1, 290}, + {11132, 1, 1, 270}, + {11042, 1, 1, 47}, + {11045, 1, 1, 47}, + {11064, 1, 1, 47}, + {11062, 1, 1, 47}, + {11070, 1, 1, 48}, + {11101, 1, 1, 47}, + {11108, 1, 1, 47}, + {11109, 1, 1, 47}, + {11120, 1, 1, 47}, + {11122, 1, 1, 47}, + {11134, 1, 1, 47}, + {11141, 1, 1, 47}, + {11084, 1, 1, 47}, + {11087, 1, 1, 47}, + {11094, 1, 1, 47}, + {10374, 1, 1, 47}, + {10375, 1, 1, 47}, + {11051, 1, 1, 17}, + {11071, 1, 1, 16}, + {11076, 1, 1, 16}, + {11102, 1, 1, 17}, + {11124, 1, 1, 17}, + {11090, 1, 1, 17}, + {11159, 1, 1, 1200}, + {11159, 2, 1, 650}, + {11160, 1, 1, 800}, + {11160, 2, 1, 300}, + {11161, 1, 1, 100}, + {11161, 2, 1, 50}, + {11164, 1, 1, 100}, + {11162, 1, 1, 100}, + {11163, 1, 1, 100}, + {11158, 1, 1, 300}, + {11463, 1, 1, 300}, + {11356, 1, 1, 300}, + {11464, 1, 1, 300}, + {11357, 1, 1, 500}, + {11039, 1, 2, 300}, + {11040, 1, 2, 270}, + {11049, 1, 2, 300}, + {11061, 1, 2, 290}, + {11063, 1, 2, 290}, + {11077, 1, 2, 290}, + {11099, 1, 2, 280}, + {11105, 1, 2, 300}, + {11129, 1, 2, 250}, + {11130, 1, 2, 300}, + {11131, 1, 2, 280}, + {11139, 1, 2, 290}, + {11145, 1, 2, 260}, + {11096, 1, 2, 300}, + {11046, 1, 2, 47}, + {11066, 1, 2, 47}, + {11067, 1, 2, 47}, + {11072, 1, 2, 47}, + {11082, 1, 2, 47}, + {11103, 1, 2, 47}, + {11110, 1, 2, 47}, + {11112, 1, 2, 47}, + {11114, 1, 2, 47}, + {11115, 1, 2, 47}, + {11121, 1, 2, 47}, + {11144, 1, 2, 48}, + {11085, 1, 2, 47}, + {11089, 1, 2, 47}, + {11091, 1, 2, 47}, + {10376, 1, 2, 47}, + {10377, 1, 2, 47}, + {11127, 1, 2, 17}, + {11069, 1, 2, 17}, + {11142, 1, 2, 17}, + {11078, 1, 2, 17}, + {11056, 1, 2, 16}, + {11092, 1, 2, 16}, + {11159, 1, 2, 1200}, + {11159, 2, 2, 650}, + {11160, 1, 2, 800}, + {11160, 2, 2, 300}, + {11161, 1, 2, 100}, + {11161, 2, 2, 50}, + {11164, 1, 2, 100}, + {11162, 1, 2, 100}, + {11163, 1, 2, 100}, + {11158, 1, 2, 300}, + {11463, 1, 2, 300}, + {11356, 1, 2, 300}, + {11464, 1, 2, 300}, + {11357, 1, 2, 500}, + {11041, 1, 3, 266}, + {11047, 1, 3, 266}, + {11054, 1, 3, 266}, + {11065, 1, 3, 266}, + {11068, 1, 3, 266}, + {11075, 1, 3, 266}, + {11100, 1, 3, 266}, + {11106, 1, 3, 266}, + {11119, 1, 3, 266}, + {11135, 1, 3, 268}, + {11136, 1, 3, 268}, + {11138, 1, 3, 268}, + {11088, 1, 3, 268}, + {10370, 1, 3, 266}, + {10368, 1, 3, 268}, + {11043, 1, 3, 50}, + {11048, 1, 3, 50}, + {11050, 1, 3, 50}, + {11058, 1, 3, 50}, + {11060, 1, 3, 50}, + {11074, 1, 3, 50}, + {11107, 1, 3, 50}, + {11111, 1, 3, 50}, + {11113, 1, 3, 50}, + {11118, 1, 3, 50}, + {11126, 1, 3, 50}, + {11140, 1, 3, 50}, + {11086, 1, 3, 50}, + {11095, 1, 3, 50}, + {11055, 1, 3, 50}, + {10378, 1, 3, 50}, + {11052, 1, 3, 15}, + {11073, 1, 3, 15}, + {11146, 1, 3, 15}, + {11116, 1, 3, 15}, + {11123, 1, 3, 15}, + {11097, 1, 3, 15}, + {10367, 1, 3, 15}, + {10371, 1, 3, 15}, + {10373, 1, 3, 15}, + {10778, 1, 3, 375}, + {11209, 1, 3, 375}, + {10813, 1, 3, 375}, + {11389, 1, 3, 375}, + {11159, 1, 3, 1000}, + {11159, 2, 3, 250}, + {11160, 1, 3, 700}, + {11160, 2, 3, 175}, + {11161, 1, 3, 300}, + {11161, 2, 3, 75}, + {11465, 1, 3, 53}, + {11466, 1, 3, 27}, + {11467, 1, 3, 266}, + {11468, 1, 3, 533}, + {11469, 1, 3, 186}, + }, +} + +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 +} + func handleMsgMhfGetPaperData(s *Session, p mhfpacket.MHFPacket) { - // if the game gets bad responses for this it breaks the ability to save pkt := p.(*mhfpacket.MsgMhfGetPaperData) - var data []byte - var err error - if pkt.Unk2 == 4 { - data, err = hex.DecodeString("0A218EAD000000000000000000000000") - } else if pkt.Unk2 == 5 { - data, err = hex.DecodeString("0A218EAD00000000000000000000003403E900010000000000000000000003E900020000000000000000000003EB00010064006400C80064000003EB00020096006400F00064000003EC000A270F002800000000000003ED000A01F4000000000000000003EF00010000000000000000000003F000C801900BB801900BB8000003F200010FA0000000000000000003F200020FA0000000000000000003F3000117703A984E2061A8753003F3000217703A984E2061A8753003F400011F40445C57E46B6C791803F400021F40445C57E46B6C791803F700010010001000100000000003F7000200100010001000000000044D000107E001F4000000000000044D000207E001F4000000000000044F0001000000000BB800000BB8044F0002000000000BB800000BB804500001000A270F00280000000004500002000A270F00280000000004510001000A01F400000000000004510002000A01F400000000000007D100010011003A0000000602BC07D100010014003A0000000300C807D100010016003A0000000700FA07D10001001B003A00000001006407D100010035003A0000000803E807D100010043003A0000000901F407D100010044003A00000002009607D10001004A003A0000000400C807D10001004B003A0000000501F407D10001004C003A0000000A032007D100010050003A0000000B038407D100010059003A0000000C025807D100020011003C0000000602BC07D100020014003C0000000300C807D100020016003C00000007015E07D10002001B003C00000001006407D100020027003C0000000D00C807D100020028003C0000000F025807D100020035003C0000000803E807D100020043003C0000000201F407D100020044003C00000009009607D10002004A003C0000000400C807D10002004B003C0000000501F407D10002004C003C0000000A032007D100020050003C0000000B038407D100020051003C0000000E038407D100020059003C0000000C025807D10002005E003C0000001003E8") - } else if pkt.Unk2 == 6 { - data, err = hex.DecodeString("0A218EAD0000000000000000000001A503EA00640000000000000000000003EE00012710271000000000000003EE000227104E2000000000000003F100140000000000000000000003F5000100010001006400C8012C03F5000100010002006400C8012C03F5000100020001012C006400C803F5000100020002012C006400C803F500010003000100C8012C006403F500010003000200C8012C006403F5000200010001012C006400C803F5000200010002012C006400C803F500020002000100C8012C006403F500020002000200C8012C006403F5000200030001006400C8012C03F5000200030002006400C8012C03F500030001000100C8012C006403F500030001000200C8012C006403F5000300020001006400C8012C03F5000300020002006400C8012C03F5000300030001012C006400C803F5000300030002012C006400C803F800010001005000000000000003F800010002005000000000000003F800010003005000000000000003F800020001005000000000000003F800020002005000000000000003F800020003005000000000000004B10001003C003200000000000004B10002003C003200000000000004B200010000000500320000000004B2000100060014003C0000000004B200010015002800460000000004B200010029007800500000000004B20001007900A0005A0000000004B2000100A100FA00640000000004B2000100FB01F400640000000004B2000101F5270F00640000000004B200020000006400640000000004B20002006500C800640000000004B2000200C901F400960000000004B2000201F5270F00960000000004B3000100000005000A0000000004B300010006000A00140000000004B30001000B001E001E0000000004B30001001F003C00280000000004B30001003D007800320000000004B3000100790082003C0000000004B300010083008C00460000000004B30001008D009600500000000004B30001009700A000550000000004B3000100A100C800640000000004B3000100C901F400640000000004B3000101F5270F00640000000004B300020000007800460000000004B30002007901F400780000000004B3000201F5270F00780000000004B4000100000005000F0000000004B400010006000A00140000000004B40001000B000F00190000000004B4000100100014001B0000000004B4000100150019001E0000000004B40001001A001E00200000000004B40001001F002800230000000004B400010029003200250000000004B400010033003C00280000000004B40001003D0046002B0000000004B4000100470050002D0000000004B400010051005A002F0000000004B40001005B006400320000000004B400010065006E003C0000000004B40001006F007800460000000004B4000100790082004B0000000004B400010083008C00520000000004B40001008D00A000550000000004B4000100A100C800640000000004B4000100C901F400640000000004B4000101F5270F00640000000004B400020000007800460000000004B40002007901F400780000000004B4000201F5270F0078000000000FA10001000000000000000000000FA10002000029AB0005000000010FA10002000029AB0005000000010FA10002000029AB0005000000010FA10002000029AB0005000000010FA10002000029AC0002000000010FA10002000029AC0002000000010FA10002000029AC0002000000010FA10002000029AC0002000000010FA10002000029AD0001000000010FA10002000029AD0001000000010FA10002000029AD0001000000010FA10002000029AD0001000000010FA10002000029AF0003000000010FA10002000029AF0003000000010FA10002000029AF0003000000010FA10002000029AF0003000000010FA10002000028900001000000010FA10002000028900001000000010FA10002000029AE0002000000010FA10002000029AE0002000000010FA10002000029BA0002000000010FA10002000029BB0002000000010FA10002000029B60001000000010FA10002000029B60001000000010FA5000100002B970001138800010FA5000100002B9800010D1600010FA5000100002B99000105DC00010FA5000100002B9A0001006400010FA5000100002B9B0001003200010FA5000200002B970002070800010FA5000200002B98000204B000010FA5000200002B99000201F400010FA5000200002B9A0001003200010FA5000200002B1D0001009600010FA5000200002B1E0001009600010FA5000200002B240001009600010FA5000200002B310001009600010FA5000200002B330001009600010FA5000200002B470001009600010FA5000200002B5A0001009600010FA5000200002B600001009600010FA5000200002B6D0001009600010FA5000200002B780001009600010FA5000200002B7D0001009600010FA5000200002B810001009600010FA5000200002B870001009600010FA5000200002B7C0001009600010FA5000200002B1F0001009600010FA5000200002B200001009600010FA5000200002B290001009600010FA5000200002B350001009600010FA5000200002B370001009600010FA5000200002B450001009600010FA5000200002B5B0001009600010FA5000200002B610001009600010FA5000200002B790001009600010FA5000200002B7A0001009600010FA5000200002B7B0001009600010FA5000200002B830001009600010FA5000200002B890001009600010FA5000200002B580001009600010FA5000200002B210001009600010FA5000200002B270001009600010FA5000200002B2E0001009600010FA5000200002B390001009600010FA5000200002B3C0001009600010FA5000200002B430001009600010FA5000200002B5C0001009600010FA5000200002B620001009600010FA5000200002B6F0001009600010FA5000200002B7F0001009600010FA5000200002B800001009600010FA5000200002B820001009600010FA5000200002B500001009600010FA50002000028820001009600010FA50002000028800001009600010FA6000100002B970001138800010FA6000100002B9800010D1600010FA6000100002B99000105DC00010FA6000100002B9A0001006400010FA6000100002B9B0001003200010FA6000200002B970002070800010FA6000200002B98000204B000010FA6000200002B99000201F400010FA6000200002B9A0001003200010FA6000200002B1D0001009600010FA6000200002B1E0001009600010FA6000200002B240001009600010FA6000200002B310001009600010FA6000200002B330001009600010FA6000200002B470001009600010FA6000200002B5A0001009600010FA6000200002B600001009600010FA6000200002B6D0001009600010FA6000200002B780001009600010FA6000200002B7D0001009600010FA6000200002B810001009600010FA6000200002B870001009600010FA6000200002B7C0001009600010FA6000200002B1F0001009600010FA6000200002B200001009600010FA6000200002B290001009600010FA6000200002B350001009600010FA6000200002B370001009600010FA6000200002B450001009600010FA6000200002B5B0001009600010FA6000200002B610001009600010FA6000200002B790001009600010FA6000200002B7A0001009600010FA6000200002B7B0001009600010FA6000200002B830001009600010FA6000200002B890001009600010FA6000200002B580001009600010FA6000200002B210001009600010FA6000200002B270001009600010FA6000200002B2E0001009600010FA6000200002B390001009600010FA6000200002B3C0001009600010FA6000200002B430001009600010FA6000200002B5C0001009600010FA6000200002B620001009600010FA6000200002B6F0001009600010FA6000200002B7F0001009600010FA6000200002B800001009600010FA6000200002B820001009600010FA6000200002B500001009600010FA60002000028820001009600010FA60002000028800001009600010FA7000100002B320001004600010FA7000100002B340001004600010FA7000100002B360001004600010FA7000100002B380001004600010FA7000100002B3A0001004600010FA7000100002B6E0001004600010FA7000100002B700001004600010FA7000100002B660001004600010FA7000100002B680001004600010FA7000100002B6A0001004600010FA7000100002B220001004600010FA7000100002B230001004600010FA7000100002B420001004600010FA7000100002B840001004600010FA7000100002B3B0001004600010FA7000100002B280001004600010FA7000100002B260001004600010FA7000100002B5F0001004600010FA7000100002B630001004600010FA7000100002B640001004600010FA7000100002B710001004600010FA7000100002B7E0001004600010FA7000100002B4C0001004600010FA7000100002B4D0001004600010FA7000100002B4E0001004600010FA7000100002B4F0001004600010FA7000100002B560001004600010FA7000100002B570001004600010FA70001000028860001004600010FA70001000028870001004600010FA70001000028880001004600010FA70001000028890001004600010FA700010000288A0001004600010FA7000100002B3D0001002D00010FA7000100002B3F0001002D00010FA7000100002B410001002D00010FA7000100002B440001002D00010FA7000100002B460001002D00010FA7000100002B6C0001002D00010FA7000100002B730001002D00010FA7000100002B770001002D00010FA7000100002B860001002D00010FA7000100002B300001002D00010FA7000100002B520001002D00010FA7000100002B590001002D00010FA700010000287F0001002D00010FA70001000028830001002D00010FA70001000028850001002D00010FA7000100002B480001000F00010FA7000100002B490001000F00010FA7000100002B4B0001000F00010FA7000100002B750001000F00010FA7000100002B550001000E00010FA7000100002B2D0001000A00010FA7000100002B8B0001000A00010FA70001000028840001000500010FA70001000028810001000100010FA7000100002B9B0001009600010FA7000100002CC90001003200010FA7000100002CCA0001001900010FA7000100002CCB000100C800010FA7000100002CCC0001019000010FA7000100002CCD0001009600010FA7000100002B1D0001005C00010FA7000100002B1E0001005C00010FA7000100002B240001005C00010FA7000100002B310001005C00010FA7000100002B330001005C00010FA7000100002B470001005C00010FA7000100002B5A0001005C00010FA7000100002B600001005C00010FA7000100002B6D0001005C00010FA7000100002B7D0001005C00010FA7000100002B810001005C00010FA7000100002B870001005C00010FA7000100002B7C0001005C00010FA7000100002B1F0001005C00010FA7000100002B200001005C00010FA7000100002B290001005C00010FA7000100002B350001005C00010FA7000100002B370001005C00010FA7000100002B450001005C00010FA7000100002B5B0001005C00010FA7000100002B610001005C00010FA7000100002B790001005C00010FA7000100002B7A0001005C00010FA7000100002B7B0001005C00010FA7000100002B830001005C00010FA7000100002B890001005B00010FA7000100002B580001005B00010FA7000100002B210001005B00010FA7000100002B270001005B00010FA7000100002B2E0001005B00010FA7000100002B390001005B00010FA7000100002B3C0001005B00010FA7000100002B430001005B00010FA7000100002B5C0001005B00010FA7000100002B620001005B00010FA7000100002B6F0001005B00010FA7000100002B7F0001005B00010FA7000100002B800001005B00010FA7000100002B820001005B00010FA7000100002B500001005B00010FA70001000028820001005B00010FA70001000028800001005B00010FA7000100002B250001005B00010FA7000100002B3E0001005B00010FA7000100002B5D0001005B00010FA7000100002B650001005B00010FA7000100002B720001005B00010FA7000100002B850001005B00010FA7000100002B2B0001005B00010FA7000100002B5E0001005B00010FA7000100002B740001005B00010FA7000100002B400001005B00010FA7000100002B4A0001005B00010FA7000100002B6B0001005B00010FA7000100002B880001005B00010FA7000100002B510001005B00010FA7000100002B530001005B00010FA7000100002B540001005B00010FA7000100002B2A0001005B00010FA7000100002B670001005B00010FA7000100002B690001005B00010FA7000100002B760001005B00010FA7000100002B2F0001005B00010FA7000100002B2C0001005B00010FA7000100002B8A0001005B00010FA7000200002B320001005A00010FA7000200002B340001005A00010FA7000200002B360001005A00010FA7000200002B380001005A00010FA7000200002B3A0001005A00010FA7000200002B6E0001005A00010FA7000200002B700001005A00010FA7000200002B660001005A00010FA7000200002B680001005A00010FA7000200002B6A0001005A00010FA7000200002B220001005A00010FA7000200002B230001005A00010FA7000200002B420001005A00010FA7000200002B840001005A00010FA7000200002B3B0001005A00010FA7000200002B280001005A00010FA7000200002B260001005A00010FA7000200002B5F0001005A00010FA7000200002B630001005A00010FA7000200002B640001005A00010FA7000200002B710001005A00010FA7000200002B7E0001005A00010FA7000200002B4C0001005A00010FA7000200002B4D0001005A00010FA7000200002B4E0001005A00010FA7000200002B4F0001005A00010FA7000200002B560001005A00010FA7000200002B570001005A00010FA70002000028860001005A00010FA70002000028870001005A00010FA70002000028880001005A00010FA70002000028890001005A00010FA700020000288A0001005A00010FA7000200002B3D0001005000010FA7000200002B3F0001005000010FA7000200002B410001005000010FA7000200002B440001005000010FA7000200002B460001005000010FA7000200002B6C0001005000010FA7000200002B730001005000010FA7000200002B770001005000010FA7000200002B860001005000010FA7000200002B300001005000010FA7000200002B520001005000010FA7000200002B590001005000010FA700020000287F0001005000010FA70002000028830001005000010FA70002000028850001005000010FA7000200002B480001001600010FA7000200002B490001001600010FA7000200002B4B0001001600010FA7000200002B750001001600010FA7000200002B550001001600010FA7000200002B2D0001000F00010FA7000200002B8B0001000F00010FA70002000028840001000800010FA70002000028810001000200010FA7000200002B97000304C400010FA7000200002B980003028A00010FA7000200002B99000300A000010FA7000200002D8D0001032000010FA7000200002D8E0001032000010FA7000200002B9B000101F400010FA7000200002B9A0001022600010FA7000200002CC90001003200010FA7000200002CCA0001001900010FA7000200002CCB000100FA00010FA7000200002CCC000101F400010FA7000200002CCD000100AF0001106A000100002B9B000117700001106A000100002CC9000100C80001106A000100002CCA000100640001106A000100002CCB000103E80001106A000100002CCC000107D00001106A000100002CCD000102BC0001106A000200002D8D000103200001106A000200002D8E000103200001106A000200002B9B000101900001106A000200002CC9000101900001106A000200002CCA000100C80001106A000200002CCB000107D00001106A000200002CCC00010FA00001106A000200002CCD000105780001") - } else if pkt.Unk2 == 6001 { - data, err = hex.DecodeString("0A218EAD0000000000000000000000052B97010113882B9801010D162B99010105DC2B9A010100642B9B01010032") - } else if pkt.Unk2 == 6002 { - data, err = hex.DecodeString("0A218EAD00000000000000000000002F2B97020107082B98020104B02B99020101F42B9A010100322B1D010100962B1E010100962B24010100962B31010100962B33010100962B47010100962B5A010100962B60010100962B6D010100962B78010100962B7D010100962B81010100962B87010100962B7C010100962B1F010100962B20010100962B29010100962B35010100962B37010100962B45010100962B5B010100962B61010100962B79010100962B7A010100962B7B010100962B83010100962B89010100962B58010100962B21010100962B27010100962B2E010100962B39010100962B3C010100962B43010100962B5C010100962B62010100962B6F010100962B7F010100962B80010100962B82010100962B5001010096288201010096288001010096") - } else if pkt.Unk2 == 6010 { - data, err = hex.DecodeString("0A218EAD00000000000000000000000B2B9701010E742B9801010B542B99010105142CBD010100FA2CBE010100FA2F17010100FA2F21010100FA2F1A010100FA2F24010100FA2DFE010100C82DFD01010190") - } else if pkt.Unk2 == 6011 { - data, err = hex.DecodeString("0A218EAD00000000000000000000000B2B9701010E742B9801010B542B99010105142CBD010100FA2CBE010100FA2F17010100FA2F21010100FA2F1A010100FA2F24010100FA2DFE010100C82DFD01010190") - } else if pkt.Unk2 == 6012 { - data, err = hex.DecodeString("0A218EAD00000000000000000000000D2B9702010DAC2B9802010B542B990201051430DC010101902CBD010100C82CBE010100C82F17010100C82F21010100C82F1A010100C82F24010100C82DFF010101902E00010100C82E0101010064") - } else if pkt.Unk2 == 7001 { - data, err = hex.DecodeString("0A218EAD00000000000000000000009D2B1D010101222B1E0101010E2B240101010E2B31010101222B33010101222B47010101222B5A010101182B600101012C2B6D010101182B78010101222B7D010101222B810101012C2B87010101222B7C0101010E2B220101002F2B250101002F2B380101002F2B360101002F2B3E010100302B5D0101002F2B640101002F2B650101002F2B700101002F2B720101002F2B7E0101002F2B850101002F2B4C0101002F2B4F0101002F2B560101002F28860101002F28870101002F2B2B010100112B3F010100102B44010100102B5E010100112B74010100112B52010100112B97010104B02B970201028A2B98010103202B980201012C2B99010100642B99020100322B9C010100642B9A010100642B9B010100642B960101012C2CC70101012C2C5C0101012C2CC80101012C2C5D010101F42B1F0102012C2B200102010E2B290102012C2B35010201222B37010201222B45010201222B5B010201182B610102012C2B79010200FA2B7A0102012C2B7B010201182B83010201222B89010201042B580102012C2B260102002F2B3A0102002F2B3B0102002F2B400102002F2B4A0102002F2B5F0102002F2B660102002F2B680102002F2B6A0102002F2B6B0102002F2B710102002F2B88010200302B4D0102002F2B510102002F2B530102002F28880102002F28890102002F2B77010200112B3D010200112B86010200112B46010200112B30010200102B54010200102B97010204B02B970202028A2B98010203202B980202012C2B99010200642B99020200322B9C010200642B9A010200642B9B010200642B960102012C2CC70102012C2C5C0102012C2CC80102012C2C5D010201F42B210103010A2B270103010A2B2E0103010A2B390103010A2B3C0103010A2B430103010A2B5C0103010A2B620103010A2B6F0103010A2B7F0103010C2B800103010C2B820103010C2B500103010C28820103010A28800103010C2B23010300322B28010300322B2A010300322B32010300322B34010300322B42010300322B63010300322B67010300322B69010300322B6E010300322B76010300322B84010300322B4E010300322B57010300322B2F01030032288A010300322B2C0103000F2B410103000F2B8A0103000F2B6C0103000F2B730103000F2B590103000F287F0103000F28830103000F28850103000F2A1A010301772BC9010301772A3D010301772C7D010301772B97010303E82B97020300FA2B98010302BC2B98020300AF2B990103012C2B990203004B2CC9010300352CCA0103001B2CCB0103010A2CCC010302152CCD010300BA") - } else if pkt.Unk2 == 7002 { - data, err = hex.DecodeString("0A218EAD0000000000000000000000B92B1D010100642B1E010100642B24010100642B31010100642B33010100642B47010100642B5A010100642B60010100642B6D010100642B78010100642B7D010100642B81010100642B87010100642B7C010100642B220101003C2B250101003C2B380101003C2B360101003C2B3E0101003C2B5D0101003C2B640101003C2B650101003C2B700101003C2B720101003C2B7E0101003C2B850101003C2B4C0101003C2B4F0101003C2B560101003C28860101003C28870101003C2B2B010100142B3F010100142B44010100142B5E010100142B74010100142B52010100142B9C010101902B9A010100C82B9B010100C82CC7010100642CC80101009628730101009630DA010100C830DB0101012C30DC01010384353D0101015E353C010100C82C5C010100642C5D010100962EEE010100FA2EF0010101902EEF0101019A2B97020101F42B97040101F42B97060101F42B98020101902B98040101902B98060101902B99020100642B99040100642B99060100642B1F010200642B20010200642B29010200642B35010200642B37010200642B45010200642B5B010200642B61010200642B79010200642B7A010200642B7B010200642B83010200642B89010200642B58010200642B260102003C2B3A0102003C2B3B0102003C2B400102003C2B4A0102003C2B5F0102003C2B660102003C2B680102003C2B6A0102003C2B6B0102003C2B710102003C2B880102003C2B4D0102003C2B510102003C2B530102003C28880102003C28890102003C2B77010200142B3D010200142B86010200142B46010200142B30010200142B54010200142B9C010201902B9A010200C82B9B010200C82CC7010200FA2CC80102015E30DA0102009630DB010200C830DC0102015E353D010200FA353C010200C82873010201902B96010200642C5C010200642C5D010200642EEE0102012C2EF0010201C22EEF010201CC2B97020201F42B97040201F42B97060201F42B98020201902B98040201902B98060201902B99020200642B99040200642B99060200642B21010300782B27010300782B2E010300782B39010300782B3C010300782B43010300782B5C010300782B62010300782B6F010300782B7F010300782B80010300782B82010300782B50010300782882010300782880010300782B23010300412B28010300412B2A010300412B32010300412B34010300412B42010300412B63010300412B67010300412B69010300412B6E010300412B76010300412B84010300412B4E010300412B57010300412B2F01030041288A010300412B2C0103000F2B410103000F2B8A0103000F2B6C0103000F2B730103000F2B590103000F287F0103000F28830103000F28850103000F2A1A030301EA2BC9030301EA2A3D030301EA2C7D030301EA2F0E030301F430D7030301F42B97020301F42B97040301F42B97060301F42B98020301902B98040301902B98060301902B99020300642B99040300642B99060300642CC9010300352CCA0103001B2CCB0103010A2CCC010302152CCD010300BA") - } else if pkt.Unk2 == 7011 { - data, err = hex.DecodeString("0A218EAD00000000000000000000009D2B1D010101222B1E0101010E2B240101010E2B31010101222B33010101222B47010101222B5A010101182B600101012C2B6D010101182B78010101222B7D010101222B810101012C2B87010101222B7C0101010E2B220101002F2B250101002F2B380101002F2B360101002F2B3E010100302B5D0101002F2B640101002F2B650101002F2B700101002F2B720101002F2B7E0101002F2B850101002F2B4C0101002F2B4F0101002F2B560101002F28860101002F28870101002F2B2B010100112B3F010100102B44010100102B5E010100112B74010100112B52010100112B97010104B02B970201028A2B98010103202B980201012C2B99010100642B99020100322B9C010100642B9A010100642B9B010100642B960101012C2CC70101012C2C5C0101012C2CC80101012C2C5D010101F42B1F0102012C2B200102010E2B290102012C2B35010201222B37010201222B45010201222B5B010201182B610102012C2B79010200FA2B7A0102012C2B7B010201182B83010201222B89010201042B580102012C2B260102002F2B3A0102002F2B3B0102002F2B400102002F2B4A0102002F2B5F0102002F2B660102002F2B680102002F2B6A0102002F2B6B0102002F2B710102002F2B88010200302B4D0102002F2B510102002F2B530102002F28880102002F28890102002F2B77010200112B3D010200112B86010200112B46010200112B30010200102B54010200102B97010204B02B970202028A2B98010203202B980202012C2B99010200642B99020200322B9C010200642B9A010200642B9B010200642B960102012C2CC70102012C2C5C0102012C2CC80102012C2C5D010201F42B210103010A2B270103010A2B2E0103010A2B390103010A2B3C0103010A2B430103010A2B5C0103010A2B620103010A2B6F0103010A2B7F0103010C2B800103010C2B820103010C2B500103010C28820103010A28800103010C2B23010300322B28010300322B2A010300322B32010300322B34010300322B42010300322B63010300322B67010300322B69010300322B6E010300322B76010300322B84010300322B4E010300322B57010300322B2F01030032288A010300322B2C0103000F2B410103000F2B8A0103000F2B6C0103000F2B730103000F2B590103000F287F0103000F28830103000F28850103000F2A1A010301772BC9010301772A3D010301772C7D010301772B97010303E82B97020300FA2B98010302BC2B98020300AF2B990103012C2B990203004B2CC9010300352CCA0103001B2CCB0103010A2CCC010302152CCD010300BA") - } else if pkt.Unk2 == 7012 { - data, err = hex.DecodeString("0A218EAD00000000000000000000009D2B1D010101222B1E0101010E2B240101010E2B31010101222B33010101222B47010101222B5A010101182B600101012C2B6D010101182B78010101222B7D010101222B810101012C2B87010101222B7C0101010E2B220101002F2B250101002F2B380101002F2B360101002F2B3E010100302B5D0101002F2B640101002F2B650101002F2B700101002F2B720101002F2B7E0101002F2B850101002F2B4C0101002F2B4F0101002F2B560101002F28860101002F28870101002F2B2B010100112B3F010100102B44010100102B5E010100112B74010100112B52010100112B97010104B02B970201028A2B98010103202B980201012C2B99010100642B99020100322B9C010100642B9A010100642B9B010100642B960101012C2CC70101012C2C5C0101012C2CC80101012C2C5D010101F42B1F0102012C2B200102010E2B290102012C2B35010201222B37010201222B45010201222B5B010201182B610102012C2B79010200FA2B7A0102012C2B7B010201182B83010201222B89010201042B580102012C2B260102002F2B3A0102002F2B3B0102002F2B400102002F2B4A0102002F2B5F0102002F2B660102002F2B680102002F2B6A0102002F2B6B0102002F2B710102002F2B88010200302B4D0102002F2B510102002F2B530102002F28880102002F28890102002F2B77010200112B3D010200112B86010200112B46010200112B30010200102B54010200102B97010204B02B970202028A2B98010203202B980202012C2B99010200642B99020200322B9C010200642B9A010200642B9B010200642B960102012C2CC70102012C2C5C0102012C2CC80102012C2C5D010201F42B210103010A2B270103010A2B2E0103010A2B390103010A2B3C0103010A2B430103010A2B5C0103010A2B620103010A2B6F0103010A2B7F0103010C2B800103010C2B820103010C2B500103010C28820103010A28800103010C2B23010300322B28010300322B2A010300322B32010300322B34010300322B42010300322B63010300322B67010300322B69010300322B6E010300322B76010300322B84010300322B4E010300322B57010300322B2F01030032288A010300322B2C0103000F2B410103000F2B8A0103000F2B6C0103000F2B730103000F2B590103000F287F0103000F28830103000F28850103000F2A1A010301772BC9010301772A3D010301772C7D010301772B97010303E82B97020300FA2B98010302BC2B98020300AF2B990103012C2B990203004B2CC9010300352CCA0103001B2CCB0103010A2CCC010302152CCD010300BA") + var data []*byteframe.ByteFrame + + var paperData []PaperData + var paperMissions PaperMission + var paperGift []PaperGift + + switch pkt.Unk2 { + case 0: + paperMissions = PaperMission{ + []PaperMissionTimetable{{TimeMidnight(), TimeMidnight().Add(24 * time.Hour)}}, + []PaperMissionData{}, + } + case 5: + paperData = []PaperData{ + // getTowerQuestTowerLevel + {1001, 1, 0, 0, 0, 0, 0}, + {1001, 2, 0, 0, 0, 0, 0}, + // iniTQT + {1003, 1, 100, 100, 200, 100, 0}, + {1003, 2, 150, 100, 240, 100, 0}, + {1004, 10, 9999, 40, 0, 0, 0}, + {1005, 10, 500, 0, 0, 0, 0}, + // getPaperDataSetFromProp + {1007, 1, 0, 0, 0, 0, 0}, + {1008, 200, 400, 3000, 400, 3000, 0}, + // getPaperDataSetParam1 / Dure Goal + {1010, 1, 4000, 0, 0, 0, 0}, + {1010, 2, 4000, 0, 0, 0, 0}, + // update_disp_flag / getPaperDataSetParam1 + {1011, 1, 6000, 15000, 20000, 25000, 30000}, + {1011, 2, 6000, 15000, 20000, 25000, 30000}, + {1012, 1, 8000, 17500, 22500, 27500, 31000}, + {1012, 2, 8000, 17500, 22500, 27500, 31000}, + // setServerZako + {1015, 1, 16, 16, 16, 0, 0}, + {1015, 2, 16, 16, 16, 0, 0}, + // createTowerFloorRandomNumberArray + {1101, 1, 2016, 500, 0, 0, 0}, + {1101, 2, 2016, 500, 0, 0, 0}, + // HRP/SRP/GRP/GSRP/TRP reward + {1103, 1, 0, 0, 3000, 0, 3000}, + {1103, 2, 0, 0, 3000, 0, 3000}, + // getTowerNextVenomLevel + {1104, 1, 10, 9999, 40, 0, 0}, + {1104, 2, 10, 9999, 40, 0, 0}, + {1105, 1, 10, 500, 0, 0, 0}, + {1105, 2, 10, 500, 0, 0, 0}, + // setServerBoss + {2001, 1, 17, 58, 0, 6, 700}, + {2001, 1, 20, 58, 0, 3, 200}, + {2001, 1, 22, 58, 0, 7, 250}, + {2001, 1, 27, 58, 0, 1, 100}, + {2001, 1, 53, 58, 0, 8, 1000}, + {2001, 1, 67, 58, 0, 9, 500}, + {2001, 1, 68, 58, 0, 2, 150}, + {2001, 1, 74, 58, 0, 4, 200}, + {2001, 1, 75, 58, 0, 5, 500}, + {2001, 1, 76, 58, 0, 10, 800}, + {2001, 1, 80, 58, 0, 11, 900}, + {2001, 1, 89, 58, 0, 12, 600}, + {2001, 2, 17, 60, 0, 6, 700}, + {2001, 2, 20, 60, 0, 3, 200}, + {2001, 2, 22, 60, 0, 7, 350}, + {2001, 2, 27, 60, 0, 1, 100}, + {2001, 2, 39, 60, 0, 13, 200}, + {2001, 2, 40, 60, 0, 15, 600}, + {2001, 2, 53, 60, 0, 8, 1000}, + {2001, 2, 67, 60, 0, 2, 500}, + {2001, 2, 68, 60, 0, 9, 150}, + {2001, 2, 74, 60, 0, 4, 200}, + {2001, 2, 75, 60, 0, 5, 500}, + {2001, 2, 76, 60, 0, 10, 800}, + {2001, 2, 80, 60, 0, 11, 900}, + {2001, 2, 81, 60, 0, 14, 900}, + {2001, 2, 89, 60, 0, 12, 600}, + {2001, 2, 94, 60, 0, 16, 1000}, + } + case 6: + paperData = []PaperData{ + // updateClearTowerFloor + {1002, 100, 0, 0, 0, 0, 0}, + // give_gem_func + {1006, 1, 10000, 10000, 0, 0, 0}, + {1006, 2, 10000, 20000, 0, 0, 0}, + {1009, 20, 0, 0, 0, 0, 0}, + // ttcStageInitDRP + {1013, 1, 1, 1, 100, 200, 300}, + {1013, 1, 1, 2, 100, 200, 300}, + {1013, 1, 2, 1, 300, 100, 200}, + {1013, 1, 2, 2, 300, 100, 200}, + {1013, 1, 3, 1, 200, 300, 100}, + {1013, 1, 3, 2, 200, 300, 100}, + {1013, 2, 1, 1, 300, 100, 200}, + {1013, 2, 1, 2, 300, 100, 200}, + {1013, 2, 2, 1, 200, 300, 100}, + {1013, 2, 2, 2, 200, 300, 100}, + {1013, 2, 3, 1, 100, 200, 300}, + {1013, 2, 3, 2, 100, 200, 300}, + {1013, 3, 1, 1, 200, 300, 100}, + {1013, 3, 1, 2, 200, 300, 100}, + {1013, 3, 2, 1, 100, 200, 300}, + {1013, 3, 2, 2, 100, 200, 300}, + {1013, 3, 3, 1, 300, 100, 200}, + {1013, 3, 3, 2, 300, 100, 200}, + {1016, 1, 1, 80, 0, 0, 0}, + {1016, 1, 2, 80, 0, 0, 0}, + {1016, 1, 3, 80, 0, 0, 0}, + {1016, 2, 1, 80, 0, 0, 0}, + {1016, 2, 2, 80, 0, 0, 0}, + {1016, 2, 3, 80, 0, 0, 0}, + {1201, 1, 60, 50, 0, 0, 0}, + {1201, 2, 60, 50, 0, 0, 0}, + // Gimmick Damage {ID, Block, StartFloor, EndFloor, Multiplier*100, Unk, Unk} + {1202, 1, 0, 5, 50, 0, 0}, + {1202, 1, 6, 20, 60, 0, 0}, + {1202, 1, 21, 40, 70, 0, 0}, + {1202, 1, 41, 120, 80, 0, 0}, + {1202, 1, 121, 160, 90, 0, 0}, + {1202, 1, 161, 250, 100, 0, 0}, + {1202, 1, 251, 500, 100, 0, 0}, + {1202, 1, 501, 9999, 100, 0, 0}, + {1202, 2, 0, 100, 100, 0, 0}, + {1202, 2, 101, 200, 100, 0, 0}, + {1202, 2, 201, 500, 150, 0, 0}, + {1202, 2, 501, 9999, 150, 0, 0}, + // Mon Damage {ID, Block, StartFloor, EndFloor, Multiplier*100, Unk, Unk} + {1203, 1, 0, 5, 10, 0, 0}, + {1203, 1, 6, 10, 20, 0, 0}, + {1203, 1, 11, 30, 30, 0, 0}, + {1203, 1, 31, 60, 40, 0, 0}, + {1203, 1, 61, 120, 50, 0, 0}, + {1203, 1, 121, 130, 60, 0, 0}, + {1203, 1, 131, 140, 70, 0, 0}, + {1203, 1, 141, 150, 80, 0, 0}, + {1203, 1, 151, 160, 85, 0, 0}, + {1203, 1, 161, 200, 100, 0, 0}, + {1203, 1, 201, 500, 100, 0, 0}, + {1203, 1, 501, 9999, 100, 0, 0}, + {1203, 2, 0, 120, 70, 0, 0}, + {1203, 2, 121, 500, 120, 0, 0}, + {1203, 2, 501, 9999, 120, 0, 0}, + // Mon HP {ID, Block, StartFloor, EndFloor, Multiplier*100, Unk, Unk} + {1204, 1, 0, 5, 15, 0, 0}, + {1204, 1, 6, 10, 20, 0, 0}, + {1204, 1, 11, 15, 25, 0, 0}, + {1204, 1, 16, 20, 27, 0, 0}, + {1204, 1, 21, 25, 30, 0, 0}, + {1204, 1, 26, 30, 32, 0, 0}, + {1204, 1, 31, 40, 35, 0, 0}, + {1204, 1, 41, 50, 37, 0, 0}, + {1204, 1, 51, 60, 40, 0, 0}, + {1204, 1, 61, 70, 43, 0, 0}, + {1204, 1, 71, 80, 45, 0, 0}, + {1204, 1, 81, 90, 47, 0, 0}, + {1204, 1, 91, 100, 50, 0, 0}, + {1204, 1, 101, 110, 60, 0, 0}, + {1204, 1, 111, 120, 70, 0, 0}, + {1204, 1, 121, 130, 75, 0, 0}, + {1204, 1, 131, 140, 82, 0, 0}, + {1204, 1, 141, 160, 85, 0, 0}, + {1204, 1, 161, 200, 100, 0, 0}, + {1204, 1, 201, 500, 100, 0, 0}, + {1204, 1, 501, 9999, 100, 0, 0}, + {1204, 2, 0, 120, 70, 0, 0}, + {1204, 2, 121, 500, 120, 0, 0}, + {1204, 2, 501, 9999, 120, 0, 0}, + // Supply Items {ID, Block, Unk, ItemID, Quantity, Unk, Unk} + {4001, 1, 0, 0, 0, 0, 0}, + {4001, 2, 0, 10667, 5, 0, 1}, + {4001, 2, 0, 10667, 5, 0, 1}, + {4001, 2, 0, 10667, 5, 0, 1}, + {4001, 2, 0, 10667, 5, 0, 1}, + {4001, 2, 0, 10668, 2, 0, 1}, + {4001, 2, 0, 10668, 2, 0, 1}, + {4001, 2, 0, 10668, 2, 0, 1}, + {4001, 2, 0, 10668, 2, 0, 1}, + {4001, 2, 0, 10669, 1, 0, 1}, + {4001, 2, 0, 10669, 1, 0, 1}, + {4001, 2, 0, 10669, 1, 0, 1}, + {4001, 2, 0, 10669, 1, 0, 1}, + {4001, 2, 0, 10671, 3, 0, 1}, + {4001, 2, 0, 10671, 3, 0, 1}, + {4001, 2, 0, 10671, 3, 0, 1}, + {4001, 2, 0, 10671, 3, 0, 1}, + {4001, 2, 0, 10384, 1, 0, 1}, + {4001, 2, 0, 10384, 1, 0, 1}, + {4001, 2, 0, 10670, 2, 0, 1}, + {4001, 2, 0, 10670, 2, 0, 1}, + {4001, 2, 0, 10682, 2, 0, 1}, + {4001, 2, 0, 10683, 2, 0, 1}, + {4001, 2, 0, 10678, 1, 0, 1}, + {4001, 2, 0, 10678, 1, 0, 1}, + // Item Rewards {ID, Block, Unk, ItemID, Quantity?, Chance*100, Unk} + {4005, 1, 0, 11159, 1, 5000, 1}, + {4005, 1, 0, 11160, 1, 3350, 1}, + {4005, 1, 0, 11161, 1, 1500, 1}, + {4005, 1, 0, 11162, 1, 100, 1}, + {4005, 1, 0, 11163, 1, 50, 1}, + {4005, 2, 0, 11159, 2, 1800, 1}, + {4005, 2, 0, 11160, 2, 1200, 1}, + {4005, 2, 0, 11161, 2, 500, 1}, + {4005, 2, 0, 11162, 1, 50, 1}, + {4005, 2, 0, 11037, 1, 150, 1}, + {4005, 2, 0, 11038, 1, 150, 1}, + {4005, 2, 0, 11044, 1, 150, 1}, + {4005, 2, 0, 11057, 1, 150, 1}, + {4005, 2, 0, 11059, 1, 150, 1}, + {4005, 2, 0, 11079, 1, 150, 1}, + {4005, 2, 0, 11098, 1, 150, 1}, + {4005, 2, 0, 11104, 1, 150, 1}, + {4005, 2, 0, 11117, 1, 150, 1}, + {4005, 2, 0, 11128, 1, 150, 1}, + {4005, 2, 0, 11133, 1, 150, 1}, + {4005, 2, 0, 11137, 1, 150, 1}, + {4005, 2, 0, 11143, 1, 150, 1}, + {4005, 2, 0, 11132, 1, 150, 1}, + {4005, 2, 0, 11039, 1, 150, 1}, + {4005, 2, 0, 11040, 1, 150, 1}, + {4005, 2, 0, 11049, 1, 150, 1}, + {4005, 2, 0, 11061, 1, 150, 1}, + {4005, 2, 0, 11063, 1, 150, 1}, + {4005, 2, 0, 11077, 1, 150, 1}, + {4005, 2, 0, 11099, 1, 150, 1}, + {4005, 2, 0, 11105, 1, 150, 1}, + {4005, 2, 0, 11129, 1, 150, 1}, + {4005, 2, 0, 11130, 1, 150, 1}, + {4005, 2, 0, 11131, 1, 150, 1}, + {4005, 2, 0, 11139, 1, 150, 1}, + {4005, 2, 0, 11145, 1, 150, 1}, + {4005, 2, 0, 11096, 1, 150, 1}, + {4005, 2, 0, 11041, 1, 150, 1}, + {4005, 2, 0, 11047, 1, 150, 1}, + {4005, 2, 0, 11054, 1, 150, 1}, + {4005, 2, 0, 11065, 1, 150, 1}, + {4005, 2, 0, 11068, 1, 150, 1}, + {4005, 2, 0, 11075, 1, 150, 1}, + {4005, 2, 0, 11100, 1, 150, 1}, + {4005, 2, 0, 11106, 1, 150, 1}, + {4005, 2, 0, 11119, 1, 150, 1}, + {4005, 2, 0, 11135, 1, 150, 1}, + {4005, 2, 0, 11136, 1, 150, 1}, + {4005, 2, 0, 11138, 1, 150, 1}, + {4005, 2, 0, 11088, 1, 150, 1}, + {4005, 2, 0, 10370, 1, 150, 1}, + {4005, 2, 0, 10368, 1, 150, 1}, + {4006, 1, 0, 11159, 1, 5000, 1}, + {4006, 1, 0, 11160, 1, 3350, 1}, + {4006, 1, 0, 11161, 1, 1500, 1}, + {4006, 1, 0, 11162, 1, 100, 1}, + {4006, 1, 0, 11163, 1, 50, 1}, + {4006, 2, 0, 11159, 2, 1800, 1}, + {4006, 2, 0, 11160, 2, 1200, 1}, + {4006, 2, 0, 11161, 2, 500, 1}, + {4006, 2, 0, 11162, 1, 50, 1}, + {4006, 2, 0, 11037, 1, 150, 1}, + {4006, 2, 0, 11038, 1, 150, 1}, + {4006, 2, 0, 11044, 1, 150, 1}, + {4006, 2, 0, 11057, 1, 150, 1}, + {4006, 2, 0, 11059, 1, 150, 1}, + {4006, 2, 0, 11079, 1, 150, 1}, + {4006, 2, 0, 11098, 1, 150, 1}, + {4006, 2, 0, 11104, 1, 150, 1}, + {4006, 2, 0, 11117, 1, 150, 1}, + {4006, 2, 0, 11128, 1, 150, 1}, + {4006, 2, 0, 11133, 1, 150, 1}, + {4006, 2, 0, 11137, 1, 150, 1}, + {4006, 2, 0, 11143, 1, 150, 1}, + {4006, 2, 0, 11132, 1, 150, 1}, + {4006, 2, 0, 11039, 1, 150, 1}, + {4006, 2, 0, 11040, 1, 150, 1}, + {4006, 2, 0, 11049, 1, 150, 1}, + {4006, 2, 0, 11061, 1, 150, 1}, + {4006, 2, 0, 11063, 1, 150, 1}, + {4006, 2, 0, 11077, 1, 150, 1}, + {4006, 2, 0, 11099, 1, 150, 1}, + {4006, 2, 0, 11105, 1, 150, 1}, + {4006, 2, 0, 11129, 1, 150, 1}, + {4006, 2, 0, 11130, 1, 150, 1}, + {4006, 2, 0, 11131, 1, 150, 1}, + {4006, 2, 0, 11139, 1, 150, 1}, + {4006, 2, 0, 11145, 1, 150, 1}, + {4006, 2, 0, 11096, 1, 150, 1}, + {4006, 2, 0, 11041, 1, 150, 1}, + {4006, 2, 0, 11047, 1, 150, 1}, + {4006, 2, 0, 11054, 1, 150, 1}, + {4006, 2, 0, 11065, 1, 150, 1}, + {4006, 2, 0, 11068, 1, 150, 1}, + {4006, 2, 0, 11075, 1, 150, 1}, + {4006, 2, 0, 11100, 1, 150, 1}, + {4006, 2, 0, 11106, 1, 150, 1}, + {4006, 2, 0, 11119, 1, 150, 1}, + {4006, 2, 0, 11135, 1, 150, 1}, + {4006, 2, 0, 11136, 1, 150, 1}, + {4006, 2, 0, 11138, 1, 150, 1}, + {4006, 2, 0, 11088, 1, 150, 1}, + {4006, 2, 0, 10370, 1, 150, 1}, + {4006, 2, 0, 10368, 1, 150, 1}, + {4007, 1, 0, 11058, 1, 70, 1}, + {4007, 1, 0, 11060, 1, 70, 1}, + {4007, 1, 0, 11062, 1, 70, 1}, + {4007, 1, 0, 11064, 1, 70, 1}, + {4007, 1, 0, 11066, 1, 70, 1}, + {4007, 1, 0, 11118, 1, 70, 1}, + {4007, 1, 0, 11120, 1, 70, 1}, + {4007, 1, 0, 11110, 1, 70, 1}, + {4007, 1, 0, 11112, 1, 70, 1}, + {4007, 1, 0, 11114, 1, 70, 1}, + {4007, 1, 0, 11042, 1, 70, 1}, + {4007, 1, 0, 11043, 1, 70, 1}, + {4007, 1, 0, 11074, 1, 70, 1}, + {4007, 1, 0, 11140, 1, 70, 1}, + {4007, 1, 0, 11067, 1, 70, 1}, + {4007, 1, 0, 11048, 1, 70, 1}, + {4007, 1, 0, 11046, 1, 70, 1}, + {4007, 1, 0, 11103, 1, 70, 1}, + {4007, 1, 0, 11107, 1, 70, 1}, + {4007, 1, 0, 11108, 1, 70, 1}, + {4007, 1, 0, 11121, 1, 70, 1}, + {4007, 1, 0, 11134, 1, 70, 1}, + {4007, 1, 0, 11084, 1, 70, 1}, + {4007, 1, 0, 11085, 1, 70, 1}, + {4007, 1, 0, 11086, 1, 70, 1}, + {4007, 1, 0, 11087, 1, 70, 1}, + {4007, 1, 0, 11094, 1, 70, 1}, + {4007, 1, 0, 11095, 1, 70, 1}, + {4007, 1, 0, 10374, 1, 70, 1}, + {4007, 1, 0, 10375, 1, 70, 1}, + {4007, 1, 0, 10376, 1, 70, 1}, + {4007, 1, 0, 10377, 1, 70, 1}, + {4007, 1, 0, 10378, 1, 70, 1}, + {4007, 1, 0, 11069, 1, 45, 1}, + {4007, 1, 0, 11071, 1, 45, 1}, + {4007, 1, 0, 11073, 1, 45, 1}, + {4007, 1, 0, 11076, 1, 45, 1}, + {4007, 1, 0, 11078, 1, 45, 1}, + {4007, 1, 0, 11116, 1, 45, 1}, + {4007, 1, 0, 11123, 1, 45, 1}, + {4007, 1, 0, 11127, 1, 45, 1}, + {4007, 1, 0, 11142, 1, 45, 1}, + {4007, 1, 0, 11056, 1, 45, 1}, + {4007, 1, 0, 11090, 1, 45, 1}, + {4007, 1, 0, 11097, 1, 45, 1}, + {4007, 1, 0, 10367, 1, 45, 1}, + {4007, 1, 0, 10371, 1, 45, 1}, + {4007, 1, 0, 10373, 1, 45, 1}, + {4007, 1, 0, 11080, 1, 15, 1}, + {4007, 1, 0, 11081, 1, 15, 1}, + {4007, 1, 0, 11083, 1, 15, 1}, + {4007, 1, 0, 11125, 1, 15, 1}, + {4007, 1, 0, 11093, 1, 14, 1}, + {4007, 1, 0, 11053, 1, 10, 1}, + {4007, 1, 0, 11147, 1, 10, 1}, + {4007, 1, 0, 10372, 1, 5, 1}, + {4007, 1, 0, 10369, 1, 1, 1}, + {4007, 1, 0, 11163, 1, 150, 1}, + {4007, 1, 0, 11465, 1, 50, 1}, + {4007, 1, 0, 11466, 1, 25, 1}, + {4007, 1, 0, 11467, 1, 200, 1}, + {4007, 1, 0, 11468, 1, 400, 1}, + {4007, 1, 0, 11469, 1, 150, 1}, + {4007, 1, 0, 11037, 1, 92, 1}, + {4007, 1, 0, 11038, 1, 92, 1}, + {4007, 1, 0, 11044, 1, 92, 1}, + {4007, 1, 0, 11057, 1, 92, 1}, + {4007, 1, 0, 11059, 1, 92, 1}, + {4007, 1, 0, 11079, 1, 92, 1}, + {4007, 1, 0, 11098, 1, 92, 1}, + {4007, 1, 0, 11104, 1, 92, 1}, + {4007, 1, 0, 11117, 1, 92, 1}, + {4007, 1, 0, 11133, 1, 92, 1}, + {4007, 1, 0, 11137, 1, 92, 1}, + {4007, 1, 0, 11143, 1, 92, 1}, + {4007, 1, 0, 11132, 1, 92, 1}, + {4007, 1, 0, 11039, 1, 92, 1}, + {4007, 1, 0, 11040, 1, 92, 1}, + {4007, 1, 0, 11049, 1, 92, 1}, + {4007, 1, 0, 11061, 1, 92, 1}, + {4007, 1, 0, 11063, 1, 92, 1}, + {4007, 1, 0, 11077, 1, 92, 1}, + {4007, 1, 0, 11099, 1, 92, 1}, + {4007, 1, 0, 11105, 1, 92, 1}, + {4007, 1, 0, 11129, 1, 92, 1}, + {4007, 1, 0, 11130, 1, 92, 1}, + {4007, 1, 0, 11131, 1, 92, 1}, + {4007, 1, 0, 11139, 1, 92, 1}, + {4007, 1, 0, 11145, 1, 91, 1}, + {4007, 1, 0, 11096, 1, 91, 1}, + {4007, 1, 0, 11041, 1, 91, 1}, + {4007, 1, 0, 11047, 1, 91, 1}, + {4007, 1, 0, 11054, 1, 91, 1}, + {4007, 1, 0, 11065, 1, 91, 1}, + {4007, 1, 0, 11068, 1, 91, 1}, + {4007, 1, 0, 11075, 1, 91, 1}, + {4007, 1, 0, 11100, 1, 91, 1}, + {4007, 1, 0, 11106, 1, 91, 1}, + {4007, 1, 0, 11119, 1, 91, 1}, + {4007, 1, 0, 11135, 1, 91, 1}, + {4007, 1, 0, 11136, 1, 91, 1}, + {4007, 1, 0, 11138, 1, 91, 1}, + {4007, 1, 0, 11088, 1, 91, 1}, + {4007, 1, 0, 10370, 1, 91, 1}, + {4007, 1, 0, 10368, 1, 91, 1}, + {4007, 1, 0, 11045, 1, 91, 1}, + {4007, 1, 0, 11070, 1, 91, 1}, + {4007, 1, 0, 11101, 1, 91, 1}, + {4007, 1, 0, 11109, 1, 91, 1}, + {4007, 1, 0, 11122, 1, 91, 1}, + {4007, 1, 0, 11141, 1, 91, 1}, + {4007, 1, 0, 11051, 1, 91, 1}, + {4007, 1, 0, 11102, 1, 91, 1}, + {4007, 1, 0, 11124, 1, 91, 1}, + {4007, 1, 0, 11072, 1, 91, 1}, + {4007, 1, 0, 11082, 1, 91, 1}, + {4007, 1, 0, 11115, 1, 91, 1}, + {4007, 1, 0, 11144, 1, 91, 1}, + {4007, 1, 0, 11089, 1, 91, 1}, + {4007, 1, 0, 11091, 1, 91, 1}, + {4007, 1, 0, 11092, 1, 91, 1}, + {4007, 1, 0, 11050, 1, 91, 1}, + {4007, 1, 0, 11111, 1, 91, 1}, + {4007, 1, 0, 11113, 1, 91, 1}, + {4007, 1, 0, 11126, 1, 91, 1}, + {4007, 1, 0, 11055, 1, 91, 1}, + {4007, 1, 0, 11052, 1, 91, 1}, + {4007, 1, 0, 11146, 1, 91, 1}, + {4007, 2, 0, 11058, 1, 90, 1}, + {4007, 2, 0, 11060, 1, 90, 1}, + {4007, 2, 0, 11062, 1, 90, 1}, + {4007, 2, 0, 11064, 1, 90, 1}, + {4007, 2, 0, 11066, 1, 90, 1}, + {4007, 2, 0, 11118, 1, 90, 1}, + {4007, 2, 0, 11120, 1, 90, 1}, + {4007, 2, 0, 11110, 1, 90, 1}, + {4007, 2, 0, 11112, 1, 90, 1}, + {4007, 2, 0, 11114, 1, 90, 1}, + {4007, 2, 0, 11042, 1, 90, 1}, + {4007, 2, 0, 11043, 1, 90, 1}, + {4007, 2, 0, 11074, 1, 90, 1}, + {4007, 2, 0, 11140, 1, 90, 1}, + {4007, 2, 0, 11067, 1, 90, 1}, + {4007, 2, 0, 11048, 1, 90, 1}, + {4007, 2, 0, 11046, 1, 90, 1}, + {4007, 2, 0, 11103, 1, 90, 1}, + {4007, 2, 0, 11107, 1, 90, 1}, + {4007, 2, 0, 11108, 1, 90, 1}, + {4007, 2, 0, 11121, 1, 90, 1}, + {4007, 2, 0, 11134, 1, 90, 1}, + {4007, 2, 0, 11084, 1, 90, 1}, + {4007, 2, 0, 11085, 1, 90, 1}, + {4007, 2, 0, 11086, 1, 90, 1}, + {4007, 2, 0, 11087, 1, 90, 1}, + {4007, 2, 0, 11094, 1, 90, 1}, + {4007, 2, 0, 11095, 1, 90, 1}, + {4007, 2, 0, 10374, 1, 90, 1}, + {4007, 2, 0, 10375, 1, 90, 1}, + {4007, 2, 0, 10376, 1, 90, 1}, + {4007, 2, 0, 10377, 1, 90, 1}, + {4007, 2, 0, 10378, 1, 90, 1}, + {4007, 2, 0, 11069, 1, 80, 1}, + {4007, 2, 0, 11071, 1, 80, 1}, + {4007, 2, 0, 11073, 1, 80, 1}, + {4007, 2, 0, 11076, 1, 80, 1}, + {4007, 2, 0, 11078, 1, 80, 1}, + {4007, 2, 0, 11116, 1, 80, 1}, + {4007, 2, 0, 11123, 1, 80, 1}, + {4007, 2, 0, 11127, 1, 80, 1}, + {4007, 2, 0, 11142, 1, 80, 1}, + {4007, 2, 0, 11056, 1, 80, 1}, + {4007, 2, 0, 11090, 1, 80, 1}, + {4007, 2, 0, 11097, 1, 80, 1}, + {4007, 2, 0, 10367, 1, 80, 1}, + {4007, 2, 0, 10371, 1, 80, 1}, + {4007, 2, 0, 10373, 1, 80, 1}, + {4007, 2, 0, 11080, 1, 22, 1}, + {4007, 2, 0, 11081, 1, 22, 1}, + {4007, 2, 0, 11083, 1, 22, 1}, + {4007, 2, 0, 11125, 1, 22, 1}, + {4007, 2, 0, 11093, 1, 22, 1}, + {4007, 2, 0, 11053, 1, 15, 1}, + {4007, 2, 0, 11147, 1, 15, 1}, + {4007, 2, 0, 10372, 1, 8, 1}, + {4007, 2, 0, 10369, 1, 2, 1}, + {4007, 2, 0, 11159, 3, 1220, 1}, + {4007, 2, 0, 11160, 3, 650, 1}, + {4007, 2, 0, 11161, 3, 160, 1}, + {4007, 2, 0, 11661, 1, 800, 1}, + {4007, 2, 0, 11662, 1, 800, 1}, + {4007, 2, 0, 11163, 1, 500, 1}, + {4007, 2, 0, 11162, 1, 550, 1}, + {4007, 2, 0, 11465, 1, 50, 1}, + {4007, 2, 0, 11466, 1, 25, 1}, + {4007, 2, 0, 11467, 1, 250, 1}, + {4007, 2, 0, 11468, 1, 500, 1}, + {4007, 2, 0, 11469, 1, 175, 1}, + // Probably treasure chest rewards + {4202, 1, 0, 11163, 1, 6000, 1}, + {4202, 1, 0, 11465, 1, 200, 1}, + {4202, 1, 0, 11466, 1, 100, 1}, + {4202, 1, 0, 11467, 1, 1000, 1}, + {4202, 1, 0, 11468, 1, 2000, 1}, + {4202, 1, 0, 11469, 1, 700, 1}, + {4202, 2, 0, 11661, 1, 800, 1}, + {4202, 2, 0, 11662, 1, 800, 1}, + {4202, 2, 0, 11163, 1, 400, 1}, + {4202, 2, 0, 11465, 1, 400, 1}, + {4202, 2, 0, 11466, 1, 200, 1}, + {4202, 2, 0, 11467, 1, 2000, 1}, + {4202, 2, 0, 11468, 1, 4000, 1}, + {4202, 2, 0, 11469, 1, 1400, 1}, + } + default: + if pkt.Unk2 < 1000 { + s.logger.Info("PaperData request for unknown type", zap.Uint32("Unk2", pkt.Unk2)) + } + } + + if pkt.Unk2 > 1000 { + _, ok := paperGiftData[pkt.Unk2] + if ok { + paperGift = paperGiftData[pkt.Unk2] + } else { + s.logger.Info("PaperGift request for unknown type", zap.Uint32("Unk2", pkt.Unk2)) + } + for _, gift := range paperGift { + bf := byteframe.NewByteFrame() + bf.WriteUint16(gift.Unk0) + bf.WriteUint8(gift.Unk1) + bf.WriteUint8(gift.Unk2) + bf.WriteUint16(gift.Unk3) + data = append(data, bf) + } + doAckEarthSucceed(s, pkt.AckHandle, data) + } else if pkt.Unk2 == 0 { + bf := byteframe.NewByteFrame() + bf.WriteUint16(uint16(len(paperMissions.Timetables))) + bf.WriteUint16(uint16(len(paperMissions.Data))) + for _, timetable := range paperMissions.Timetables { + bf.WriteUint32(uint32(timetable.Start.Unix())) + bf.WriteUint32(uint32(timetable.End.Unix())) + } + for _, mdata := range paperMissions.Data { + bf.WriteUint8(mdata.Unk0) + bf.WriteUint8(mdata.Unk1) + bf.WriteInt16(mdata.Unk2) + bf.WriteUint16(mdata.Reward1ID) + bf.WriteUint8(mdata.Reward1Quantity) + bf.WriteUint16(mdata.Reward2ID) + bf.WriteUint8(mdata.Reward2Quantity) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } else { - data = []byte{0x00, 0x00, 0x00, 0x00} - s.logger.Info("GET_PAPER request for unknown type") + for _, pdata := range paperData { + bf := byteframe.NewByteFrame() + bf.WriteUint16(pdata.Unk0) + bf.WriteInt16(pdata.Unk1) + bf.WriteInt16(pdata.Unk2) + bf.WriteInt16(pdata.Unk3) + bf.WriteInt16(pdata.Unk4) + bf.WriteInt16(pdata.Unk5) + bf.WriteInt16(pdata.Unk6) + data = append(data, bf) + } + doAckEarthSucceed(s, pkt.AckHandle, data) } - if err != nil { - panic(err) - } - doAckBufSucceed(s, pkt.AckHandle, data) } func handleMsgSysAuthData(s *Session, p mhfpacket.MHFPacket) {} diff --git a/server/channelserver/handlers_distitem.go b/server/channelserver/handlers_distitem.go index 0da9347fa..2bde7c60a 100644 --- a/server/channelserver/handlers_distitem.go +++ b/server/channelserver/handlers_distitem.go @@ -4,6 +4,7 @@ import ( "erupe-ce/common/byteframe" ps "erupe-ce/common/pascalstring" "erupe-ce/network/mhfpacket" + "go.uber.org/zap" ) @@ -66,10 +67,28 @@ func handleMsgMhfEnumerateDistItem(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(distData.MaxSR) bf.WriteUint16(distData.MinGR) bf.WriteUint16(distData.MaxGR) - bf.WriteUint32(0) // Unk - bf.WriteUint32(0) // Unk - ps.Uint16(bf, distData.EventName, true) - bf.WriteBytes(make([]byte, 391)) + bf.WriteUint8(0) + bf.WriteUint16(0) + bf.WriteUint8(0) + bf.WriteUint16(0) + bf.WriteUint16(0) + bf.WriteUint8(0) + ps.Uint8(bf, distData.EventName, true) + for i := 0; i < 6; i++ { + for j := 0; j < 13; j++ { + bf.WriteUint8(0) + bf.WriteUint32(0) + } + } + i := uint8(0) + bf.WriteUint8(i) + if i <= 10 { + for j := uint8(0); j < i; j++ { + bf.WriteUint32(0) + bf.WriteUint32(0) + bf.WriteUint32(0) + } + } } resp := byteframe.NewByteFrame() resp.WriteUint16(uint16(distCount)) diff --git a/server/channelserver/handlers_diva.go b/server/channelserver/handlers_diva.go index 230dde40b..2fe611a42 100644 --- a/server/channelserver/handlers_diva.go +++ b/server/channelserver/handlers_diva.go @@ -9,6 +9,7 @@ import ( "go.uber.org/zap" "golang.org/x/exp/slices" "math/rand" + _config "erupe-ce/config" "time" "erupe-ce/common/byteframe" @@ -89,7 +90,11 @@ func handleMsgMhfGetUdSchedule(s *Session, p mhfpacket.MHFPacket) { var timestamps []uint32 if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.DivaEvent >= 0 { if s.server.erupeConfig.DevModeOptions.DivaEvent == 0 { - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 36)) + if s.server.erupeConfig.RealClientMode <= _config.Z1 { + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 32)) + } else { + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 36)) + } return } timestamps = generateDivaTimestamps(s, uint32(s.server.erupeConfig.DevModeOptions.DivaEvent), true) @@ -97,9 +102,11 @@ func handleMsgMhfGetUdSchedule(s *Session, p mhfpacket.MHFPacket) { timestamps = generateDivaTimestamps(s, start, false) } - bf.WriteUint32(id) - for _, timestamp := range timestamps { - bf.WriteUint32(timestamp) + if s.server.erupeConfig.RealClientMode <= _config.Z1 { + bf.WriteUint32(id) + } + for i := range timestamps { + bf.WriteUint32(timestamps[i]) } bf.WriteUint16(0x19) // Unk 00011001 diff --git a/server/channelserver/handlers_event.go b/server/channelserver/handlers_event.go index bba4c1065..d01f92a3d 100644 --- a/server/channelserver/handlers_event.go +++ b/server/channelserver/handlers_event.go @@ -2,6 +2,7 @@ package channelserver import ( "erupe-ce/common/token" + _config "erupe-ce/config" "math" "time" @@ -9,47 +10,41 @@ import ( "erupe-ce/network/mhfpacket" ) -func handleMsgMhfRegisterEvent(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgMhfRegisterEvent) - bf := byteframe.NewByteFrame() - bf.WriteUint8(pkt.Unk2) - bf.WriteUint8(pkt.Unk4) - bf.WriteUint16(0x1142) - doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) -} - -func handleMsgMhfReleaseEvent(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgMhfReleaseEvent) - - // Do this ack manually because it uses a non-(0|1) error code - /* - _ACK_SUCCESS = 0 - _ACK_ERROR = 1 - - _ACK_EINPROGRESS = 16 - _ACK_ENOENT = 17 - _ACK_ENOSPC = 18 - _ACK_ETIMEOUT = 19 - - _ACK_EINVALID = 64 - _ACK_EFAILED = 65 - _ACK_ENOMEM = 66 - _ACK_ENOTEXIT = 67 - _ACK_ENOTREADY = 68 - _ACK_EALREADY = 69 - _ACK_DISABLE_WORK = 71 - */ - s.QueueSendMHF(&mhfpacket.MsgSysAck{ - AckHandle: pkt.AckHandle, - IsBufferResponse: false, - ErrorCode: 0x41, - AckData: []byte{0x00, 0x00, 0x00, 0x00}, - }) +type Event struct { + EventType uint16 + Unk1 uint16 + Unk2 uint16 + Unk3 uint16 + Unk4 uint16 + Unk5 uint32 + Unk6 uint32 + QuestFileIDs []uint16 } func handleMsgMhfEnumerateEvent(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfEnumerateEvent) - stubEnumerateNoResults(s, pkt.AckHandle) + bf := byteframe.NewByteFrame() + + events := []Event{} + + bf.WriteUint8(uint8(len(events))) + for _, event := range events { + bf.WriteUint16(event.EventType) + bf.WriteUint16(event.Unk1) + bf.WriteUint16(event.Unk2) + bf.WriteUint16(event.Unk3) + bf.WriteUint16(event.Unk4) + bf.WriteUint32(event.Unk5) + bf.WriteUint32(event.Unk6) + if event.EventType == 2 { + bf.WriteUint8(uint8(len(event.QuestFileIDs))) + for _, qf := range event.QuestFileIDs { + bf.WriteUint16(qf) + } + } + } + + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } type activeFeature struct { @@ -90,14 +85,24 @@ func handleMsgMhfGetWeeklySchedule(s *Session, p mhfpacket.MHFPacket) { } func generateFeatureWeapons(count int) activeFeature { - if count > 14 { - count = 14 + _max := 14 + if _config.ErupeConfig.RealClientMode < _config.ZZ { + _max = 13 + } + if _config.ErupeConfig.RealClientMode < _config.G10 { + _max = 12 + } + if _config.ErupeConfig.RealClientMode < _config.GG { + _max = 11 + } + if count > _max { + count = _max } nums := make([]int, 0) var result int for len(nums) < count { rng := token.RNG() - num := rng.Intn(14) + num := rng.Intn(_max) exist := false for _, v := range nums { if v == num { diff --git a/server/channelserver/handlers_festa.go b/server/channelserver/handlers_festa.go index 155cee3d8..7ca50d9d1 100644 --- a/server/channelserver/handlers_festa.go +++ b/server/channelserver/handlers_festa.go @@ -1,10 +1,10 @@ package channelserver import ( - "encoding/hex" "erupe-ce/common/byteframe" ps "erupe-ce/common/pascalstring" "erupe-ce/common/token" + _config "erupe-ce/config" "erupe-ce/network/mhfpacket" "sort" "time" @@ -140,13 +140,26 @@ func generateFestaTimestamps(s *Session, start uint32, debug bool) []uint32 { return timestamps } -type Trial struct { +type FestaTrial struct { ID uint32 `db:"id"` - Objective uint8 `db:"objective"` + Objective uint16 `db:"objective"` GoalID uint32 `db:"goal_id"` TimesReq uint16 `db:"times_req"` Locale uint16 `db:"locale_req"` Reward uint16 `db:"reward"` + Monopoly uint16 + Unk uint16 +} + +type FestaReward struct { + Unk0 uint8 + Unk1 uint8 + ItemType uint16 + Quantity uint16 + ItemID uint16 + Unk5 uint16 + Unk6 uint16 + Unk7 uint8 } func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) { @@ -190,36 +203,82 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(blueSouls) bf.WriteUint32(redSouls) + var trials []FestaTrial + var trial FestaTrial rows, _ = s.server.db.Queryx("SELECT * FROM festa_trials") - trialData := byteframe.NewByteFrame() - var count uint16 for rows.Next() { - trial := &Trial{} err := rows.StructScan(&trial) if err != nil { continue } - count++ - trialData.WriteUint32(trial.ID) - trialData.WriteUint8(0) // Unk - trialData.WriteUint8(trial.Objective) - trialData.WriteUint32(trial.GoalID) - trialData.WriteUint16(trial.TimesReq) - trialData.WriteUint16(trial.Locale) - trialData.WriteUint16(trial.Reward) - trialData.WriteUint8(0xFF) // Unk - trialData.WriteUint8(0xFF) // MonopolyState - trialData.WriteUint16(0) // Unk + trials = append(trials, trial) + } + bf.WriteUint16(uint16(len(trials))) + for _, trial := range trials { + bf.WriteUint32(trial.ID) + bf.WriteUint16(trial.Objective) + bf.WriteUint32(trial.GoalID) + bf.WriteUint16(trial.TimesReq) + bf.WriteUint16(trial.Locale) + bf.WriteUint16(trial.Reward) + trial.Monopoly = 0xFFFF // NYI + bf.WriteUint16(trial.Monopoly) + bf.WriteUint16(trial.Unk) } - bf.WriteUint16(count) - bf.WriteBytes(trialData.Data()) - // Static bonus rewards - rewards, _ := hex.DecodeString("001901000007015E05F000000000000100000703E81B6300000000010100000C03E8000000000000000100000D0000000000000000000100000100000000000000000002000007015E05F000000000000200000703E81B6300000000010200000C03E8000000000000000200000D0000000000000000000200000400000000000000000003000007015E05F000000000000300000703E81B6300000000010300000C03E8000000000000000300000D0000000000000000000300000100000000000000000004000007015E05F000000000000400000703E81B6300000000010400000C03E8000000000000000400000D0000000000000000000400000400000000000000000005000007015E05F000000000000500000703E81B6300000000010500000C03E8000000000000000500000D00000000000000000005000001000000000000000000") - bf.WriteBytes(rewards) + // The Winner and Loser Armor IDs are missing + // Item 7011 may not exist in older versions, remove to prevent crashes + rewards := []FestaReward{ + {1, 0, 7, 350, 1520, 0, 0, 0}, + {1, 0, 7, 1000, 7011, 0, 0, 1}, + {1, 0, 12, 1000, 0, 0, 0, 0}, + {1, 0, 13, 0, 0, 0, 0, 0}, + //{1, 0, 1, 0, 0, 0, 0, 0}, + {2, 0, 7, 350, 1520, 0, 0, 0}, + {2, 0, 7, 1000, 7011, 0, 0, 1}, + {2, 0, 12, 1000, 0, 0, 0, 0}, + {2, 0, 13, 0, 0, 0, 0, 0}, + //{2, 0, 4, 0, 0, 0, 0, 0}, + {3, 0, 7, 350, 1520, 0, 0, 0}, + {3, 0, 7, 1000, 7011, 0, 0, 1}, + {3, 0, 12, 1000, 0, 0, 0, 0}, + {3, 0, 13, 0, 0, 0, 0, 0}, + //{3, 0, 1, 0, 0, 0, 0, 0}, + {4, 0, 7, 350, 1520, 0, 0, 0}, + {4, 0, 7, 1000, 7011, 0, 0, 1}, + {4, 0, 12, 1000, 0, 0, 0, 0}, + {4, 0, 13, 0, 0, 0, 0, 0}, + //{4, 0, 4, 0, 0, 0, 0, 0}, + {5, 0, 7, 350, 1520, 0, 0, 0}, + {5, 0, 7, 1000, 7011, 0, 0, 1}, + {5, 0, 12, 1000, 0, 0, 0, 0}, + {5, 0, 13, 0, 0, 0, 0, 0}, + //{5, 0, 1, 0, 0, 0, 0, 0}, + } - bf.WriteUint16(0x0001) - bf.WriteUint32(0xD4C001F4) + bf.WriteUint16(uint16(len(rewards))) + for _, reward := range rewards { + bf.WriteUint8(reward.Unk0) + bf.WriteUint8(reward.Unk1) + bf.WriteUint16(reward.ItemType) + bf.WriteUint16(reward.Quantity) + bf.WriteUint16(reward.ItemID) + // Not confirmed to be G1 but exists in G3 + if _config.ErupeConfig.RealClientMode >= _config.G1 { + bf.WriteUint16(reward.Unk5) + bf.WriteUint16(reward.Unk6) + bf.WriteUint8(reward.Unk7) + } + } + if _config.ErupeConfig.RealClientMode <= _config.G61 { + if s.server.erupeConfig.GameplayOptions.MaximumFP > 0xFFFF { + s.server.erupeConfig.GameplayOptions.MaximumFP = 0xFFFF + } + bf.WriteUint16(uint16(s.server.erupeConfig.GameplayOptions.MaximumFP)) + } else { + bf.WriteUint32(s.server.erupeConfig.GameplayOptions.MaximumFP) + } + bf.WriteUint16(500) categoryWinners := uint16(0) // NYI bf.WriteUint16(categoryWinners) @@ -239,8 +298,18 @@ func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) { ps.Uint8(bf, "", true) // Guild Name } - d, _ := hex.DecodeString("000000000000000100001388000007D0000003E800000064012C00C8009600640032") - bf.WriteBytes(d) + // Unknown values + bf.WriteUint32(1) + bf.WriteUint32(5000) + bf.WriteUint32(2000) + bf.WriteUint32(1000) + bf.WriteUint32(100) + bf.WriteUint16(300) + bf.WriteUint16(200) + bf.WriteUint16(150) + bf.WriteUint16(100) + bf.WriteUint16(50) + ps.Uint16(bf, "", false) doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } diff --git a/server/channelserver/handlers_guild.go b/server/channelserver/handlers_guild.go index 697f005e6..2d828a0dc 100644 --- a/server/channelserver/handlers_guild.go +++ b/server/channelserver/handlers_guild.go @@ -4,9 +4,9 @@ import ( "database/sql" "database/sql/driver" "encoding/binary" - "encoding/hex" "encoding/json" "errors" + _config "erupe-ce/config" "fmt" "math" "sort" @@ -62,7 +62,6 @@ type Guild struct { Recruiting bool `db:"recruiting"` FestivalColour FestivalColour `db:"festival_colour"` Souls uint32 `db:"souls"` - Rank uint16 `db:"rank"` AllianceID uint32 `db:"alliance_id"` Icon *GuildIcon `db:"icon"` @@ -115,6 +114,39 @@ 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.ErupeConfig.RealClientMode <= _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.ErupeConfig.RealClientMode <= _config.S6 && i >= 12 { + return 12 + } else if _config.ErupeConfig.RealClientMode <= _config.F5 && i >= 13 { + return 13 + } else if _config.ErupeConfig.RealClientMode <= _config.G32 && i >= 14 { + return 14 + } + return uint16(i) + } + } + if _config.ErupeConfig.RealClientMode <= _config.S6 { + return 12 + } else if _config.ErupeConfig.RealClientMode <= _config.F5 { + return 13 + } else if _config.ErupeConfig.RealClientMode <= _config.G32 { + return 14 + } + return 17 +} + const guildInfoSelectQuery = ` SELECT g.id, @@ -137,14 +169,6 @@ SELECT recruiting, COALESCE((SELECT team FROM festa_registrations fr WHERE fr.guild_id = g.id), 'none') AS festival_colour, (SELECT SUM(souls) FROM guild_characters gc WHERE gc.guild_id = g.id) AS souls, - CASE - WHEN rank_rp <= 48 THEN rank_rp/24 - WHEN rank_rp <= 288 THEN rank_rp/48+1 - WHEN rank_rp <= 504 THEN rank_rp/72+3 - WHEN rank_rp <= 1080 THEN (rank_rp-24)/96+5 - WHEN rank_rp < 1200 THEN 16 - ELSE 17 - END rank, COALESCE(( SELECT id FROM guild_alliances ga WHERE ga.parent_id = g.id OR @@ -615,13 +639,7 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfOperateGuild) guild, err := GetGuildInfoByID(s, pkt.GuildID) - - if err != nil { - return - } - characterGuildInfo, err := GetCharacterGuildData(s, s.charID) - if err != nil { doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) return @@ -630,22 +648,19 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) { bf := byteframe.NewByteFrame() switch pkt.Action { - case mhfpacket.OPERATE_GUILD_DISBAND: + case mhfpacket.OperateGuildDisband: + response := 1 if guild.LeaderCharID != s.charID { s.logger.Warn(fmt.Sprintf("character '%d' is attempting to manage guild '%d' without permission", s.charID, guild.ID)) - return + response = 0 + } else { + err = guild.Disband(s) + if err != nil { + response = 0 + } } - - err = guild.Disband(s) - response := 0x01 - - if err != nil { - // All successful acks return 0x01, assuming 0x00 is failure - response = 0x00 - } - bf.WriteUint32(uint32(response)) - case mhfpacket.OPERATE_GUILD_RESIGN: + case mhfpacket.OperateGuildResign: guildMembers, err := GetGuildMembers(s, guild.ID, false) if err == nil { sort.Slice(guildMembers[:], func(i, j int) bool { @@ -664,25 +679,22 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) { } guild.Save(s) } - case mhfpacket.OPERATE_GUILD_APPLY: + case mhfpacket.OperateGuildApply: err = guild.CreateApplication(s, s.charID, GuildApplicationTypeApplied, nil) - if err == nil { bf.WriteUint32(guild.LeaderCharID) + } else { + bf.WriteUint32(0) } - case mhfpacket.OPERATE_GUILD_LEAVE: - var err error - + case mhfpacket.OperateGuildLeave: if characterGuildInfo.IsApplicant { err = guild.RejectApplication(s, s.charID) } else { err = guild.RemoveCharacter(s, s.charID) } - - response := 0x01 + response := 1 if err != nil { - // All successful acks return 0x01, assuming 0x00 is failure - response = 0x00 + response = 0 } else { mail := Mail{ RecipientID: s.charID, @@ -692,26 +704,25 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) { } mail.Send(s, nil) } - bf.WriteUint32(uint32(response)) - case mhfpacket.OPERATE_GUILD_DONATE_RANK: + case mhfpacket.OperateGuildDonateRank: bf.WriteBytes(handleDonateRP(s, uint16(pkt.Data1.ReadUint32()), guild, false)) - case mhfpacket.OPERATE_GUILD_SET_APPLICATION_DENY: + case mhfpacket.OperateGuildSetApplicationDeny: s.server.db.Exec("UPDATE guilds SET recruiting=false WHERE id=$1", guild.ID) - case mhfpacket.OPERATE_GUILD_SET_APPLICATION_ALLOW: + case mhfpacket.OperateGuildSetApplicationAllow: s.server.db.Exec("UPDATE guilds SET recruiting=true WHERE id=$1", guild.ID) - case mhfpacket.OPERATE_GUILD_SET_AVOID_LEADERSHIP_TRUE: + case mhfpacket.OperateGuildSetAvoidLeadershipTrue: handleAvoidLeadershipUpdate(s, pkt, true) - case mhfpacket.OPERATE_GUILD_SET_AVOID_LEADERSHIP_FALSE: + case mhfpacket.OperateGuildSetAvoidLeadershipFalse: handleAvoidLeadershipUpdate(s, pkt, false) - case mhfpacket.OPERATE_GUILD_UPDATE_COMMENT: + case mhfpacket.OperateGuildUpdateComment: if !characterGuildInfo.IsLeader && !characterGuildInfo.IsSubLeader() { doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) return } guild.Comment = stringsupport.SJISToUTF8(pkt.Data2.ReadNullTerminatedBytes()) guild.Save(s) - case mhfpacket.OPERATE_GUILD_UPDATE_MOTTO: + case mhfpacket.OperateGuildUpdateMotto: if !characterGuildInfo.IsLeader && !characterGuildInfo.IsSubLeader() { doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) return @@ -720,27 +731,29 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) { guild.SubMotto = pkt.Data1.ReadUint8() guild.MainMotto = pkt.Data1.ReadUint8() guild.Save(s) - case mhfpacket.OPERATE_GUILD_RENAME_PUGI_1: + case mhfpacket.OperateGuildRenamePugi1: handleRenamePugi(s, pkt.Data2, guild, 1) - case mhfpacket.OPERATE_GUILD_RENAME_PUGI_2: + case mhfpacket.OperateGuildRenamePugi2: handleRenamePugi(s, pkt.Data2, guild, 2) - case mhfpacket.OPERATE_GUILD_RENAME_PUGI_3: + case mhfpacket.OperateGuildRenamePugi3: handleRenamePugi(s, pkt.Data2, guild, 3) - case mhfpacket.OPERATE_GUILD_CHANGE_PUGI_1: + case mhfpacket.OperateGuildChangePugi1: handleChangePugi(s, uint8(pkt.Data1.ReadUint32()), guild, 1) - case mhfpacket.OPERATE_GUILD_CHANGE_PUGI_2: + case mhfpacket.OperateGuildChangePugi2: handleChangePugi(s, uint8(pkt.Data1.ReadUint32()), guild, 2) - case mhfpacket.OPERATE_GUILD_CHANGE_PUGI_3: + case mhfpacket.OperateGuildChangePugi3: handleChangePugi(s, uint8(pkt.Data1.ReadUint32()), guild, 3) - case mhfpacket.OPERATE_GUILD_UNLOCK_OUTFIT: + case mhfpacket.OperateGuildUnlockOutfit: // TODO: This doesn't implement blocking, if someone unlocked the same outfit at the same time s.server.db.Exec(`UPDATE guilds SET pugi_outfits=pugi_outfits+$1 WHERE id=$2`, int(math.Pow(float64(pkt.Data1.ReadUint32()), 2)), guild.ID) - case mhfpacket.OPERATE_GUILD_DONATE_EVENT: + case mhfpacket.OperateGuildDonateRoom: + // TODO: Where does this go? + case mhfpacket.OperateGuildDonateEvent: quantity := uint16(pkt.Data1.ReadUint32()) bf.WriteBytes(handleDonateRP(s, quantity, guild, true)) // TODO: Move this value onto rp_yesterday and reset to 0... daily? s.server.db.Exec(`UPDATE guild_characters SET rp_today=rp_today+$1 WHERE character_id=$2`, quantity, s.charID) - case mhfpacket.OPERATE_GUILD_EVENT_EXCHANGE: + case mhfpacket.OperateGuildEventExchange: rp := uint16(pkt.Data1.ReadUint32()) var balance uint32 s.server.db.QueryRow(`UPDATE guilds SET event_rp=event_rp-$1 WHERE id=$2 RETURNING event_rp`, rp, guild.ID).Scan(&balance) @@ -922,14 +935,19 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(guild.ID) bf.WriteUint32(guild.LeaderCharID) - bf.WriteUint16(guild.Rank) + bf.WriteUint16(guild.Rank()) bf.WriteUint16(guild.MemberCount) bf.WriteUint8(guild.MainMotto) bf.WriteUint8(guild.SubMotto) // Unk appears to be static - bf.WriteBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) + bf.WriteUint8(0) + bf.WriteUint8(0) + bf.WriteUint8(0) + bf.WriteUint8(0) + bf.WriteUint8(0) + bf.WriteUint8(0) bf.WriteBool(!guild.Recruiting) @@ -952,28 +970,39 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint8(FestivalColourCodes[guild.FestivalColour]) bf.WriteUint32(guild.RankRP) bf.WriteBytes(guildLeaderName) - bf.WriteBytes([]byte{0x00, 0x00, 0x00, 0x00}) // Unk - bf.WriteBool(false) // isReturnGuild - bf.WriteBool(false) // earnedSpecialHall - bf.WriteBytes([]byte{0x02, 0x02}) // Unk - bf.WriteUint32(guild.EventRP) + bf.WriteUint32(0) // Unk + bf.WriteBool(false) // isReturnGuild + bf.WriteBool(false) // earnedSpecialHall + bf.WriteUint8(2) + bf.WriteUint8(2) + bf.WriteUint32(guild.EventRP) // Skipped if last byte is <2? ps.Uint8(bf, guild.PugiName1, true) ps.Uint8(bf, guild.PugiName2, true) ps.Uint8(bf, guild.PugiName3, true) bf.WriteUint8(guild.PugiOutfit1) bf.WriteUint8(guild.PugiOutfit2) bf.WriteUint8(guild.PugiOutfit3) - bf.WriteUint8(guild.PugiOutfit1) - bf.WriteUint8(guild.PugiOutfit2) - bf.WriteUint8(guild.PugiOutfit3) + if s.server.erupeConfig.RealClientMode >= _config.Z1 { + bf.WriteUint8(guild.PugiOutfit1) + bf.WriteUint8(guild.PugiOutfit2) + bf.WriteUint8(guild.PugiOutfit3) + } bf.WriteUint32(guild.PugiOutfits) - // Unk flags - bf.WriteUint8(0x3C) // also seen as 0x32 on JP and 0x64 on TW + if guild.Rank() >= 3 { + bf.WriteUint8(40) + } else if guild.Rank() >= 7 { + bf.WriteUint8(50) + } else if guild.Rank() >= 10 { + bf.WriteUint8(60) + } else { + bf.WriteUint8(30) + } - bf.WriteBytes([]byte{ - 0x00, 0x00, 0xD6, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }) + bf.WriteUint32(55000) + bf.WriteUint32(0) + bf.WriteUint16(0) // Changing Room RP + bf.WriteUint16(0) if guild.AllianceID > 0 { alliance, err := GetAllianceData(s, guild.AllianceID) @@ -983,7 +1012,8 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(alliance.ID) bf.WriteUint32(uint32(alliance.CreatedAt.Unix())) bf.WriteUint16(alliance.TotalMembers) - bf.WriteUint16(0) // Unk0 + bf.WriteUint8(0) + bf.WriteUint8(0) ps.Uint16(bf, alliance.Name, true) if alliance.SubGuild1ID > 0 { if alliance.SubGuild2ID > 0 { @@ -1001,7 +1031,7 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { } else { bf.WriteUint16(0) } - bf.WriteUint16(alliance.ParentGuild.Rank) + bf.WriteUint16(alliance.ParentGuild.Rank()) bf.WriteUint16(alliance.ParentGuild.MemberCount) ps.Uint16(bf, alliance.ParentGuild.Name, true) ps.Uint16(bf, alliance.ParentGuild.LeaderName, true) @@ -1013,7 +1043,7 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { } else { bf.WriteUint16(0) } - bf.WriteUint16(alliance.SubGuild1.Rank) + bf.WriteUint16(alliance.SubGuild1.Rank()) bf.WriteUint16(alliance.SubGuild1.MemberCount) ps.Uint16(bf, alliance.SubGuild1.Name, true) ps.Uint16(bf, alliance.SubGuild1.LeaderName, true) @@ -1026,7 +1056,7 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { } else { bf.WriteUint16(0) } - bf.WriteUint16(alliance.SubGuild2.Rank) + bf.WriteUint16(alliance.SubGuild2.Rank()) bf.WriteUint16(alliance.SubGuild2.MemberCount) ps.Uint16(bf, alliance.SubGuild2.Name, true) ps.Uint16(bf, alliance.SubGuild2.LeaderName, true) @@ -1043,29 +1073,46 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(uint16(len(applicants))) for _, applicant := range applicants { bf.WriteUint32(applicant.CharID) - bf.WriteUint16(0) - bf.WriteUint16(0) + bf.WriteUint32(0) bf.WriteUint16(applicant.HRP) bf.WriteUint16(applicant.GR) ps.Uint8(bf, applicant.Name, true) } } - bf.WriteUint16(0x0000) // lenAllianceApplications + type UnkGuildInfo struct { + Unk0 uint8 + Unk1 uint8 + Unk2 uint8 + } + unkGuildInfo := []UnkGuildInfo{} + bf.WriteUint8(uint8(len(unkGuildInfo))) + for _, info := range unkGuildInfo { + bf.WriteUint8(info.Unk0) + bf.WriteUint8(info.Unk1) + bf.WriteUint8(info.Unk2) + } - /* - alliance application format - uint16 numapplicants (above) - - uint32 guild id - uint32 guild leader id (for mail) - uint32 unk (always null in pcap) - uint16 member count - uint16 len guild name - string nullterm guild name - uint16 len guild leader name - string nullterm guild leader name - */ + type AllianceInvite struct { + GuildID uint32 + LeaderID uint32 + Unk0 uint16 + Unk1 uint16 + Members uint16 + GuildName string + LeaderName string + } + allianceInvites := []AllianceInvite{} + bf.WriteUint8(uint8(len(allianceInvites))) + for _, invite := range allianceInvites { + bf.WriteUint32(invite.GuildID) + bf.WriteUint32(invite.LeaderID) + bf.WriteUint16(invite.Unk0) + bf.WriteUint16(invite.Unk1) + bf.WriteUint16(invite.Members) + ps.Uint16(bf, invite.GuildName, true) + ps.Uint16(bf, invite.LeaderName, true) + } if guild.Icon != nil { bf.WriteUint8(uint8(len(guild.Icon.Parts))) @@ -1083,7 +1130,7 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(p.PosY) } } else { - bf.WriteUint8(0x00) + bf.WriteUint8(0) } bf.WriteUint8(0) // Unk @@ -1100,91 +1147,87 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) { var alliances []*GuildAlliance var rows *sqlx.Rows var err error - bf := byteframe.NewByteFrameFromBytes(pkt.RawDataPayload) + bf := byteframe.NewByteFrameFromBytes(pkt.Data1) - switch pkt.Type { - case mhfpacket.ENUMERATE_GUILD_TYPE_GUILD_NAME: - bf.ReadBytes(8) - searchTerm := fmt.Sprintf(`%%%s%%`, stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())) - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s WHERE g.name ILIKE $1 OFFSET $2 LIMIT 11`, guildInfoSelectQuery), searchTerm, pkt.Page*10) + if pkt.Type <= 8 { + var tempGuilds []*Guild + rows, err = s.server.db.Queryx(guildInfoSelectQuery) if err == nil { for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + guild, err := buildGuildObjectFromDbResult(rows, err, s) + if err != nil { + continue + } + tempGuilds = append(tempGuilds, guild) } } - case mhfpacket.ENUMERATE_GUILD_TYPE_LEADER_NAME: - bf.ReadBytes(8) - searchTerm := fmt.Sprintf(`%%%s%%`, stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())) - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s WHERE lc.name ILIKE $1 OFFSET $2 LIMIT 11`, guildInfoSelectQuery), searchTerm, pkt.Page*10) - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + switch pkt.Type { + case mhfpacket.ENUMERATE_GUILD_TYPE_GUILD_NAME: + for _, guild := range tempGuilds { + if strings.Contains(guild.Name, pkt.Data2) { + guilds = append(guilds, guild) + } } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_LEADER_ID: - ID := bf.ReadUint32() - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s WHERE leader_id = $1`, guildInfoSelectQuery), ID) - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + case mhfpacket.ENUMERATE_GUILD_TYPE_LEADER_NAME: + for _, guild := range tempGuilds { + if strings.Contains(guild.LeaderName, pkt.Data2) { + guilds = append(guilds, guild) + } } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_MEMBERS: - if pkt.Sorting { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY member_count DESC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } else { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY member_count ASC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + case mhfpacket.ENUMERATE_GUILD_TYPE_LEADER_ID: + ID := bf.ReadUint32() + for _, guild := range tempGuilds { + if guild.LeaderCharID == ID { + guilds = append(guilds, guild) + } } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION: - if pkt.Sorting { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY id ASC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } else { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY id DESC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_MEMBERS: + if pkt.Sorting { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].MemberCount > tempGuilds[j].MemberCount + }) + } else { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].MemberCount < tempGuilds[j].MemberCount + }) } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_RANK: - if pkt.Sorting { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY rank_rp DESC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } else { - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s ORDER BY rank_rp ASC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - } - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + guilds = tempGuilds + case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION: + if pkt.Sorting { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].CreatedAt.Unix() > tempGuilds[j].CreatedAt.Unix() + }) + } else { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].CreatedAt.Unix() < tempGuilds[j].CreatedAt.Unix() + }) } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_MOTTO: - mainMotto := bf.ReadUint16() - subMotto := bf.ReadUint16() - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s WHERE main_motto = $1 AND sub_motto = $2 OFFSET $3 LIMIT 11`, guildInfoSelectQuery), mainMotto, subMotto, pkt.Page*10) - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + guilds = tempGuilds + case mhfpacket.ENUMERATE_GUILD_TYPE_ORDER_RANK: + if pkt.Sorting { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].RankRP > tempGuilds[j].RankRP + }) + } else { + sort.Slice(tempGuilds, func(i, j int) bool { + return tempGuilds[i].RankRP < tempGuilds[j].RankRP + }) } - } - case mhfpacket.ENUMERATE_GUILD_TYPE_RECRUITING: - // Assume the player wants the newest guilds with open recruitment - rows, err = s.server.db.Queryx(fmt.Sprintf(`%s WHERE recruiting=true ORDER BY id DESC OFFSET $1 LIMIT 11`, guildInfoSelectQuery), pkt.Page*10) - if err == nil { - for rows.Next() { - guild, _ := buildGuildObjectFromDbResult(rows, err, s) - guilds = append(guilds, guild) + guilds = tempGuilds + case mhfpacket.ENUMERATE_GUILD_TYPE_MOTTO: + mainMotto := uint8(bf.ReadUint16()) + subMotto := uint8(bf.ReadUint16()) + for _, guild := range tempGuilds { + if guild.MainMotto == mainMotto && guild.SubMotto == subMotto { + guilds = append(guilds, guild) + } + } + case mhfpacket.ENUMERATE_GUILD_TYPE_RECRUITING: + recruitingMotto := uint8(bf.ReadUint16()) + for _, guild := range tempGuilds { + if guild.MainMotto == recruitingMotto { + guilds = append(guilds, guild) + } } } } @@ -1200,18 +1243,14 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) { } switch pkt.Type { case mhfpacket.ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME: - bf.ReadBytes(8) - searchTerm := stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) for _, alliance := range tempAlliances { - if strings.Contains(alliance.Name, searchTerm) { + if strings.Contains(alliance.Name, pkt.Data2) { alliances = append(alliances, alliance) } } case mhfpacket.ENUMERATE_ALLIANCE_TYPE_LEADER_NAME: - bf.ReadBytes(8) - searchTerm := stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) for _, alliance := range tempAlliances { - if strings.Contains(alliance.ParentGuild.LeaderName, searchTerm) { + if strings.Contains(alliance.ParentGuild.LeaderName, pkt.Data2) { alliances = append(alliances, alliance) } } @@ -1292,8 +1331,8 @@ func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(guild.ID) bf.WriteUint32(guild.LeaderCharID) bf.WriteUint16(guild.MemberCount) - bf.WriteUint16(0x0000) // Unk - bf.WriteUint16(guild.Rank) // OR guilds in alliance + bf.WriteUint16(0x0000) // Unk + bf.WriteUint16(guild.Rank()) bf.WriteUint32(uint32(guild.CreatedAt.Unix())) ps.Uint8(bf, guild.Name, true) ps.Uint8(bf, guild.LeaderName, true) @@ -1355,7 +1394,7 @@ func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) { if guild != nil { isApplicant, _ := guild.HasApplicationForCharID(s, s.charID) if isApplicant { - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 2)) return } } @@ -1397,14 +1436,21 @@ func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) { for _, member := range guildMembers { bf.WriteUint32(member.CharID) bf.WriteUint16(member.HRP) - bf.WriteUint16(member.GR) - bf.WriteUint16(member.WeaponID) - if member.WeaponType == 1 || member.WeaponType == 5 || member.WeaponType == 10 { // If weapon is ranged - bf.WriteUint16(0x0700) - } else { - bf.WriteUint16(0x0600) + if s.server.erupeConfig.RealClientMode > _config.G7 { + bf.WriteUint16(member.GR) } - bf.WriteUint8(member.OrderIndex) + if s.server.erupeConfig.RealClientMode < _config.ZZ { + // Magnet Spike crash workaround + bf.WriteUint16(0) + } else { + bf.WriteUint16(member.WeaponID) + } + if member.WeaponType == 1 || member.WeaponType == 5 || member.WeaponType == 10 { // If weapon is ranged + bf.WriteUint8(7) + } else { + bf.WriteUint8(6) + } + bf.WriteUint16(member.OrderIndex) bf.WriteBool(member.AvoidLeadership) ps.Uint8(bf, member.Name, true) } @@ -1458,7 +1504,6 @@ func handleMsgMhfGetGuildManageRight(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGuildManageRight) guild, err := GetGuildInfoByCharacterId(s, s.charID) - if guild == nil && s.prevGuildID != 0 { guild, err = GetGuildInfoByID(s, s.prevGuildID) s.prevGuildID = 0 @@ -1468,31 +1513,14 @@ func handleMsgMhfGetGuildManageRight(s *Session, p mhfpacket.MHFPacket) { } } - if err != nil { - s.logger.Warn("failed to respond to manage rights message") - return - } else if guild == nil { - bf := byteframe.NewByteFrame() - bf.WriteUint16(0x00) // Unk - bf.WriteUint16(0x00) // Member count - - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) - return - } - bf := byteframe.NewByteFrame() - - bf.WriteUint16(0x00) // Unk - bf.WriteUint16(guild.MemberCount) - + bf.WriteUint32(uint32(guild.MemberCount)) members, _ := GetGuildMembers(s, guild.ID, false) - for _, member := range members { bf.WriteUint32(member.CharID) bf.WriteBool(member.Recruiter) bf.WriteBytes(make([]byte, 3)) } - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } @@ -1689,16 +1717,51 @@ func handleMsgMhfReadGuildcard(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, resp.Data()) } +type GuildMission struct { + ID uint32 + Unk uint32 + Type uint16 + Goal uint16 + Quantity uint16 + SkipTickets uint16 + GR bool + RewardType uint16 + RewardLevel uint16 +} + func handleMsgMhfGetGuildMissionList(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGuildMissionList) - - decoded, err := hex.DecodeString("000694610000023E000112990023000100000200015DDD232100069462000002F30000005F000C000200000300025DDD232100069463000002EA0000005F0006000100000100015DDD23210006946400000245000000530010000200000400025DDD232100069465000002B60001129B0019000100000200015DDD232100069466000003DC0000001B0010000100000600015DDD232100069467000002DA000112A00019000100000400015DDD232100069468000002A800010DEF0032000200000200025DDD2321000694690000045500000022003C000200000600025DDD23210006946A00000080000122D90046000200000300025DDD23210006946B000001960000003B000A000100000100015DDD23210006946C0000049200000046005A000300000600035DDD23210006946D000000A4000000260018000200000600025DDD23210006946E0000017A00010DE40096000300000100035DDD23210006946F000001BE0000005E0014000200000400025DDD2355000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") - - if err != nil { - panic(err) + bf := byteframe.NewByteFrame() + missions := []GuildMission{ + {431201, 574, 1, 4761, 35, 1, false, 2, 1}, + {431202, 755, 0, 95, 12, 2, false, 3, 2}, + {431203, 746, 0, 95, 6, 1, false, 1, 1}, + {431204, 581, 0, 83, 16, 2, false, 4, 2}, + {431205, 694, 1, 4763, 25, 1, false, 2, 1}, + {431206, 988, 0, 27, 16, 1, false, 6, 1}, + {431207, 730, 1, 4768, 25, 1, false, 4, 1}, + {431208, 680, 1, 3567, 50, 2, false, 2, 2}, + {431209, 1109, 0, 34, 60, 2, false, 6, 2}, + {431210, 128, 1, 8921, 70, 2, false, 3, 2}, + {431211, 406, 0, 59, 10, 1, false, 1, 1}, + {431212, 1170, 0, 70, 90, 3, false, 6, 3}, + {431213, 164, 0, 38, 24, 2, false, 6, 2}, + {431214, 378, 1, 3556, 150, 3, false, 1, 3}, + {431215, 446, 0, 94, 20, 2, false, 4, 2}, } - - doAckBufSucceed(s, pkt.AckHandle, decoded) + for _, mission := range missions { + bf.WriteUint32(mission.ID) + bf.WriteUint32(mission.Unk) + bf.WriteUint16(mission.Type) + bf.WriteUint16(mission.Goal) + bf.WriteUint16(mission.Quantity) + bf.WriteUint16(mission.SkipTickets) + bf.WriteBool(mission.GR) + bf.WriteUint16(mission.RewardType) + bf.WriteUint16(mission.RewardLevel) + bf.WriteUint32(uint32(TimeAdjusted().Unix())) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfGetGuildMissionRecord(s *Session, p mhfpacket.MHFPacket) { @@ -1783,14 +1846,14 @@ func handleMsgMhfGetGuildWeeklyBonusMaster(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGuildWeeklyBonusMaster) // Values taken from brand new guild capture - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 0x28)) + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 40)) } func handleMsgMhfGetGuildWeeklyBonusActiveCount(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGuildWeeklyBonusActiveCount) bf := byteframe.NewByteFrame() - bf.WriteUint8(0x3C) // Active count - bf.WriteUint8(0x3C) // Current active count - bf.WriteUint8(0x00) // New active count + bf.WriteUint8(60) // Active count + bf.WriteUint8(60) // Current active count + bf.WriteUint8(0) // New active count doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } @@ -1798,18 +1861,54 @@ func handleMsgMhfGuildHuntdata(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGuildHuntdata) bf := byteframe.NewByteFrame() switch pkt.Operation { - case 0: // Unk - doAckBufSucceed(s, pkt.AckHandle, []byte{}) - case 1: // Get Huntdata + case 0: // Acquire + s.server.db.Exec(`UPDATE guild_characters SET box_claimed=$1 WHERE character_id=$2`, TimeAdjusted(), s.charID) + case 1: // Enumerate bf.WriteUint8(0) // Entries - /* Entry format - uint32 UnkID - uint32 MonID - */ - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) - case 2: // Unk, controls glow - doAckBufSucceed(s, pkt.AckHandle, []byte{0x00, 0x00}) + rows, err := s.server.db.Query(`SELECT kl.id, kl.monster FROM kill_logs kl + INNER JOIN guild_characters gc ON kl.character_id = gc.character_id + WHERE gc.guild_id=$1 + AND kl.timestamp >= (SELECT box_claimed FROM guild_characters WHERE character_id=$2) + `, pkt.GuildID, s.charID) + if err == nil { + var count uint8 + var huntID, monID uint32 + for rows.Next() { + err = rows.Scan(&huntID, &monID) + if err != nil { + continue + } + count++ + if count > 255 { + count = 255 + rows.Close() + break + } + bf.WriteUint32(huntID) + bf.WriteUint32(monID) + } + bf.Seek(0, 0) + bf.WriteUint8(count) + } + case 2: // Check + guild, err := GetGuildInfoByCharacterId(s, s.charID) + if err == nil { + var count uint8 + err = s.server.db.QueryRow(`SELECT COUNT(*) FROM kill_logs kl + INNER JOIN guild_characters gc ON kl.character_id = gc.character_id + WHERE gc.guild_id=$1 + AND kl.timestamp >= (SELECT box_claimed FROM guild_characters WHERE character_id=$2) + `, guild.ID, s.charID).Scan(&count) + if err == nil && count > 0 { + bf.WriteBool(true) + } else { + bf.WriteBool(false) + } + } else { + bf.WriteBool(false) + } } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } type MessageBoardPost struct { diff --git a/server/channelserver/handlers_guild_alliance.go b/server/channelserver/handlers_guild_alliance.go index fbb285e0a..f27d67026 100644 --- a/server/channelserver/handlers_guild_alliance.go +++ b/server/channelserver/handlers_guild_alliance.go @@ -209,14 +209,14 @@ func handleMsgMhfInfoJoint(s *Session, p mhfpacket.MHFPacket) { } bf.WriteUint32(alliance.ParentGuildID) bf.WriteUint32(alliance.ParentGuild.LeaderCharID) - bf.WriteUint16(alliance.ParentGuild.Rank) + bf.WriteUint16(alliance.ParentGuild.Rank()) bf.WriteUint16(alliance.ParentGuild.MemberCount) ps.Uint16(bf, alliance.ParentGuild.Name, true) ps.Uint16(bf, alliance.ParentGuild.LeaderName, true) if alliance.SubGuild1ID > 0 { bf.WriteUint32(alliance.SubGuild1ID) bf.WriteUint32(alliance.SubGuild1.LeaderCharID) - bf.WriteUint16(alliance.SubGuild1.Rank) + bf.WriteUint16(alliance.SubGuild1.Rank()) bf.WriteUint16(alliance.SubGuild1.MemberCount) ps.Uint16(bf, alliance.SubGuild1.Name, true) ps.Uint16(bf, alliance.SubGuild1.LeaderName, true) @@ -224,7 +224,7 @@ func handleMsgMhfInfoJoint(s *Session, p mhfpacket.MHFPacket) { if alliance.SubGuild2ID > 0 { bf.WriteUint32(alliance.SubGuild2ID) bf.WriteUint32(alliance.SubGuild2.LeaderCharID) - bf.WriteUint16(alliance.SubGuild2.Rank) + bf.WriteUint16(alliance.SubGuild2.Rank()) bf.WriteUint16(alliance.SubGuild2.MemberCount) ps.Uint16(bf, alliance.SubGuild2.Name, true) ps.Uint16(bf, alliance.SubGuild2.LeaderName, true) diff --git a/server/channelserver/handlers_guild_member.go b/server/channelserver/handlers_guild_member.go index 47387bffe..e053e2498 100644 --- a/server/channelserver/handlers_guild_member.go +++ b/server/channelserver/handlers_guild_member.go @@ -17,7 +17,7 @@ type GuildMember struct { RPYesterday uint16 `db:"rp_yesterday"` Name string `db:"name"` IsApplicant bool `db:"is_applicant"` - OrderIndex uint8 `db:"order_index"` + OrderIndex uint16 `db:"order_index"` LastLogin uint32 `db:"last_login"` Recruiter bool `db:"recruiter"` AvoidLeadership bool `db:"avoid_leadership"` @@ -25,7 +25,7 @@ type GuildMember struct { HRP uint16 `db:"hrp"` GR uint16 `db:"gr"` WeaponID uint16 `db:"weapon_id"` - WeaponType uint16 `db:"weapon_type"` + WeaponType uint8 `db:"weapon_type"` } func (gm *GuildMember) CanRecruit() bool { diff --git a/server/channelserver/handlers_guild_tresure.go b/server/channelserver/handlers_guild_tresure.go index 3d0918a84..f3f4815e6 100644 --- a/server/channelserver/handlers_guild_tresure.go +++ b/server/channelserver/handlers_guild_tresure.go @@ -4,72 +4,79 @@ import ( "erupe-ce/common/byteframe" "erupe-ce/common/stringsupport" "erupe-ce/network/mhfpacket" + "time" ) type TreasureHunt struct { - HuntID uint32 `db:"id"` - HostID uint32 `db:"host_id"` - Destination uint32 `db:"destination"` - Level uint32 `db:"level"` - Return uint32 `db:"return"` - Acquired bool `db:"acquired"` - Claimed bool `db:"claimed"` - Hunters string `db:"hunters"` - Treasure string `db:"treasure"` - HuntData []byte `db:"hunt_data"` + 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"` } func handleMsgMhfEnumerateGuildTresure(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfEnumerateGuildTresure) guild, err := GetGuildInfoByCharacterId(s, s.charID) - if err != nil { - panic(err) + if err != nil || guild == nil { + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) + return + } + var hunts []TreasureHunt + var hunt TreasureHunt + + switch pkt.MaxHunts { + case 1: + err = s.server.db.QueryRowx(`SELECT id, host_id, destination, level, start, hunt_data FROM guild_hunts WHERE host_id=$1 AND acquired=FALSE`, s.charID).StructScan(&hunt) + if err == nil { + hunts = append(hunts, hunt) + } + case 30: + rows, err := s.server.db.Queryx(`SELECT gh.id, gh.host_id, gh.destination, gh.level, gh.start, gh.collected, gh.hunt_data, + (SELECT COUNT(*) FROM guild_characters gc WHERE gc.treasure_hunt = gh.id AND gc.character_id <> $1) AS hunters, + CASE + WHEN ghc.character_id IS NOT NULL THEN true + ELSE false + END AS claimed + FROM guild_hunts gh + LEFT JOIN guild_hunts_claimed ghc ON gh.id = ghc.hunt_id AND ghc.character_id = $1 + WHERE gh.guild_id=$2 AND gh.level=2 AND gh.acquired=TRUE + `, s.charID, guild.ID) + if err != nil { + rows.Close() + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) + return + } else { + for rows.Next() { + err = rows.StructScan(&hunt) + if err == nil && hunt.Start.Add(time.Second*time.Duration(s.server.erupeConfig.GameplayOptions.TreasureHuntExpiry)).After(TimeAdjusted()) { + hunts = append(hunts, hunt) + } + } + } + if len(hunts) > 30 { + hunts = hunts[:30] + } } bf := byteframe.NewByteFrame() - hunts := 0 - rows, _ := s.server.db.Queryx("SELECT id, host_id, destination, level, return, acquired, claimed, hunters, treasure, hunt_data FROM guild_hunts WHERE guild_id=$1 AND $2 < return+604800", guild.ID, TimeAdjusted().Unix()) - for rows.Next() { - hunt := &TreasureHunt{} - err = rows.StructScan(&hunt) - // Remove self from other hunter count - hunt.Hunters = stringsupport.CSVRemove(hunt.Hunters, int(s.charID)) - if err != nil { - panic(err) - } - if pkt.MaxHunts == 1 { - if hunt.HostID != s.charID || hunt.Acquired { - continue - } - hunts++ - bf.WriteUint32(hunt.HuntID) - bf.WriteUint32(hunt.Destination) - bf.WriteUint32(hunt.Level) - bf.WriteUint32(uint32(stringsupport.CSVLength(hunt.Hunters))) - bf.WriteUint32(hunt.Return) - bf.WriteBool(false) - bf.WriteBool(false) - bf.WriteBytes(hunt.HuntData) - break - } else if pkt.MaxHunts == 30 && hunt.Acquired && hunt.Level == 2 { - if hunts == 30 { - break - } - hunts++ - bf.WriteUint32(hunt.HuntID) - bf.WriteUint32(hunt.Destination) - bf.WriteUint32(hunt.Level) - bf.WriteUint32(uint32(stringsupport.CSVLength(hunt.Hunters))) - bf.WriteUint32(hunt.Return) - bf.WriteBool(hunt.Claimed) - bf.WriteBool(stringsupport.CSVContains(hunt.Treasure, int(s.charID))) - bf.WriteBytes(hunt.HuntData) - } + bf.WriteUint16(uint16(len(hunts))) + bf.WriteUint16(uint16(len(hunts))) + for _, h := range hunts { + bf.WriteUint32(h.HuntID) + bf.WriteUint32(h.Destination) + bf.WriteUint32(h.Level) + bf.WriteUint32(h.Hunters) + bf.WriteUint32(uint32(h.Start.Unix())) + bf.WriteBool(h.Collected) + bf.WriteBool(h.Claimed) + bf.WriteBytes(h.HuntData) } - resp := byteframe.NewByteFrame() - resp.WriteUint16(uint16(hunts)) - resp.WriteUint16(uint16(hunts)) - resp.WriteBytes(bf.Data()) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfRegistGuildTresure(s *Session, p mhfpacket.MHFPacket) { @@ -77,8 +84,9 @@ func handleMsgMhfRegistGuildTresure(s *Session, p mhfpacket.MHFPacket) { bf := byteframe.NewByteFrameFromBytes(pkt.Data) huntData := byteframe.NewByteFrame() guild, err := GetGuildInfoByCharacterId(s, s.charID) - if err != nil { - panic(err) + if err != nil || guild == nil { + doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) + return } guildCats := getGuildAirouList(s) destination := bf.ReadUint32() @@ -92,87 +100,55 @@ func handleMsgMhfRegistGuildTresure(s *Session, p mhfpacket.MHFPacket) { if catID > 0 { catsUsed = stringsupport.CSVAdd(catsUsed, int(catID)) for _, cat := range guildCats { - if cat.CatID == catID { - huntData.WriteBytes(cat.CatName) + if cat.ID == catID { + huntData.WriteBytes(cat.Name) break } } huntData.WriteBytes(bf.ReadBytes(9)) } } - _, err = s.server.db.Exec("INSERT INTO guild_hunts (guild_id, host_id, destination, level, return, hunt_data, cats_used) VALUES ($1, $2, $3, $4, $5, $6, $7)", - guild.ID, s.charID, destination, level, TimeAdjusted().Unix(), huntData.Data(), catsUsed) - if err != nil { - panic(err) - } + s.server.db.Exec(`INSERT INTO guild_hunts (guild_id, host_id, destination, level, hunt_data, cats_used) VALUES ($1, $2, $3, $4, $5, $6) + `, guild.ID, s.charID, destination, level, huntData.Data(), catsUsed) doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } func handleMsgMhfAcquireGuildTresure(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfAcquireGuildTresure) - _, err := s.server.db.Exec("UPDATE guild_hunts SET acquired=true WHERE id=$1", pkt.HuntID) - if err != nil { - panic(err) - } + s.server.db.Exec(`UPDATE guild_hunts SET acquired=true WHERE id=$1`, pkt.HuntID) doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } -func treasureHuntUnregister(s *Session) { - guild, err := GetGuildInfoByCharacterId(s, s.charID) - if err != nil || guild == nil { - return - } - var huntID int - var hunters string - rows, err := s.server.db.Queryx("SELECT id, hunters FROM guild_hunts WHERE guild_id=$1", guild.ID) - if err != nil { - return - } - for rows.Next() { - rows.Scan(&huntID, &hunters) - hunters = stringsupport.CSVRemove(hunters, int(s.charID)) - s.server.db.Exec("UPDATE guild_hunts SET hunters=$1 WHERE id=$2", hunters, huntID) - } -} - func handleMsgMhfOperateGuildTresureReport(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfOperateGuildTresureReport) - var csv string - if pkt.State == 0 { // Report registration - // Unregister from all other hunts - treasureHuntUnregister(s) - if pkt.HuntID != 0 { - // Register to selected hunt - err := s.server.db.QueryRow("SELECT hunters FROM guild_hunts WHERE id=$1", pkt.HuntID).Scan(&csv) - if err != nil { - panic(err) - } - csv = stringsupport.CSVAdd(csv, int(s.charID)) - _, err = s.server.db.Exec("UPDATE guild_hunts SET hunters=$1 WHERE id=$2", csv, pkt.HuntID) - if err != nil { - panic(err) - } - } - } else if pkt.State == 1 { // Collected by hunter - s.server.db.Exec("UPDATE guild_hunts SET hunters='', claimed=true WHERE id=$1", pkt.HuntID) - } else if pkt.State == 2 { // Claim treasure - err := s.server.db.QueryRow("SELECT treasure FROM guild_hunts WHERE id=$1", pkt.HuntID).Scan(&csv) - if err != nil { - panic(err) - } - csv = stringsupport.CSVAdd(csv, int(s.charID)) - _, err = s.server.db.Exec("UPDATE guild_hunts SET treasure=$1 WHERE id=$2", csv, pkt.HuntID) - if err != nil { - panic(err) - } + switch pkt.State { + case 0: // Report registration + s.server.db.Exec(`UPDATE guild_characters SET treasure_hunt=$1 WHERE character_id=$2`, pkt.HuntID, s.charID) + case 1: // Collected by hunter + s.server.db.Exec(`UPDATE guild_hunts SET collected=true WHERE id=$1`, pkt.HuntID) + s.server.db.Exec(`UPDATE guild_characters SET treasure_hunt=NULL WHERE treasure_hunt=$1`, pkt.HuntID) + case 2: // Claim treasure + s.server.db.Exec(`INSERT INTO guild_hunts_claimed VALUES ($1, $2)`, pkt.HuntID, s.charID) } doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } +type TreasureSouvenir struct { + Destination uint32 + Quantity uint32 +} + func handleMsgMhfGetGuildTresureSouvenir(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGuildTresureSouvenir) - - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 6)) + bf := byteframe.NewByteFrame() + bf.WriteUint32(0) + souvenirs := []TreasureSouvenir{} + bf.WriteUint16(uint16(len(souvenirs))) + for _, souvenir := range souvenirs { + bf.WriteUint32(souvenir.Destination) + bf.WriteUint32(souvenir.Quantity) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgMhfAcquireGuildTresureSouvenir(s *Session, p mhfpacket.MHFPacket) { diff --git a/server/channelserver/handlers_house.go b/server/channelserver/handlers_house.go index ab150f180..560e73ec7 100644 --- a/server/channelserver/handlers_house.go +++ b/server/channelserver/handlers_house.go @@ -4,6 +4,7 @@ import ( "erupe-ce/common/byteframe" ps "erupe-ce/common/pascalstring" "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "erupe-ce/network/mhfpacket" "fmt" "go.uber.org/zap" @@ -118,7 +119,9 @@ func handleMsgMhfEnumerateHouse(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint8(0) } bf.WriteUint16(house.HRP) - bf.WriteUint16(house.GR) + if _config.ErupeConfig.RealClientMode >= _config.G10 { + bf.WriteUint16(house.GR) + } ps.Uint8(bf, house.Name, true) } bf.Seek(0, 0) @@ -237,8 +240,8 @@ func handleMsgMhfGetMyhouseInfo(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfUpdateMyhouseInfo(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfUpdateMyhouseInfo) - s.server.db.Exec("UPDATE user_binary SET mission=$1 WHERE id=$2", pkt.Unk0, s.charID) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + s.server.db.Exec("UPDATE user_binary SET mission=$1 WHERE id=$2", pkt.Data, s.charID) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } func handleMsgMhfLoadDecoMyset(s *Session, p mhfpacket.MHFPacket) { @@ -249,6 +252,9 @@ func handleMsgMhfLoadDecoMyset(s *Session, p mhfpacket.MHFPacket) { s.logger.Error("Failed to load decomyset", zap.Error(err)) } if len(data) == 0 { + if s.server.erupeConfig.RealClientMode < _config.G10 { + data = []byte{0x00, 0x00} + } data = []byte{0x01, 0x00} } doAckBufSucceed(s, pkt.AckHandle, data) diff --git a/server/channelserver/handlers_mercenary.go b/server/channelserver/handlers_mercenary.go index 251bc107b..19c358c52 100644 --- a/server/channelserver/handlers_mercenary.go +++ b/server/channelserver/handlers_mercenary.go @@ -3,13 +3,12 @@ package channelserver import ( "erupe-ce/common/byteframe" "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "erupe-ce/network/mhfpacket" "erupe-ce/server/channelserver/compression/deltacomp" "erupe-ce/server/channelserver/compression/nullcomp" "go.uber.org/zap" "io" - "os" - "path/filepath" "time" ) @@ -56,11 +55,15 @@ func handleMsgMhfLoadLegendDispatch(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfLoadHunterNavi) + naviLength := 552 + if s.server.erupeConfig.RealClientMode <= _config.G7 { + naviLength = 280 + } var data []byte err := s.server.db.QueryRow("SELECT hunternavi FROM characters WHERE id = $1", s.charID).Scan(&data) if len(data) == 0 { s.logger.Error("Failed to load hunternavi", zap.Error(err)) - data = make([]byte, 0x226) + data = make([]byte, naviLength) } doAckBufSucceed(s, pkt.AckHandle, data) } @@ -68,6 +71,10 @@ func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfSaveHunterNavi(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfSaveHunterNavi) if pkt.IsDataDiff { + naviLength := 552 + if s.server.erupeConfig.RealClientMode <= _config.G7 { + naviLength = 280 + } var data []byte // Load existing save err := s.server.db.QueryRow("SELECT hunternavi FROM characters WHERE id = $1", s.charID).Scan(&data) @@ -78,7 +85,7 @@ func handleMsgMhfSaveHunterNavi(s *Session, p mhfpacket.MHFPacket) { // Check if we actually had any hunternavi data, using a blank buffer if not. // This is requried as the client will try to send a diff after character creation without a prior MsgMhfSaveHunterNavi packet. if len(data) == 0 { - data = make([]byte, 0x226) + data = make([]byte, naviLength) } // Perform diff and compress it to write back to db @@ -222,8 +229,8 @@ func handleMsgMhfReadMercenaryM(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfContractMercenary(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfContractMercenary) switch pkt.Op { - case 0: - s.server.db.Exec("UPDATE characters SET pact_id=$1 WHERE id=$2", pkt.PactMercID, s.charID) + case 0: // Form loan + s.server.db.Exec("UPDATE characters SET pact_id=$1 WHERE id=$2", pkt.PactMercID, pkt.CID) case 1: // Cancel lend s.server.db.Exec("UPDATE characters SET pact_id=0 WHERE id=$1", s.charID) case 2: // Cancel loan @@ -290,18 +297,12 @@ func handleMsgMhfSaveOtomoAirou(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfEnumerateAiroulist(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfEnumerateAiroulist) resp := byteframe.NewByteFrame() - if _, err := os.Stat(filepath.Join(s.server.erupeConfig.BinPath, "airoulist.bin")); err == nil { - data, _ := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, "airoulist.bin")) - resp.WriteBytes(data) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) - return - } airouList := getGuildAirouList(s) resp.WriteUint16(uint16(len(airouList))) resp.WriteUint16(uint16(len(airouList))) for _, cat := range airouList { - resp.WriteUint32(cat.CatID) - resp.WriteBytes(cat.CatName) + resp.WriteUint32(cat.ID) + resp.WriteBytes(cat.Name) resp.WriteUint32(cat.Experience) resp.WriteUint8(cat.Personality) resp.WriteUint8(cat.Class) @@ -312,11 +313,10 @@ func handleMsgMhfEnumerateAiroulist(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, resp.Data()) } -// CatDefinition holds values needed to populate the guild cat list -type CatDefinition struct { - CatID uint32 - CatName []byte - CurrentTask uint8 +type Airou struct { + ID uint32 + Name []byte + Task uint8 Personality uint8 Class uint8 Experience uint32 @@ -324,46 +324,39 @@ type CatDefinition struct { WeaponID uint16 } -func getGuildAirouList(s *Session) []CatDefinition { - var guild *Guild - var err error - var guildCats []CatDefinition - - // returning 0 cats on any guild issues - // can probably optimise all of the guild queries pretty heavily - guild, err = GetGuildInfoByCharacterId(s, s.charID) +func getGuildAirouList(s *Session) []Airou { + var guildCats []Airou + bannedCats := make(map[uint32]int) + guild, err := GetGuildInfoByCharacterId(s, s.charID) if err != nil { return guildCats } - - // Get cats used recently - // Retail reset at midday, 12 hours is a midpoint - tempBanDuration := 43200 - (1800) // Minus hunt time - bannedCats := make(map[uint32]int) - var csvTemp string - rows, err := s.server.db.Query(`SELECT cats_used - FROM guild_hunts gh - INNER JOIN characters c - ON gh.host_id = c.id - WHERE c.id=$1 AND gh.return+$2>$3`, s.charID, tempBanDuration, TimeAdjusted().Unix()) + rows, err := s.server.db.Query(`SELECT cats_used FROM guild_hunts gh + INNER JOIN characters c ON gh.host_id = c.id WHERE c.id=$1 + `, s.charID) if err != nil { s.logger.Warn("Failed to get recently used airous", zap.Error(err)) + return guildCats } + + var csvTemp string + var startTemp time.Time for rows.Next() { - rows.Scan(&csvTemp) - for i, j := range stringsupport.CSVElems(csvTemp) { - bannedCats[uint32(j)] = i + err = rows.Scan(&csvTemp, &startTemp) + if err != nil { + continue + } + if startTemp.Add(time.Second * time.Duration(s.server.erupeConfig.GameplayOptions.TreasureHuntPartnyaCooldown)).Before(TimeAdjusted()) { + for i, j := range stringsupport.CSVElems(csvTemp) { + bannedCats[uint32(j)] = i + } } } - // ellie's GetGuildMembers didn't seem to pull leader? - rows, err = s.server.db.Query(`SELECT c.otomoairou - FROM characters c - INNER JOIN guild_characters gc - ON gc.character_id = c.id + rows, err = s.server.db.Query(`SELECT c.otomoairou FROM characters c + INNER JOIN guild_characters gc ON gc.character_id = c.id WHERE gc.guild_id = $1 AND c.otomoairou IS NOT NULL - ORDER BY c.id ASC - LIMIT 60;`, guild.ID) + ORDER BY c.id LIMIT 60`, guild.ID) if err != nil { s.logger.Warn("Selecting otomoairou based on guild failed", zap.Error(err)) return guildCats @@ -372,11 +365,7 @@ func getGuildAirouList(s *Session) []CatDefinition { for rows.Next() { var data []byte err = rows.Scan(&data) - if err != nil { - s.logger.Warn("select failure", zap.Error(err)) - continue - } else if len(data) == 0 { - // non extant cats that aren't null in DB + if err != nil || len(data) == 0 { continue } // first byte has cat existence in general, can skip if 0 @@ -387,10 +376,10 @@ func getGuildAirouList(s *Session) []CatDefinition { continue } bf := byteframe.NewByteFrameFromBytes(decomp) - cats := GetCatDetails(bf) + cats := GetAirouDetails(bf) for _, cat := range cats { - _, exists := bannedCats[cat.CatID] - if cat.CurrentTask == 4 && !exists { + _, exists := bannedCats[cat.ID] + if cat.Task == 4 && !exists { guildCats = append(guildCats, cat) } } @@ -399,20 +388,20 @@ func getGuildAirouList(s *Session) []CatDefinition { return guildCats } -func GetCatDetails(bf *byteframe.ByteFrame) []CatDefinition { +func GetAirouDetails(bf *byteframe.ByteFrame) []Airou { catCount := bf.ReadUint8() - cats := make([]CatDefinition, catCount) + cats := make([]Airou, catCount) for x := 0; x < int(catCount); x++ { - var catDef CatDefinition + var catDef Airou // cat sometimes has additional bytes for whatever reason, gift items? timestamp? // until actual variance is known we can just seek to end based on start catDefLen := bf.ReadUint32() catStart, _ := bf.Seek(0, io.SeekCurrent) - catDef.CatID = bf.ReadUint32() - bf.Seek(1, io.SeekCurrent) // unknown value, probably a bool - catDef.CatName = bf.ReadBytes(18) // always 18 len, reads first null terminated string out of section and discards rest - catDef.CurrentTask = bf.ReadUint8() + catDef.ID = bf.ReadUint32() + bf.Seek(1, io.SeekCurrent) // unknown value, probably a bool + catDef.Name = bf.ReadBytes(18) // always 18 len, reads first null terminated string out of section and discards rest + catDef.Task = bf.ReadUint8() bf.Seek(16, io.SeekCurrent) // appearance data and what is seemingly null bytes catDef.Personality = bf.ReadUint8() catDef.Class = bf.ReadUint8() diff --git a/server/channelserver/handlers_object.go b/server/channelserver/handlers_object.go index 8984c21bf..241505c0d 100644 --- a/server/channelserver/handlers_object.go +++ b/server/channelserver/handlers_object.go @@ -10,25 +10,9 @@ import ( func handleMsgSysCreateObject(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgSysCreateObject) - // Prevent reusing an object index - var nextID uint32 - for { - exists := false - nextID = s.stage.NextObjectID() - for _, object := range s.stage.objects { - if object.id == nextID { - exists = true - break - } - } - if exists == false { - break - } - } - s.stage.Lock() newObj := &Object{ - id: nextID, + id: s.NextObjectID(), ownerCharID: s.charID, x: pkt.X, y: pkt.Y, @@ -78,7 +62,8 @@ func handleMsgSysRotateObject(s *Session, p mhfpacket.MHFPacket) {} func handleMsgSysDuplicateObject(s *Session, p mhfpacket.MHFPacket) {} func handleMsgSysSetObjectBinary(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgSysSetObjectBinary) + _ = p.(*mhfpacket.MsgSysSetObjectBinary) + /* This causes issues with PS3 as this actually sends with endiness! for _, session := range s.server.sessions { if session.charID == s.charID { s.server.userBinaryPartsLock.Lock() @@ -91,6 +76,7 @@ func handleMsgSysSetObjectBinary(s *Session, p mhfpacket.MHFPacket) { s.server.BroadcastMHF(msg, s) } } + */ } func handleMsgSysGetObjectBinary(s *Session, p mhfpacket.MHFPacket) {} diff --git a/server/channelserver/handlers_plate.go b/server/channelserver/handlers_plate.go index 3f5688184..19fdd84a2 100644 --- a/server/channelserver/handlers_plate.go +++ b/server/channelserver/handlers_plate.go @@ -42,7 +42,7 @@ func handleMsgMhfSavePlateData(s *Session, p mhfpacket.MHFPacket) { } } else { // create empty save if absent - data = make([]byte, 0x1AF20) + data = make([]byte, 140000) } // Perform diff and compress it to write back to db @@ -110,7 +110,7 @@ func handleMsgMhfSavePlateBox(s *Session, p mhfpacket.MHFPacket) { } } else { // create empty save if absent - data = make([]byte, 0x820) + data = make([]byte, 4800) } // Perform diff and compress it to write back to db @@ -147,7 +147,7 @@ func handleMsgMhfLoadPlateMyset(s *Session, p mhfpacket.MHFPacket) { err := s.server.db.QueryRow("SELECT platemyset FROM characters WHERE id = $1", s.charID).Scan(&data) if len(data) == 0 { s.logger.Error("Failed to load platemyset", zap.Error(err)) - data = make([]byte, 0x780) + data = make([]byte, 1920) } doAckBufSucceed(s, pkt.AckHandle, data) } diff --git a/server/channelserver/handlers_quest.go b/server/channelserver/handlers_quest.go index 9caef6dbf..aab84b960 100644 --- a/server/channelserver/handlers_quest.go +++ b/server/channelserver/handlers_quest.go @@ -1,14 +1,18 @@ package channelserver import ( - "encoding/hex" + "database/sql" + "erupe-ce/common/byteframe" + "erupe-ce/common/decryption" + ps "erupe-ce/common/pascalstring" + _config "erupe-ce/config" + "erupe-ce/network/mhfpacket" "fmt" "io" "os" "path/filepath" + "time" - "erupe-ce/common/byteframe" - "erupe-ce/network/mhfpacket" "go.uber.org/zap" ) @@ -36,29 +40,21 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) { } doAckBufSucceed(s, pkt.AckHandle, data) } else { - if _, err := os.Stat(filepath.Join(s.server.erupeConfig.BinPath, "quest_override.bin")); err == nil { - data, err := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, "quest_override.bin")) - if err != nil { - panic(err) - } - doAckBufSucceed(s, pkt.AckHandle, data) - } else { - if s.server.erupeConfig.DevModeOptions.QuestDebugTools && s.server.erupeConfig.DevMode { - s.logger.Debug( - "Quest", - zap.String("Filename", pkt.Filename), - ) - } - // Get quest file. - data, err := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("quests/%s.bin", pkt.Filename))) - if err != nil { - s.logger.Error(fmt.Sprintf("Failed to open file: %s/quests/%s.bin", s.server.erupeConfig.BinPath, pkt.Filename)) - // This will crash the game. - doAckBufSucceed(s, pkt.AckHandle, data) - return - } - doAckBufSucceed(s, pkt.AckHandle, data) + if s.server.erupeConfig.DevModeOptions.QuestDebugTools && s.server.erupeConfig.DevMode { + s.logger.Debug( + "Quest", + zap.String("Filename", pkt.Filename), + ) } + + data, err := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("quests/%s.bin", pkt.Filename))) + if err != nil { + s.logger.Error(fmt.Sprintf("Failed to open file: %s/quests/%s.bin", s.server.erupeConfig.BinPath, pkt.Filename)) + // This will crash the game. + doAckBufSucceed(s, pkt.AckHandle, data) + return + } + doAckBufSucceed(s, pkt.AckHandle, data) } } @@ -80,37 +76,589 @@ func handleMsgMhfSaveFavoriteQuest(s *Session, p mhfpacket.MHFPacket) { doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) } +func loadQuestFile(s *Session, questId int) []byte { + file, err := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, fmt.Sprintf("quests/%05dd0.bin", questId))) + if err != nil { + return nil + } + + decrypted := decryption.UnpackSimple(file) + fileBytes := byteframe.NewByteFrameFromBytes(decrypted) + fileBytes.SetLE() + fileBytes.Seek(int64(fileBytes.ReadUint32()), 0) + + // The 320 bytes directly following the data pointer must go directly into the event's body, after the header and before the string pointers. + questBody := byteframe.NewByteFrameFromBytes(fileBytes.ReadBytes(320)) + questBody.SetLE() + // Find the master quest string pointer + questBody.Seek(40, 0) + fileBytes.Seek(int64(questBody.ReadUint32()), 0) + questBody.Seek(40, 0) + // Overwrite it + questBody.WriteUint32(320) + questBody.Seek(0, 2) + + // Rewrite the quest strings and their pointers + var tempString []byte + newStrings := byteframe.NewByteFrame() + tempPointer := 352 + for i := 0; i < 8; i++ { + questBody.WriteUint32(uint32(tempPointer)) + temp := int64(fileBytes.Index()) + fileBytes.Seek(int64(fileBytes.ReadUint32()), 0) + tempString = fileBytes.ReadNullTerminatedBytes() + fileBytes.Seek(temp+4, 0) + tempPointer += len(tempString) + 1 + newStrings.WriteNullTerminatedBytes(tempString) + } + questBody.WriteBytes(newStrings.Data()) + + return questBody.Data() +} + +func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) { + var id, mark uint32 + var questId int + var maxPlayers, questType uint8 + rows.Scan(&id, &maxPlayers, &questType, &questId, &mark) + + data := loadQuestFile(s, questId) + if data == nil { + return nil, fmt.Errorf("failed to load quest file") + } + + bf := byteframe.NewByteFrame() + bf.WriteUint32(id) + bf.WriteUint32(0) // Unk + bf.WriteUint8(0) // Unk + switch questType { + case 16: + bf.WriteUint8(s.server.erupeConfig.GameplayOptions.RegularRavienteMaxPlayers) + case 22: + bf.WriteUint8(s.server.erupeConfig.GameplayOptions.ViolentRavienteMaxPlayers) + case 40: + bf.WriteUint8(s.server.erupeConfig.GameplayOptions.BerserkRavienteMaxPlayers) + case 50: + bf.WriteUint8(s.server.erupeConfig.GameplayOptions.ExtremeRavienteMaxPlayers) + case 51: + bf.WriteUint8(s.server.erupeConfig.GameplayOptions.SmallBerserkRavienteMaxPlayers) + default: + bf.WriteUint8(maxPlayers) + } + bf.WriteUint8(questType) + if questType == 9 { + bf.WriteBool(false) + } else { + bf.WriteBool(true) + } + bf.WriteUint16(0) // Unk + if _config.ErupeConfig.RealClientMode >= _config.G1 { + bf.WriteUint32(mark) + } + bf.WriteUint16(0) // Unk + bf.WriteUint16(uint16(len(data))) + bf.WriteBytes(data) + + // Time Flag Replacement + // Bitset Structure: b8 UNK, b7 Required Objective, b6 UNK, b5 Night, b4 Day, b3 Cold, b2 Warm, b1 Spring + // if the byte is set to 0 the game choses the quest file corresponding to whatever season the game is on + bf.Seek(25, 0) + flagByte := bf.ReadUint8() + bf.Seek(25, 0) + if s.server.erupeConfig.GameplayOptions.SeasonOverride { + bf.WriteUint8(flagByte & 0b11100000) + } else { + bf.WriteUint8(flagByte) + } + + // Bitset Structure Quest Variant 1: b8 UL Fixed, b7 UNK, b6 UNK, b5 UNK, b4 G Rank, b3 HC to UL, b2 Fix HC, b1 Hiden + // Bitset Structure Quest Variant 2: b8 Road, b7 High Conquest, b6 Fixed Difficulty, b5 No Active Feature, b4 Timer, b3 No Cuff, b2 No Halk Pots, b1 Low Conquest + // Bitset Structure Quest Variant 3: b8 No Sigils, b7 UNK, b6 Interception, b5 Zenith, b4 No GP Skills, b3 No Simple Mode?, b2 GSR to GR, b1 No Reward Skills + + bf.Seek(175, 0) + questVariant3 := bf.ReadUint8() + questVariant3 &= 0b11011111 // disable Interception flag + bf.Seek(175, 0) + bf.WriteUint8(questVariant3) + + ps.Uint8(bf, "", true) // Debug/Notes string for quest + return bf.Data(), nil +} + func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfEnumerateQuest) var totalCount, returnedCount uint16 bf := byteframe.NewByteFrame() bf.WriteUint16(0) - err := filepath.Walk(fmt.Sprintf("%s/events/", s.server.erupeConfig.BinPath), func(path string, info os.FileInfo, err error) error { + + rows, _ := s.server.db.Query("SELECT id, COALESCE(max_players, 4) AS max_players, quest_type, quest_id, COALESCE(mark, 0) AS mark FROM event_quests ORDER BY quest_id") + for rows.Next() { + data, err := makeEventQuest(s, rows) if err != nil { - return err - } else if info.IsDir() { - return nil - } - data, err := os.ReadFile(path) - if err != nil { - return err + continue } else { - if len(data) > 850 || len(data) < 400 { - return nil // Could be more or less strict with size limits + if len(data) > 896 || len(data) < 352 { + continue } else { totalCount++ - if totalCount > pkt.Offset && len(bf.Data()) < 60000 { - returnedCount++ - bf.WriteBytes(data) - return nil + if _config.ErupeConfig.RealClientMode == _config.F5 { + if totalCount > pkt.Offset && len(bf.Data()) < 21550 { + returnedCount++ + bf.WriteBytes(data) + continue + } + } else { + if totalCount > pkt.Offset && len(bf.Data()) < 60000 { + returnedCount++ + bf.WriteBytes(data) + continue + } } } } - return nil - }) - if err != nil || totalCount == 0 { - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 18)) - return + } + + type tuneValue struct { + ID uint16 + Value uint16 + } + + tuneValues := []tuneValue{ + {ID: 20, Value: 1}, + {ID: 26, Value: 1}, + {ID: 27, Value: 1}, + {ID: 33, Value: 1}, + {ID: 40, Value: 1}, + {ID: 49, Value: 1}, + {ID: 53, Value: 1}, + {ID: 59, Value: 1}, + {ID: 67, Value: 1}, + {ID: 80, Value: 1}, + {ID: 94, Value: 1}, + {ID: 1010, Value: 300}, + {ID: 1011, Value: 300}, + {ID: 1012, Value: 300}, + {ID: 1013, Value: 300}, + {ID: 1014, Value: 200}, + {ID: 1015, Value: 200}, + {ID: 1021, Value: 400}, + {ID: 1023, Value: 8}, + {ID: 1024, Value: 150}, + {ID: 1025, Value: 1}, + {ID: 1026, Value: 999}, // get_grank_cap + {ID: 1027, Value: 100}, + {ID: 1028, Value: 100}, + {ID: 1030, Value: 8}, + {ID: 1031, Value: 100}, + {ID: 1032, Value: 0}, // isValid_partner + {ID: 1044, Value: 200}, // get_rate_tload_time_out + {ID: 1045, Value: 0}, // get_rate_tower_treasure_preset + {ID: 1046, Value: 99}, + {ID: 1048, Value: 0}, // get_rate_tower_log_disable + {ID: 1049, Value: 10}, // get_rate_tower_gem_max + {ID: 1050, Value: 1}, // get_rate_tower_gem_set + {ID: 1051, Value: 200}, + {ID: 1052, Value: 200}, + {ID: 1063, Value: 50000}, + {ID: 1064, Value: 50000}, + {ID: 1065, Value: 25000}, + {ID: 1066, Value: 25000}, + {ID: 1067, Value: 90}, // get_lobby_member_upper_for_making_room Lv1? + {ID: 1068, Value: 80}, // get_lobby_member_upper_for_making_room Lv2? + {ID: 1069, Value: 70}, // get_lobby_member_upper_for_making_room Lv3? + {ID: 1072, Value: 300}, // get_rate_premium_ravi_tama + {ID: 1073, Value: 300}, // get_rate_premium_ravi_ax_tama + {ID: 1074, Value: 300}, // get_rate_premium_ravi_g_tama + {ID: 1078, Value: 0}, + {ID: 1079, Value: 1}, + {ID: 1080, Value: 1}, + {ID: 1081, Value: 1}, + {ID: 1082, Value: 4}, + {ID: 1083, Value: 2}, + {ID: 1084, Value: 10}, + {ID: 1085, Value: 1}, + {ID: 1086, Value: 4}, + {ID: 1087, Value: 2}, + {ID: 1088, Value: 10}, + {ID: 1089, Value: 1}, + {ID: 1090, Value: 3}, + {ID: 1091, Value: 2}, + {ID: 1092, Value: 10}, + {ID: 1093, Value: 2}, + {ID: 1094, Value: 5}, + {ID: 1095, Value: 2}, + {ID: 1096, Value: 10}, + {ID: 1097, Value: 2}, + {ID: 1098, Value: 5}, + {ID: 1099, Value: 2}, + {ID: 1100, Value: 10}, + {ID: 1101, Value: 2}, + {ID: 1102, Value: 5}, + {ID: 1103, Value: 2}, + {ID: 1104, Value: 10}, + {ID: 1145, Value: 200}, + {ID: 1146, Value: 0}, // isTower_invisible + {ID: 1147, Value: 0}, // isVenom_playable + {ID: 1149, Value: 20}, + {ID: 1152, Value: 1130}, + {ID: 1154, Value: 0}, // isDisabled_object_season + {ID: 1158, Value: 1}, + {ID: 1160, Value: 300}, + {ID: 1162, Value: 1}, + {ID: 1163, Value: 3}, + {ID: 1164, Value: 5}, + {ID: 1165, Value: 1}, + {ID: 1166, Value: 5}, + {ID: 1167, Value: 1}, + {ID: 1168, Value: 3}, + {ID: 1169, Value: 3}, + {ID: 1170, Value: 5}, + {ID: 1171, Value: 1}, + {ID: 1172, Value: 1}, + {ID: 1173, Value: 1}, + {ID: 1174, Value: 2}, + {ID: 1175, Value: 4}, + {ID: 1176, Value: 10}, + {ID: 1177, Value: 4}, + {ID: 1178, Value: 10}, + {ID: 1179, Value: 2}, + {ID: 1180, Value: 5}, + {ID: 3000, Value: 100}, + {ID: 3001, Value: 100}, + {ID: 3002, Value: 100}, + {ID: 3003, Value: 100}, + {ID: 3004, Value: 100}, + {ID: 3005, Value: 100}, + {ID: 3006, Value: 100}, + {ID: 3007, Value: 100}, + {ID: 3008, Value: 100}, + {ID: 3009, Value: 100}, + {ID: 3010, Value: 100}, + {ID: 3011, Value: 100}, + {ID: 3012, Value: 100}, + {ID: 3013, Value: 100}, + {ID: 3014, Value: 100}, + {ID: 3015, Value: 100}, + {ID: 3016, Value: 100}, + {ID: 3017, Value: 100}, + {ID: 3018, Value: 100}, + {ID: 3019, Value: 100}, + {ID: 3020, Value: 100}, + {ID: 3021, Value: 100}, + {ID: 3022, Value: 100}, + {ID: 3023, Value: 100}, + {ID: 3024, Value: 100}, + {ID: 3025, Value: 100}, + {ID: 3286, Value: 200}, + {ID: 3287, Value: 200}, + {ID: 3288, Value: 200}, + {ID: 3289, Value: 200}, + {ID: 3290, Value: 200}, + {ID: 3291, Value: 200}, + {ID: 3292, Value: 200}, + {ID: 3293, Value: 200}, + {ID: 3294, Value: 200}, + {ID: 3295, Value: 200}, + {ID: 3296, Value: 200}, + {ID: 3297, Value: 200}, + {ID: 3298, Value: 200}, + {ID: 3299, Value: 200}, + {ID: 3300, Value: 200}, + {ID: 3301, Value: 200}, + {ID: 3302, Value: 200}, + {ID: 3303, Value: 200}, + {ID: 3304, Value: 200}, + {ID: 3305, Value: 200}, + {ID: 3306, Value: 200}, + {ID: 3307, Value: 200}, + {ID: 3308, Value: 200}, + {ID: 3309, Value: 200}, + {ID: 3310, Value: 200}, + {ID: 3311, Value: 200}, + {ID: 3312, Value: 300}, + {ID: 3313, Value: 300}, + {ID: 3314, Value: 300}, + {ID: 3315, Value: 300}, + {ID: 3316, Value: 300}, + {ID: 3317, Value: 300}, + {ID: 3318, Value: 300}, + {ID: 3319, Value: 300}, + {ID: 3320, Value: 300}, + {ID: 3321, Value: 300}, + {ID: 3322, Value: 300}, + {ID: 3323, Value: 300}, + {ID: 3324, Value: 300}, + {ID: 3325, Value: 300}, + {ID: 3326, Value: 300}, + {ID: 3327, Value: 300}, + {ID: 3328, Value: 300}, + {ID: 3329, Value: 300}, + {ID: 3330, Value: 300}, + {ID: 3331, Value: 300}, + {ID: 3332, Value: 300}, + {ID: 3333, Value: 300}, + {ID: 3334, Value: 300}, + {ID: 3335, Value: 300}, + {ID: 3336, Value: 300}, + {ID: 3337, Value: 300}, + {ID: 3338, Value: 100}, + {ID: 3339, Value: 100}, + {ID: 3340, Value: 100}, + {ID: 3341, Value: 100}, + {ID: 3342, Value: 100}, + {ID: 3343, Value: 100}, + {ID: 3344, Value: 100}, + {ID: 3345, Value: 100}, + {ID: 3346, Value: 100}, + {ID: 3347, Value: 100}, + {ID: 3348, Value: 100}, + {ID: 3349, Value: 100}, + {ID: 3350, Value: 100}, + {ID: 3351, Value: 100}, + {ID: 3352, Value: 100}, + {ID: 3353, Value: 100}, + {ID: 3354, Value: 100}, + {ID: 3355, Value: 100}, + {ID: 3356, Value: 100}, + {ID: 3357, Value: 100}, + {ID: 3358, Value: 100}, + {ID: 3359, Value: 100}, + {ID: 3360, Value: 100}, + {ID: 3361, Value: 100}, + {ID: 3362, Value: 100}, + {ID: 3363, Value: 100}, + {ID: 3364, Value: 100}, + {ID: 3365, Value: 100}, + {ID: 3366, Value: 100}, + {ID: 3367, Value: 100}, + {ID: 3368, Value: 100}, + {ID: 3369, Value: 100}, + {ID: 3370, Value: 100}, + {ID: 3371, Value: 100}, + {ID: 3372, Value: 100}, + {ID: 3373, Value: 100}, + {ID: 3374, Value: 100}, + {ID: 3375, Value: 100}, + {ID: 3376, Value: 100}, + {ID: 3377, Value: 100}, + {ID: 3378, Value: 100}, + {ID: 3379, Value: 100}, + {ID: 3380, Value: 100}, + {ID: 3381, Value: 100}, + {ID: 3382, Value: 100}, + {ID: 3383, Value: 100}, + {ID: 3384, Value: 100}, + {ID: 3385, Value: 100}, + {ID: 3386, Value: 100}, + {ID: 3387, Value: 100}, + {ID: 3388, Value: 100}, + {ID: 3389, Value: 100}, + {ID: 3390, Value: 100}, + {ID: 3391, Value: 100}, + {ID: 3392, Value: 100}, + {ID: 3393, Value: 100}, + {ID: 3394, Value: 100}, + {ID: 3395, Value: 100}, + {ID: 3396, Value: 100}, + {ID: 3397, Value: 100}, + {ID: 3398, Value: 100}, + {ID: 3399, Value: 100}, + {ID: 3400, Value: 100}, + {ID: 3401, Value: 100}, + {ID: 3402, Value: 100}, + {ID: 3416, Value: 100}, + {ID: 3417, Value: 100}, + {ID: 3418, Value: 100}, + {ID: 3419, Value: 100}, + {ID: 3420, Value: 100}, + {ID: 3421, Value: 100}, + {ID: 3422, Value: 100}, + {ID: 3423, Value: 100}, + {ID: 3424, Value: 100}, + {ID: 3425, Value: 100}, + {ID: 3426, Value: 100}, + {ID: 3427, Value: 100}, + {ID: 3428, Value: 100}, + {ID: 3442, Value: 100}, + {ID: 3443, Value: 100}, + {ID: 3444, Value: 100}, + {ID: 3445, Value: 100}, + {ID: 3446, Value: 100}, + {ID: 3447, Value: 100}, + {ID: 3448, Value: 100}, + {ID: 3449, Value: 100}, + {ID: 3450, Value: 100}, + {ID: 3451, Value: 100}, + {ID: 3452, Value: 100}, + {ID: 3453, Value: 100}, + {ID: 3454, Value: 100}, + {ID: 3468, Value: 100}, + {ID: 3469, Value: 100}, + {ID: 3470, Value: 100}, + {ID: 3471, Value: 100}, + {ID: 3472, Value: 100}, + {ID: 3473, Value: 100}, + {ID: 3474, Value: 100}, + {ID: 3475, Value: 100}, + {ID: 3476, Value: 100}, + {ID: 3477, Value: 100}, + {ID: 3478, Value: 100}, + {ID: 3479, Value: 100}, + {ID: 3480, Value: 100}, + {ID: 3494, Value: 0}, + {ID: 3495, Value: 0}, + {ID: 3496, Value: 0}, + {ID: 3497, Value: 0}, + {ID: 3498, Value: 0}, + {ID: 3499, Value: 0}, + {ID: 3500, Value: 0}, + {ID: 3501, Value: 0}, + {ID: 3502, Value: 0}, + {ID: 3503, Value: 0}, + {ID: 3504, Value: 0}, + {ID: 3505, Value: 0}, + {ID: 3506, Value: 0}, + {ID: 3520, Value: 0}, + {ID: 3521, Value: 0}, + {ID: 3522, Value: 0}, + {ID: 3523, Value: 0}, + {ID: 3524, Value: 0}, + {ID: 3525, Value: 0}, + {ID: 3526, Value: 0}, + {ID: 3527, Value: 0}, + {ID: 3528, Value: 0}, + {ID: 3529, Value: 0}, + {ID: 3530, Value: 0}, + {ID: 3531, Value: 0}, + {ID: 3532, Value: 0}, + {ID: 3546, Value: 0}, + {ID: 3547, Value: 0}, + {ID: 3548, Value: 0}, + {ID: 3549, Value: 0}, + {ID: 3550, Value: 0}, + {ID: 3551, Value: 0}, + {ID: 3552, Value: 0}, + {ID: 3553, Value: 0}, + {ID: 3554, Value: 0}, + {ID: 3555, Value: 0}, + {ID: 3556, Value: 0}, + {ID: 3557, Value: 0}, + {ID: 3558, Value: 0}, + {ID: 3572, Value: 0}, + {ID: 3573, Value: 0}, + {ID: 3574, Value: 0}, + {ID: 3575, Value: 0}, + {ID: 3576, Value: 0}, + {ID: 3577, Value: 0}, + {ID: 3578, Value: 0}, + {ID: 3579, Value: 0}, + {ID: 3580, Value: 0}, + {ID: 3581, Value: 0}, + {ID: 3582, Value: 0}, + {ID: 3583, Value: 0}, + {ID: 3584, Value: 0}, + } + + tuneValues = append(tuneValues, tuneValue{1020, uint16(s.server.erupeConfig.GameplayOptions.GCPMultiplier * 100)}) + + tuneValues = append(tuneValues, tuneValue{1029, uint16(s.server.erupeConfig.GameplayOptions.GUrgentRate * 100)}) + + if s.server.erupeConfig.GameplayOptions.DisableHunterNavi { + tuneValues = append(tuneValues, tuneValue{1037, 1}) + } + + if s.server.erupeConfig.GameplayOptions.EnableKaijiEvent { + tuneValues = append(tuneValues, tuneValue{1106, 1}) + } else { + tuneValues = append(tuneValues, tuneValue{1106, 0}) + } + + if s.server.erupeConfig.GameplayOptions.EnableHiganjimaEvent { + tuneValues = append(tuneValues, tuneValue{1144, 1}) + } else { + tuneValues = append(tuneValues, tuneValue{1144, 0}) + } + + if s.server.erupeConfig.GameplayOptions.EnableNierEvent { + tuneValues = append(tuneValues, tuneValue{1153, 1}) + } else { + tuneValues = append(tuneValues, tuneValue{1153, 0}) + } + + if s.server.erupeConfig.GameplayOptions.DisableRoad { + tuneValues = append(tuneValues, tuneValue{1155, 1}) + } else { + tuneValues = append(tuneValues, tuneValue{1155, 0}) + } + + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3026, uint16(s.server.erupeConfig.GameplayOptions.GRPMultiplier * 100)}) + } + + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3039, uint16(s.server.erupeConfig.GameplayOptions.GSRPMultiplier * 100)}) + } + + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3052, uint16(s.server.erupeConfig.GameplayOptions.GZennyMultiplier * 100)}) + } + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3078, uint16(s.server.erupeConfig.GameplayOptions.GZennyMultiplier * 100)}) + } + + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3104, uint16(s.server.erupeConfig.GameplayOptions.MaterialMultiplier * 100)}) + } + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3130, uint16(s.server.erupeConfig.GameplayOptions.MaterialMultiplier * 100)}) + } + + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3156, s.server.erupeConfig.GameplayOptions.ExtraCarves}) + } + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3182, s.server.erupeConfig.GameplayOptions.ExtraCarves}) + } + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3208, s.server.erupeConfig.GameplayOptions.ExtraCarves}) + } + for i := uint16(0); i < 13; i++ { + tuneValues = append(tuneValues, tuneValue{i + 3234, s.server.erupeConfig.GameplayOptions.ExtraCarves}) + } + + offset := uint16(time.Now().Unix()) + bf.WriteUint16(offset) + + tuneLimit := 770 + if _config.ErupeConfig.RealClientMode <= _config.F5 { + tuneLimit = 256 + } else if _config.ErupeConfig.RealClientMode <= _config.G3 { + tuneLimit = 283 + } else if _config.ErupeConfig.RealClientMode <= _config.GG { + tuneLimit = 315 + } else if _config.ErupeConfig.RealClientMode <= _config.G61 { + tuneLimit = 332 + } else if _config.ErupeConfig.RealClientMode <= _config.G7 { + tuneLimit = 339 + } else if _config.ErupeConfig.RealClientMode <= _config.G81 { + tuneLimit = 396 + } else if _config.ErupeConfig.RealClientMode <= _config.G91 { + tuneLimit = 694 + } else if _config.ErupeConfig.RealClientMode <= _config.G101 { + tuneLimit = 704 + } else if _config.ErupeConfig.RealClientMode <= _config.Z2 { + tuneLimit = 750 + } + if len(tuneValues) > tuneLimit { + tuneValues = tuneValues[:tuneLimit] + } + + bf.WriteUint16(uint16(len(tuneValues))) + for i := range tuneValues { + bf.WriteUint16(tuneValues[i].ID ^ offset) + bf.WriteUint16(offset) + bf.WriteBytes(make([]byte, 4)) + bf.WriteUint16(tuneValues[i].Value ^ offset) } vsQuestItems := []uint16{1580, 1581, 1582, 1583, 1584, 1585, 1587, 1588, 1589, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604} @@ -123,12 +671,9 @@ func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) { {false, 5000}, {false, 10000}, } - - data, _ := hex.DecodeString("06E601CF051406E6D4D4D40007CA02F006E6D4D4D4000685051506E6D4D4D40007CA051206E6D4D4D40007CA051306E6D4D4D40007CA02DC06E6D4D4D40006E202D806E6D4D4D40006E202A406E6D4D4D40006E5026806E6D4D4D40006E3027406E6D4D4D40006E3027006E6D4D4D40006E4026506E6D4D4D40006E602E006E6D4D4D40006EE02E706E6D4D4D40006E70B4006E6D4D4D40006E602E206E6D4D4D400068202E506E6D4D4D400068206C706E6D4D4D40006E706B606E6D4D4D40006E706D706E6D4D4D40006E706F206E6D4D4D40006E706DD06E6D4D4D40006E706D306E6D4D4D40006E706FC06E6D4D4D40006E706B806E6D4D4D40006E706CE06E6D4D4D40006E706FD06E6D4D4D40006E706A506E6D4D4D40006E7051906E6D4D4D40006EE02E606E6D4D4D40006700B4106E6D4D4D40006E60B4E06E6D4D4D40006E60B4F06E6D4D4D40006E60B4C06E6D4D4D40006E60B4D06E6D4D4D40006E60B4A06E6D4D4D40006E60B4B06E6D4D4D40006E60B4806E6D4D4D40006E60B4906E6D4D4D40006E60B5606E6D4D4D40006E60B5706E6D4D4D40006E60B5406E6D4D4D40006E60B2606E6D4D4D40006E60B2706E6D4D4D40006E602DE06E6D4D4D40006E702DF06E6D4D4D40006E70B2406E6D4D4D40006E60B2506E6D4D4D40006E60A3006E6D4D4D400062E0A3106E6D4D4D400062E0A3E06E6D4D4D400062E0B2206E6D4D4D40006E60B2306E6D4D4D40006E60B2006E6D4D4D40006E60B2106E6D4D4D40006E60B2E06E6D4D4D40006E60B2F06E6D4D4D40006E6051A06E6D4D4D4000682051B06E6D4D4D400077602CD06E6D4D4D40006BC0B2C06E6D4D4D40006E60A3F06E6D4D4D400062E0A3C06E6D4D4D400062E0A3D06E6D4D4D400062E0A3A06E6D4D4D400062E0A3B06E6D4D4D400062E0A3806E6D4D4D400062E0A3906E6D4D4D400062E0A0606E6D4D4D400062E0A0706E6D4D4D400062E0A0406E6D4D4D400062E0A0506E6D4D4D400062E0A0206E6D4D4D400062E0A0306E6D4D4D400062E0A0006E6D4D4D400062E0A0106E6D4D4D400062E0A0E06E6D4D4D400062E0A0F06E6D4D4D400062E0A0C06E6D4D4D400062E0A0D06E6D4D4D400062E0A0A06E6D4D4D400062E0A0B06E6D4D4D400062E0A0806E6D4D4D400062E0A0906E6D4D4D400062E0A1606E6D4D4D40007CA0A1706E6D4D4D40007CA0A1406E6D4D4D40007CA0A1506E6D4D4D40007CA0A1206E6D4D4D40007CA0A1306E6D4D4D40007CA0A1006E6D4D4D40007CA0A1106E6D4D4D40007CA0A1E06E6D4D4D40007CA0A1F06E6D4D4D40007CA0A1C06E6D4D4D40007CA0A1D06E6D4D4D40007CA0A1A06E6D4D4D40007CA0A1B06E6D4D4D40007CA0A1806E6D4D4D40007CA0A1906E6D4D4D40007CA0BE606E6D4D4D40007CA0BE706E6D4D4D40007CA0BE406E6D4D4D40007CA0BE506E6D4D4D40007CA0BE206E6D4D4D40007CA0B2D06E6D4D4D40006E60B2A06E6D4D4D40006E60BE306E6D4D4D40007CA02D606E6D4D4D40007CA029F06E6D4D4D400062E0B9406E6D4D4D40006820BE006E6D4D4D40007CA0BE106E6D4D4D40007CA0BEE06E6D4D4D40007CA0BEF06E6D4D4D40007CA02C106E6D4D4D400C5B602CE06E6D4D4D400C5B602CF06E6D4D4D400674E02CC06E6D4D4D400674E051006E6D4D4D400062E02FA06E6D4D4D400062E02CA06E6D4D4D40006B602CB06E6D4D4D40006A0051106E6D4D4D400062E02FD06E6D4D4D400062E0B9506E6D4D4D40006820B9206E6D4D4D40006820B9306E6D4D4D40006820B9006E6D4D4D40006820B9106E6D4D4D40006820B9E06E6D4D4D40006820B9F06E6D4D4D40006820BEC06E6D4D4D40006820BED06E6D4D4D40006820BEA06E6D4D4D40006820BEB06E6D4D4D40006820BE806E6D4D4D40006820BE906E6D4D4D40006820BF606E6D4D4D40006820BF706E6D4D4D40006820BF406E6D4D4D40006820BF506E6D4D4D40006820BF206E6D4D4D40006820BF306E6D4D4D40006820BF006E6D4D4D40006820BF106E6D4D4D400068202DB06E6D4D4D40006E70B9C06E6D4D4D40006820BFE06E6D4D4D40006820BFF06E6D4D4D400068202A706E6D4D4D40006E70B9D06E6D4D4D40006820BFC06E6D4D4D400068202D106E6D4D4D40006E702DD06E6D4D4D40006E402DA06E6D4D4D40006EC02D906E6D4D4D40006E402A606E6D4D4D40006EC02A506E6D4D4D40006E402A206E6D4D4D40006EC02A106E6D4D4D40006E402AE06E6D4D4D40006EC02AD06E6D4D4D40006E402AA06E6D4D4D40006EC02A906E6D4D4D40006E402B606E6D4D4D40006EC0BFD06E6D4D4D40006820BFA06E6D4D4D40006820BFB06E6D4D4D40006820BF806E6D4D4D40006820BF906E6D4D4D40006820BC606E6D4D4D40006820BC706E6D4D4D40006820BC406E6D4D4D40006820BC506E6D4D4D40006820BC206E6D4D4D40006820BC306E6D4D4D40006820BC006E6D4D4D40006820BC106E6D4D4D40006820BCE06E6D4D4D40006820BCF06E6D4D4D40006820BCC06E6D4D4D40006820BCD06E6D4D4D40006820BCA06E6D4D4D40006820BCB06E6D4D4D40006820BC806E6D4D4D40006820BC906E6D4D4D40006820BD606E6D4D4D40006820BD706E6D4D4D40006820BD406E6D4D4D40006820BD506E6D4D4D40006820BD206E6D4D4D40006820BD306E6D4D4D40006820BD006E6D4D4D40006820BD106E6D4D4D40006820BDE06E6D4D4D40006820BDF06E6D4D4D40006820BDC06E6D4D4D40006820BDD06E6D4D4D40006820BDA06E6D4D4D40006820BDB06E6D4D4D40006820B9A06E6D4D4D40006820BD806E6D4D4D40006820BD906E6D4D4D40006820BA606E6D4D4D40006820BA706E6D4D4D40006820BA406E6D4D4D40006820BA506E6D4D4D40006820BA206E6D4D4D40006820BA306E6D4D4D40006820BA006E6D4D4D40006820BA106E6D4D4D40006820BAE06E6D4D4D40006820BAF06E6D4D4D40006820BAC06E6D4D4D40006820BBE06E6D4D4D40006820BBF06E6D4D4D40006820BBC06E6D4D4D40006820BBD06E6D4D4D40006820BBA06E6D4D4D40006820BBB06E6D4D4D40006820BB806E6D4D4D40006820BB906E6D4D4D40006820B8606E6D4D4D40006820B8706E6D4D4D40006820B8406E6D4D4D40006820B8506E6D4D4D40006820B8206E6D4D4D400068202D706E6D4D4D40007CA02D406E6D4D4D40007CA026E06E6D4D4D40007CA0B9B06E6D4D4D40006820B9806E6D4D4D40006820B6A06E6D4D4D40006820B6B06E6D4D4D4000682029C06E6D4D4D40006E60B6806E6D4D4D4000682029D06E6D4D4D40006E60B6906E6D4D4D40006820A6E06E6D4D4D40006E60A6F06E6D4D4D40006E60A6C06E6D4D4D40006E60A6D06E6D4D4D40006E60A6A06E6D4D4D40006E60A6B06E6D4D4D40006E60A6806E6D4D4D40006E60A6906E6D4D4D40006E60A7606E6D4D4D40006E60A7706E6D4D4D40006E602E406E6D4D4D40005010A7406E6D4D4D40006E60A7506E6D4D4D40006E602D006E6D4D4D40006E60A7206E6D4D4D40006E6026606E6D4D4D400028C0A4406E6D4D4D40006E60A4506E6D4D4D40006E6026C06E6D4D4D40006E7026D06E6D4D4D40006E5026A06E6D4D4D40006E3026B06E6D4D4D40006E70A4206E6D4D4D40006E6026906E6D4D4D40006E7027606E6D4D4D40006E5027706E6D4D4D40006E50A4306E6D4D4D40006E6027506E6D4D4D40006E7027206E6D4D4D40006E7027306E6D4D4D40006E70A4006E6D4D4D40006E60A4106E6D4D4D40006E60A4E06E6D4D4D40006E60A4F06E6D4D4D40006E60A4C06E6D4D4D40006E60A4D06E6D4D4D40006E60A4A06E6D4D4D40006E60A4B06E6D4D4D40006E60A4806E6D4D4D40006E6029E06E6D4D4D40006E602A306E6D4D4D40006E402A006E6D4D4D40006E302AF06E6D4D4D40006E402AC06E6D4D4D40006E302AB06E6D4D4D40006E402A806E6D4D4D40006E3027106E6D4D4D40006E2027E06E6D4D4D40006EC027F06E6D4D4D40006E2027C06E6D4D4D40006EC027D06E6D4D4D40006E40B7606E6D4D4D40006820B7706E6D4D4D40006820B7406E6D4D4D40006820B7506E6D4D4D40006820B7206E6D4D4D40006820B7306E6D4D4D40006820B7006E6D4D4D40006820B7106E6D4D4D40006820B7E06E6D4D4D40006820B3C06E6D4D4D40006E60D3406E6D4D4D40006820D3506E6D4D4D40006820B3D06E6D4D4D40006E6026706E6D4D4D40006E60D5E06E6D4D4D40006820D5F06E6D4D4D40006820D5C06E6D4D4D40006820D5D06E6D4D4D40006820D5A06E6D4D4D40006820D5B06E6D4D4D40006820D5806E6D4D4D40006820D5906E6D4D4D40006820D2606E6D4D4D40006820D2706E6D4D4D40006820D2406E6D4D4D40006820D2506E6D4D4D40006820D2206E6D4D4D40006820D3206E6D4D4D40006820D3306E6D4D4D40006820D3006E6D4D4D40006820D3106E6D4D4D40006820D3E06E6D4D4D40006820D2306E6D4D4D40006820D2006E6D4D4D40006820D2106E6D4D4D40006820D2E06E6D4D4D40006820D2F06E6D4D4D40006820D2C06E6D4D4D40006820D2D06E6D4D4D40006820D2A06E6D4D4D40006820D2B06E6D4D4D40006820D2806E6D4D4D40006820D2906E6D4D4D40006820D3606E6D4D4D40006820D3706E6D4D4D400068202E306E6D4D4D40006F802E106E6D4D4D40006820D3F06E6D4D4D40006820D0A06E6D4D4D40006820D0B06E6D4D4D40006820D0806E6D4D4D40006820D0906E6D4D4D40006820D1606E6D4D4D40006820D1706E6D4D4D40006820D1406E6D4D4D40006820D1506E6D4D4D40006820D1206E6D4D4D40006820D3C06E6D4D4D400068202B406E6D4D4D40006E60D1306E6D4D4D40006820D1006E6D4D4D40006820D1106E6D4D4D40006820D1E06E6D4D4D40006820AE006E6D4D4D40006820AE106E6D4D4D40006820AEE06E6D4D4D40006820AEF06E6D4D4D40006820AEC06E6D4D4D40006820AED06E6D4D4D40006820AEA06E6D4D4D40006820AEB06E6D4D4D40006820AE806E6D4D4D40006820AE906E6D4D4D40006820AF606E6D4D4D4000682026406E6D4D4D40006E60AF706E6D4D4D40006820B3A06E6D4D4D40006E60AB206E6D4D4D40006E60B3B06E6D4D4D40006E60D3D06E6D4D4D40006820D3A06E6D4D4D40006820D3B06E6D4D4D40006820AB306E6D4D4D40006E60AB006E6D4D4D40006E60AB106E6D4D4D40006E60ABE06E6D4D4D40006E60ABF06E6D4D4D40006E60ABC06E6D4D4D40006E60ABD06E6D4D4D40006E60ABA06E6D4D4D40006E60ABB06E6D4D4D40006E60AB806E6D4D4D40006E60AB906E6D4D4D40006E60A8606E6D4D4D40006E60A8806E6D4D4D40006E60A8906E6D4D4D40006E60A9606E6D4D4D40006E60A9706E6D4D4D40006E60A9406E6D4D4D40006E60A9506E6D4D4D40006E60A9206E6D4D4D40006E60A9306E6D4D4D40006E60A9006E6D4D4D40006E60A9106E6D4D4D40006E60A9E06E6D4D4D40006E60A9F06E6D4D4D40006E60A9C06E6D4D4D40006E60D3806E6D4D4D40006820D3906E6D4D4D40006820D0606E6D4D4D40006820D0706E6D4D4D40006820D0406E6D4D4D40006820D0506E6D4D4D40006820D0206E6D4D4D40006820D0306E6D4D4D40006820D0006E6D4D4D40006820D0106E6D4D4D40006820D0E06E6D4D4D40006820D0F06E6D4D4D40006820D0C06E6D4D4D40006820D0D06E6D4D4D40006820B3806E6D4D4D40006E60B3906E6D4D4D40006E60B0606E6D4D4D40006E60B0706E6D4D4D40006E60B0406E6D4D4D40006E60B0506E6D4D4D40006E60B0206E6D4D4D40006E60B0306E6D4D4D40006E60B0006E6D4D4D40006E60B1206E6D4D4D40006E60B1306E6D4D4D40006E60B1006E6D4D4D40006E60B1106E6D4D4D40006E60B1E06E6D4D4D40006E60B1F06E6D4D4D40006E60B1C06E6D4D4D40006E60B1D06E6D4D4D40006E60B1A06E6D4D4D40006E60B1B06E6D4D4D40006E60B1806E6D4D4D40006E60B1906E6D4D4D40006E608E606E6D4D4D40006E6029B06E6D4D4D40006F20AF406E6D4D4D4000682026006E6D4D4D40006E70AC606E6D4D4D40006820AC706E6D4D4D40006820AC406E6D4D4D40006820AC506E6D4D4D40006820AC206E6D4D4D40006820AC306E6D4D4D40006820AC006E6D4D4D40006820AC106E6D4D4D40006820ACE06E6D4D4D40006820ACF06E6D4D4D40006820ACC06E6D4D4D40006820ACD06E6D4D4D40006820ACA06E6D4D4D4000682027A06E6D4D4D40006E30ADC06E6D4D4D40006820ADD06E6D4D4D40006820ADA06E6D4D4D40006820ADB06E6D4D4D40006820AD806E6D4D4D40006820AD906E6D4D4D40006820AA606E6D4D4D40006820AA706E6D4D4D40006820AA406E6D4D4D40006820AA506E6D4D4D40006820AA206E6D4D4D40006820AA306E6D4D4D40006820AA006E6D4D4D4000682") - bf.WriteBytes(data) - bf.WriteUint16(uint16(len(vsQuestItems))) - bf.WriteUint32(uint32(len(vsQuestBets))) + bf.WriteUint16(0) // Unk array of uint16s + bf.WriteUint16(uint16(len(vsQuestBets))) bf.WriteUint16(0) // Unk for i := range vsQuestItems { @@ -145,6 +690,7 @@ func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(pkt.Offset) bf.Seek(0, io.SeekStart) bf.WriteUint16(returnedCount) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } diff --git a/server/channelserver/handlers_register.go b/server/channelserver/handlers_register.go index efe9dc1b1..6a74358aa 100644 --- a/server/channelserver/handlers_register.go +++ b/server/channelserver/handlers_register.go @@ -6,283 +6,147 @@ import ( "strings" ) +func handleMsgMhfRegisterEvent(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfRegisterEvent) + bf := byteframe.NewByteFrame() + // Some kind of check if there's already a session + if pkt.Unk3 > 0 && s.server.getRaviSemaphore() == nil { + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) + return + } + bf.WriteUint8(uint8(pkt.WorldID)) + bf.WriteUint8(uint8(pkt.LandID)) + bf.WriteUint16(s.server.raviente.id) + doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfReleaseEvent(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfReleaseEvent) + + // Do this ack manually because it uses a non-(0|1) error code + /* + _ACK_SUCCESS = 0 + _ACK_ERROR = 1 + + _ACK_EINPROGRESS = 16 + _ACK_ENOENT = 17 + _ACK_ENOSPC = 18 + _ACK_ETIMEOUT = 19 + + _ACK_EINVALID = 64 + _ACK_EFAILED = 65 + _ACK_ENOMEM = 66 + _ACK_ENOTEXIT = 67 + _ACK_ENOTREADY = 68 + _ACK_EALREADY = 69 + _ACK_DISABLE_WORK = 71 + */ + s.QueueSendMHF(&mhfpacket.MsgSysAck{ + AckHandle: pkt.AckHandle, + IsBufferResponse: false, + ErrorCode: 0x41, + AckData: []byte{0x00, 0x00, 0x00, 0x00}, + }) +} + +type RaviUpdate struct { + Op uint8 + Dest uint8 + Data uint32 +} + func handleMsgSysOperateRegister(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgSysOperateRegister) - bf := byteframe.NewByteFrameFromBytes(pkt.RawDataPayload) - s.server.raviente.Lock() - switch pkt.SemaphoreID { - case 4: - resp := byteframe.NewByteFrame() - size := 6 - for i := 0; i < len(bf.Data())-1; i += size { - op := bf.ReadUint8() - dest := bf.ReadUint8() - data := bf.ReadUint32() - resp.WriteUint8(1) - resp.WriteUint8(dest) - ref := &s.server.raviente.state.stateData[dest] - damageMultiplier := s.server.raviente.GetRaviMultiplier(s.server) - switch op { - case 2: - resp.WriteUint32(*ref) - if dest == 28 { // Berserk resurrection tracker - resp.WriteUint32(*ref + data) - *ref += data - } else if dest == 17 { // Berserk poison tracker - if damageMultiplier == 1 { - resp.WriteUint32(*ref + data) - *ref += data - } else { - resp.WriteUint32(*ref) - } - } else { - data = uint32(float64(data) * damageMultiplier) - resp.WriteUint32(*ref + data) - *ref += data - } - case 13: - fallthrough - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - } - } - resp.WriteUint8(0) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) - case 5: - resp := byteframe.NewByteFrame() - size := 6 - for i := 0; i < len(bf.Data())-1; i += size { - op := bf.ReadUint8() - dest := bf.ReadUint8() - data := bf.ReadUint32() - resp.WriteUint8(1) - resp.WriteUint8(dest) - ref := &s.server.raviente.support.supportData[dest] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - fallthrough - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - } - } - resp.WriteUint8(0) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) - case 6: - resp := byteframe.NewByteFrame() - size := 6 - for i := 0; i < len(bf.Data())-1; i += size { - op := bf.ReadUint8() - dest := bf.ReadUint8() - data := bf.ReadUint32() - resp.WriteUint8(1) - resp.WriteUint8(dest) - switch dest { - case 0: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.nextTime = data - case 1: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.startTime = data - case 2: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.killedTime = data - case 3: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.postTime = data - case 4: - ref := &s.server.raviente.register.register[0] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - } - case 5: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.carveQuest = data - case 6: - ref := &s.server.raviente.register.register[1] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - } - case 7: - ref := &s.server.raviente.register.register[2] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - } - case 8: - ref := &s.server.raviente.register.register[3] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - } - case 9: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.maxPlayers = data - case 10: - resp.WriteUint32(0) - resp.WriteUint32(data) - s.server.raviente.register.ravienteType = data - case 11: - ref := &s.server.raviente.register.register[4] - switch op { - case 2: - resp.WriteUint32(*ref) - resp.WriteUint32(*ref + data) - *ref += data - case 13: - resp.WriteUint32(0) - resp.WriteUint32(data) - *ref = data - case 14: - resp.WriteUint32(0) - resp.WriteUint32(data) - } - default: - resp.WriteUint32(0) - resp.WriteUint32(0) - } - } - resp.WriteUint8(0) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) + + var raviUpdates []RaviUpdate + var raviUpdate RaviUpdate + // Strip null terminator + bf := byteframe.NewByteFrameFromBytes(pkt.RawDataPayload[:len(pkt.RawDataPayload)-1]) + for i := len(pkt.RawDataPayload) / 6; i > 0; i-- { + raviUpdate.Op = bf.ReadUint8() + raviUpdate.Dest = bf.ReadUint8() + raviUpdate.Data = bf.ReadUint32() + raviUpdates = append(raviUpdates, raviUpdate) + } + bf = byteframe.NewByteFrame() + + var _old, _new uint32 + s.server.raviente.Lock() + for _, update := range raviUpdates { + switch update.Op { + case 2: + _old, _new = s.server.UpdateRavi(pkt.SemaphoreID, update.Dest, update.Data, true) + case 13, 14: + _old, _new = s.server.UpdateRavi(pkt.SemaphoreID, update.Dest, update.Data, false) + } + bf.WriteUint8(1) + bf.WriteUint8(update.Dest) + bf.WriteUint32(_old) + bf.WriteUint32(_new) } - s.notifyRavi() s.server.raviente.Unlock() + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + + if s.server.erupeConfig.GameplayOptions.LowLatencyRaviente { + s.notifyRavi() + } } func handleMsgSysLoadRegister(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgSysLoadRegister) - r := pkt.Unk1 - switch r { - case 12: - resp := byteframe.NewByteFrame() - resp.WriteUint8(0) - resp.WriteUint8(12) - resp.WriteUint32(s.server.raviente.register.nextTime) - resp.WriteUint32(s.server.raviente.register.startTime) - resp.WriteUint32(s.server.raviente.register.killedTime) - resp.WriteUint32(s.server.raviente.register.postTime) - resp.WriteUint32(s.server.raviente.register.register[0]) - resp.WriteUint32(s.server.raviente.register.carveQuest) - resp.WriteUint32(s.server.raviente.register.register[1]) - resp.WriteUint32(s.server.raviente.register.register[2]) - resp.WriteUint32(s.server.raviente.register.register[3]) - resp.WriteUint32(s.server.raviente.register.maxPlayers) - resp.WriteUint32(s.server.raviente.register.ravienteType) - resp.WriteUint32(s.server.raviente.register.register[4]) - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) - case 29: - resp := byteframe.NewByteFrame() - resp.WriteUint8(0) - resp.WriteUint8(29) - for _, v := range s.server.raviente.state.stateData { - resp.WriteUint32(v) + bf := byteframe.NewByteFrame() + bf.WriteUint8(0) + bf.WriteUint8(pkt.Values) + for i := uint8(0); i < pkt.Values; i++ { + switch pkt.RegisterID { + case 0x40000: + bf.WriteUint32(s.server.raviente.state[i]) + case 0x50000: + bf.WriteUint32(s.server.raviente.support[i]) + case 0x60000: + bf.WriteUint32(s.server.raviente.register[i]) } - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) - case 25: - resp := byteframe.NewByteFrame() - resp.WriteUint8(0) - resp.WriteUint8(25) - for _, v := range s.server.raviente.support.supportData { - resp.WriteUint32(v) - } - doAckBufSucceed(s, pkt.AckHandle, resp.Data()) } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } func (s *Session) notifyRavi() { + sema := s.server.getRaviSemaphore() + if sema == nil { + return + } var temp mhfpacket.MHFPacket raviNotif := byteframe.NewByteFrame() - temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 4} + temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 0x40000} raviNotif.WriteUint16(uint16(temp.Opcode())) temp.Build(raviNotif, s.clientContext) - temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 5} + temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 0x50000} raviNotif.WriteUint16(uint16(temp.Opcode())) temp.Build(raviNotif, s.clientContext) - temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 6} + temp = &mhfpacket.MsgSysNotifyRegister{RegisterID: 0x60000} raviNotif.WriteUint16(uint16(temp.Opcode())) temp.Build(raviNotif, s.clientContext) raviNotif.WriteUint16(0x0010) // End it. - sema := getRaviSemaphore(s.server) - if sema != nil { + if s.server.erupeConfig.GameplayOptions.LowLatencyRaviente { for session := range sema.clients { session.QueueSend(raviNotif.Data()) } + } else { + for session := range sema.clients { + if session.charID == s.charID { + session.QueueSend(raviNotif.Data()) + } + } } } -func getRaviSemaphore(s *Server) *Semaphore { +func (s *Server) getRaviSemaphore() *Semaphore { for _, semaphore := range s.semaphore { - if strings.HasPrefix(semaphore.id_semaphore, "hs_l0u3B5") && strings.HasSuffix(semaphore.id_semaphore, "3") { + if strings.HasPrefix(semaphore.name, "hs_l0") && strings.HasSuffix(semaphore.name, "3") { return semaphore } } return nil } -func resetRavi(s *Session) { - s.server.raviente.Lock() - s.server.raviente.register.nextTime = 0 - s.server.raviente.register.startTime = 0 - s.server.raviente.register.killedTime = 0 - s.server.raviente.register.postTime = 0 - s.server.raviente.register.ravienteType = 0 - s.server.raviente.register.maxPlayers = 0 - s.server.raviente.register.carveQuest = 0 - s.server.raviente.register.register = []uint32{0, 0, 0, 0, 0} - s.server.raviente.state.stateData = []uint32{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - s.server.raviente.support.supportData = []uint32{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - s.server.raviente.Unlock() -} - func handleMsgSysNotifyRegister(s *Session, p mhfpacket.MHFPacket) {} diff --git a/server/channelserver/handlers_seibattle.go b/server/channelserver/handlers_seibattle.go new file mode 100644 index 000000000..caf5c19c9 --- /dev/null +++ b/server/channelserver/handlers_seibattle.go @@ -0,0 +1,106 @@ +package channelserver + +import ( + "erupe-ce/common/byteframe" + "erupe-ce/network/mhfpacket" +) + +func handleMsgMhfGetBreakSeibatuLevelReward(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetBreakSeibatuLevelReward) + bf := byteframe.NewByteFrame() + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} + +type WeeklySeibatuRankingReward struct { + Unk0 int32 + Unk1 int32 + Unk2 uint32 + Unk3 int32 + Unk4 int32 + Unk5 int32 +} + +func handleMsgMhfGetWeeklySeibatuRankingReward(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetWeeklySeibatuRankingReward) + var data []*byteframe.ByteFrame + weeklySeibatuRankingRewards := []WeeklySeibatuRankingReward{ + {0, 0, 0, 0, 0, 0}, + } + for _, reward := range weeklySeibatuRankingRewards { + bf := byteframe.NewByteFrame() + bf.WriteInt32(reward.Unk0) + bf.WriteInt32(reward.Unk1) + bf.WriteUint32(reward.Unk2) + bf.WriteInt32(reward.Unk3) + bf.WriteInt32(reward.Unk4) + bf.WriteInt32(reward.Unk5) + data = append(data, bf) + } + doAckEarthSucceed(s, pkt.AckHandle, data) +} + +func handleMsgMhfGetFixedSeibatuRankingTable(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetFixedSeibatuRankingTable) + bf := byteframe.NewByteFrame() + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteBytes(make([]byte, 32)) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfReadBeatLevel(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfReadBeatLevel) + + // This response is fixed and will never change on JP, + // but I've left it dynamic for possible other client differences. + resp := byteframe.NewByteFrame() + for i := 0; i < int(pkt.ValidIDCount); i++ { + resp.WriteUint32(pkt.IDs[i]) + resp.WriteUint32(1) + resp.WriteUint32(1) + resp.WriteUint32(1) + } + + doAckBufSucceed(s, pkt.AckHandle, resp.Data()) +} + +func handleMsgMhfReadLastWeekBeatRanking(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfReadLastWeekBeatRanking) + bf := byteframe.NewByteFrame() + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfUpdateBeatLevel(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfUpdateBeatLevel) + + doAckBufSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) +} + +func handleMsgMhfReadBeatLevelAllRanking(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfReadBeatLevelAllRanking) + bf := byteframe.NewByteFrame() + bf.WriteUint32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + + for i := 0; i < 100; i++ { + bf.WriteUint32(0) + bf.WriteUint32(0) + bf.WriteBytes(make([]byte, 32)) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} + +func handleMsgMhfReadBeatLevelMyRanking(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfReadBeatLevelMyRanking) + bf := byteframe.NewByteFrame() + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} diff --git a/server/channelserver/handlers_semaphore.go b/server/channelserver/handlers_semaphore.go index cbf1a0a7f..19925c6d6 100644 --- a/server/channelserver/handlers_semaphore.go +++ b/server/channelserver/handlers_semaphore.go @@ -2,7 +2,6 @@ package channelserver import ( "erupe-ce/common/byteframe" - "fmt" "go.uber.org/zap" "strconv" "strings" @@ -13,9 +12,6 @@ import ( func removeSessionFromSemaphore(s *Session) { s.server.semaphoreLock.Lock() for _, semaphore := range s.server.semaphore { - if _, exists := semaphore.reservedClientSlots[s.charID]; exists { - delete(semaphore.reservedClientSlots, s.charID) - } if _, exists := semaphore.clients[s]; exists { delete(semaphore.clients, s) } @@ -31,49 +27,38 @@ func handleMsgSysCreateSemaphore(s *Session, p mhfpacket.MHFPacket) { func destructEmptySemaphores(s *Session) { s.server.semaphoreLock.Lock() for id, sema := range s.server.semaphore { - if len(sema.reservedClientSlots) == 0 && len(sema.clients) == 0 { - s.server.semaphoreLock.Unlock() + if len(sema.clients) == 0 { delete(s.server.semaphore, id) - s.server.semaphoreLock.Lock() - if strings.HasPrefix(id, "hs_l0u3B5") { - releaseRaviSemaphore(s, sema) + if strings.HasPrefix(id, "hs_l0") { + s.server.resetRaviente() } - s.logger.Debug("Destructed semaphore", zap.String("sema.id_semaphore", id)) + s.logger.Debug("Destructed semaphore", zap.String("sema.name", id)) } } s.server.semaphoreLock.Unlock() } -func releaseRaviSemaphore(s *Session, sema *Semaphore) { - delete(sema.reservedClientSlots, s.charID) - delete(sema.clients, s) - if strings.HasSuffix(sema.id_semaphore, "2") && len(sema.clients) == 0 { - s.logger.Debug("Main raviente semaphore is empty, resetting") - resetRavi(s) - } -} - func handleMsgSysDeleteSemaphore(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgSysDeleteSemaphore) - sem := pkt.AckHandle - if s.server.semaphore != nil { - destructEmptySemaphores(s) - s.server.semaphoreLock.Lock() - for id, sema := range s.server.semaphore { - if sema.id == sem { - if strings.HasPrefix(id, "hs_l0u3B5") { - releaseRaviSemaphore(s, sema) - s.server.semaphoreLock.Unlock() - return + destructEmptySemaphores(s) + s.server.semaphoreLock.Lock() + for id, sema := range s.server.semaphore { + if sema.id == pkt.SemaphoreID { + for session := range sema.clients { + if s == session { + delete(sema.clients, s) } - s.server.semaphoreLock.Unlock() + } + if len(sema.clients) == 0 { delete(s.server.semaphore, id) - s.logger.Debug("Destructed semaphore", zap.String("sema.id_semaphore", id)) - return + if strings.HasPrefix(id, "hs_l0") { + s.server.resetRaviente() + } + s.logger.Debug("Destructed semaphore", zap.String("sema.name", id)) } } - s.server.semaphoreLock.Unlock() } + s.server.semaphoreLock.Unlock() } func handleMsgSysCreateAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) { @@ -81,18 +66,15 @@ func handleMsgSysCreateAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) { SemaphoreID := pkt.SemaphoreID newSemaphore, exists := s.server.semaphore[SemaphoreID] - - fmt.Printf("Got reserve stage req, StageID: %v\n\n", SemaphoreID) if !exists { s.server.semaphoreLock.Lock() - if strings.HasPrefix(SemaphoreID, "hs_l0u3B5") { - suffix, _ := strconv.ParseUint(pkt.SemaphoreID[len(pkt.SemaphoreID)-1:], 10, 32) + if strings.HasPrefix(SemaphoreID, "hs_l0") { + suffix, _ := strconv.Atoi(pkt.SemaphoreID[len(pkt.SemaphoreID)-1:]) s.server.semaphore[SemaphoreID] = &Semaphore{ - id_semaphore: pkt.SemaphoreID, - id: uint32(suffix + 1), - clients: make(map[*Session]uint32), - reservedClientSlots: make(map[uint32]interface{}), - maxPlayers: 32, + name: pkt.SemaphoreID, + id: uint32((suffix + 1) * 0x10000), + clients: make(map[*Session]uint32), + maxPlayers: 127, } } else { s.server.semaphore[SemaphoreID] = NewSemaphore(s.server, SemaphoreID, 1) @@ -103,22 +85,19 @@ func handleMsgSysCreateAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) { newSemaphore.Lock() defer newSemaphore.Unlock() - if _, exists := newSemaphore.reservedClientSlots[s.charID]; exists { - bf := byteframe.NewByteFrame() + bf := byteframe.NewByteFrame() + if _, exists := newSemaphore.clients[s]; exists { bf.WriteUint32(newSemaphore.id) - doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) - } else if uint16(len(newSemaphore.reservedClientSlots)) < newSemaphore.maxPlayers { - newSemaphore.reservedClientSlots[s.charID] = nil + } else if uint16(len(newSemaphore.clients)) < newSemaphore.maxPlayers { newSemaphore.clients[s] = s.charID s.Lock() s.semaphore = newSemaphore s.Unlock() - bf := byteframe.NewByteFrame() bf.WriteUint32(newSemaphore.id) - doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) } else { - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + bf.WriteUint32(0) } + doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) } func handleMsgSysAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) { @@ -131,7 +110,6 @@ func handleMsgSysAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) { } else { doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4)) } - } func handleMsgSysReleaseSemaphore(s *Session, p mhfpacket.MHFPacket) { diff --git a/server/channelserver/handlers_shop_gacha.go b/server/channelserver/handlers_shop_gacha.go index 1341e341c..38b036f7f 100644 --- a/server/channelserver/handlers_shop_gacha.go +++ b/server/channelserver/handlers_shop_gacha.go @@ -3,6 +3,7 @@ package channelserver import ( "erupe-ce/common/byteframe" ps "erupe-ce/common/pascalstring" + _config "erupe-ce/config" "erupe-ce/network/mhfpacket" "math/rand" ) @@ -40,13 +41,14 @@ type GachaEntry struct { EntryType uint8 `db:"entry_type"` ID uint32 `db:"id"` ItemType uint8 `db:"item_type"` - ItemNumber uint16 `db:"item_number"` + 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 { @@ -108,6 +110,12 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { // 8: special item switch pkt.ShopType { case 1: // Running gachas + // Fundamentally, gacha works completely differently, just hide it for now. + if _config.ErupeConfig.RealClientMode <= _config.G7 { + doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) + return + } + var count uint16 shopEntries, err := s.server.db.Queryx("SELECT id, min_gr, min_hr, name, url_banner, url_feature, url_thumbnail, wide, recommended, gacha_type, hidden FROM gacha_shop") if err != nil { @@ -151,7 +159,7 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(pkt.ShopID) var gachaType int s.server.db.QueryRow(`SELECT gacha_type FROM gacha_shop WHERE id = $1`, pkt.ShopID).Scan(&gachaType) - entries, err := s.server.db.Queryx(`SELECT entry_type, id, item_type, item_number, item_quantity, weight, rarity, rolls, daily_limit, frontier_points FROM gacha_entries WHERE gacha_id = $1 ORDER BY weight DESC`, pkt.ShopID) + entries, err := s.server.db.Queryx(`SELECT entry_type, id, item_type, item_number, item_quantity, weight, rarity, rolls, daily_limit, frontier_points, name FROM gacha_entries WHERE gacha_id = $1 ORDER BY weight DESC`, pkt.ShopID) if err != nil { doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) return @@ -168,8 +176,7 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint8(gachaEntry.EntryType) bf.WriteUint32(gachaEntry.ID) bf.WriteUint8(gachaEntry.ItemType) - bf.WriteUint16(0) - bf.WriteUint16(gachaEntry.ItemNumber) + bf.WriteUint32(gachaEntry.ItemNumber) bf.WriteUint16(gachaEntry.ItemQuantity) if gachaType >= 4 { // If box bf.WriteUint16(1) @@ -197,7 +204,11 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(gachaEntry.FrontierPoints) bf.WriteUint8(gachaEntry.DailyLimit) - bf.WriteUint8(0) + if gachaEntry.EntryType < 10 { + ps.Uint8(bf, gachaEntry.Name, true) + } else { + bf.WriteUint8(0) + } bf.WriteBytes(temp.Data()) } bf.Seek(4, 0) diff --git a/server/channelserver/handlers_tournament.go b/server/channelserver/handlers_tournament.go index 84c2c8e8f..87fc95330 100644 --- a/server/channelserver/handlers_tournament.go +++ b/server/channelserver/handlers_tournament.go @@ -7,54 +7,124 @@ 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 +} + func handleMsgMhfInfoTournament(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfInfoTournament) bf := byteframe.NewByteFrame() + tournamentInfo0 := []TournamentInfo0{} + tournamentInfo21 := []TournamentInfo21{} + tournamentInfo22 := []TournamentInfo22{} + switch pkt.Unk0 { case 0: - bf.WriteUint32(uint32(TimeAdjusted().Unix())) - bf.WriteUint32(0) // Tied to schedule ID? - case 1: - - bf.WriteBytes(make([]byte, 21)) - ps.Uint8(bf, "", false) - break - - bf.WriteUint32(0xACEDCAFE) - - bf.WriteUint32(5) // Active schedule? - - bf.WriteUint32(1) // Schedule ID? - - bf.WriteUint32(32) // Max players - bf.WriteUint32(0) // Registered players - - bf.WriteUint16(0) - bf.WriteUint16(2) // Color code for schedule item bf.WriteUint32(0) - - bf.WriteUint32(uint32(time.Now().Add(time.Hour * -10).Unix())) - bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix())) - bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix())) - bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix())) - bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix())) - bf.WriteUint32(uint32(time.Now().Add(time.Hour * 10).Unix())) - - bf.WriteBool(true) // Unk - bf.WriteBool(false) // Cafe-only - - bf.WriteUint32(0) // Min HR - bf.WriteUint32(0) // Max HR - - ps.Uint8(bf, "Test", false) - - // ... + bf.WriteUint32(uint32(len(tournamentInfo0))) + for _, tinfo := range tournamentInfo0 { + bf.WriteUint32(tinfo.ID) + bf.WriteUint32(tinfo.MaxPlayers) + bf.WriteUint32(tinfo.CurrentPlayers) + bf.WriteUint16(tinfo.Unk1) + bf.WriteUint16(tinfo.TextColor) + bf.WriteUint32(tinfo.Unk2) + bf.WriteUint32(uint32(tinfo.Time1.Unix())) + bf.WriteUint32(uint32(tinfo.Time2.Unix())) + bf.WriteUint32(uint32(tinfo.Time3.Unix())) + bf.WriteUint32(uint32(tinfo.Time4.Unix())) + bf.WriteUint32(uint32(tinfo.Time5.Unix())) + bf.WriteUint32(uint32(tinfo.Time6.Unix())) + bf.WriteUint8(tinfo.Unk3) + bf.WriteUint8(tinfo.Unk4) + bf.WriteUint32(tinfo.MinHR) + bf.WriteUint32(tinfo.MaxHR) + ps.Uint8(bf, tinfo.Unk5, true) + ps.Uint16(bf, tinfo.Unk6, true) + } + case 1: + bf.WriteUint32(uint32(TimeAdjusted().Unix())) + bf.WriteUint32(0) // Registered ID + bf.WriteUint32(0) + bf.WriteUint32(0) + bf.WriteUint8(0) + bf.WriteUint32(0) + ps.Uint8(bf, "", true) + case 2: + bf.WriteUint32(0) + bf.WriteUint32(uint32(len(tournamentInfo21))) + for _, info := range tournamentInfo21 { + bf.WriteUint32(info.Unk0) + bf.WriteUint32(info.Unk1) + bf.WriteUint32(info.Unk2) + bf.WriteUint8(info.Unk3) + } + bf.WriteUint32(uint32(len(tournamentInfo22))) + for _, info := range tournamentInfo22 { + bf.WriteUint32(info.Unk0) + bf.WriteUint32(info.Unk1) + bf.WriteUint32(info.Unk2) + bf.WriteUint8(info.Unk3) + ps.Uint8(bf, info.Unk4, true) + } } doAckBufSucceed(s, pkt.AckHandle, bf.Data()) } -func handleMsgMhfEntryTournament(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfEntryTournament(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfEntryTournament) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} -func handleMsgMhfAcquireTournament(s *Session, p mhfpacket.MHFPacket) {} +type TournamentReward struct { + Unk0 uint16 + Unk1 uint16 + Unk2 uint16 +} + +func handleMsgMhfAcquireTournament(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfAcquireTournament) + rewards := []TournamentReward{} + bf := byteframe.NewByteFrame() + bf.WriteUint8(uint8(len(rewards))) + for _, reward := range rewards { + bf.WriteUint16(reward.Unk0) + bf.WriteUint16(reward.Unk1) + bf.WriteUint16(reward.Unk2) + } + doAckBufSucceed(s, pkt.AckHandle, bf.Data()) +} diff --git a/server/channelserver/handlers_tower.go b/server/channelserver/handlers_tower.go index 0a2675812..a9bc1421c 100644 --- a/server/channelserver/handlers_tower.go +++ b/server/channelserver/handlers_tower.go @@ -1,102 +1,477 @@ package channelserver import ( - "encoding/hex" + "fmt" + "go.uber.org/zap" + "time" + + "erupe-ce/common/byteframe" + "erupe-ce/common/stringsupport" "erupe-ce/network/mhfpacket" ) +type TowerInfoTRP struct { + TR int32 + TRP int32 +} + +type TowerInfoSkill struct { + TSP int32 + Unk1 []int16 // 40 +} + +type TowerInfoHistory struct { + Unk0 []int16 // 5 + Unk1 []int16 // 5 +} + +type TowerInfoLevel struct { + Floors int32 + Unk1 int32 + Unk2 int32 + Unk3 int32 +} + func handleMsgMhfGetTowerInfo(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetTowerInfo) - var data []byte - var err error - /* - type: - 1 == TOWER_RANK_POINT, - 2 == GET_OWN_TOWER_SKILL - 3 == GET_OWN_TOWER_LEVEL_V3 - 4 == TOWER_TOUHA_HISTORY - 5 = ? - - [] = type - req - resp - - 01 1d 01 fc 00 09 [00 00 00 01] 00 00 00 02 00 00 00 00 - 00 12 01 fc 00 09 01 00 00 18 0a 21 8e ad 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 - - 01 1d 01 fc 00 0a [00 00 00 02] 00 00 00 00 00 00 00 00 - 00 12 01 fc 00 0a 01 00 00 94 0a 21 8e ad 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - - 01 1d 01 ff 00 0f [00 00 00 04] 00 00 00 00 00 00 00 00 - 00 12 01 ff 00 0f 01 00 00 24 0a 21 8e ad 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - - 01 1d 01 fc 00 0b [00 00 00 05] 00 00 00 00 00 00 00 00 - 00 12 01 fc 00 0b 01 00 00 10 0a 21 8e ad 00 00 00 00 00 00 00 00 00 00 00 00 - */ - switch pkt.InfoType { - case mhfpacket.TowerInfoTypeTowerRankPoint: - data, err = hex.DecodeString("0A218EAD0000000000000000000000010000000000000000") - case mhfpacket.TowerInfoTypeGetOwnTowerSkill: - //data, err = hex.DecodeString("0A218EAD000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") - data, err = hex.DecodeString("0A218EAD0000000000000000000000010000001C0000000500050000000000020000000000000000000000000000000000030003000000000003000500050000000300030003000300030003000200030001000300020002000300010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") - case mhfpacket.TowerInfoTypeGetOwnTowerLevelV3: - panic("No known response values for GetOwnTowerLevelV3") - case mhfpacket.TowerInfoTypeTowerTouhaHistory: - data, err = hex.DecodeString("0A218EAD0000000000000000000000010000000000000000000000000000000000000000") - case mhfpacket.TowerInfoTypeUnk5: - data, err = hex.DecodeString("0A218EAD000000000000000000000000") + var data []*byteframe.ByteFrame + type TowerInfo struct { + TRP []TowerInfoTRP + Skill []TowerInfoSkill + History []TowerInfoHistory + Level []TowerInfoLevel } + towerInfo := TowerInfo{ + TRP: []TowerInfoTRP{{0, 0}}, + Skill: []TowerInfoSkill{{0, make([]int16, 40)}}, + History: []TowerInfoHistory{{make([]int16, 5), make([]int16, 5)}}, + Level: []TowerInfoLevel{{0, 0, 0, 0}, {0, 0, 0, 0}}, + } + + tempSkills := "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + + err := s.server.db.QueryRow(`SELECT COALESCE(tr, 0), COALESCE(trp, 0), COALESCE(tsp, 0), COALESCE(block1, 0), COALESCE(block2, 0), skills FROM tower WHERE char_id=$1 + `, s.charID).Scan(&towerInfo.TRP[0].TR, &towerInfo.TRP[0].TRP, &towerInfo.Skill[0].TSP, &towerInfo.Level[0].Floors, &towerInfo.Level[1].Floors, &tempSkills) if err != nil { - stubGetNoResults(s, pkt.AckHandle) + s.server.db.Exec(`INSERT INTO tower (char_id) VALUES ($1)`, s.charID) } - doAckBufSucceed(s, pkt.AckHandle, data) + + for i, skill := range stringsupport.CSVElems(tempSkills) { + towerInfo.Skill[0].Unk1[i] = int16(skill) + } + + switch pkt.InfoType { + case 1: + for _, trp := range towerInfo.TRP { + bf := byteframe.NewByteFrame() + bf.WriteInt32(trp.TR) + bf.WriteInt32(trp.TRP) + data = append(data, bf) + } + case 2: + for _, skills := range towerInfo.Skill { + bf := byteframe.NewByteFrame() + bf.WriteInt32(skills.TSP) + for i := range skills.Unk1 { + bf.WriteInt16(skills.Unk1[i]) + } + data = append(data, bf) + } + case 4: + for _, history := range towerInfo.History { + bf := byteframe.NewByteFrame() + for i := range history.Unk0 { + bf.WriteInt16(history.Unk0[i]) + } + for i := range history.Unk1 { + bf.WriteInt16(history.Unk1[i]) + } + data = append(data, bf) + } + case 5: + for _, level := range towerInfo.Level { + bf := byteframe.NewByteFrame() + bf.WriteInt32(level.Floors) + bf.WriteInt32(level.Unk1) + bf.WriteInt32(level.Unk2) + bf.WriteInt32(level.Unk3) + data = append(data, bf) + } + } + doAckEarthSucceed(s, pkt.AckHandle, data) } func handleMsgMhfPostTowerInfo(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfPostTowerInfo) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) + + if s.server.erupeConfig.DevModeOptions.QuestDebugTools { + s.logger.Debug( + p.Opcode().String(), + zap.Uint32("InfoType", pkt.InfoType), + zap.Uint32("Unk1", pkt.Unk1), + zap.Int32("Skill", pkt.Skill), + zap.Int32("TR", pkt.TR), + zap.Int32("TRP", pkt.TRP), + zap.Int32("Cost", pkt.Cost), + zap.Int32("Unk6", pkt.Unk6), + zap.Int32("Unk7", pkt.Unk7), + zap.Int32("Block1", pkt.Block1), + zap.Int64("Unk9", pkt.Unk9), + ) + } + + switch pkt.InfoType { + case 2: + skills := "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + s.server.db.QueryRow(`SELECT skills FROM tower WHERE char_id=$1`, s.charID).Scan(&skills) + s.server.db.Exec(`UPDATE tower SET skills=$1, tsp=tsp-$2 WHERE char_id=$3`, stringsupport.CSVSetIndex(skills, int(pkt.Skill), stringsupport.CSVGetIndex(skills, int(pkt.Skill))+1), pkt.Cost, s.charID) + case 7: + s.server.db.Exec(`UPDATE tower SET tr=$1, trp=trp+$2, block1=block1+$3 WHERE char_id=$4`, pkt.TR, pkt.TRP, pkt.Block1, s.charID) + } + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} + +// Default missions +var tenrouiraiData = []TenrouiraiData{ + {1, 1, 80, 0, 2, 2, 1, 1, 2, 2}, + {1, 4, 16, 0, 2, 2, 1, 1, 2, 2}, + {1, 6, 50, 0, 2, 2, 1, 0, 2, 2}, + {1, 4, 12, 50, 2, 2, 1, 1, 2, 2}, + {1, 3, 50, 0, 2, 2, 1, 1, 2, 2}, + {2, 5, 40000, 0, 2, 2, 1, 0, 2, 2}, + {1, 5, 50000, 50, 2, 2, 1, 1, 2, 2}, + {2, 1, 60, 0, 2, 2, 1, 1, 2, 2}, + {2, 3, 50, 0, 2, 1, 1, 0, 1, 2}, + {2, 3, 40, 50, 2, 1, 1, 1, 1, 2}, + {2, 4, 12, 0, 2, 1, 1, 1, 1, 2}, + {2, 6, 40, 0, 2, 1, 1, 0, 1, 2}, + {1, 1, 60, 50, 2, 1, 2, 1, 1, 2}, + {1, 5, 50000, 0, 3, 1, 2, 1, 1, 2}, + {1, 6, 50, 0, 3, 1, 2, 0, 1, 2}, + {1, 4, 16, 50, 3, 1, 2, 1, 1, 2}, + {1, 5, 50000, 0, 3, 1, 2, 1, 1, 2}, + {2, 3, 40, 0, 3, 1, 2, 0, 1, 2}, + {1, 3, 50, 50, 3, 1, 2, 1, 1, 2}, + {2, 5, 40000, 0, 3, 1, 2, 1, 1, 1}, + {2, 6, 40, 0, 3, 1, 2, 0, 1, 1}, + {2, 1, 60, 50, 3, 1, 2, 1, 1, 1}, + {2, 6, 50, 0, 3, 1, 2, 1, 1, 1}, + {2, 4, 12, 0, 3, 1, 2, 0, 1, 1}, + {1, 1, 80, 50, 3, 1, 2, 1, 1, 1}, + {1, 5, 40000, 0, 3, 1, 2, 1, 1, 1}, + {1, 3, 50, 0, 3, 1, 2, 0, 1, 1}, + {1, 4, 16, 50, 3, 1, 0, 1, 1, 1}, + {1, 6, 50, 0, 3, 1, 0, 1, 1, 1}, + {2, 3, 40, 0, 3, 1, 0, 1, 1, 1}, + {1, 1, 80, 50, 3, 1, 0, 0, 1, 1}, + {2, 5, 40000, 0, 3, 1, 0, 0, 1, 1}, + {2, 6, 40, 0, 3, 1, 0, 0, 1, 1}, +} + +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 } func handleMsgMhfGetTenrouirai(s *Session, p mhfpacket.MHFPacket) { - // if the game gets bad responses for this it breaks the ability to save pkt := p.(*mhfpacket.MsgMhfGetTenrouirai) - var data []byte - var err error - if pkt.Unk0 == 1 { - data, err = hex.DecodeString("0A218EAD000000000000000000000001010000000000060010") - } else if pkt.Unk2 == 4 { - data, err = hex.DecodeString("0A218EAD0000000000000000000000210101005000000202010102020104001000000202010102020106003200000202010002020104000C003202020101020201030032000002020101020202059C4000000202010002020105C35000320202010102020201003C00000202010102020203003200000201010001020203002800320201010101020204000C00000201010101020206002800000201010001020101003C00320201020101020105C35000000301020101020106003200000301020001020104001000320301020101020105C350000003010201010202030028000003010200010201030032003203010201010202059C4000000301020101010206002800000301020001010201003C00320301020101010206003200000301020101010204000C000003010200010101010050003203010201010101059C40000003010201010101030032000003010200010101040010003203010001010101060032000003010001010102030028000003010001010101010050003203010000010102059C4000000301000001010206002800000301000001010010") - } else { - data = []byte{0x00, 0x00, 0x00, 0x00} - s.logger.Info("GET_TENROUIRAI request for unknown type") + var data []*byteframe.ByteFrame + + tenrouirai := Tenrouirai{ + Progress: []TenrouiraiProgress{{1, 0, 0, 0}}, + Data: tenrouiraiData, + Ticket: []TenrouiraiTicket{{0, 0, 0}}, } - if err != nil { - panic(err) + + switch pkt.Unk1 { + case 1: + for _, tdata := range tenrouirai.Data { + bf := byteframe.NewByteFrame() + bf.WriteUint8(tdata.Block) + bf.WriteUint8(tdata.Mission) + bf.WriteUint16(tdata.Goal) + bf.WriteUint16(tdata.Cost) + bf.WriteUint8(tdata.Skill1) + bf.WriteUint8(tdata.Skill2) + bf.WriteUint8(tdata.Skill3) + bf.WriteUint8(tdata.Skill4) + bf.WriteUint8(tdata.Skill5) + bf.WriteUint8(tdata.Skill6) + data = append(data, bf) + } + case 2: + for _, reward := range tenrouirai.Reward { + bf := byteframe.NewByteFrame() + bf.WriteUint8(reward.Index) + bf.WriteUint16(reward.Item[0]) + bf.WriteUint16(reward.Item[1]) + bf.WriteUint16(reward.Item[2]) + bf.WriteUint16(reward.Item[3]) + bf.WriteUint16(reward.Item[4]) + bf.WriteUint8(reward.Quantity[0]) + bf.WriteUint8(reward.Quantity[1]) + bf.WriteUint8(reward.Quantity[2]) + bf.WriteUint8(reward.Quantity[3]) + bf.WriteUint8(reward.Quantity[4]) + data = append(data, bf) + } + case 4: + s.server.db.QueryRow(`SELECT tower_mission_page FROM guilds WHERE id=$1`, pkt.GuildID).Scan(&tenrouirai.Progress[0].Page) + s.server.db.QueryRow(`SELECT SUM(tower_mission_1) AS _, SUM(tower_mission_2) AS _, SUM(tower_mission_3) AS _ FROM guild_characters WHERE guild_id=$1 + `, pkt.GuildID).Scan(&tenrouirai.Progress[0].Mission1, &tenrouirai.Progress[0].Mission2, &tenrouirai.Progress[0].Mission3) + + if tenrouirai.Progress[0].Mission1 > tenrouiraiData[(tenrouirai.Progress[0].Page*3)-3].Goal { + tenrouirai.Progress[0].Mission1 = tenrouiraiData[(tenrouirai.Progress[0].Page*3)-3].Goal + } + if tenrouirai.Progress[0].Mission2 > tenrouiraiData[(tenrouirai.Progress[0].Page*3)-2].Goal { + tenrouirai.Progress[0].Mission2 = tenrouiraiData[(tenrouirai.Progress[0].Page*3)-2].Goal + } + if tenrouirai.Progress[0].Mission3 > tenrouiraiData[(tenrouirai.Progress[0].Page*3)-1].Goal { + tenrouirai.Progress[0].Mission3 = tenrouiraiData[(tenrouirai.Progress[0].Page*3)-1].Goal + } + + for _, progress := range tenrouirai.Progress { + bf := byteframe.NewByteFrame() + bf.WriteUint8(progress.Page) + bf.WriteUint16(progress.Mission1) + bf.WriteUint16(progress.Mission2) + bf.WriteUint16(progress.Mission3) + data = append(data, bf) + } + case 5: + if pkt.Unk3 > 3 { + pkt.Unk3 %= 3 + if pkt.Unk3 == 0 { + pkt.Unk3 = 3 + } + } + rows, _ := s.server.db.Query(fmt.Sprintf(`SELECT name, tower_mission_%d FROM guild_characters gc INNER JOIN characters c ON gc.character_id = c.id WHERE guild_id=$1 AND tower_mission_%d IS NOT NULL ORDER BY tower_mission_%d DESC`, pkt.Unk3, pkt.Unk3, pkt.Unk3), pkt.GuildID) + for rows.Next() { + temp := TenrouiraiCharScore{} + rows.Scan(&temp.Name, &temp.Score) + tenrouirai.CharScore = append(tenrouirai.CharScore, temp) + } + for _, charScore := range tenrouirai.CharScore { + bf := byteframe.NewByteFrame() + bf.WriteInt32(charScore.Score) + bf.WriteBytes(stringsupport.PaddedString(charScore.Name, 14, true)) + data = append(data, bf) + } + case 6: + s.server.db.QueryRow(`SELECT tower_rp FROM guilds WHERE id=$1`, pkt.GuildID).Scan(&tenrouirai.Ticket[0].RP) + for _, ticket := range tenrouirai.Ticket { + bf := byteframe.NewByteFrame() + bf.WriteUint8(ticket.Unk0) + bf.WriteUint32(ticket.RP) + bf.WriteUint32(ticket.Unk2) + data = append(data, bf) + } } - doAckBufSucceed(s, pkt.AckHandle, data) + + doAckEarthSucceed(s, pkt.AckHandle, data) } func handleMsgMhfPostTenrouirai(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfPostTenrouirai) - doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) -} -func handleMsgMhfGetBreakSeibatuLevelReward(s *Session, p mhfpacket.MHFPacket) {} + if s.server.erupeConfig.DevModeOptions.QuestDebugTools { + s.logger.Debug( + p.Opcode().String(), + zap.Uint8("Unk0", pkt.Unk0), + zap.Uint8("Op", pkt.Op), + zap.Uint32("GuildID", pkt.GuildID), + zap.Uint8("Unk1", pkt.Unk1), + zap.Uint16("Floors", pkt.Floors), + zap.Uint16("Antiques", pkt.Antiques), + zap.Uint16("Chests", pkt.Chests), + zap.Uint16("Cats", pkt.Cats), + zap.Uint16("TRP", pkt.TRP), + zap.Uint16("Slays", pkt.Slays), + ) + } -func handleMsgMhfGetWeeklySeibatuRankingReward(s *Session, p mhfpacket.MHFPacket) { - pkt := p.(*mhfpacket.MsgMhfGetWeeklySeibatuRankingReward) - doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) + if pkt.Op == 2 { + var page, requirement, donated int + s.server.db.QueryRow(`SELECT tower_mission_page, tower_rp FROM guilds WHERE id=$1`, pkt.GuildID).Scan(&page, &donated) + + for i := 0; i < (page*3)+1; i++ { + requirement += int(tenrouiraiData[i].Cost) + } + + bf := byteframe.NewByteFrame() + + sd, err := GetCharacterSaveData(s, s.charID) + if err == nil && sd != nil { + sd.RP -= pkt.DonatedRP + sd.Save(s) + if donated+int(pkt.DonatedRP) >= requirement { + s.server.db.Exec(`UPDATE guilds SET tower_mission_page=tower_mission_page+1 WHERE id=$1`, pkt.GuildID) + s.server.db.Exec(`UPDATE guild_characters SET tower_mission_1=NULL, tower_mission_2=NULL, tower_mission_3=NULL WHERE guild_id=$1`, pkt.GuildID) + pkt.DonatedRP = uint16(requirement - donated) + } + bf.WriteUint32(uint32(pkt.DonatedRP)) + s.server.db.Exec(`UPDATE guilds SET tower_rp=tower_rp+$1 WHERE id=$2`, pkt.DonatedRP, pkt.GuildID) + } else { + bf.WriteUint32(0) + } + + doAckSimpleSucceed(s, pkt.AckHandle, bf.Data()) + } else { + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) + } } func handleMsgMhfPresentBox(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfPresentBox) - doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) + var data []*byteframe.ByteFrame + /* + bf.WriteUint32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + bf.WriteInt32(0) + */ + doAckEarthSucceed(s, pkt.AckHandle, data) +} + +type GemInfo struct { + Gem uint16 + Quantity uint16 +} + +type GemHistory struct { + Gem uint16 + Message uint16 + Timestamp time.Time + Sender string } func handleMsgMhfGetGemInfo(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfGetGemInfo) + var data []*byteframe.ByteFrame + gemInfo := []GemInfo{} + gemHistory := []GemHistory{} + + tempGems := "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + s.server.db.QueryRow(`SELECT gems FROM tower WHERE char_id=$1`, s.charID).Scan(&tempGems) + for i, v := range stringsupport.CSVElems(tempGems) { + gemInfo = append(gemInfo, GemInfo{uint16(((i / 5) * 256) + ((i % 5) + 1)), uint16(v)}) + } + + switch pkt.Unk0 { + case 1: + for _, info := range gemInfo { + bf := byteframe.NewByteFrame() + bf.WriteUint16(info.Gem) + bf.WriteUint16(info.Quantity) + data = append(data, bf) + } + case 2: + for _, history := range gemHistory { + bf := byteframe.NewByteFrame() + bf.WriteUint16(history.Gem) + bf.WriteUint16(history.Message) + bf.WriteUint32(uint32(history.Timestamp.Unix())) + bf.WriteBytes(stringsupport.PaddedString(history.Sender, 14, true)) + data = append(data, bf) + } + } + doAckEarthSucceed(s, pkt.AckHandle, data) +} + +func handleMsgMhfPostGemInfo(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostGemInfo) + + if s.server.erupeConfig.DevModeOptions.QuestDebugTools { + s.logger.Debug( + p.Opcode().String(), + zap.Uint32("Op", pkt.Op), + zap.Uint32("Unk1", pkt.Unk1), + zap.Int32("Gem", pkt.Gem), + zap.Int32("Quantity", pkt.Quantity), + zap.Int32("CID", pkt.CID), + zap.Int32("Message", pkt.Message), + zap.Int32("Unk6", pkt.Unk6), + ) + } + + gems := "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + s.server.db.QueryRow(`SELECT gems FROM tower WHERE char_id=$1`, s.charID).Scan(&gems) + switch pkt.Op { + case 1: // Add gem + i := int(((pkt.Gem / 256) * 5) + (((pkt.Gem - ((pkt.Gem / 256) * 256)) - 1) % 5)) + s.server.db.Exec(`UPDATE tower SET gems=$1 WHERE char_id=$2`, stringsupport.CSVSetIndex(gems, i, stringsupport.CSVGetIndex(gems, i)+int(pkt.Quantity)), s.charID) + case 2: // Transfer gem + // no way im doing this for now + } doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) } -func handleMsgMhfPostGemInfo(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfGetNotice(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfGetNotice) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} + +func handleMsgMhfPostNotice(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfPostNotice) + doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4)) +} diff --git a/server/channelserver/sys_channel_server.go b/server/channelserver/sys_channel_server.go index 309ed1af8..1dfef82d0 100644 --- a/server/channelserver/sys_channel_server.go +++ b/server/channelserver/sys_channel_server.go @@ -3,6 +3,7 @@ package channelserver import ( "fmt" "net" + "strings" "sync" "erupe-ce/common/byteframe" @@ -22,7 +23,7 @@ type Config struct { Logger *zap.Logger DB *sqlx.DB DiscordBot *discordbot.DiscordBot - ErupeConfig *config.Config + ErupeConfig *_config.Config Name string Enable bool } @@ -43,10 +44,11 @@ type Server struct { Port uint16 logger *zap.Logger db *sqlx.DB - erupeConfig *config.Config + erupeConfig *_config.Config acceptConns chan net.Conn deleteConns chan net.Conn sessions map[net.Conn]*Session + objectIDs map[*Session]uint16 listener net.Listener // Listener that is created when Server.Start is called. isShuttingDown bool @@ -75,61 +77,30 @@ type Server struct { type Raviente struct { sync.Mutex - - register *RavienteRegister - state *RavienteState - support *RavienteSupport + id uint16 + register []uint32 + state []uint32 + support []uint32 } -type RavienteRegister struct { - nextTime uint32 - startTime uint32 - postTime uint32 - killedTime uint32 - ravienteType uint32 - maxPlayers uint32 - carveQuest uint32 - register []uint32 -} - -type RavienteState struct { - stateData []uint32 -} - -type RavienteSupport struct { - supportData []uint32 -} - -// Set up the Raviente variables for the server -func NewRaviente() *Raviente { - ravienteRegister := &RavienteRegister{ - nextTime: 0, - startTime: 0, - killedTime: 0, - postTime: 0, - ravienteType: 0, - maxPlayers: 0, - carveQuest: 0, +func (s *Server) resetRaviente() { + for _, semaphore := range s.semaphore { + if strings.HasPrefix(semaphore.name, "hs_l0") { + return + } } - ravienteState := &RavienteState{} - ravienteSupport := &RavienteSupport{} - ravienteRegister.register = []uint32{0, 0, 0, 0, 0} - ravienteState.stateData = []uint32{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - ravienteSupport.supportData = []uint32{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - - raviente := &Raviente{ - register: ravienteRegister, - state: ravienteState, - support: ravienteSupport, - } - return raviente + s.logger.Debug("All Raviente Semaphores empty, resetting") + s.raviente.id = s.raviente.id + 1 + s.raviente.register = make([]uint32, 30) + s.raviente.state = make([]uint32, 30) + s.raviente.support = make([]uint32, 30) } -func (r *Raviente) GetRaviMultiplier(s *Server) float64 { - raviSema := getRaviSemaphore(s) +func (s *Server) GetRaviMultiplier() float64 { + raviSema := s.getRaviSemaphore() if raviSema != nil { var minPlayers int - if r.register.maxPlayers > 8 { + if s.raviente.register[9] > 8 { minPlayers = 24 } else { minPlayers = 4 @@ -142,6 +113,33 @@ func (r *Raviente) GetRaviMultiplier(s *Server) float64 { return 0 } +func (s *Server) UpdateRavi(semaID uint32, index uint8, value uint32, update bool) (uint32, uint32) { + var prev uint32 + var dest *[]uint32 + switch semaID { + case 0x40000: + switch index { + case 17, 28: // Ignore res and poison + break + default: + value = uint32(float64(value) * s.GetRaviMultiplier()) + } + dest = &s.raviente.state + case 0x50000: + dest = &s.raviente.support + case 0x60000: + dest = &s.raviente.register + default: + return 0, 0 + } + if update { + (*dest)[index] += value + } else { + (*dest)[index] = value + } + return prev, (*dest)[index] +} + // NewServer creates a new Server type. func NewServer(config *Config) *Server { s := &Server{ @@ -152,13 +150,19 @@ func NewServer(config *Config) *Server { acceptConns: make(chan net.Conn), deleteConns: make(chan net.Conn), sessions: make(map[net.Conn]*Session), + objectIDs: make(map[*Session]uint16), stages: make(map[string]*Stage), userBinaryParts: make(map[userBinaryPartID][]byte), semaphore: make(map[string]*Semaphore), semaphoreIndex: 7, discordBot: config.DiscordBot, name: config.Name, - raviente: NewRaviente(), + raviente: &Raviente{ + id: 1, + register: make([]uint32, 30), + state: make([]uint32, 30), + support: make([]uint32, 30), + }, } // Mezeporta @@ -391,17 +395,23 @@ func (s *Server) NextSemaphoreID() uint32 { for { exists := false s.semaphoreIndex = s.semaphoreIndex + 1 - if s.semaphoreIndex == 0 { - s.semaphoreIndex = 7 // Skip reserved indexes + if s.semaphoreIndex > 0xFFFF { + s.semaphoreIndex = 1 } for _, semaphore := range s.semaphore { if semaphore.id == s.semaphoreIndex { exists = true + break } } - if exists == false { + if !exists { break } } return s.semaphoreIndex } + +func (s *Server) Season() uint8 { + sid := int64(((s.ID & 0xFF00) - 4096) / 256) + return uint8(((TimeAdjusted().Unix() / 86400) + sid) % 3) +} diff --git a/server/channelserver/sys_language.go b/server/channelserver/sys_language.go index 993f2dc8d..7e4e78779 100644 --- a/server/channelserver/sys_language.go +++ b/server/channelserver/sys_language.go @@ -59,6 +59,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandTeleportSuccess"] = "%d %dにテレポート" strings["commandPSNError"] = "PSN連携コマンドエラー 例:%s " strings["commandPSNSuccess"] = "PSN「%s」が連携されています" + strings["commandPSNExists"] = "PSNは既存のユーザに接続されています" strings["commandRaviNoCommand"] = "ラヴィコマンドが指定されていません" strings["commandRaviStartSuccess"] = "大討伐を開始します" @@ -70,6 +71,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandRaviRequest"] = "鎮静支援を要請します" strings["commandRaviError"] = "ラヴィコマンドが認識されません" strings["commandRaviNoPlayers"] = "誰も大討伐に参加していません" + strings["commandRaviVersion"] = "This command is disabled outside of MHFZZ" strings["ravienteBerserk"] = "<大討伐:猛狂期>が開催されました!" strings["ravienteExtreme"] = "<大討伐:猛狂期【極】>が開催されました!" @@ -146,6 +148,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandTeleportSuccess"] = "Teleporting to %d %d" strings["commandPSNError"] = "Error in command. Format: %s " strings["commandPSNSuccess"] = "Connected PSN ID: %s" + strings["commandPSNExists"] = "PSN ID is connected to another account!" strings["commandRaviNoCommand"] = "No Raviente command specified!" strings["commandRaviStartSuccess"] = "The Great Slaying will begin in a moment" @@ -157,6 +160,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandRaviRequest"] = "Requesting sedation support!" strings["commandRaviError"] = "Raviente command not recognised!" strings["commandRaviNoPlayers"] = "No one has joined the Great Slaying!" + strings["commandRaviVersion"] = "This command is disabled outside of MHFZZ" strings["ravienteBerserk"] = " is being held!" strings["ravienteExtreme"] = " is being held!" diff --git a/server/channelserver/sys_semaphore.go b/server/channelserver/sys_semaphore.go index 369e481b6..78ff963b5 100644 --- a/server/channelserver/sys_semaphore.go +++ b/server/channelserver/sys_semaphore.go @@ -7,55 +7,35 @@ import ( "sync" ) -// Stage holds stage-specific information +// Semaphore holds Semaphore-specific information type Semaphore struct { sync.RWMutex - // Stage ID string - id_semaphore string + // Semaphore ID string + name string id uint32 // Map of session -> charID. - // These are clients that are CURRENTLY in the stage + // These are clients that are registered to the Semaphore clients map[*Session]uint32 - // Map of charID -> interface{}, only the key is used, value is always nil. - reservedClientSlots map[uint32]interface{} - // Max Players for Semaphore maxPlayers uint16 } -// NewStage creates a new stage with intialized values. +// NewSemaphore creates a new Semaphore with intialized values func NewSemaphore(s *Server, ID string, MaxPlayers uint16) *Semaphore { sema := &Semaphore{ - id_semaphore: ID, - id: s.NextSemaphoreID(), - clients: make(map[*Session]uint32), - reservedClientSlots: make(map[uint32]interface{}), - maxPlayers: MaxPlayers, + name: ID, + id: s.NextSemaphoreID(), + clients: make(map[*Session]uint32), + maxPlayers: MaxPlayers, } return sema } -func (s *Semaphore) BroadcastRavi(pkt mhfpacket.MHFPacket) { - // Broadcast the data. - for session := range s.clients { - - // Make the header - bf := byteframe.NewByteFrame() - bf.WriteUint16(uint16(pkt.Opcode())) - - // Build the packet onto the byteframe. - pkt.Build(bf, session.clientContext) - - // Enqueue in a non-blocking way that drops the packet if the connections send buffer channel is full. - session.QueueSendNonBlocking(bf.Data()) - } -} - -// BroadcastMHF queues a MHFPacket to be sent to all sessions in the stage. +// BroadcastMHF queues a MHFPacket to be sent to all sessions in the Semaphore func (s *Semaphore) BroadcastMHF(pkt mhfpacket.MHFPacket, ignoredSession *Session) { // Broadcast the data. for session := range s.clients { diff --git a/server/channelserver/sys_session.go b/server/channelserver/sys_session.go index 40d54fdb3..406ea4384 100644 --- a/server/channelserver/sys_session.go +++ b/server/channelserver/sys_session.go @@ -34,6 +34,7 @@ type Session struct { clientContext *clientctx.ClientContext lastPacket time.Time + objectIndex uint16 userEnteredStage bool // If the user has entered a stage before stageID string stage *Stage @@ -78,6 +79,7 @@ func NewSession(server *Server, conn net.Conn) *Session { sessionStart: TimeAdjusted().Unix(), stageMoveStack: stringstack.New(), } + s.SetObjectID() return s } @@ -268,3 +270,29 @@ func (s *Session) logMessage(opcode uint16, data []byte, sender string, recipien fmt.Printf("Data [%d bytes]:\n(Too long!)\n\n", len(data)) } } + +func (s *Session) SetObjectID() { + for i := uint16(1); i < 127; i++ { + exists := false + for _, j := range s.server.objectIDs { + if i == j { + exists = true + break + } + } + if !exists { + s.server.objectIDs[s] = i + return + } + } + s.server.objectIDs[s] = 0 +} + +func (s *Session) NextObjectID() uint32 { + bf := byteframe.NewByteFrame() + bf.WriteUint16(s.server.objectIDs[s]) + s.objectIndex++ + bf.WriteUint16(s.objectIndex) + bf.Seek(0, 0) + return bf.ReadUint32() +} diff --git a/server/channelserver/sys_stage.go b/server/channelserver/sys_stage.go index b69995724..ae8ddd149 100644 --- a/server/channelserver/sys_stage.go +++ b/server/channelserver/sys_stage.go @@ -95,18 +95,3 @@ func (s *Stage) isCharInQuestByID(charID uint32) bool { func (s *Stage) isQuest() bool { return len(s.reservedClientSlots) > 0 } - -func (s *Stage) NextObjectID() uint32 { - s.objectIndex = s.objectIndex + 1 - // Objects beyond 127 do not duplicate correctly - // Indexes 0 and 127 does not update position correctly - if s.objectIndex == 127 { - s.objectIndex = 1 - } - bf := byteframe.NewByteFrame() - bf.WriteUint8(0) - bf.WriteUint8(s.objectIndex) - bf.WriteUint16(0) - obj := uint32(bf.Data()[3]) | uint32(bf.Data()[2])<<8 | uint32(bf.Data()[1])<<16 | uint32(bf.Data()[0])<<24 - return obj -} diff --git a/server/channelserver/sys_time.go b/server/channelserver/sys_time.go index 396ae4cf5..a41b18b2e 100644 --- a/server/channelserver/sys_time.go +++ b/server/channelserver/sys_time.go @@ -23,3 +23,7 @@ func TimeWeekStart() time.Time { func TimeWeekNext() time.Time { return TimeWeekStart().Add(time.Hour * 24 * 7) } + +func TimeGameAbsolute() uint32 { + return uint32((TimeAdjusted().Unix() - 2160) % 5760) +} diff --git a/server/channelserver/timeserver/time_mode.go b/server/channelserver/timeserver/time_mode.go deleted file mode 100644 index e335b814a..000000000 --- a/server/channelserver/timeserver/time_mode.go +++ /dev/null @@ -1,87 +0,0 @@ -package timeserver - -import ( - "time" -) - -var DoOnce_midnight = false -var DoOnce_t2 = false -var DoOnce_t = false -var Fix_midnight = time.Time{} -var Fix_t2 = time.Time{} -var Fix_t = time.Time{} -var Pfixtimer time.Duration -var Pnewtime = 0 -var yearsFixed = -7 - -func PFadd_time() time.Duration { - Pnewtime = Pnewtime + 24 - Pfixtimer = time.Duration(Pnewtime) - return Pfixtimer -} - -func Time_static() time.Time { - if !DoOnce_t { - DoOnce_t = true - // Force to 201x - tFix1 := time.Now() - tFix2 := tFix1.AddDate(yearsFixed, 0, 0) - Fix_t = tFix2.In(time.FixedZone("UTC+1", 1*60*60)) - } - return Fix_t -} - -func Tstatic_midnight() time.Time { - if !DoOnce_midnight { - DoOnce_midnight = true - // Force to 201x - tFix1 := time.Now() - tFix2 := tFix1.AddDate(yearsFixed, 0, 0) - var tFix = tFix2.In(time.FixedZone("UTC+1", 1*60*60)) - yearFix, monthFix, dayFix := tFix2.Date() - Fix_midnight = time.Date(yearFix, monthFix, dayFix, 0, 0, 0, 0, tFix.Location()).Add(time.Hour) - } - return Fix_midnight -} - -func Time_midnight() time.Time { - // Force to 201x - t1 := time.Now() - t2 := t1.AddDate(yearsFixed, 0, 0) - var t = t2.In(time.FixedZone("UTC+1", 1*60*60)) - year, month, day := t2.Date() - midnight := time.Date(year, month, day, 0, 0, 0, 0, t.Location()).Add(time.Hour) - return midnight -} - -func TimeCurrent() time.Time { - // Force to 201x - t1 := time.Now() - t2 := t1.AddDate(yearsFixed, 0, 0) - var t = t2.In(time.FixedZone("UTC+1", 1*60*60)) - return t -} - -func Time_Current_Week_uint8() uint8 { - beginningOfTheMonth := time.Date(TimeCurrent().Year(), TimeCurrent().Month(), 1, 1, 1, 1, 1, time.UTC) - _, thisWeek := TimeCurrent().ISOWeek() - _, beginningWeek := beginningOfTheMonth.ISOWeek() - - return uint8(1 + thisWeek - beginningWeek) -} - -func Time_Current_Week_uint32() uint32 { - beginningOfTheMonth := time.Date(TimeCurrent().Year(), TimeCurrent().Month(), 1, 1, 1, 1, 1, time.UTC) - _, thisWeek := TimeCurrent().ISOWeek() - _, beginningWeek := beginningOfTheMonth.ISOWeek() - result := 1 + thisWeek - beginningWeek - return uint32(result) -} - -func Detect_Day() bool { - switch time.Now().Weekday() { - case time.Wednesday: - return true - } - return false -} diff --git a/server/discordbot/discord_bot.go b/server/discordbot/discord_bot.go index fc5c41ce8..c082faf70 100644 --- a/server/discordbot/discord_bot.go +++ b/server/discordbot/discord_bot.go @@ -9,14 +9,14 @@ import ( type DiscordBot struct { Session *discordgo.Session - config *config.Config + config *_config.Config logger *zap.Logger MainGuild *discordgo.Guild RealtimeChannel *discordgo.Channel } type Options struct { - Config *config.Config + Config *_config.Config Logger *zap.Logger } diff --git a/server/entranceserver/entrance_server.go b/server/entranceserver/entrance_server.go index c0a4e852b..8b06be0e0 100644 --- a/server/entranceserver/entrance_server.go +++ b/server/entranceserver/entrance_server.go @@ -18,7 +18,7 @@ import ( type Server struct { sync.Mutex logger *zap.Logger - erupeConfig *config.Config + erupeConfig *_config.Config db *sqlx.DB listener net.Listener isShuttingDown bool @@ -28,7 +28,7 @@ type Server struct { type Config struct { Logger *zap.Logger DB *sqlx.DB - ErupeConfig *config.Config + ErupeConfig *_config.Config } // NewServer creates a new Server type. @@ -68,7 +68,7 @@ func (s *Server) Shutdown() { s.listener.Close() } -//acceptClients handles accepting new clients in a loop. +// acceptClients handles accepting new clients in a loop. func (s *Server) acceptClients() { for { conn, err := s.listener.Accept() diff --git a/server/entranceserver/make_resp.go b/server/entranceserver/make_resp.go index 2d13709db..eaa023c5b 100644 --- a/server/entranceserver/make_resp.go +++ b/server/entranceserver/make_resp.go @@ -3,32 +3,33 @@ package entranceserver import ( "encoding/binary" "encoding/hex" + "erupe-ce/common/stringsupport" + _config "erupe-ce/config" "fmt" "net" - "erupe-ce/common/stringsupport" - "erupe-ce/common/byteframe" - "erupe-ce/config" "erupe-ce/server/channelserver" ) -// Server Entries -var season uint8 - -// Server Channels -var currentplayers uint16 - -func encodeServerInfo(config *config.Config, s *Server, local bool) []byte { +func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte { serverInfos := config.Entrance.Entries bf := byteframe.NewByteFrame() for serverIdx, si := range serverInfos { - sid := (4096 + serverIdx*256) + 16 - err := s.db.QueryRow("SELECT season FROM servers WHERE server_id=$1", sid).Scan(&season) - if err != nil { - season = 0 + // Prevent MezFes Worlds displaying on Z1 + if config.RealClientMode <= _config.Z1 { + if si.Type == 6 { + continue + } } + if config.RealClientMode <= _config.G6 { + if si.Type == 5 { + continue + } + } + + sid := (4096 + serverIdx*256) * 6000 if si.IP == "" { si.IP = config.Host } @@ -41,31 +42,49 @@ func encodeServerInfo(config *config.Config, s *Server, local bool) []byte { bf.WriteUint16(0x0000) bf.WriteUint16(uint16(len(si.Channels))) bf.WriteUint8(si.Type) - bf.WriteUint8(season) - bf.WriteUint8(si.Recommended) - bf.WriteUint8(0) // Prevents malformed server name - combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...) - combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) - bf.WriteBytes(stringsupport.PaddedString(string(combined), 65, false)) - bf.WriteUint32(si.AllowedClientFlags) + bf.WriteUint8(uint8(((channelserver.TimeAdjusted().Unix() / 86400) + int64(serverIdx)) % 3)) + if s.erupeConfig.RealClientMode >= _config.G1 { + bf.WriteUint8(si.Recommended) + } + + if s.erupeConfig.RealClientMode <= _config.F5 { + combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...) + combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) + bf.WriteBytes(stringsupport.PaddedString(string(combined), 65, false)) + } else if s.erupeConfig.RealClientMode <= _config.GG { + combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...) + combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) + bf.WriteUint8(uint8(len(combined))) + bf.WriteBytes(combined) + } else { + bf.WriteUint8(0) // Prevents malformed server name + combined := append(stringsupport.UTF8ToSJIS(si.Name), []byte{0x00}...) + combined = append(combined, stringsupport.UTF8ToSJIS(si.Description)...) + bf.WriteBytes(stringsupport.PaddedString(string(combined), 65, false)) + } + + if s.erupeConfig.RealClientMode >= _config.GG { + bf.WriteUint32(si.AllowedClientFlags) + } for channelIdx, ci := range si.Channels { sid = (4096 + serverIdx*256) + (16 + channelIdx) bf.WriteUint16(ci.Port) bf.WriteUint16(16 + uint16(channelIdx)) bf.WriteUint16(ci.MaxPlayers) - err := s.db.QueryRow("SELECT current_players FROM servers WHERE server_id=$1", sid).Scan(¤tplayers) - if err != nil { - currentplayers = 0 - } - bf.WriteUint16(currentplayers) - bf.WriteUint32(0) - bf.WriteUint32(0) - bf.WriteUint32(0) - bf.WriteUint16(319) // Unk - bf.WriteUint16(252) // Unk - bf.WriteUint16(248) // Unk - bf.WriteUint16(0x3039) + var currentPlayers uint16 + s.db.QueryRow("SELECT current_players FROM servers WHERE server_id=$1", sid).Scan(¤tPlayers) + bf.WriteUint16(currentPlayers) + bf.WriteUint16(0) // Unk + bf.WriteUint16(0) // Unk + bf.WriteUint16(0) // Unk + bf.WriteUint16(0) // Unk + bf.WriteUint16(0) // Unk + bf.WriteUint16(0) // Unk + bf.WriteUint16(319) // Unk + bf.WriteUint16(252) // Unk + bf.WriteUint16(248) // Unk + bf.WriteUint16(12345) // Unk } } bf.WriteUint32(uint32(channelserver.TimeAdjusted().Unix())) @@ -91,16 +110,39 @@ func makeHeader(data []byte, respType string, entryCount uint16, key byte) []byt return bf.Data() } -func makeSv2Resp(config *config.Config, s *Server, local bool) []byte { +func makeSv2Resp(config *_config.Config, s *Server, local bool) []byte { serverInfos := config.Entrance.Entries + // Decrease by the number of MezFes Worlds + var mf int + if config.RealClientMode <= _config.Z1 { + for _, si := range serverInfos { + if si.Type == 6 { + mf++ + } + } + } + // and Return Worlds + var ret int + if config.RealClientMode <= _config.G6 { + for _, si := range serverInfos { + if si.Type == 5 { + ret++ + } + } + } rawServerData := encodeServerInfo(config, s, local) if s.erupeConfig.DevMode && s.erupeConfig.DevModeOptions.LogOutboundMessages { fmt.Printf("[Server] -> [Client]\nData [%d bytes]:\n%s\n", len(rawServerData), hex.Dump(rawServerData)) } + respType := "SV2" + if config.RealClientMode <= _config.G32 { + respType = "SVR" + } + bf := byteframe.NewByteFrame() - bf.WriteBytes(makeHeader(rawServerData, "SV2", uint16(len(serverInfos)), 0x00)) + bf.WriteBytes(makeHeader(rawServerData, respType, uint16(len(serverInfos)-(mf+ret)), 0x00)) return bf.Data() } diff --git a/server/signserver/dbutils.go b/server/signserver/dbutils.go index ee4dcc493..751862a49 100644 --- a/server/signserver/dbutils.go +++ b/server/signserver/dbutils.go @@ -1,22 +1,20 @@ package signserver import ( + "database/sql" + "errors" "erupe-ce/common/mhfcourse" + "erupe-ce/common/token" "strings" "time" + "go.uber.org/zap" "golang.org/x/crypto/bcrypt" ) -func (s *Server) newUserChara(username string) error { - var id int - err := s.db.QueryRow("SELECT id FROM users WHERE username = $1", username).Scan(&id) - if err != nil { - return err - } - +func (s *Server) newUserChara(uid uint32) error { var numNewChars int - err = s.db.QueryRow("SELECT COUNT(*) FROM characters WHERE user_id = $1 AND is_new_character = true", id).Scan(&numNewChars) + err := s.db.QueryRow("SELECT COUNT(*) FROM characters WHERE user_id = $1 AND is_new_character = true", uid).Scan(&numNewChars) if err != nil { return err } @@ -31,7 +29,7 @@ func (s *Server) newUserChara(username string) error { user_id, is_female, is_new_character, name, unk_desc_string, hrp, gr, weapon_type, last_login) VALUES($1, False, True, '', '', 0, 0, 0, $2)`, - id, + uid, uint32(time.Now().Unix()), ) if err != nil { @@ -41,38 +39,22 @@ func (s *Server) newUserChara(username string) error { return nil } -func (s *Server) registerDBAccount(username string, password string) error { +func (s *Server) registerDBAccount(username string, password string) (uint32, error) { + var uid uint32 + s.logger.Info("Creating user", zap.String("User", username)) + // Create salted hash of user password passwordHash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) if err != nil { - return err + return 0, err } - _, err = s.db.Exec("INSERT INTO users (username, password, return_expires) VALUES ($1, $2, $3)", username, string(passwordHash), time.Now().Add(time.Hour*24*30)) + err = s.db.QueryRow("INSERT INTO users (username, password, return_expires) VALUES ($1, $2, $3) RETURNING id", username, string(passwordHash), time.Now().Add(time.Hour*24*30)).Scan(&uid) if err != nil { - return err + return 0, err } - var id int - err = s.db.QueryRow("SELECT id FROM users WHERE username = $1", username).Scan(&id) - if err != nil { - return err - } - - // Create a base new character. - _, err = s.db.Exec(` - INSERT INTO characters ( - user_id, is_female, is_new_character, name, unk_desc_string, - hrp, gr, weapon_type, last_login) - VALUES($1, False, True, '', '', 0, 0, 0, $2)`, - id, - uint32(time.Now().Unix()), - ) - if err != nil { - return err - } - - return nil + return uid, nil } type character struct { @@ -87,16 +69,16 @@ type character struct { LastLogin uint32 `db:"last_login"` } -func (s *Server) getCharactersForUser(uid int) ([]character, error) { +func (s *Server) getCharactersForUser(uid uint32) ([]character, error) { characters := make([]character, 0) - err := s.db.Select(&characters, "SELECT id, is_female, is_new_character, name, unk_desc_string, hrp, gr, weapon_type, last_login FROM characters WHERE user_id = $1 AND deleted = false ORDER BY id ASC", uid) + err := s.db.Select(&characters, "SELECT id, is_female, is_new_character, name, unk_desc_string, hrp, gr, weapon_type, last_login FROM characters WHERE user_id = $1 AND deleted = false ORDER BY id", uid) if err != nil { return nil, err } return characters, nil } -func (s *Server) getReturnExpiry(uid int) time.Time { +func (s *Server) getReturnExpiry(uid uint32) time.Time { var returnExpiry, lastLogin time.Time s.db.Get(&lastLogin, "SELECT COALESCE(last_login, now()) FROM users WHERE id=$1", uid) if time.Now().Add((time.Hour * 24) * -90).After(lastLogin) { @@ -113,16 +95,18 @@ func (s *Server) getReturnExpiry(uid int) time.Time { return returnExpiry } -func (s *Server) getLastCID(uid int) uint32 { +func (s *Server) getLastCID(uid uint32) uint32 { var lastPlayed uint32 _ = s.db.QueryRow("SELECT last_character FROM users WHERE id=$1", uid).Scan(&lastPlayed) return lastPlayed } -func (s *Server) getUserRights(uid int) uint32 { - rights := uint32(2) - _ = s.db.QueryRow("SELECT rights FROM users WHERE id=$1", uid).Scan(&rights) - _, rights = mhfcourse.GetCourseStruct(rights) +func (s *Server) getUserRights(uid uint32) uint32 { + var rights uint32 + if uid != 0 { + _ = s.db.QueryRow("SELECT rights FROM users WHERE id=$1", uid).Scan(&rights) + _, rights = mhfcourse.GetCourseStruct(rights) + } return rights } @@ -155,9 +139,6 @@ func (s *Server) getFriendsForCharacters(chars []character) []members { } friends = append(friends, charFriends...) } - if len(friends) > 255 { // Uint8 - friends = friends[:255] - } return friends } @@ -177,26 +158,21 @@ func (s *Server) getGuildmatesForCharacters(chars []character) []members { if err != nil { continue } - for i, _ := range charGuildmates { + for i := range charGuildmates { charGuildmates[i].CID = char.ID } guildmates = append(guildmates, charGuildmates...) } } - if len(guildmates) > 255 { // Uint8 - guildmates = guildmates[:255] - } return guildmates } -func (s *Server) deleteCharacter(cid int, token string) error { - var verify int - err := s.db.QueryRow("SELECT count(*) FROM sign_sessions WHERE token = $1", token).Scan(&verify) - if err != nil { - return err // Invalid token +func (s *Server) deleteCharacter(cid int, token string, tokenID uint32) error { + if !s.validateToken(token, tokenID) { + return errors.New("invalid token") } var isNew bool - err = s.db.QueryRow("SELECT is_new_character FROM characters WHERE id = $1", cid).Scan(&isNew) + err := s.db.QueryRow("SELECT is_new_character FROM characters WHERE id = $1", cid).Scan(&isNew) if isNew { _, err = s.db.Exec("DELETE FROM characters WHERE id = $1", cid) } else { @@ -209,7 +185,7 @@ func (s *Server) deleteCharacter(cid int, token string) error { } // Unused -func (s *Server) checkToken(uid int) (bool, error) { +func (s *Server) checkToken(uid uint32) (bool, error) { var exists int err := s.db.QueryRow("SELECT count(*) FROM sign_sessions WHERE user_id = $1", uid).Scan(&exists) if err != nil { @@ -221,10 +197,55 @@ func (s *Server) checkToken(uid int) (bool, error) { return false, nil } -func (s *Server) registerToken(uid int, token string) error { - _, err := s.db.Exec("INSERT INTO sign_sessions (user_id, token) VALUES ($1, $2)", uid, token) - if err != nil { - return err - } - return nil +func (s *Server) registerUidToken(uid uint32) (uint32, string, error) { + token := token.Generate(16) + var tid uint32 + err := s.db.QueryRow(`INSERT INTO sign_sessions (user_id, token) VALUES ($1, $2) RETURNING id`, uid, token).Scan(&tid) + return tid, token, err +} + +func (s *Server) registerPsnToken(psn string) (uint32, string, error) { + token := token.Generate(16) + var tid uint32 + err := s.db.QueryRow(`INSERT INTO sign_sessions (psn_id, token) VALUES ($1, $2) RETURNING id`, psn, token).Scan(&tid) + return tid, token, err +} + +func (s *Server) validateToken(token string, tokenID uint32) bool { + query := `SELECT count(*) FROM sign_sessions WHERE token = $1` + if tokenID > 0 { + query += ` AND id = $2` + } + var exists int + err := s.db.QueryRow(query, token, tokenID).Scan(&exists) + if err != nil || exists == 0 { + return false + } + return true +} + +func (s *Server) validateLogin(user string, pass string) (uint32, RespID) { + var uid uint32 + var passDB string + err := s.db.QueryRow(`SELECT id, password FROM users WHERE username = $1`, user).Scan(&uid, &passDB) + if err != nil { + if err == sql.ErrNoRows { + s.logger.Info("User not found", zap.String("User", user)) + if s.erupeConfig.DevMode && s.erupeConfig.DevModeOptions.AutoCreateAccount { + uid, err = s.registerDBAccount(user, pass) + if err == nil { + return uid, SIGN_SUCCESS + } else { + return 0, SIGN_EABORT + } + } + return 0, SIGN_EAUTH + } + return 0, SIGN_EABORT + } else { + if bcrypt.CompareHashAndPassword([]byte(passDB), []byte(pass)) == nil { + return uid, SIGN_SUCCESS + } + return 0, SIGN_EPASS + } } diff --git a/server/signserver/dsgn_resp.go b/server/signserver/dsgn_resp.go index 926711d57..77ac6468d 100644 --- a/server/signserver/dsgn_resp.go +++ b/server/signserver/dsgn_resp.go @@ -4,37 +4,54 @@ import ( "erupe-ce/common/byteframe" ps "erupe-ce/common/pascalstring" "erupe-ce/common/stringsupport" - "erupe-ce/common/token" + _config "erupe-ce/config" "erupe-ce/server/channelserver" "fmt" "go.uber.org/zap" "strings" ) -func (s *Session) makeSignResponse(uid int) []byte { +func (s *Session) makeSignResponse(uid uint32) []byte { // Get the characters from the DB. chars, err := s.server.getCharactersForUser(uid) + if len(chars) == 0 && uid != 0 { + err = s.server.newUserChara(uid) + if err == nil { + chars, err = s.server.getCharactersForUser(uid) + } + } if err != nil { s.logger.Warn("Error getting characters from DB", zap.Error(err)) } - sessToken := token.Generate(16) - _ = s.server.registerToken(uid, sessToken) - bf := byteframe.NewByteFrame() + var tokenID uint32 + var sessToken string + if uid == 0 && s.psn != "" { + tokenID, sessToken, err = s.server.registerPsnToken(s.psn) + } else { + tokenID, sessToken, err = s.server.registerUidToken(uid) + } + if err != nil { + bf.WriteUint8(uint8(SIGN_EABORT)) + return bf.Data() + } - bf.WriteUint8(1) // resp_code - if s.server.erupeConfig.DevMode && s.server.erupeConfig.PatchServerManifest != "" && s.server.erupeConfig.PatchServerFile != "" { + bf.WriteUint8(uint8(SIGN_SUCCESS)) // resp_code + if (s.server.erupeConfig.PatchServerManifest != "" && s.server.erupeConfig.PatchServerFile != "") || s.client == PS3 { bf.WriteUint8(2) } else { bf.WriteUint8(0) } bf.WriteUint8(1) // entrance server count bf.WriteUint8(uint8(len(chars))) - bf.WriteUint32(0xFFFFFFFF) // login_token_number + bf.WriteUint32(tokenID) bf.WriteBytes([]byte(sessToken)) bf.WriteUint32(uint32(channelserver.TimeAdjusted().Unix())) - if s.server.erupeConfig.DevMode { + if s.client == PS3 { + ps.Uint8(bf, fmt.Sprintf(`ps3-%s.zerulight.cc`, s.server.erupeConfig.Language), false) + ps.Uint8(bf, fmt.Sprintf(`ps3-%s.zerulight.cc`, s.server.erupeConfig.Language), false) + } else { if s.server.erupeConfig.PatchServerManifest != "" && s.server.erupeConfig.PatchServerFile != "" { ps.Uint8(bf, s.server.erupeConfig.PatchServerManifest, false) ps.Uint8(bf, s.server.erupeConfig.PatchServerFile, false) @@ -68,15 +85,23 @@ func (s *Session) makeSignResponse(uid int) []byte { bf.WriteBool(true) // Use uint16 GR, no reason not to bf.WriteBytes(stringsupport.PaddedString(char.Name, 16, true)) // Character name bf.WriteBytes(stringsupport.PaddedString(char.UnkDescString, 32, false)) // unk str - bf.WriteUint16(char.GR) - bf.WriteUint16(0) // Unk + if s.server.erupeConfig.RealClientMode >= _config.G7 { + bf.WriteUint16(char.GR) + bf.WriteUint8(0) // Unk + bf.WriteUint8(0) // Unk + } } friends := s.server.getFriendsForCharacters(chars) if len(friends) == 0 { bf.WriteUint8(0) } else { - bf.WriteUint8(uint8(len(friends))) + if len(friends) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(friends))) + } else { + bf.WriteUint8(uint8(len(friends))) + } for _, friend := range friends { bf.WriteUint32(friend.CID) bf.WriteUint32(friend.ID) @@ -88,7 +113,12 @@ func (s *Session) makeSignResponse(uid int) []byte { if len(guildmates) == 0 { bf.WriteUint8(0) } else { - bf.WriteUint8(uint8(len(guildmates))) + if len(guildmates) > 255 { + bf.WriteUint8(255) + bf.WriteUint16(uint16(len(guildmates))) + } else { + bf.WriteUint8(uint8(len(guildmates))) + } for _, guildmate := range guildmates { bf.WriteUint32(guildmate.CID) bf.WriteUint32(guildmate.ID) @@ -97,12 +127,12 @@ func (s *Session) makeSignResponse(uid int) []byte { } if s.server.erupeConfig.HideLoginNotice { - bf.WriteUint8(0) + bf.WriteBool(false) } else { - bf.WriteUint8(uint8(len(s.server.erupeConfig.LoginNotices))) - for _, notice := range s.server.erupeConfig.LoginNotices { - ps.Uint32(bf, notice, true) - } + bf.WriteBool(true) + bf.WriteUint8(0) + bf.WriteUint8(0) + ps.Uint16(bf, strings.Join(s.server.erupeConfig.LoginNotices[:], ""), true) } bf.WriteUint32(s.server.getLastCID(uid)) @@ -122,35 +152,37 @@ func (s *Session) makeSignResponse(uid int) []byte { bf.WriteUint16(0x4E20) ps.Uint16(bf, "", false) // unk ipv4 bf.WriteUint32(uint32(s.server.getReturnExpiry(uid).Unix())) - bf.WriteUint32(0x00000000) - bf.WriteUint32(0x0A5197DF) // unk id + bf.WriteUint32(0) mezfes := s.server.erupeConfig.DevModeOptions.MezFesEvent alt := s.server.erupeConfig.DevModeOptions.MezFesAlt if mezfes { + // We can just use the start timestamp as the event ID + bf.WriteUint32(uint32(channelserver.TimeWeekStart().Unix())) // Start time bf.WriteUint32(uint32(channelserver.TimeWeekStart().Unix())) // End time bf.WriteUint32(uint32(channelserver.TimeWeekNext().Unix())) - bf.WriteUint8(2) // Unk - bf.WriteUint32(20) // Single tickets - bf.WriteUint32(10) // Group tickets - bf.WriteUint8(8) // Stalls open - bf.WriteUint8(0xA) // Unk - bf.WriteUint8(0x3) // Pachinko - bf.WriteUint8(0x6) // Nyanrendo - bf.WriteUint8(0x9) // Point stall + bf.WriteUint8(2) // Unk + bf.WriteUint32(s.server.erupeConfig.GameplayOptions.MezfesSoloTickets) + bf.WriteUint32(s.server.erupeConfig.GameplayOptions.MezfesGroupTickets) + bf.WriteUint8(8) // Stalls open + bf.WriteUint8(10) // Stall Map + bf.WriteUint8(3) // Pachinko + bf.WriteUint8(6) // Nyanrendo + bf.WriteUint8(9) // Point stall if alt { - bf.WriteUint8(0x2) // Tokotoko + bf.WriteUint8(2) // Tokotoko Partnya } else { - bf.WriteUint8(0x4) // Volpakkun + bf.WriteUint8(4) // Volpakkun Together } - bf.WriteUint8(0x8) // Battle cats - bf.WriteUint8(0x5) // Gook - bf.WriteUint8(0x7) // Honey + bf.WriteUint8(8) // Dokkan Battle Cats + bf.WriteUint8(5) // Goocoo Scoop + bf.WriteUint8(7) // Honey Panic } else { bf.WriteUint32(0) bf.WriteUint32(0) + bf.WriteUint32(0) } return bf.Data() } diff --git a/server/signserver/session.go b/server/signserver/session.go index dfe034226..5806f1108 100644 --- a/server/signserver/session.go +++ b/server/signserver/session.go @@ -3,22 +3,24 @@ package signserver import ( "database/sql" "encoding/hex" + "erupe-ce/common/stringsupport" "fmt" "net" + "strings" "sync" "erupe-ce/common/byteframe" "erupe-ce/network" "go.uber.org/zap" - "golang.org/x/crypto/bcrypt" ) -type Client int +type client int const ( - PC100 Client = iota + PC100 client = iota VITA PS3 + WIIU ) // Session holds state for the sign server connection. @@ -28,7 +30,8 @@ type Session struct { server *Server rawConn net.Conn cryptConn *network.CryptConn - client Client + client client + psn string } func (s *Session) work() { @@ -50,20 +53,25 @@ func (s *Session) work() { func (s *Session) handlePacket(pkt []byte) error { bf := byteframe.NewByteFrameFromBytes(pkt) reqType := string(bf.ReadNullTerminatedBytes()) - switch reqType { - case "DLTSKEYSIGN:100", "DSGN:100": + switch reqType[:len(reqType)-3] { + case "DLTSKEYSIGN:", "DSGN:": s.handleDSGN(bf) - case "PS3SGN:100": + case "PS3SGN:": s.client = PS3 s.handlePSSGN(bf) - case "VITASGN:100": + case "VITASGN:": s.client = VITA s.handlePSSGN(bf) - case "DELETE:100": - loginTokenString := string(bf.ReadNullTerminatedBytes()) + case "WIIUSGN:": + s.client = WIIU + s.handleWIIUSGN(bf) + case "VITACOGLNK:", "COGLNK:": + s.handlePSNLink(bf) + case "DELETE:": + token := string(bf.ReadNullTerminatedBytes()) characterID := int(bf.ReadUint32()) - _ = int(bf.ReadUint32()) // login_token_number - err := s.server.deleteCharacter(characterID, loginTokenString) + tokenID := bf.ReadUint32() + err := s.server.deleteCharacter(characterID, token, tokenID) if err == nil { s.logger.Info("Deleted character", zap.Int("CharacterID", characterID)) s.cryptConn.SendPacket([]byte{0x01}) // DEL_SUCCESS @@ -79,83 +87,117 @@ func (s *Session) handlePacket(pkt []byte) error { func (s *Session) authenticate(username string, password string) { newCharaReq := false - if username[len(username)-1] == 43 { // '+' username = username[:len(username)-1] newCharaReq = true } - - var id int - var hash string bf := byteframe.NewByteFrame() - - err := s.server.db.QueryRow("SELECT id, password FROM users WHERE username = $1", username).Scan(&id, &hash) - switch { - case err == sql.ErrNoRows: - s.logger.Info("User not found", zap.String("Username", username)) - if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.AutoCreateAccount { - s.logger.Info("Creating user", zap.String("Username", username)) - err = s.server.registerDBAccount(username, password) - if err == nil { - bf.WriteBytes(s.makeSignResponse(id)) - } - } else { - bf.WriteUint8(uint8(SIGN_EAUTH)) + uid, resp := s.server.validateLogin(username, password) + switch resp { + case SIGN_SUCCESS: + if newCharaReq { + _ = s.server.newUserChara(uid) } - case err != nil: - bf.WriteUint8(uint8(SIGN_EABORT)) - s.logger.Error("Error getting user details", zap.Error(err)) + bf.WriteBytes(s.makeSignResponse(uid)) default: - if bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) == nil || s.client == VITA || s.client == PS3 { - s.logger.Debug("Passwords match!") - if newCharaReq { - err = s.server.newUserChara(username) - if err != nil { - s.logger.Error("Error adding new character to user", zap.Error(err)) - bf.WriteUint8(uint8(SIGN_EABORT)) - break - } - } - // TODO: Need to auto delete user tokens after inactivity - // exists, err := s.server.checkToken(id) - // if err != nil { - // s.logger.Info("Error checking for live tokens", zap.Error(err)) - // serverRespBytes = makeSignInFailureResp(SIGN_EABORT) - // break - // } - bf.WriteBytes(s.makeSignResponse(id)) - } else { - s.logger.Warn("Incorrect password") - bf.WriteUint8(uint8(SIGN_EPASS)) - } + bf.WriteUint8(uint8(resp)) } - if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.LogOutboundMessages { fmt.Printf("\n[Server] -> [Client]\nData [%d bytes]:\n%s\n", len(bf.Data()), hex.Dump(bf.Data())) } + _ = s.cryptConn.SendPacket(bf.Data()) +} - err = s.cryptConn.SendPacket(bf.Data()) +func (s *Session) handleWIIUSGN(bf *byteframe.ByteFrame) { + _ = bf.ReadBytes(1) + wiiuKey := string(bf.ReadBytes(64)) + var uid uint32 + err := s.server.db.QueryRow(`SELECT id FROM users WHERE wiiu_key = $1`, wiiuKey).Scan(&uid) + if err != nil { + if err == sql.ErrNoRows { + s.logger.Info("Unlinked Wii U attempted to authenticate", zap.String("Key", wiiuKey)) + s.sendCode(SIGN_ECOGLINK) + return + } + s.sendCode(SIGN_EABORT) + return + } + s.cryptConn.SendPacket(s.makeSignResponse(uid)) } func (s *Session) handlePSSGN(bf *byteframe.ByteFrame) { - _ = bf.ReadNullTerminatedBytes() // 0000000256 - _ = bf.ReadNullTerminatedBytes() // 1 - _ = bf.ReadBytes(82) - psnUser := string(bf.ReadNullTerminatedBytes()) - var reqUsername string - err := s.server.db.QueryRow(`SELECT username FROM users WHERE psn_id = $1`, psnUser).Scan(&reqUsername) - if err == sql.ErrNoRows { - resp := byteframe.NewByteFrame() - resp.WriteUint8(uint8(SIGN_ECOGLINK)) - s.cryptConn.SendPacket(resp.Data()) + // Prevent reading malformed request + if len(bf.DataFromCurrent()) < 128 { + s.sendCode(SIGN_EABORT) return } - s.authenticate(reqUsername, "") + _ = bf.ReadNullTerminatedBytes() // VITA = 0000000256, PS3 = 0000000255 + _ = bf.ReadBytes(2) // VITA = 1, PS3 = ! + _ = bf.ReadBytes(82) + s.psn = string(bf.ReadNullTerminatedBytes()) + var uid uint32 + err := s.server.db.QueryRow(`SELECT id FROM users WHERE psn_id = $1`, s.psn).Scan(&uid) + if err != nil { + if err == sql.ErrNoRows { + s.cryptConn.SendPacket(s.makeSignResponse(0)) + return + } + s.sendCode(SIGN_EABORT) + return + } + s.cryptConn.SendPacket(s.makeSignResponse(uid)) +} + +func (s *Session) handlePSNLink(bf *byteframe.ByteFrame) { + _ = bf.ReadNullTerminatedBytes() // Client ID + credentials := strings.Split(stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()), "\n") + token := string(bf.ReadNullTerminatedBytes()) + uid, resp := s.server.validateLogin(credentials[0], credentials[1]) + if resp == SIGN_SUCCESS && uid > 0 { + var psn string + err := s.server.db.QueryRow(`SELECT psn_id FROM sign_sessions WHERE token = $1`, token).Scan(&psn) + if err != nil { + s.sendCode(SIGN_ECOGLINK) + return + } + + // Since we check for the psn_id, this will never run + var exists int + err = s.server.db.QueryRow(`SELECT count(*) FROM users WHERE psn_id = $1`, psn).Scan(&exists) + if err != nil { + s.sendCode(SIGN_ECOGLINK) + return + } else if exists > 0 { + s.sendCode(SIGN_EPSI) + return + } + + var currentPSN string + err = s.server.db.QueryRow(`SELECT COALESCE(psn_id, '') FROM users WHERE username = $1`, credentials[0]).Scan(¤tPSN) + if err != nil { + s.sendCode(SIGN_ECOGLINK) + return + } else if currentPSN != "" { + s.sendCode(SIGN_EMBID) + return + } + + _, err = s.server.db.Exec(`UPDATE users SET psn_id = $1 WHERE username = $2`, psn, credentials[0]) + if err == nil { + s.sendCode(SIGN_SUCCESS) + return + } + } + s.sendCode(SIGN_ECOGLINK) } func (s *Session) handleDSGN(bf *byteframe.ByteFrame) { - reqUsername := string(bf.ReadNullTerminatedBytes()) - reqPassword := string(bf.ReadNullTerminatedBytes()) + user := stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) + pass := stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) _ = string(bf.ReadNullTerminatedBytes()) // Unk - s.authenticate(reqUsername, reqPassword) + s.authenticate(user, pass) +} + +func (s *Session) sendCode(id RespID) { + s.cryptConn.SendPacket([]byte{byte(id)}) } diff --git a/server/signserver/sign_server.go b/server/signserver/sign_server.go index fd4bd9bed..f93a6459a 100644 --- a/server/signserver/sign_server.go +++ b/server/signserver/sign_server.go @@ -16,14 +16,14 @@ import ( type Config struct { Logger *zap.Logger DB *sqlx.DB - ErupeConfig *config.Config + ErupeConfig *_config.Config } // Server is a MHF sign server. type Server struct { sync.Mutex logger *zap.Logger - erupeConfig *config.Config + erupeConfig *_config.Config sessions map[int]*Session db *sqlx.DB listener net.Listener diff --git a/server/signv2server/signv2_server.go b/server/signv2server/signv2_server.go index c00a4a641..c6db00b09 100644 --- a/server/signv2server/signv2_server.go +++ b/server/signv2server/signv2_server.go @@ -18,14 +18,14 @@ import ( type Config struct { Logger *zap.Logger DB *sqlx.DB - ErupeConfig *config.Config + ErupeConfig *_config.Config } // Server is the MHF custom launcher sign server. type Server struct { sync.Mutex logger *zap.Logger - erupeConfig *config.Config + erupeConfig *_config.Config db *sqlx.DB httpServer *http.Server isShuttingDown bool