159 Commits
Author SHA1 Message Date
Melledy 088c2df58a Bump server version to 1.3.0 2026-01-02 21:31:47 -08:00
Melledy f949f3b619 Fix exception when giving all materials 2026-01-02 03:32:50 -08:00
Melledy 9f8fd4464b Update data versions 2026-01-01 03:00:49 -08:00
Melledy 3aaa5bb334 Update data versions 2025-12-26 01:54:56 -08:00
Melledy 297255a316 Implement setting disc music as main theme 2025-12-25 18:06:35 -08:00
Melledy fba1dfccd6 Fix return to ascension 2025-12-25 17:29:43 -08:00
Melledy 957d3a9ac3 Remove activities that are not in the activity module 2025-12-24 21:16:12 -08:00
Melledy 9db0f6aabb Implement login reward activity 2025-12-24 21:12:31 -08:00
Melledy b086851b95 Implement Summit Show 2025-12-24 00:30:51 -08:00
Melledy 9df83c5205 Implement new weekly quests 2025-12-24 00:03:05 -08:00
Melledy c2ebff92c9 Clean up some stuff and update enums 2025-12-23 20:56:00 -08:00
Hiro 92c7dbcbc5 update to support the latest game version 2025-12-24 02:45:06 +02:00
Melledy a8e358d2d6 Update server to support latest version 2025-12-22 20:37:45 -08:00
Melledy 450b0cca30 Remove broken honor titles when logging in 2025-12-22 19:36:54 -08:00
Melledy c75da823e0 Implement sending friends energy 2025-12-22 18:46:21 -08:00
Melledy b4948212ce Update score boss control id properly 2025-12-22 17:54:36 -08:00
Melledy 53839b48ca Implement !autobuild command
The `!autobuild` (or `!ab`) command allows you to build a record without needing to add every id. Missing trekkers/discs/potentials/melodies will be auto selected by the server.

Usage:
`!autobuild [character/disc/potential/melody ids...] lv[target record level] s[target record score]`

Examples:
`!autobuild s99999` = Creates a record with a random main trekker with the max score.
`!autobuild 103 lv30` = Creates a record with this trekker at record rank 30.
`!autobuild 155 132 107 s25000` = Creates a record with these trekkers with a record score of about 25000.
`!autobuild 103 510301 510302 510303 510304 lv20` = Creates a record with this trekker and these potentials at record rank 20.

Notes:
- Target level overrides target score. So a command of `!autobuild lv30 s1000` would have a record rank of 30 and NOT a score of 1000.
- If there is no target level or score, the command will default to a target level of 40.
- You can only add trekkers/discs that you own.
2025-12-20 04:20:34 -08:00
Melledy b5fde4433d Forgot to update something in GameCharacter.java 2025-12-19 01:21:51 -08:00
Melledy 495e76a456 Added command to set a trekker's emblem stats
Usage:
`!e [character id] [slot id - this is between 1 and 3] [attr 1] [attr 2] [attr 3] [attr 4]`

Example:
`!e 141 1 1004 1004 1004 1004` = Sets the first emblem of the character to all +ignis damage.

Notes:
Attribute ids can be found in `CharGemAttrValue.json` in the resources/bin folder.
2025-12-19 01:18:37 -08:00
Melledy 496d012c36 Bump server version to 1.2.0 2025-12-17 21:45:08 -08:00
Melledy c5d6d707f8 Add support for loading the handbook in different languages 2025-12-17 21:34:22 -08:00
Melledy d9b502002c Improve achievement params handling 2025-12-16 00:11:18 -08:00
Melledy 85b08c7593 Fix issues with gacha history
You may need to reset gacha history info in the database
2025-12-15 08:48:55 -08:00
Melledy 4da479a88a Fix gacha 4 star probability rates 2025-12-15 08:39:29 -08:00
Melledy 21467faa7f Fix potential count when giving up a Monolith run 2025-12-15 07:41:08 -08:00
Melledy 72d9cd530d Implement proper melody drops in Monolith 2025-12-15 07:40:03 -08:00
Melledy 26019d639b Implement a couple more Monolith achievements 2025-12-15 07:28:36 -08:00
Melledy ee5d759a98 Add a config option to unlock all story CGs 2025-12-15 07:12:49 -08:00
HongchengQ f439b25f2a Fix null IP handling in ban IP processing
- Continue loop instead of returning for empty IPs
- Prevent single null IP from interrupting entire ban check
2025-12-13 16:12:59 -08:00
HongchengQ 4fb2712a89 Fix Android-CN -1 error 2025-12-13 16:12:26 -08:00
Melledy e5ffb1743a Fix wrong materials used for emblem generation 2025-12-13 16:11:51 -08:00
Melledy 4d14099f11 Fix Menace Arena not saving properly 2025-12-13 01:20:06 -08:00
Melledy 9599877005 Clear current player level ids when settling 2025-12-13 00:49:55 -08:00
Melledy 31e56ae17f Fix potential count when giving up a Monolith run 2025-12-13 00:33:27 -08:00
Melledy ab1f84e8db Fix Ocean of Souls research node 2025-12-13 00:26:19 -08:00
Melledy 588522df88 Fix lucky potential effect in selector 2025-12-13 00:17:18 -08:00
Melledy 660d5a3cf7 Fix emblems for on certain characters 2025-12-13 00:14:29 -08:00
Melledy 1aa2129bba Add platform string for game session 2025-12-13 00:14:07 -08:00
Melledy 968880c320 Show errors properly if emblem creation/reroll fails 2025-12-12 02:06:11 -08:00
Melledy 353d7d97b6 Add nightly link to readme 2025-12-12 01:45:34 -08:00
Melledy c51268bcb8 Rework how story is handled, fixes choices not saving 2025-12-12 01:31:31 -08:00
Melledy 11ea526a35 Fix null pointer error when logging into a new account 2025-12-11 23:25:49 -08:00
Melledy 5668ba9cea Update data versions 2025-12-11 23:24:45 -08:00
阁主 fef25496fa Implement !status command 2025-12-11 21:21:01 -08:00
Melledy 5d9ff6e1af Fix !build command potential count and not saving to the database 2025-12-10 20:38:05 -08:00
HongchengQ 3a6387c2bd Implement ban functionality
- Added ban module
- Added Ban and Unban commands, supporting banning and unbanning players through various command parameters.
- Added timestamp formatting method in Utils utility class for displaying ban expiration times
- Introduced PlayerErrorCode enum defining various error codes including ErrBan
- Added dual ban checking for both IP and user during player login
- Optimized login failure responses to provide specific error reasons and parameters
2025-12-10 16:33:41 -08:00
Melledy 6483e8a5a7 Implement weekly journey ticket limit 2025-12-09 23:49:48 -08:00
Melledy 5d797fb9d3 Fix weekly boss entry tickets resetting every day 2025-12-09 23:28:24 -08:00
Melledy 0ad87dd751 Improve random potential selector generator 2025-12-09 22:37:04 -08:00
Melledy 5b7adc8fa4 Separate custom data defs into their own category 2025-12-09 21:57:35 -08:00
Melledy 6f832bcdfe Fix potential count calculations when creating a record 2025-12-09 21:33:34 -08:00
Melledy bf5fe3912f Fix discs surging to max crescendo regardless of materials used 2025-12-09 21:28:53 -08:00
Melledy c5f339c8be Implement new event 2025-12-08 22:28:47 -08:00
Melledy 80a181680b Fix !giveall not saving characters/discs properties to the database 2025-12-08 20:12:19 -08:00
Melledy f582444679 Update data versions 2025-12-08 20:07:26 -08:00
Melledy 2af715477e Implement random npc event chance in Monoliths 2025-12-08 18:01:44 -08:00
Melledy 9d77005da6 Implement more Monolith research nodes 2025-12-08 14:47:59 -08:00
Melledy 78d88a87cd Bump server version to 1.1.3
Also updated readme and command descriptions
2025-12-08 01:28:10 -08:00
Melledy e5ce16d6ea Fix more Monolith achievements 2025-12-08 01:12:01 -08:00
Melledy b92319b4c5 Update sessionTimeout default value to 5 minutes 2025-12-07 23:58:18 -08:00
Melledy 1b0b6873b9 Update player session removal 2025-12-07 23:52:23 -08:00
Melledy f542ea7cb4 Fix gift boxes not giving gifts when being bought from the shop 2025-12-07 23:15:25 -08:00
Melledy fa08bcebae Give crescendo/talent material if we are adding duplicate discs/characters 2025-12-07 23:01:46 -08:00
Melledy 209ce83fc9 Reset shop purchases each month 2025-12-07 21:06:53 -08:00
HongchengQ 8e7ef038ea Add HTTP debugging log configuration option 2025-12-07 20:31:03 -08:00
Melledy 90f4be862f Implement daily check in 2025-12-07 20:00:22 -08:00
HongchengQ 05e74f4d12 docs(readme): Update supported regions and domain list
- Added new supported region CN in README
2025-12-07 18:53:42 -08:00
Melledy 005f138599 Implement Boss Blitz star rewards 2025-12-07 16:31:19 -08:00
Melledy be5a6709fd Improve Boss Blitz UI 2025-12-07 16:02:44 -08:00
Melledy c6ac09f112 Fix weekly boss entry tickets and rewards 2025-12-07 15:45:19 -08:00
Melledy 7f0bdb1824 Update player delete function to remove achievements and activities
Also cleaned up some stuff
2025-12-07 15:07:48 -08:00
HongchengQ f8bd7d5db2 fix CN Client cannot modify nickname through /user/set-info 2025-12-07 13:08:00 -08:00
HongchengQ a7eddd2ed0 Support CN Client
- Add Chinese region server key configuration
- Rename UserLoginEntity to OverseaUserLoginEntity and adjust package path
- Add ChinaUserLoginEntity entity class to support Chinese region user data structure
- Modify CommonConfigHandler to distinguish between Chinese and overseas configuration returns
- Update HandlerPlayerLoginReq to be compatible with Chinese region login token parsing
- Add /user/set-info and /user/send-sms interfaces in HttpServer
- Modify UserLoginHandler to support both Chinese and overseas user login logic
- Add mobile phone number + verification code login method support
- Add channel recognition logic to return corresponding regional user data
2025-12-07 03:38:38 -08:00
Melledy 467b7443f3 Add journey tickets after finishing a tower run 2025-12-06 19:40:15 -08:00
Melledy 2a7817df95 Prevent players from giving themselves unavailable characters/discs 2025-12-06 17:52:13 -08:00
Melledy dfb93cae4b Implement some tower achievements 2025-12-06 02:01:57 -08:00
Fishia 5707c1c919 feat(tower_defense): implement first clear rewards 2025-12-06 01:21:28 -08:00
Fishia 51f6db9803 fix(tower_defense): level id is key, not value 2025-12-06 01:21:28 -08:00
Fishia 3df873e385 feat: tower defense activity
Bare minimum work done.
2025-12-06 01:21:28 -08:00
HongchengQ f44262f427 Fix abnormal player online status on duplicate login
- Prevent incorrect player deletion on duplicate login
2025-12-06 00:54:58 -08:00
Melledy cf63bc0b7e Implement starting musical notes 2025-12-05 23:24:10 -08:00
Melledy b7bf1fcdeb Implement potential rerolling 2025-12-05 23:01:37 -08:00
Melledy 198d3aac4f Fix story red dot (untested) 2025-12-05 22:34:47 -08:00
Melledy 810427a028 Fix battle pass weekly exp not resetting 2025-12-05 21:05:21 -08:00
Melledy 70c7c849df Implement !battlepass command
Examples:
`!battlepass premium` = Activates elite grant
`!battlepass lv40` = Unlocks the rewards up to level 40
2025-12-05 21:03:09 -08:00
Melledy 0b7f1ae3a2 Fix battle pass red dot when logging in 2025-12-05 20:32:06 -08:00
Melledy 5182e94db7 Fix item count on star tower shop goods 2025-12-05 19:25:20 -08:00
Melledy 426e5bce63 Add a notification when getting the wrong answer in a npc event 2025-12-05 19:11:39 -08:00
HongchengQ b9c4a174f8 Improve remote command execution response results
- Ensure that commands return specific messages instead of fixed strings after execution
2025-12-05 13:38:48 -08:00
Melledy 6974631601 Implement bonus potential level monolith talents 2025-12-05 02:12:29 -08:00
Melledy 880f0d1d7d Fix max level of potentials in !build being 3 2025-12-05 01:26:12 -08:00
Melledy 86c607c0b3 Implement some star tower npc events 2025-12-04 23:40:24 -08:00
Melledy 3710f0a697 Implement secondary skills in star tower too 2025-12-04 19:32:23 -08:00
Melledy c19aa5d0a1 Fix disc secondary skills 2025-12-04 16:25:18 -08:00
Melledy be84e0f406 Remove max level potentials from potential selectors 2025-12-04 00:01:48 -08:00
Melledy e5cb842fdd Implement monolith shop discounts and improvements 2025-12-03 23:53:18 -08:00
Melledy 15618414a6 Implement monolith shop discounts 2025-12-03 23:15:25 -08:00
Melledy 71de6184b9 Optimize star tower case handling 2025-12-03 22:52:49 -08:00
Melledy e887d5eb4c Update data versions 2025-12-03 22:45:42 -08:00
Melledy 211e012c42 Update patchlist handler 2025-12-03 22:44:12 -08:00
Melledy 9c87d74ad7 Add /client-code endpoint 2025-12-03 22:34:29 -08:00
Melledy 357d12779b Implement monolith shop refresh 2025-12-03 22:23:41 -08:00
Melledy c8a7db75aa Implement bonus max potential level 2025-12-03 21:28:47 -08:00
Melledy ef8846445c Implement monolith enhancement machines 2025-12-03 19:36:47 -08:00
Melledy 7ef7490c37 Support JP and TW clients 2025-12-03 14:08:38 -08:00
Melledy 2c1e1ae2fb Spawn the shop npc at the end of a monolith run 2025-12-03 12:07:05 -08:00
Melledy e3d34bfa48 Spawn recovery npc after each battle in monolith 2025-12-03 00:20:51 -08:00
Melledy 65250b07bf Don't send door case after every shop purchase 2025-12-02 23:56:57 -08:00
Melledy b38f4f0957 Fix duplicate potentials in potential selector 2025-12-02 23:50:57 -08:00
Melledy e4dc85a50f Fix wrong potentials in star tower potential selector 2025-12-02 23:44:45 -08:00
Melledy 893b23b50d Rework star tower 2025-12-02 23:15:31 -08:00
Melledy 33b1cf55d4 Update data version to 60 2025-12-01 21:43:06 -08:00
Melledy aecea6ab03 Implement !build command for creating records 2025-12-01 13:33:34 -08:00
Melledy e8e7df7d50 Fix incorrect element type for wind/aqua 2025-12-01 13:21:42 -08:00
Melledy 9188d3b53a Improve command arg handling 2025-12-01 13:16:24 -08:00
Melledy 30f565d0d6 Bump version to 1.1.2 2025-11-30 23:49:50 -08:00
Melledy faa4ea0780 Only show boss blitz leaderboard for the current season 2025-11-30 23:48:24 -08:00
Melledy 354f390c3b Reset score entry if control id doesn't match 2025-11-30 23:42:34 -08:00
Melledy 3171bce3cc Update boss blitz control id 2025-11-30 23:35:04 -08:00
Melledy 56b4d3b66d Fix monolith crash at floor 20 2025-11-30 23:33:05 -08:00
Melledy 585734c2f3 Handle more achievements 2025-11-30 23:16:37 -08:00
Melledy 6f7a92725a Rework how quest/achievement conditions are handled 2025-11-30 17:06:08 -08:00
Melledy a04f3354f7 Implement trial activities 2025-11-30 15:19:35 -08:00
Melledy f53bdaba32 Implement achievements properly 2025-11-29 00:29:04 -08:00
Melledy 898e8dd43f Bump version to 1.1.1 2025-11-28 14:33:53 -08:00
Melledy 29db60fd0a Fix commission bonus rewards 2025-11-28 14:29:57 -08:00
Fishia 7577bf87d4 fix(startower): fix level up logic 2025-11-28 07:14:59 -08:00
Melledy 3e47c8ef06 Cleanup + Bump version to 1.1.0 2025-11-27 19:25:40 -08:00
Melledy a981c6fce4 Save score in cataclysm survivor properly 2025-11-27 12:20:41 -08:00
Melledy 26ea746368 Hardcode emblem attribute values
(They were removed from the data files)
2025-11-27 12:00:08 -08:00
Fishia 4356b194df feat(startower): leveling up 2025-11-27 07:49:00 -08:00
Fishia bfb22eddff feat: properly handle door cases and currency 2025-11-27 07:49:00 -08:00
Melledy 3f2f58b227 Implement weekly resets for battlepass quests 2025-11-27 01:05:59 -08:00
Melledy 187d715866 Add basic support for other regions 2025-11-26 21:31:09 -08:00
Melledy 7df1be99ef Fix gitignore 2025-11-26 19:48:19 -08:00
RaidenShogun503andMelledy 6d9e28963d Add Command SetLevel (#8)
* Add Remote Command API (Use KEY)

* Clean up HttpServer by removing unused code

Removed commented-out code

* Add SetLevel Command (need to restart the game for it to take effect)

* Add Proto Request Change Level (Not Work)

* Update setlevel command

---------

Co-authored-by: Melledy <121644117+Melledy@users.noreply.github.com>
2025-11-26 19:45:45 -08:00
Melledy 2acd506245 Improve command system 2025-11-25 23:09:20 -08:00
Melledy fd8e8925ca Implement heartlink invite 2025-11-25 22:33:25 -08:00
AhAlpha e529e8e965 Change DATA_VERSION to 54 2025-11-25 22:30:26 -08:00
阁主 3a7d12c7b7 Implement !clean command and f affinity 2025-11-25 19:33:02 -08:00
Furiri 008cd06b32 Add Remote Command API (Use KEY) 2025-11-25 06:24:17 -08:00
Melledy 55ff9b2826 Add completed dummy achievements because the client needs them for random things 2025-11-24 21:38:40 -08:00
Melledy c78c6a7492 Implement trekker affinity story 2025-11-24 03:07:47 -08:00
Melledy 139b1cf87e Update daily shop reward 2025-11-24 01:39:45 -08:00
Melledy 3059c549d5 Fix cataclysm survivor score calculation 2025-11-21 20:36:35 -08:00
Haru e8a3576d8b Avoid null pointer 2025-11-21 07:41:09 -08:00
Fishia a530166347 Add nightly CI 2025-11-21 06:16:23 -08:00
Melledy 0ef1231bf1 Add a config option for configuring session timeout 2025-11-21 05:10:51 -08:00
Melledy e5fe89ebc9 Implement sending gifts 2025-11-21 04:46:11 -08:00
Melledy be842e4269 Fix emblem reforging not working when reforging locked attributes 2025-11-21 03:35:28 -08:00
Melledy eead51d32f Implement starting gold monolith research talents 2025-11-21 02:52:00 -08:00
Melledy 5382877a83 Increase max formations to 6 2025-11-21 02:41:41 -08:00
Melledy fdd4264b40 Fix showcase not updating when new characters/discs are added 2025-11-21 02:05:36 -08:00
阁主 e25d58d7f5 Fix crash when submitting empty player signature 2025-11-20 23:16:53 -08:00
Melledy f128b93210 Fix issues with unlocking talents in monolith research 2025-11-20 05:42:44 -08:00
Melledy 6289e3f1b6 Fix buying energy with gems not giving the correct amount 2025-11-20 05:37:21 -08:00
Melledy 480d0d60b3 Fix quick craft not using item choice boxes to create materials 2025-11-20 05:25:39 -08:00
Melledy e4b7bb74c5 Bump server version to 1.0.1 2025-11-19 06:50:10 -08:00
Melledy 01ed3da162 Fix player registration 2025-11-19 06:25:46 -08:00
288 changed files with 26732 additions and 1894 deletions

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
name: Nebula Nightly
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582
- name: Build
run: |
chmod +x gradlew
./gradlew jar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Nebula-Nightly
path: Nebula.jar
+2 -1
View File
@@ -58,12 +58,13 @@ tmp/
.DS_Store
.directory
# Generated/resource/log/plugins folders
# Generated/resource/log/plugins/etc folders
/logs
/plugins
/proto
/resources
/web
/StellaSoraData
# Compiled
/*.jar
+42 -21
View File
@@ -1,12 +1,14 @@
# Nebula
A work in progress game server emulator for a certain anime game.
A work in progress game server emulator for a certain anime game. Most features are implemented.
For any extra support, questions, or discussions, check out our [Discord](https://discord.gg/cskCWBqdJk).
Latest nightly compiled server jar: [Nightly](https://nightly.link/Melledy/Nebula/workflows/gradle/main/Nebula-Nightly.zip)
### Notable features
- Basic profile features
- Character system implemented (except for affinity)
- Character system
- Inventory/Discs working
- Energy system
- Mail system
@@ -14,20 +16,26 @@ For any extra support, questions, or discussions, check out our [Discord](https:
- Daily quests
- Battle pass
- Gacha
- Friend system (sending energy not implemented)
- Shop (using only in-game currency)
- Friend system
- Shop (only in-game currency supported)
- Commissions
- Heartlink (missing advanced affinity related features)
- Monoliths (completeable but many other features missing)
- Heartlink
- Achievements
- Monoliths (research quests not implemented)
- Bounty Trials
- Menance Arena
- Proving grounds
- Catacylsm Survivor (talents not fully working, score not calculated properly)
- Proving Grounds
- Catacylsm Survivor (talents not fully working)
- Boss Blitz
- Events (Only tower defense and trials)
### Not implemented
- Achievements
- Events
### Supported regions
Nebula supports the global PC client by default. If you want to switch regions, you need to change the `region` field in the Nebula config.
Current supported regions (PC): `GLOBAL`, `KR`, `JP`, `TW`, `CN`
You may need to change the data version when switching regions. The `customDataVersion` field should match the the data version of your client, which is usually the last number of your client's version string (top left of your login screen). Example: 1.0.0.42 = data version 42.
# Running the server and client
@@ -38,7 +46,7 @@ For any extra support, questions, or discussions, check out our [Discord](https:
* [MongoDB 4.0+](https://www.mongodb.com/try/download/community)
### Compiling the server
1. Open your system terminal, and compile the server with `./gradlew jar`
1. Open your system terminal, and compile the server with `./gradlew jar` (If you downloaded the server jar from the Nightly link, you can skip this step)
2. Create a folder named `resources` in your server directory
3. Download the `bin`, `language` folders from a repository with [datamined game data](https://github.com/Hiro420/StellaSoraData) and place them into your resources folder.
4. Run the server with `java -jar Nebula.jar` from your system terminal. This server comes with a built-in internal MongoDB server for its database, so no Mongodb installation is required. However, it is highly recommended to install Mongodb anyway.
@@ -49,34 +57,47 @@ For any extra support, questions, or discussions, check out our [Discord](https:
3. Copy and paste the following code into the Fiddlerscript tab of Fiddler Classic. Remember to save the fiddler script after you copy and paste it:
```
import System;
import System.Windows.Forms;
import Fiddler;
import System.Text.RegularExpressions;
class Handlers
{
static var list = [
".yostarplat.com",
".stellasora.global",
".stellasora.kr",
".stellasora.jp",
".stargazer-games.com",
".yostar.cn"
];
static function OnBeforeRequest(oS: Session) {
if (oS.host.EndsWith(".yostarplat.com") || oS.host.EndsWith(".stellasora.global")) {
oS.oRequest.headers.UriScheme = "http";
oS.host = "localhost"; // This can also be replaced with another IP address.
for (var i = 0; i < list.length; i++) {
if (oS.host.EndsWith(list[i])) {
oS.oRequest.headers.UriScheme = "http";
oS.host = "localhost"; // This can also be replaced with another IP address
}
}
}
};
```
4. If `autoCreateAccount` is set to true in the config, then you can skip this step. Otherwise, type `/account create [account email]` in the server console to create an account.
5. Login with your account name, the code field is ignored by the server and can be set to anything.
5. Login with your account email, the code field is ignored by the server and can be set to anything.
### Server commands
Server commands need to be run in the server console OR in the signature edit menu of your profile.
```
!account {create | delete} [email] (reserved player uid) = Creates or deletes an account.
!char [all | {characterId}] lv(level) a(ascension) s(skill level) t(talent level) = Changes the properties of the targeted characters.
!battlepass [free | premium] lv(level) = Modifies the targeted player's battle pass
!char [all | {characterId}] lv(level) a(ascension) s(skill level) t(talent level) f(affinity level) = Changes the properties of the targeted characters.
!clean [all | {id} ...] [items|resources] = Removes items/resources from the targeted player.
!disc [all | {discId}] lv(level) a(ascension) c(crescendo level) = Changes the properties of the targeted discs.
!give [item id] x[amount] = Gives the targeted player an item through the mail.
!giveall [characters | discs | materials] = Gives the targeted player items.
!mail = Sends the targeted player a system mail.
!help = Displays a list of available commands. (Very spammy in-game)
!level (level) = Sets the player level
!mail "subject" "body" [itemId xQty | itemId:qty ...] = Sends the targeted player a system mail.
!reload = Reloads the server config.
!remote = Creates a player token for remote api usage
```
+1 -1
View File
@@ -29,7 +29,7 @@ java {
}
}
version = '1.0.0'
version = '1.3.0'
var shouldGenerateProto = System.getenv("GENERATE_PROTO") == "true"
System.out.println(shouldGenerateProto ? "Generating proto files" : "Skipping proto generation")
@@ -90,6 +90,16 @@ public final class ActivityDetail {
*/
private final Public.ActivityBuildConvert bdConvert = Public.ActivityBuildConvert.newInstance();
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
*/
private final Public.ActivityTrekkerVersus trekkerVersus = Public.ActivityTrekkerVersus.newInstance();
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
*/
private final Public.ActivityStoryChapter storyChapter = Public.ActivityStoryChapter.newInstance();
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
@@ -883,12 +893,126 @@ public final class ActivityDetail {
return this;
}
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
* @return whether the trekkerVersus field is set
*/
public boolean hasTrekkerVersus() {
return (bitField0_ & 0x00004000) != 0;
}
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
* @return this
*/
public ActivityMsg clearTrekkerVersus() {
bitField0_ &= ~0x00004000;
trekkerVersus.clear();
return this;
}
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableTrekkerVersus()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ActivityTrekkerVersus getTrekkerVersus() {
return trekkerVersus;
}
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ActivityTrekkerVersus getMutableTrekkerVersus() {
bitField0_ |= 0x00004000;
return trekkerVersus;
}
/**
* <code>optional .ActivityTrekkerVersus TrekkerVersus = 15;</code>
* @param value the trekkerVersus to set
* @return this
*/
public ActivityMsg setTrekkerVersus(final Public.ActivityTrekkerVersus value) {
bitField0_ |= 0x00004000;
trekkerVersus.copyFrom(value);
return this;
}
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
* @return whether the storyChapter field is set
*/
public boolean hasStoryChapter() {
return (bitField0_ & 0x00008000) != 0;
}
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
* @return this
*/
public ActivityMsg clearStoryChapter() {
bitField0_ &= ~0x00008000;
storyChapter.clear();
return this;
}
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableStoryChapter()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ActivityStoryChapter getStoryChapter() {
return storyChapter;
}
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ActivityStoryChapter getMutableStoryChapter() {
bitField0_ |= 0x00008000;
return storyChapter;
}
/**
* <code>optional .ActivityStoryChapter StoryChapter = 16;</code>
* @param value the storyChapter to set
* @return this
*/
public ActivityMsg setStoryChapter(final Public.ActivityStoryChapter value) {
bitField0_ |= 0x00008000;
storyChapter.copyFrom(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00004000) != 0;
return (bitField0_ & 0x00010000) != 0;
}
/**
@@ -896,7 +1020,7 @@ public final class ActivityDetail {
* @return this
*/
public ActivityMsg clearNextPackage() {
bitField0_ &= ~0x00004000;
bitField0_ &= ~0x00010000;
nextPackage.clear();
return this;
}
@@ -925,7 +1049,7 @@ public final class ActivityDetail {
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
return nextPackage;
}
@@ -935,7 +1059,7 @@ public final class ActivityDetail {
* @return this
*/
public ActivityMsg addNextPackage(final byte value) {
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
nextPackage.add(value);
return this;
}
@@ -946,7 +1070,7 @@ public final class ActivityDetail {
* @return this
*/
public ActivityMsg addAllNextPackage(final byte... values) {
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
nextPackage.addAll(values);
return this;
}
@@ -957,7 +1081,7 @@ public final class ActivityDetail {
* @return this
*/
public ActivityMsg setNextPackage(final byte... values) {
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
nextPackage.copyFrom(values);
return this;
}
@@ -981,6 +1105,8 @@ public final class ActivityDetail {
task.copyFrom(other.task);
shop.copyFrom(other.shop);
bdConvert.copyFrom(other.bdConvert);
trekkerVersus.copyFrom(other.trekkerVersus);
storyChapter.copyFrom(other.storyChapter);
nextPackage.copyFrom(other.nextPackage);
}
return this;
@@ -1034,6 +1160,12 @@ public final class ActivityDetail {
if (other.hasBdConvert()) {
getMutableBdConvert().mergeFrom(other.bdConvert);
}
if (other.hasTrekkerVersus()) {
getMutableTrekkerVersus().mergeFrom(other.trekkerVersus);
}
if (other.hasStoryChapter()) {
getMutableStoryChapter().mergeFrom(other.storyChapter);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
@@ -1061,6 +1193,8 @@ public final class ActivityDetail {
task.clear();
shop.clear();
bdConvert.clear();
trekkerVersus.clear();
storyChapter.clear();
nextPackage.clear();
return this;
}
@@ -1085,6 +1219,8 @@ public final class ActivityDetail {
task.clearQuick();
shop.clearQuick();
bdConvert.clearQuick();
trekkerVersus.clearQuick();
storyChapter.clearQuick();
nextPackage.clear();
return this;
}
@@ -1113,6 +1249,8 @@ public final class ActivityDetail {
&& (!hasTask() || task.equals(other.task))
&& (!hasShop() || shop.equals(other.shop))
&& (!hasBdConvert() || bdConvert.equals(other.bdConvert))
&& (!hasTrekkerVersus() || trekkerVersus.equals(other.trekkerVersus))
&& (!hasStoryChapter() || storyChapter.equals(other.storyChapter))
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage));
}
@@ -1175,6 +1313,14 @@ public final class ActivityDetail {
output.writeMessageNoTag(bdConvert);
}
if ((bitField0_ & 0x00004000) != 0) {
output.writeRawByte((byte) 122);
output.writeMessageNoTag(trekkerVersus);
}
if ((bitField0_ & 0x00008000) != 0) {
output.writeRawLittleEndian16((short) 386);
output.writeMessageNoTag(storyChapter);
}
if ((bitField0_ & 0x00010000) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
@@ -1226,6 +1372,12 @@ public final class ActivityDetail {
size += 1 + ProtoSink.computeMessageSizeNoTag(bdConvert);
}
if ((bitField0_ & 0x00004000) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(trekkerVersus);
}
if ((bitField0_ & 0x00008000) != 0) {
size += 2 + ProtoSink.computeMessageSizeNoTag(storyChapter);
}
if ((bitField0_ & 0x00010000) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
return size;
@@ -1360,6 +1512,24 @@ public final class ActivityDetail {
input.readMessage(bdConvert);
bitField0_ |= 0x00002000;
tag = input.readTag();
if (tag != 122) {
break;
}
}
case 122: {
// trekkerVersus
input.readMessage(trekkerVersus);
bitField0_ |= 0x00004000;
tag = input.readTag();
if (tag != 130) {
break;
}
}
case 130: {
// storyChapter
input.readMessage(storyChapter);
bitField0_ |= 0x00008000;
tag = input.readTag();
if (tag != 16378) {
break;
}
@@ -1367,7 +1537,7 @@ public final class ActivityDetail {
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
tag = input.readTag();
if (tag != 0) {
break;
@@ -1433,6 +1603,12 @@ public final class ActivityDetail {
output.writeMessage(FieldNames.bdConvert, bdConvert);
}
if ((bitField0_ & 0x00004000) != 0) {
output.writeMessage(FieldNames.trekkerVersus, trekkerVersus);
}
if ((bitField0_ & 0x00008000) != 0) {
output.writeMessage(FieldNames.storyChapter, storyChapter);
}
if ((bitField0_ & 0x00010000) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
output.endObject();
@@ -1599,11 +1775,33 @@ public final class ActivityDetail {
}
break;
}
case -1534874366: {
if (input.isAtField(FieldNames.trekkerVersus)) {
if (!input.trySkipNullValue()) {
input.readMessage(trekkerVersus);
bitField0_ |= 0x00004000;
}
} else {
input.skipUnknownField();
}
break;
}
case -1858182728: {
if (input.isAtField(FieldNames.storyChapter)) {
if (!input.trySkipNullValue()) {
input.readMessage(storyChapter);
bitField0_ |= 0x00008000;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00004000;
bitField0_ |= 0x00010000;
}
} else {
input.skipUnknownField();
@@ -1690,6 +1888,10 @@ public final class ActivityDetail {
static final FieldName bdConvert = FieldName.forField("BdConvert");
static final FieldName trekkerVersus = FieldName.forField("TrekkerVersus");
static final FieldName storyChapter = FieldName.forField("StoryChapter");
static final FieldName nextPackage = FieldName.forField("NextPackage");
}
}
@@ -0,0 +1,543 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
public final class ActivityStoryApply {
/**
* Protobuf type {@code ActivityStoryApplyReq}
*/
public static final class ActivityStoryApplyReq extends ProtoMessage<ActivityStoryApplyReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint64 BuildId = 3;</code>
*/
private long buildId;
/**
* <code>optional uint32 ActivityId = 1;</code>
*/
private int activityId;
/**
* <code>optional uint32 StoryId = 2;</code>
*/
private int storyId;
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
private ActivityStoryApplyReq() {
}
/**
* @return a new empty instance of {@code ActivityStoryApplyReq}
*/
public static ActivityStoryApplyReq newInstance() {
return new ActivityStoryApplyReq();
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return whether the buildId field is set
*/
public boolean hasBuildId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return this
*/
public ActivityStoryApplyReq clearBuildId() {
bitField0_ &= ~0x00000001;
buildId = 0L;
return this;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return the buildId
*/
public long getBuildId() {
return buildId;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @param value the buildId to set
* @return this
*/
public ActivityStoryApplyReq setBuildId(final long value) {
bitField0_ |= 0x00000001;
buildId = value;
return this;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return whether the activityId field is set
*/
public boolean hasActivityId() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return this
*/
public ActivityStoryApplyReq clearActivityId() {
bitField0_ &= ~0x00000002;
activityId = 0;
return this;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return the activityId
*/
public int getActivityId() {
return activityId;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @param value the activityId to set
* @return this
*/
public ActivityStoryApplyReq setActivityId(final int value) {
bitField0_ |= 0x00000002;
activityId = value;
return this;
}
/**
* <code>optional uint32 StoryId = 2;</code>
* @return whether the storyId field is set
*/
public boolean hasStoryId() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 StoryId = 2;</code>
* @return this
*/
public ActivityStoryApplyReq clearStoryId() {
bitField0_ &= ~0x00000004;
storyId = 0;
return this;
}
/**
* <code>optional uint32 StoryId = 2;</code>
* @return the storyId
*/
public int getStoryId() {
return storyId;
}
/**
* <code>optional uint32 StoryId = 2;</code>
* @param value the storyId to set
* @return this
*/
public ActivityStoryApplyReq setStoryId(final int value) {
bitField0_ |= 0x00000004;
storyId = value;
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public ActivityStoryApplyReq clearNextPackage() {
bitField0_ &= ~0x00000008;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000008;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public ActivityStoryApplyReq addNextPackage(final byte value) {
bitField0_ |= 0x00000008;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public ActivityStoryApplyReq addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000008;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public ActivityStoryApplyReq setNextPackage(final byte... values) {
bitField0_ |= 0x00000008;
nextPackage.copyFrom(values);
return this;
}
@Override
public ActivityStoryApplyReq copyFrom(final ActivityStoryApplyReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
buildId = other.buildId;
activityId = other.activityId;
storyId = other.storyId;
nextPackage.copyFrom(other.nextPackage);
}
return this;
}
@Override
public ActivityStoryApplyReq mergeFrom(final ActivityStoryApplyReq other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasBuildId()) {
setBuildId(other.buildId);
}
if (other.hasActivityId()) {
setActivityId(other.activityId);
}
if (other.hasStoryId()) {
setStoryId(other.storyId);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
return this;
}
@Override
public ActivityStoryApplyReq clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buildId = 0L;
activityId = 0;
storyId = 0;
nextPackage.clear();
return this;
}
@Override
public ActivityStoryApplyReq clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ActivityStoryApplyReq)) {
return false;
}
ActivityStoryApplyReq other = (ActivityStoryApplyReq) o;
return bitField0_ == other.bitField0_
&& (!hasBuildId() || buildId == other.buildId)
&& (!hasActivityId() || activityId == other.activityId)
&& (!hasStoryId() || storyId == other.storyId)
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 24);
output.writeUInt64NoTag(buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 8);
output.writeUInt32NoTag(activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 16);
output.writeUInt32NoTag(storyId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt64SizeNoTag(buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(storyId);
}
if ((bitField0_ & 0x00000008) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public ActivityStoryApplyReq mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 24: {
// buildId
buildId = input.readUInt64();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 8) {
break;
}
}
case 8: {
// activityId
activityId = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 16) {
break;
}
}
case 16: {
// storyId
storyId = input.readUInt32();
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000008;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt64(FieldNames.buildId, buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.activityId, activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeUInt32(FieldNames.storyId, storyId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
output.endObject();
}
@Override
public ActivityStoryApplyReq mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 1895597065: {
if (input.isAtField(FieldNames.buildId)) {
if (!input.trySkipNullValue()) {
buildId = input.readUInt64();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -252882774: {
if (input.isAtField(FieldNames.activityId)) {
if (!input.trySkipNullValue()) {
activityId = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -219598640: {
if (input.isAtField(FieldNames.storyId)) {
if (!input.trySkipNullValue()) {
storyId = input.readUInt32();
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public ActivityStoryApplyReq clone() {
return new ActivityStoryApplyReq().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static ActivityStoryApplyReq parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new ActivityStoryApplyReq(), data).checkInitialized();
}
public static ActivityStoryApplyReq parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new ActivityStoryApplyReq(), input).checkInitialized();
}
public static ActivityStoryApplyReq parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new ActivityStoryApplyReq(), input).checkInitialized();
}
/**
* @return factory for creating ActivityStoryApplyReq messages
*/
public static MessageFactory<ActivityStoryApplyReq> getFactory() {
return ActivityStoryApplyReqFactory.INSTANCE;
}
private enum ActivityStoryApplyReqFactory implements MessageFactory<ActivityStoryApplyReq> {
INSTANCE;
@Override
public ActivityStoryApplyReq create() {
return ActivityStoryApplyReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName buildId = FieldName.forField("BuildId");
static final FieldName activityId = FieldName.forField("ActivityId");
static final FieldName storyId = FieldName.forField("StoryId");
static final FieldName nextPackage = FieldName.forField("NextPackage");
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,666 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
import us.hebi.quickbuf.RepeatedInt;
public final class ActivityTrekkerVersusApply {
/**
* Protobuf type {@code ActivityTrekkerVersusApplyReq}
*/
public static final class ActivityTrekkerVersusApplyReq extends ProtoMessage<ActivityTrekkerVersusApplyReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint64 BuildId = 3;</code>
*/
private long buildId;
/**
* <code>optional uint32 ActivityId = 1;</code>
*/
private int activityId;
/**
* <code>optional uint32 LevelId = 2;</code>
*/
private int levelId;
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated uint32 AffixIds = 4;</code>
*/
private final RepeatedInt affixIds = RepeatedInt.newEmptyInstance();
private ActivityTrekkerVersusApplyReq() {
}
/**
* @return a new empty instance of {@code ActivityTrekkerVersusApplyReq}
*/
public static ActivityTrekkerVersusApplyReq newInstance() {
return new ActivityTrekkerVersusApplyReq();
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return whether the buildId field is set
*/
public boolean hasBuildId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return this
*/
public ActivityTrekkerVersusApplyReq clearBuildId() {
bitField0_ &= ~0x00000001;
buildId = 0L;
return this;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @return the buildId
*/
public long getBuildId() {
return buildId;
}
/**
* <code>optional uint64 BuildId = 3;</code>
* @param value the buildId to set
* @return this
*/
public ActivityTrekkerVersusApplyReq setBuildId(final long value) {
bitField0_ |= 0x00000001;
buildId = value;
return this;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return whether the activityId field is set
*/
public boolean hasActivityId() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return this
*/
public ActivityTrekkerVersusApplyReq clearActivityId() {
bitField0_ &= ~0x00000002;
activityId = 0;
return this;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @return the activityId
*/
public int getActivityId() {
return activityId;
}
/**
* <code>optional uint32 ActivityId = 1;</code>
* @param value the activityId to set
* @return this
*/
public ActivityTrekkerVersusApplyReq setActivityId(final int value) {
bitField0_ |= 0x00000002;
activityId = value;
return this;
}
/**
* <code>optional uint32 LevelId = 2;</code>
* @return whether the levelId field is set
*/
public boolean hasLevelId() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 LevelId = 2;</code>
* @return this
*/
public ActivityTrekkerVersusApplyReq clearLevelId() {
bitField0_ &= ~0x00000004;
levelId = 0;
return this;
}
/**
* <code>optional uint32 LevelId = 2;</code>
* @return the levelId
*/
public int getLevelId() {
return levelId;
}
/**
* <code>optional uint32 LevelId = 2;</code>
* @param value the levelId to set
* @return this
*/
public ActivityTrekkerVersusApplyReq setLevelId(final int value) {
bitField0_ |= 0x00000004;
levelId = value;
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public ActivityTrekkerVersusApplyReq clearNextPackage() {
bitField0_ &= ~0x00000008;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000008;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public ActivityTrekkerVersusApplyReq addNextPackage(final byte value) {
bitField0_ |= 0x00000008;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public ActivityTrekkerVersusApplyReq addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000008;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public ActivityTrekkerVersusApplyReq setNextPackage(final byte... values) {
bitField0_ |= 0x00000008;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
* @return whether the affixIds field is set
*/
public boolean hasAffixIds() {
return (bitField0_ & 0x00000010) != 0;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
* @return this
*/
public ActivityTrekkerVersusApplyReq clearAffixIds() {
bitField0_ &= ~0x00000010;
affixIds.clear();
return this;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableAffixIds()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedInt getAffixIds() {
return affixIds;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedInt getMutableAffixIds() {
bitField0_ |= 0x00000010;
return affixIds;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
* @param value the affixIds to add
* @return this
*/
public ActivityTrekkerVersusApplyReq addAffixIds(final int value) {
bitField0_ |= 0x00000010;
affixIds.add(value);
return this;
}
/**
* <code>repeated uint32 AffixIds = 4;</code>
* @param values the affixIds to add
* @return this
*/
public ActivityTrekkerVersusApplyReq addAllAffixIds(final int... values) {
bitField0_ |= 0x00000010;
affixIds.addAll(values);
return this;
}
@Override
public ActivityTrekkerVersusApplyReq copyFrom(final ActivityTrekkerVersusApplyReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
buildId = other.buildId;
activityId = other.activityId;
levelId = other.levelId;
nextPackage.copyFrom(other.nextPackage);
affixIds.copyFrom(other.affixIds);
}
return this;
}
@Override
public ActivityTrekkerVersusApplyReq mergeFrom(final ActivityTrekkerVersusApplyReq other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasBuildId()) {
setBuildId(other.buildId);
}
if (other.hasActivityId()) {
setActivityId(other.activityId);
}
if (other.hasLevelId()) {
setLevelId(other.levelId);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasAffixIds()) {
getMutableAffixIds().addAll(other.affixIds);
}
return this;
}
@Override
public ActivityTrekkerVersusApplyReq clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
buildId = 0L;
activityId = 0;
levelId = 0;
nextPackage.clear();
affixIds.clear();
return this;
}
@Override
public ActivityTrekkerVersusApplyReq clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
affixIds.clear();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ActivityTrekkerVersusApplyReq)) {
return false;
}
ActivityTrekkerVersusApplyReq other = (ActivityTrekkerVersusApplyReq) o;
return bitField0_ == other.bitField0_
&& (!hasBuildId() || buildId == other.buildId)
&& (!hasActivityId() || activityId == other.activityId)
&& (!hasLevelId() || levelId == other.levelId)
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasAffixIds() || affixIds.equals(other.affixIds));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 24);
output.writeUInt64NoTag(buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 8);
output.writeUInt32NoTag(activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 16);
output.writeUInt32NoTag(levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000010) != 0) {
for (int i = 0; i < affixIds.length(); i++) {
output.writeRawByte((byte) 32);
output.writeUInt32NoTag(affixIds.array()[i]);
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt64SizeNoTag(buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000010) != 0) {
size += (1 * affixIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(affixIds);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public ActivityTrekkerVersusApplyReq mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 24: {
// buildId
buildId = input.readUInt64();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 8) {
break;
}
}
case 8: {
// activityId
activityId = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 16) {
break;
}
}
case 16: {
// levelId
levelId = input.readUInt32();
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000008;
tag = input.readTag();
if (tag != 34) {
break;
}
}
case 34: {
// affixIds [packed=true]
input.readPackedUInt32(affixIds, tag);
bitField0_ |= 0x00000010;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
case 32: {
// affixIds [packed=false]
tag = input.readRepeatedUInt32(affixIds, tag);
bitField0_ |= 0x00000010;
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt64(FieldNames.buildId, buildId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.activityId, activityId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeUInt32(FieldNames.levelId, levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000010) != 0) {
output.writeRepeatedUInt32(FieldNames.affixIds, affixIds);
}
output.endObject();
}
@Override
public ActivityTrekkerVersusApplyReq mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 1895597065: {
if (input.isAtField(FieldNames.buildId)) {
if (!input.trySkipNullValue()) {
buildId = input.readUInt64();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -252882774: {
if (input.isAtField(FieldNames.activityId)) {
if (!input.trySkipNullValue()) {
activityId = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case 1734437791: {
if (input.isAtField(FieldNames.levelId)) {
if (!input.trySkipNullValue()) {
levelId = input.readUInt32();
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
case 670408424: {
if (input.isAtField(FieldNames.affixIds)) {
if (!input.trySkipNullValue()) {
input.readRepeatedUInt32(affixIds);
bitField0_ |= 0x00000010;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public ActivityTrekkerVersusApplyReq clone() {
return new ActivityTrekkerVersusApplyReq().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static ActivityTrekkerVersusApplyReq parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusApplyReq(), data).checkInitialized();
}
public static ActivityTrekkerVersusApplyReq parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusApplyReq(), input).checkInitialized();
}
public static ActivityTrekkerVersusApplyReq parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusApplyReq(), input).checkInitialized();
}
/**
* @return factory for creating ActivityTrekkerVersusApplyReq messages
*/
public static MessageFactory<ActivityTrekkerVersusApplyReq> getFactory() {
return ActivityTrekkerVersusApplyReqFactory.INSTANCE;
}
private enum ActivityTrekkerVersusApplyReqFactory implements MessageFactory<ActivityTrekkerVersusApplyReq> {
INSTANCE;
@Override
public ActivityTrekkerVersusApplyReq create() {
return ActivityTrekkerVersusApplyReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName buildId = FieldName.forField("BuildId");
static final FieldName activityId = FieldName.forField("ActivityId");
static final FieldName levelId = FieldName.forField("LevelId");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName affixIds = FieldName.forField("AffixIds");
}
}
}
@@ -0,0 +1,524 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
import us.hebi.quickbuf.RepeatedMessage;
public final class ActivityTrekkerVersusRewardReceive {
/**
* Protobuf type {@code ActivityTrekkerVersusRewardReceiveResp}
*/
public static final class ActivityTrekkerVersusRewardReceiveResp extends ProtoMessage<ActivityTrekkerVersusRewardReceiveResp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .ChangeInfo Change = 1;</code>
*/
private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
*/
private final RepeatedMessage<Public.ItemTpl> awardItems = RepeatedMessage.newEmptyInstance(Public.ItemTpl.getFactory());
private ActivityTrekkerVersusRewardReceiveResp() {
}
/**
* @return a new empty instance of {@code ActivityTrekkerVersusRewardReceiveResp}
*/
public static ActivityTrekkerVersusRewardReceiveResp newInstance() {
return new ActivityTrekkerVersusRewardReceiveResp();
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return whether the change field is set
*/
public boolean hasChange() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp clearChange() {
bitField0_ &= ~0x00000001;
change.clear();
return this;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableChange()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ChangeInfo getChange() {
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ChangeInfo getMutableChange() {
bitField0_ |= 0x00000001;
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @param value the change to set
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp setChange(final Public.ChangeInfo value) {
bitField0_ |= 0x00000001;
change.copyFrom(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp clearNextPackage() {
bitField0_ &= ~0x00000002;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000002;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp addNextPackage(final byte value) {
bitField0_ |= 0x00000002;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000002;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp setNextPackage(final byte... values) {
bitField0_ |= 0x00000002;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
* @return whether the awardItems field is set
*/
public boolean hasAwardItems() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp clearAwardItems() {
bitField0_ &= ~0x00000004;
awardItems.clear();
return this;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableAwardItems()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.ItemTpl> getAwardItems() {
return awardItems;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.ItemTpl> getMutableAwardItems() {
bitField0_ |= 0x00000004;
return awardItems;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
* @param value the awardItems to add
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp addAwardItems(final Public.ItemTpl value) {
bitField0_ |= 0x00000004;
awardItems.add(value);
return this;
}
/**
* <code>repeated .ItemTpl AwardItems = 2;</code>
* @param values the awardItems to add
* @return this
*/
public ActivityTrekkerVersusRewardReceiveResp addAllAwardItems(final Public.ItemTpl... values) {
bitField0_ |= 0x00000004;
awardItems.addAll(values);
return this;
}
@Override
public ActivityTrekkerVersusRewardReceiveResp copyFrom(
final ActivityTrekkerVersusRewardReceiveResp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
change.copyFrom(other.change);
nextPackage.copyFrom(other.nextPackage);
awardItems.copyFrom(other.awardItems);
}
return this;
}
@Override
public ActivityTrekkerVersusRewardReceiveResp mergeFrom(
final ActivityTrekkerVersusRewardReceiveResp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasChange()) {
getMutableChange().mergeFrom(other.change);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasAwardItems()) {
getMutableAwardItems().addAll(other.awardItems);
}
return this;
}
@Override
public ActivityTrekkerVersusRewardReceiveResp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clear();
nextPackage.clear();
awardItems.clear();
return this;
}
@Override
public ActivityTrekkerVersusRewardReceiveResp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clearQuick();
nextPackage.clear();
awardItems.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ActivityTrekkerVersusRewardReceiveResp)) {
return false;
}
ActivityTrekkerVersusRewardReceiveResp other = (ActivityTrekkerVersusRewardReceiveResp) o;
return bitField0_ == other.bitField0_
&& (!hasChange() || change.equals(other.change))
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasAwardItems() || awardItems.equals(other.awardItems));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 10);
output.writeMessageNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
for (int i = 0; i < awardItems.length(); i++) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(awardItems.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
size += (1 * awardItems.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(awardItems);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public ActivityTrekkerVersusRewardReceiveResp mergeFrom(final ProtoSource input) throws
IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 10: {
// change
input.readMessage(change);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// awardItems
tag = input.readRepeatedMessage(awardItems, tag);
bitField0_ |= 0x00000004;
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.change, change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRepeatedMessage(FieldNames.awardItems, awardItems);
}
output.endObject();
}
@Override
public ActivityTrekkerVersusRewardReceiveResp mergeFrom(final JsonSource input) throws
IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 2017198032: {
if (input.isAtField(FieldNames.change)) {
if (!input.trySkipNullValue()) {
input.readMessage(change);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -1943188605: {
if (input.isAtField(FieldNames.awardItems)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(awardItems);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public ActivityTrekkerVersusRewardReceiveResp clone() {
return new ActivityTrekkerVersusRewardReceiveResp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static ActivityTrekkerVersusRewardReceiveResp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusRewardReceiveResp(), data).checkInitialized();
}
public static ActivityTrekkerVersusRewardReceiveResp parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusRewardReceiveResp(), input).checkInitialized();
}
public static ActivityTrekkerVersusRewardReceiveResp parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new ActivityTrekkerVersusRewardReceiveResp(), input).checkInitialized();
}
/**
* @return factory for creating ActivityTrekkerVersusRewardReceiveResp messages
*/
public static MessageFactory<ActivityTrekkerVersusRewardReceiveResp> getFactory() {
return ActivityTrekkerVersusRewardReceiveRespFactory.INSTANCE;
}
private enum ActivityTrekkerVersusRewardReceiveRespFactory implements MessageFactory<ActivityTrekkerVersusRewardReceiveResp> {
INSTANCE;
@Override
public ActivityTrekkerVersusRewardReceiveResp create() {
return ActivityTrekkerVersusRewardReceiveResp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName change = FieldName.forField("Change");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName awardItems = FieldName.forField("AwardItems");
}
}
}
File diff suppressed because it is too large. Load diff
@@ -35,6 +35,11 @@ public final class GachaSpin {
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated .ItemTpl Check = 15;</code>
*/
private final RepeatedMessage<Public.ItemTpl> check = RepeatedMessage.newEmptyInstance(Public.ItemTpl.getFactory());
private GachaSpinReq() {
}
@@ -198,6 +203,74 @@ public final class GachaSpin {
return this;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
* @return whether the check field is set
*/
public boolean hasCheck() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
* @return this
*/
public GachaSpinReq clearCheck() {
bitField0_ &= ~0x00000008;
check.clear();
return this;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableCheck()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.ItemTpl> getCheck() {
return check;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.ItemTpl> getMutableCheck() {
bitField0_ |= 0x00000008;
return check;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
* @param value the check to add
* @return this
*/
public GachaSpinReq addCheck(final Public.ItemTpl value) {
bitField0_ |= 0x00000008;
check.add(value);
return this;
}
/**
* <code>repeated .ItemTpl Check = 15;</code>
* @param values the check to add
* @return this
*/
public GachaSpinReq addAllCheck(final Public.ItemTpl... values) {
bitField0_ |= 0x00000008;
check.addAll(values);
return this;
}
@Override
public GachaSpinReq copyFrom(final GachaSpinReq other) {
cachedSize = other.cachedSize;
@@ -206,6 +279,7 @@ public final class GachaSpin {
id = other.id;
mode = other.mode;
nextPackage.copyFrom(other.nextPackage);
check.copyFrom(other.check);
}
return this;
}
@@ -225,6 +299,9 @@ public final class GachaSpin {
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasCheck()) {
getMutableCheck().addAll(other.check);
}
return this;
}
@@ -238,6 +315,7 @@ public final class GachaSpin {
id = 0;
mode = 0;
nextPackage.clear();
check.clear();
return this;
}
@@ -249,6 +327,7 @@ public final class GachaSpin {
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
check.clearQuick();
return this;
}
@@ -264,7 +343,8 @@ public final class GachaSpin {
return bitField0_ == other.bitField0_
&& (!hasId() || id == other.id)
&& (!hasMode() || mode == other.mode)
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage));
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasCheck() || check.equals(other.check));
}
@Override
@@ -281,6 +361,12 @@ public final class GachaSpin {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
for (int i = 0; i < check.length(); i++) {
output.writeRawByte((byte) 122);
output.writeMessageNoTag(check.get(i));
}
}
}
@Override
@@ -295,6 +381,9 @@ public final class GachaSpin {
if ((bitField0_ & 0x00000004) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
size += (1 * check.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(check);
}
return size;
}
@@ -328,6 +417,14 @@ public final class GachaSpin {
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 122) {
break;
}
}
case 122: {
// check
tag = input.readRepeatedMessage(check, tag);
bitField0_ |= 0x00000008;
if (tag != 0) {
break;
}
@@ -358,6 +455,9 @@ public final class GachaSpin {
if ((bitField0_ & 0x00000004) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRepeatedMessage(FieldNames.check, check);
}
output.endObject();
}
@@ -401,6 +501,17 @@ public final class GachaSpin {
}
break;
}
case 65074408: {
if (input.isAtField(FieldNames.check)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(check);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
@@ -458,6 +569,8 @@ public final class GachaSpin {
static final FieldName mode = FieldName.forField("Mode");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName check = FieldName.forField("Check");
}
}
@@ -2022,4 +2135,518 @@ public final class GachaSpin {
static final FieldName rewards = FieldName.forField("Rewards");
}
}
/**
* Protobuf type {@code GachaSpinSyncResp}
*/
public static final class GachaSpinSyncResp extends ProtoMessage<GachaSpinSyncResp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated .Res Res = 2;</code>
*/
private final RepeatedMessage<Public.Res> res = RepeatedMessage.newEmptyInstance(Public.Res.getFactory());
/**
* <code>repeated .Item Items = 3;</code>
*/
private final RepeatedMessage<Public.Item> items = RepeatedMessage.newEmptyInstance(Public.Item.getFactory());
private GachaSpinSyncResp() {
}
/**
* @return a new empty instance of {@code GachaSpinSyncResp}
*/
public static GachaSpinSyncResp newInstance() {
return new GachaSpinSyncResp();
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public GachaSpinSyncResp clearNextPackage() {
bitField0_ &= ~0x00000001;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000001;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public GachaSpinSyncResp addNextPackage(final byte value) {
bitField0_ |= 0x00000001;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public GachaSpinSyncResp addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000001;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public GachaSpinSyncResp setNextPackage(final byte... values) {
bitField0_ |= 0x00000001;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated .Res Res = 2;</code>
* @return whether the res field is set
*/
public boolean hasRes() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>repeated .Res Res = 2;</code>
* @return this
*/
public GachaSpinSyncResp clearRes() {
bitField0_ &= ~0x00000002;
res.clear();
return this;
}
/**
* <code>repeated .Res Res = 2;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableRes()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.Res> getRes() {
return res;
}
/**
* <code>repeated .Res Res = 2;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.Res> getMutableRes() {
bitField0_ |= 0x00000002;
return res;
}
/**
* <code>repeated .Res Res = 2;</code>
* @param value the res to add
* @return this
*/
public GachaSpinSyncResp addRes(final Public.Res value) {
bitField0_ |= 0x00000002;
res.add(value);
return this;
}
/**
* <code>repeated .Res Res = 2;</code>
* @param values the res to add
* @return this
*/
public GachaSpinSyncResp addAllRes(final Public.Res... values) {
bitField0_ |= 0x00000002;
res.addAll(values);
return this;
}
/**
* <code>repeated .Item Items = 3;</code>
* @return whether the items field is set
*/
public boolean hasItems() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>repeated .Item Items = 3;</code>
* @return this
*/
public GachaSpinSyncResp clearItems() {
bitField0_ &= ~0x00000004;
items.clear();
return this;
}
/**
* <code>repeated .Item Items = 3;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableItems()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.Item> getItems() {
return items;
}
/**
* <code>repeated .Item Items = 3;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.Item> getMutableItems() {
bitField0_ |= 0x00000004;
return items;
}
/**
* <code>repeated .Item Items = 3;</code>
* @param value the items to add
* @return this
*/
public GachaSpinSyncResp addItems(final Public.Item value) {
bitField0_ |= 0x00000004;
items.add(value);
return this;
}
/**
* <code>repeated .Item Items = 3;</code>
* @param values the items to add
* @return this
*/
public GachaSpinSyncResp addAllItems(final Public.Item... values) {
bitField0_ |= 0x00000004;
items.addAll(values);
return this;
}
@Override
public GachaSpinSyncResp copyFrom(final GachaSpinSyncResp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
nextPackage.copyFrom(other.nextPackage);
res.copyFrom(other.res);
items.copyFrom(other.items);
}
return this;
}
@Override
public GachaSpinSyncResp mergeFrom(final GachaSpinSyncResp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasRes()) {
getMutableRes().addAll(other.res);
}
if (other.hasItems()) {
getMutableItems().addAll(other.items);
}
return this;
}
@Override
public GachaSpinSyncResp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
res.clear();
items.clear();
return this;
}
@Override
public GachaSpinSyncResp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
res.clearQuick();
items.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof GachaSpinSyncResp)) {
return false;
}
GachaSpinSyncResp other = (GachaSpinSyncResp) o;
return bitField0_ == other.bitField0_
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasRes() || res.equals(other.res))
&& (!hasItems() || items.equals(other.items));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000002) != 0) {
for (int i = 0; i < res.length(); i++) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(res.get(i));
}
}
if ((bitField0_ & 0x00000004) != 0) {
for (int i = 0; i < items.length(); i++) {
output.writeRawByte((byte) 26);
output.writeMessageNoTag(items.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000002) != 0) {
size += (1 * res.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(res);
}
if ((bitField0_ & 0x00000004) != 0) {
size += (1 * items.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(items);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public GachaSpinSyncResp mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// res
tag = input.readRepeatedMessage(res, tag);
bitField0_ |= 0x00000002;
if (tag != 26) {
break;
}
}
case 26: {
// items
tag = input.readRepeatedMessage(items, tag);
bitField0_ |= 0x00000004;
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRepeatedMessage(FieldNames.res, res);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRepeatedMessage(FieldNames.items, items);
}
output.endObject();
}
@Override
public GachaSpinSyncResp mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 82048: {
if (input.isAtField(FieldNames.res)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(res);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case 70973344: {
if (input.isAtField(FieldNames.items)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(items);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public GachaSpinSyncResp clone() {
return new GachaSpinSyncResp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static GachaSpinSyncResp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new GachaSpinSyncResp(), data).checkInitialized();
}
public static GachaSpinSyncResp parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new GachaSpinSyncResp(), input).checkInitialized();
}
public static GachaSpinSyncResp parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new GachaSpinSyncResp(), input).checkInitialized();
}
/**
* @return factory for creating GachaSpinSyncResp messages
*/
public static MessageFactory<GachaSpinSyncResp> getFactory() {
return GachaSpinSyncRespFactory.INSTANCE;
}
private enum GachaSpinSyncRespFactory implements MessageFactory<GachaSpinSyncResp> {
INSTANCE;
@Override
public GachaSpinSyncResp create() {
return GachaSpinSyncResp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName res = FieldName.forField("Res");
static final FieldName items = FieldName.forField("Items");
}
}
}
@@ -10948,4 +10948,607 @@ public final class NotifyGm {
static final FieldName levels = FieldName.forField("levels");
}
}
/**
* Protobuf type {@code AssistAddBuildNotify}
*/
public static final class AssistAddBuildNotify extends ProtoMessage<AssistAddBuildNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .ChangeInfo Change = 1;</code>
*/
private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*/
private final PublicStarTower.StarTowerBuildInfo buildInfo = PublicStarTower.StarTowerBuildInfo.newInstance();
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*/
private final RepeatedMessage<Public.ItemTpl> buildRewards = RepeatedMessage.newEmptyInstance(Public.ItemTpl.getFactory());
private AssistAddBuildNotify() {
}
/**
* @return a new empty instance of {@code AssistAddBuildNotify}
*/
public static AssistAddBuildNotify newInstance() {
return new AssistAddBuildNotify();
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return whether the change field is set
*/
public boolean hasChange() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return this
*/
public AssistAddBuildNotify clearChange() {
bitField0_ &= ~0x00000001;
change.clear();
return this;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableChange()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ChangeInfo getChange() {
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ChangeInfo getMutableChange() {
bitField0_ |= 0x00000001;
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @param value the change to set
* @return this
*/
public AssistAddBuildNotify setChange(final Public.ChangeInfo value) {
bitField0_ |= 0x00000001;
change.copyFrom(value);
return this;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @return whether the buildInfo field is set
*/
public boolean hasBuildInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @return this
*/
public AssistAddBuildNotify clearBuildInfo() {
bitField0_ &= ~0x00000002;
buildInfo.clear();
return this;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableBuildInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public PublicStarTower.StarTowerBuildInfo getBuildInfo() {
return buildInfo;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public PublicStarTower.StarTowerBuildInfo getMutableBuildInfo() {
bitField0_ |= 0x00000002;
return buildInfo;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @param value the buildInfo to set
* @return this
*/
public AssistAddBuildNotify setBuildInfo(final PublicStarTower.StarTowerBuildInfo value) {
bitField0_ |= 0x00000002;
buildInfo.copyFrom(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public AssistAddBuildNotify clearNextPackage() {
bitField0_ &= ~0x00000004;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000004;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public AssistAddBuildNotify addNextPackage(final byte value) {
bitField0_ |= 0x00000004;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public AssistAddBuildNotify addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public AssistAddBuildNotify setNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @return whether the buildRewards field is set
*/
public boolean hasBuildRewards() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @return this
*/
public AssistAddBuildNotify clearBuildRewards() {
bitField0_ &= ~0x00000008;
buildRewards.clear();
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableBuildRewards()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.ItemTpl> getBuildRewards() {
return buildRewards;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.ItemTpl> getMutableBuildRewards() {
bitField0_ |= 0x00000008;
return buildRewards;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @param value the buildRewards to add
* @return this
*/
public AssistAddBuildNotify addBuildRewards(final Public.ItemTpl value) {
bitField0_ |= 0x00000008;
buildRewards.add(value);
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @param values the buildRewards to add
* @return this
*/
public AssistAddBuildNotify addAllBuildRewards(final Public.ItemTpl... values) {
bitField0_ |= 0x00000008;
buildRewards.addAll(values);
return this;
}
@Override
public AssistAddBuildNotify copyFrom(final AssistAddBuildNotify other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
change.copyFrom(other.change);
buildInfo.copyFrom(other.buildInfo);
nextPackage.copyFrom(other.nextPackage);
buildRewards.copyFrom(other.buildRewards);
}
return this;
}
@Override
public AssistAddBuildNotify mergeFrom(final AssistAddBuildNotify other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasChange()) {
getMutableChange().mergeFrom(other.change);
}
if (other.hasBuildInfo()) {
getMutableBuildInfo().mergeFrom(other.buildInfo);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasBuildRewards()) {
getMutableBuildRewards().addAll(other.buildRewards);
}
return this;
}
@Override
public AssistAddBuildNotify clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clear();
buildInfo.clear();
nextPackage.clear();
buildRewards.clear();
return this;
}
@Override
public AssistAddBuildNotify clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clearQuick();
buildInfo.clearQuick();
nextPackage.clear();
buildRewards.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AssistAddBuildNotify)) {
return false;
}
AssistAddBuildNotify other = (AssistAddBuildNotify) o;
return bitField0_ == other.bitField0_
&& (!hasChange() || change.equals(other.change))
&& (!hasBuildInfo() || buildInfo.equals(other.buildInfo))
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasBuildRewards() || buildRewards.equals(other.buildRewards));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 10);
output.writeMessageNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 26);
output.writeMessageNoTag(buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
for (int i = 0; i < buildRewards.length(); i++) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(buildRewards.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
size += (1 * buildRewards.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(buildRewards);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public AssistAddBuildNotify mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 10: {
// change
input.readMessage(change);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 26) {
break;
}
}
case 26: {
// buildInfo
input.readMessage(buildInfo);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// buildRewards
tag = input.readRepeatedMessage(buildRewards, tag);
bitField0_ |= 0x00000008;
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.change, change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.buildInfo, buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRepeatedMessage(FieldNames.buildRewards, buildRewards);
}
output.endObject();
}
@Override
public AssistAddBuildNotify mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 2017198032: {
if (input.isAtField(FieldNames.change)) {
if (!input.trySkipNullValue()) {
input.readMessage(change);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 602658844: {
if (input.isAtField(FieldNames.buildInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(buildInfo);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case 1656054: {
if (input.isAtField(FieldNames.buildRewards)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(buildRewards);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public AssistAddBuildNotify clone() {
return new AssistAddBuildNotify().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static AssistAddBuildNotify parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new AssistAddBuildNotify(), data).checkInitialized();
}
public static AssistAddBuildNotify parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistAddBuildNotify(), input).checkInitialized();
}
public static AssistAddBuildNotify parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistAddBuildNotify(), input).checkInitialized();
}
/**
* @return factory for creating AssistAddBuildNotify messages
*/
public static MessageFactory<AssistAddBuildNotify> getFactory() {
return AssistAddBuildNotifyFactory.INSTANCE;
}
private enum AssistAddBuildNotifyFactory implements MessageFactory<AssistAddBuildNotify> {
INSTANCE;
@Override
public AssistAddBuildNotify create() {
return AssistAddBuildNotify.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName change = FieldName.forField("Change");
static final FieldName buildInfo = FieldName.forField("BuildInfo");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName buildRewards = FieldName.forField("BuildRewards");
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,619 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
import us.hebi.quickbuf.RepeatedMessage;
public final class QuestAssistGroupRewardReceive {
/**
* Protobuf type {@code AssistGroupRewardResp}
*/
public static final class AssistGroupRewardResp extends ProtoMessage<AssistGroupRewardResp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .ChangeInfo Change = 1;</code>
*/
private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*/
private final PublicStarTower.StarTowerBuildInfo buildInfo = PublicStarTower.StarTowerBuildInfo.newInstance();
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*/
private final RepeatedMessage<Public.ItemTpl> buildRewards = RepeatedMessage.newEmptyInstance(Public.ItemTpl.getFactory());
private AssistGroupRewardResp() {
}
/**
* @return a new empty instance of {@code AssistGroupRewardResp}
*/
public static AssistGroupRewardResp newInstance() {
return new AssistGroupRewardResp();
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return whether the change field is set
*/
public boolean hasChange() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @return this
*/
public AssistGroupRewardResp clearChange() {
bitField0_ &= ~0x00000001;
change.clear();
return this;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableChange()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ChangeInfo getChange() {
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ChangeInfo getMutableChange() {
bitField0_ |= 0x00000001;
return change;
}
/**
* <code>optional .ChangeInfo Change = 1;</code>
* @param value the change to set
* @return this
*/
public AssistGroupRewardResp setChange(final Public.ChangeInfo value) {
bitField0_ |= 0x00000001;
change.copyFrom(value);
return this;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @return whether the buildInfo field is set
*/
public boolean hasBuildInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @return this
*/
public AssistGroupRewardResp clearBuildInfo() {
bitField0_ &= ~0x00000002;
buildInfo.clear();
return this;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableBuildInfo()} if you want to modify it.
*
* @return internal storage object for reading
*/
public PublicStarTower.StarTowerBuildInfo getBuildInfo() {
return buildInfo;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public PublicStarTower.StarTowerBuildInfo getMutableBuildInfo() {
bitField0_ |= 0x00000002;
return buildInfo;
}
/**
* <code>optional .StarTowerBuildInfo BuildInfo = 3;</code>
* @param value the buildInfo to set
* @return this
*/
public AssistGroupRewardResp setBuildInfo(final PublicStarTower.StarTowerBuildInfo value) {
bitField0_ |= 0x00000002;
buildInfo.copyFrom(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public AssistGroupRewardResp clearNextPackage() {
bitField0_ &= ~0x00000004;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000004;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public AssistGroupRewardResp addNextPackage(final byte value) {
bitField0_ |= 0x00000004;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public AssistGroupRewardResp addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public AssistGroupRewardResp setNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @return whether the buildRewards field is set
*/
public boolean hasBuildRewards() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @return this
*/
public AssistGroupRewardResp clearBuildRewards() {
bitField0_ &= ~0x00000008;
buildRewards.clear();
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableBuildRewards()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<Public.ItemTpl> getBuildRewards() {
return buildRewards;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedMessage<Public.ItemTpl> getMutableBuildRewards() {
bitField0_ |= 0x00000008;
return buildRewards;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @param value the buildRewards to add
* @return this
*/
public AssistGroupRewardResp addBuildRewards(final Public.ItemTpl value) {
bitField0_ |= 0x00000008;
buildRewards.add(value);
return this;
}
/**
* <code>repeated .ItemTpl BuildRewards = 2;</code>
* @param values the buildRewards to add
* @return this
*/
public AssistGroupRewardResp addAllBuildRewards(final Public.ItemTpl... values) {
bitField0_ |= 0x00000008;
buildRewards.addAll(values);
return this;
}
@Override
public AssistGroupRewardResp copyFrom(final AssistGroupRewardResp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
change.copyFrom(other.change);
buildInfo.copyFrom(other.buildInfo);
nextPackage.copyFrom(other.nextPackage);
buildRewards.copyFrom(other.buildRewards);
}
return this;
}
@Override
public AssistGroupRewardResp mergeFrom(final AssistGroupRewardResp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasChange()) {
getMutableChange().mergeFrom(other.change);
}
if (other.hasBuildInfo()) {
getMutableBuildInfo().mergeFrom(other.buildInfo);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasBuildRewards()) {
getMutableBuildRewards().addAll(other.buildRewards);
}
return this;
}
@Override
public AssistGroupRewardResp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clear();
buildInfo.clear();
nextPackage.clear();
buildRewards.clear();
return this;
}
@Override
public AssistGroupRewardResp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clearQuick();
buildInfo.clearQuick();
nextPackage.clear();
buildRewards.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AssistGroupRewardResp)) {
return false;
}
AssistGroupRewardResp other = (AssistGroupRewardResp) o;
return bitField0_ == other.bitField0_
&& (!hasChange() || change.equals(other.change))
&& (!hasBuildInfo() || buildInfo.equals(other.buildInfo))
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasBuildRewards() || buildRewards.equals(other.buildRewards));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 10);
output.writeMessageNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 26);
output.writeMessageNoTag(buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
for (int i = 0; i < buildRewards.length(); i++) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(buildRewards.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
size += (1 * buildRewards.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(buildRewards);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public AssistGroupRewardResp mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 10: {
// change
input.readMessage(change);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 26) {
break;
}
}
case 26: {
// buildInfo
input.readMessage(buildInfo);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// buildRewards
tag = input.readRepeatedMessage(buildRewards, tag);
bitField0_ |= 0x00000008;
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.change, change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.buildInfo, buildInfo);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRepeatedMessage(FieldNames.buildRewards, buildRewards);
}
output.endObject();
}
@Override
public AssistGroupRewardResp mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 2017198032: {
if (input.isAtField(FieldNames.change)) {
if (!input.trySkipNullValue()) {
input.readMessage(change);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 602658844: {
if (input.isAtField(FieldNames.buildInfo)) {
if (!input.trySkipNullValue()) {
input.readMessage(buildInfo);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case 1656054: {
if (input.isAtField(FieldNames.buildRewards)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(buildRewards);
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public AssistGroupRewardResp clone() {
return new AssistGroupRewardResp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static AssistGroupRewardResp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new AssistGroupRewardResp(), data).checkInitialized();
}
public static AssistGroupRewardResp parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistGroupRewardResp(), input).checkInitialized();
}
public static AssistGroupRewardResp parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistGroupRewardResp(), input).checkInitialized();
}
/**
* @return factory for creating AssistGroupRewardResp messages
*/
public static MessageFactory<AssistGroupRewardResp> getFactory() {
return AssistGroupRewardRespFactory.INSTANCE;
}
private enum AssistGroupRewardRespFactory implements MessageFactory<AssistGroupRewardResp> {
INSTANCE;
@Override
public AssistGroupRewardResp create() {
return AssistGroupRewardResp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName change = FieldName.forField("Change");
static final FieldName buildInfo = FieldName.forField("BuildInfo");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName buildRewards = FieldName.forField("BuildRewards");
}
}
}
@@ -0,0 +1,463 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
public final class QuestAssistRewardReceive {
/**
* Protobuf type {@code AssistQuestReceiveReq}
*/
public static final class AssistQuestReceiveReq extends ProtoMessage<AssistQuestReceiveReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 Group = 1;</code>
*/
private int group;
/**
* <code>optional uint32 Quest = 2;</code>
*/
private int quest;
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
private AssistQuestReceiveReq() {
}
/**
* @return a new empty instance of {@code AssistQuestReceiveReq}
*/
public static AssistQuestReceiveReq newInstance() {
return new AssistQuestReceiveReq();
}
/**
* <code>optional uint32 Group = 1;</code>
* @return whether the group field is set
*/
public boolean hasGroup() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 Group = 1;</code>
* @return this
*/
public AssistQuestReceiveReq clearGroup() {
bitField0_ &= ~0x00000001;
group = 0;
return this;
}
/**
* <code>optional uint32 Group = 1;</code>
* @return the group
*/
public int getGroup() {
return group;
}
/**
* <code>optional uint32 Group = 1;</code>
* @param value the group to set
* @return this
*/
public AssistQuestReceiveReq setGroup(final int value) {
bitField0_ |= 0x00000001;
group = value;
return this;
}
/**
* <code>optional uint32 Quest = 2;</code>
* @return whether the quest field is set
*/
public boolean hasQuest() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 Quest = 2;</code>
* @return this
*/
public AssistQuestReceiveReq clearQuest() {
bitField0_ &= ~0x00000002;
quest = 0;
return this;
}
/**
* <code>optional uint32 Quest = 2;</code>
* @return the quest
*/
public int getQuest() {
return quest;
}
/**
* <code>optional uint32 Quest = 2;</code>
* @param value the quest to set
* @return this
*/
public AssistQuestReceiveReq setQuest(final int value) {
bitField0_ |= 0x00000002;
quest = value;
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public AssistQuestReceiveReq clearNextPackage() {
bitField0_ &= ~0x00000004;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000004;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public AssistQuestReceiveReq addNextPackage(final byte value) {
bitField0_ |= 0x00000004;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public AssistQuestReceiveReq addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public AssistQuestReceiveReq setNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
nextPackage.copyFrom(values);
return this;
}
@Override
public AssistQuestReceiveReq copyFrom(final AssistQuestReceiveReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
group = other.group;
quest = other.quest;
nextPackage.copyFrom(other.nextPackage);
}
return this;
}
@Override
public AssistQuestReceiveReq mergeFrom(final AssistQuestReceiveReq other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasGroup()) {
setGroup(other.group);
}
if (other.hasQuest()) {
setQuest(other.quest);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
return this;
}
@Override
public AssistQuestReceiveReq clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
group = 0;
quest = 0;
nextPackage.clear();
return this;
}
@Override
public AssistQuestReceiveReq clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
nextPackage.clear();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AssistQuestReceiveReq)) {
return false;
}
AssistQuestReceiveReq other = (AssistQuestReceiveReq) o;
return bitField0_ == other.bitField0_
&& (!hasGroup() || group == other.group)
&& (!hasQuest() || quest == other.quest)
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 8);
output.writeUInt32NoTag(group);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 16);
output.writeUInt32NoTag(quest);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(group);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(quest);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public AssistQuestReceiveReq mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 8: {
// group
group = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 16) {
break;
}
}
case 16: {
// quest
quest = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.group, group);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.quest, quest);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
output.endObject();
}
@Override
public AssistQuestReceiveReq mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 69076575: {
if (input.isAtField(FieldNames.group)) {
if (!input.trySkipNullValue()) {
group = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case 78391490: {
if (input.isAtField(FieldNames.quest)) {
if (!input.trySkipNullValue()) {
quest = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public AssistQuestReceiveReq clone() {
return new AssistQuestReceiveReq().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static AssistQuestReceiveReq parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new AssistQuestReceiveReq(), data).checkInitialized();
}
public static AssistQuestReceiveReq parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistQuestReceiveReq(), input).checkInitialized();
}
public static AssistQuestReceiveReq parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new AssistQuestReceiveReq(), input).checkInitialized();
}
/**
* @return factory for creating AssistQuestReceiveReq messages
*/
public static MessageFactory<AssistQuestReceiveReq> getFactory() {
return AssistQuestReceiveReqFactory.INSTANCE;
}
private enum AssistQuestReceiveReqFactory implements MessageFactory<AssistQuestReceiveReq> {
INSTANCE;
@Override
public AssistQuestReceiveReq create() {
return AssistQuestReceiveReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName group = FieldName.forField("Group");
static final FieldName quest = FieldName.forField("Quest");
static final FieldName nextPackage = FieldName.forField("NextPackage");
}
}
}
@@ -0,0 +1,530 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
import us.hebi.quickbuf.RepeatedInt;
public final class QuestWeeklyActiveRewardRecevie {
/**
* Protobuf type {@code QuestWeeklyActiveRewardReceiveResp}
*/
public static final class QuestWeeklyActiveRewardReceiveResp extends ProtoMessage<QuestWeeklyActiveRewardReceiveResp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .ChangeInfo Change = 2;</code>
*/
private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();
/**
* <code>repeated uint32 ActiveIds = 1;</code>
*/
private final RepeatedInt activeIds = RepeatedInt.newEmptyInstance();
private QuestWeeklyActiveRewardReceiveResp() {
}
/**
* @return a new empty instance of {@code QuestWeeklyActiveRewardReceiveResp}
*/
public static QuestWeeklyActiveRewardReceiveResp newInstance() {
return new QuestWeeklyActiveRewardReceiveResp();
}
/**
* <code>optional .ChangeInfo Change = 2;</code>
* @return whether the change field is set
*/
public boolean hasChange() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .ChangeInfo Change = 2;</code>
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp clearChange() {
bitField0_ &= ~0x00000001;
change.clear();
return this;
}
/**
* <code>optional .ChangeInfo Change = 2;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableChange()} if you want to modify it.
*
* @return internal storage object for reading
*/
public Public.ChangeInfo getChange() {
return change;
}
/**
* <code>optional .ChangeInfo Change = 2;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public Public.ChangeInfo getMutableChange() {
bitField0_ |= 0x00000001;
return change;
}
/**
* <code>optional .ChangeInfo Change = 2;</code>
* @param value the change to set
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp setChange(final Public.ChangeInfo value) {
bitField0_ |= 0x00000001;
change.copyFrom(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp clearNextPackage() {
bitField0_ &= ~0x00000002;
nextPackage.clear();
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableNextPackage()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedByte getNextPackage() {
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000002;
return nextPackage;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param value the nextPackage to add
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp addNextPackage(final byte value) {
bitField0_ |= 0x00000002;
nextPackage.add(value);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to add
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000002;
nextPackage.addAll(values);
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @param values the nextPackage to set
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp setNextPackage(final byte... values) {
bitField0_ |= 0x00000002;
nextPackage.copyFrom(values);
return this;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
* @return whether the activeIds field is set
*/
public boolean hasActiveIds() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp clearActiveIds() {
bitField0_ &= ~0x00000004;
activeIds.clear();
return this;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableActiveIds()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedInt getActiveIds() {
return activeIds;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public RepeatedInt getMutableActiveIds() {
bitField0_ |= 0x00000004;
return activeIds;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
* @param value the activeIds to add
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp addActiveIds(final int value) {
bitField0_ |= 0x00000004;
activeIds.add(value);
return this;
}
/**
* <code>repeated uint32 ActiveIds = 1;</code>
* @param values the activeIds to add
* @return this
*/
public QuestWeeklyActiveRewardReceiveResp addAllActiveIds(final int... values) {
bitField0_ |= 0x00000004;
activeIds.addAll(values);
return this;
}
@Override
public QuestWeeklyActiveRewardReceiveResp copyFrom(
final QuestWeeklyActiveRewardReceiveResp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
change.copyFrom(other.change);
nextPackage.copyFrom(other.nextPackage);
activeIds.copyFrom(other.activeIds);
}
return this;
}
@Override
public QuestWeeklyActiveRewardReceiveResp mergeFrom(
final QuestWeeklyActiveRewardReceiveResp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasChange()) {
getMutableChange().mergeFrom(other.change);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
if (other.hasActiveIds()) {
getMutableActiveIds().addAll(other.activeIds);
}
return this;
}
@Override
public QuestWeeklyActiveRewardReceiveResp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clear();
nextPackage.clear();
activeIds.clear();
return this;
}
@Override
public QuestWeeklyActiveRewardReceiveResp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
change.clearQuick();
nextPackage.clear();
activeIds.clear();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof QuestWeeklyActiveRewardReceiveResp)) {
return false;
}
QuestWeeklyActiveRewardReceiveResp other = (QuestWeeklyActiveRewardReceiveResp) o;
return bitField0_ == other.bitField0_
&& (!hasChange() || change.equals(other.change))
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasActiveIds() || activeIds.equals(other.activeIds));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
for (int i = 0; i < activeIds.length(); i++) {
output.writeRawByte((byte) 8);
output.writeUInt32NoTag(activeIds.array()[i]);
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(change);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
size += (1 * activeIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(activeIds);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public QuestWeeklyActiveRewardReceiveResp mergeFrom(final ProtoSource input) throws
IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 18: {
// change
input.readMessage(change);
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 16378) {
break;
}
}
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 10) {
break;
}
}
case 10: {
// activeIds [packed=true]
input.readPackedUInt32(activeIds, tag);
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
case 8: {
// activeIds [packed=false]
tag = input.readRepeatedUInt32(activeIds, tag);
bitField0_ |= 0x00000004;
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.change, change);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRepeatedUInt32(FieldNames.activeIds, activeIds);
}
output.endObject();
}
@Override
public QuestWeeklyActiveRewardReceiveResp mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 2017198032: {
if (input.isAtField(FieldNames.change)) {
if (!input.trySkipNullValue()) {
input.readMessage(change);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -2086528590: {
if (input.isAtField(FieldNames.activeIds)) {
if (!input.trySkipNullValue()) {
input.readRepeatedUInt32(activeIds);
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public QuestWeeklyActiveRewardReceiveResp clone() {
return new QuestWeeklyActiveRewardReceiveResp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static QuestWeeklyActiveRewardReceiveResp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new QuestWeeklyActiveRewardReceiveResp(), data).checkInitialized();
}
public static QuestWeeklyActiveRewardReceiveResp parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new QuestWeeklyActiveRewardReceiveResp(), input).checkInitialized();
}
public static QuestWeeklyActiveRewardReceiveResp parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new QuestWeeklyActiveRewardReceiveResp(), input).checkInitialized();
}
/**
* @return factory for creating QuestWeeklyActiveRewardReceiveResp messages
*/
public static MessageFactory<QuestWeeklyActiveRewardReceiveResp> getFactory() {
return QuestWeeklyActiveRewardReceiveRespFactory.INSTANCE;
}
private enum QuestWeeklyActiveRewardReceiveRespFactory implements MessageFactory<QuestWeeklyActiveRewardReceiveResp> {
INSTANCE;
@Override
public QuestWeeklyActiveRewardReceiveResp create() {
return QuestWeeklyActiveRewardReceiveResp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName change = FieldName.forField("Change");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName activeIds = FieldName.forField("ActiveIds");
}
}
}
@@ -0,0 +1,5 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;
public final class QuestWeeklyRewardRecevie {
}
@@ -1262,6 +1262,11 @@ public final class ScoreBossRank {
*/
private int levelScore;
/**
* <code>optional uint32 LevelId = 4;</code>
*/
private int levelId;
/**
* <code>optional bytes NextPackage = 2047;</code>
*/
@@ -1356,12 +1361,49 @@ public final class ScoreBossRank {
return this;
}
/**
* <code>optional uint32 LevelId = 4;</code>
* @return whether the levelId field is set
*/
public boolean hasLevelId() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 LevelId = 4;</code>
* @return this
*/
public ScoreBossRankTeam clearLevelId() {
bitField0_ &= ~0x00000004;
levelId = 0;
return this;
}
/**
* <code>optional uint32 LevelId = 4;</code>
* @return the levelId
*/
public int getLevelId() {
return levelId;
}
/**
* <code>optional uint32 LevelId = 4;</code>
* @param value the levelId to set
* @return this
*/
public ScoreBossRankTeam setLevelId(final int value) {
bitField0_ |= 0x00000004;
levelId = value;
return this;
}
/**
* <code>optional bytes NextPackage = 2047;</code>
* @return whether the nextPackage field is set
*/
public boolean hasNextPackage() {
return (bitField0_ & 0x00000004) != 0;
return (bitField0_ & 0x00000008) != 0;
}
/**
@@ -1369,7 +1411,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam clearNextPackage() {
bitField0_ &= ~0x00000004;
bitField0_ &= ~0x00000008;
nextPackage.clear();
return this;
}
@@ -1398,7 +1440,7 @@ public final class ScoreBossRank {
* @return internal storage object for modifications
*/
public RepeatedByte getMutableNextPackage() {
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
return nextPackage;
}
@@ -1408,7 +1450,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam addNextPackage(final byte value) {
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
nextPackage.add(value);
return this;
}
@@ -1419,7 +1461,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam addAllNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
nextPackage.addAll(values);
return this;
}
@@ -1430,7 +1472,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam setNextPackage(final byte... values) {
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
nextPackage.copyFrom(values);
return this;
}
@@ -1440,7 +1482,7 @@ public final class ScoreBossRank {
* @return whether the chars field is set
*/
public boolean hasChars() {
return (bitField0_ & 0x00000008) != 0;
return (bitField0_ & 0x00000010) != 0;
}
/**
@@ -1448,7 +1490,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam clearChars() {
bitField0_ &= ~0x00000008;
bitField0_ &= ~0x00000010;
chars.clear();
return this;
}
@@ -1477,7 +1519,7 @@ public final class ScoreBossRank {
* @return internal storage object for modifications
*/
public RepeatedMessage<ScoreBossRankChar> getMutableChars() {
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000010;
return chars;
}
@@ -1487,7 +1529,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam addChars(final ScoreBossRankChar value) {
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000010;
chars.add(value);
return this;
}
@@ -1498,7 +1540,7 @@ public final class ScoreBossRank {
* @return this
*/
public ScoreBossRankTeam addAllChars(final ScoreBossRankChar... values) {
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000010;
chars.addAll(values);
return this;
}
@@ -1510,6 +1552,7 @@ public final class ScoreBossRank {
bitField0_ = other.bitField0_;
buildScore = other.buildScore;
levelScore = other.levelScore;
levelId = other.levelId;
nextPackage.copyFrom(other.nextPackage);
chars.copyFrom(other.chars);
}
@@ -1528,6 +1571,9 @@ public final class ScoreBossRank {
if (other.hasLevelScore()) {
setLevelScore(other.levelScore);
}
if (other.hasLevelId()) {
setLevelId(other.levelId);
}
if (other.hasNextPackage()) {
getMutableNextPackage().copyFrom(other.nextPackage);
}
@@ -1546,6 +1592,7 @@ public final class ScoreBossRank {
bitField0_ = 0;
buildScore = 0;
levelScore = 0;
levelId = 0;
nextPackage.clear();
chars.clear();
return this;
@@ -1575,6 +1622,7 @@ public final class ScoreBossRank {
return bitField0_ == other.bitField0_
&& (!hasBuildScore() || buildScore == other.buildScore)
&& (!hasLevelScore() || levelScore == other.levelScore)
&& (!hasLevelId() || levelId == other.levelId)
&& (!hasNextPackage() || nextPackage.equals(other.nextPackage))
&& (!hasChars() || chars.equals(other.chars));
}
@@ -1590,10 +1638,14 @@ public final class ScoreBossRank {
output.writeUInt32NoTag(levelScore);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 32);
output.writeUInt32NoTag(levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRawLittleEndian16((short) 32762);
output.writeBytesNoTag(nextPackage);
}
if ((bitField0_ & 0x00000008) != 0) {
if ((bitField0_ & 0x00000010) != 0) {
for (int i = 0; i < chars.length(); i++) {
output.writeRawByte((byte) 18);
output.writeMessageNoTag(chars.get(i));
@@ -1611,9 +1663,12 @@ public final class ScoreBossRank {
size += 1 + ProtoSink.computeUInt32SizeNoTag(levelScore);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
size += 1 + ProtoSink.computeUInt32SizeNoTag(levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
}
if ((bitField0_ & 0x00000010) != 0) {
size += (1 * chars.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(chars);
}
return size;
@@ -1640,6 +1695,15 @@ public final class ScoreBossRank {
levelScore = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 32) {
break;
}
}
case 32: {
// levelId
levelId = input.readUInt32();
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 16378) {
break;
}
@@ -1647,7 +1711,7 @@ public final class ScoreBossRank {
case 16378: {
// nextPackage
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
tag = input.readTag();
if (tag != 18) {
break;
@@ -1656,7 +1720,7 @@ public final class ScoreBossRank {
case 18: {
// chars
tag = input.readRepeatedMessage(chars, tag);
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000010;
if (tag != 0) {
break;
}
@@ -1685,9 +1749,12 @@ public final class ScoreBossRank {
output.writeUInt32(FieldNames.levelScore, levelScore);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
output.writeUInt32(FieldNames.levelId, levelId);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeBytes(FieldNames.nextPackage, nextPackage);
}
if ((bitField0_ & 0x00000010) != 0) {
output.writeRepeatedMessage(FieldNames.chars, chars);
}
output.endObject();
@@ -1722,11 +1789,22 @@ public final class ScoreBossRank {
}
break;
}
case 1734437791: {
if (input.isAtField(FieldNames.levelId)) {
if (!input.trySkipNullValue()) {
levelId = input.readUInt32();
bitField0_ |= 0x00000004;
}
} else {
input.skipUnknownField();
}
break;
}
case -2082324045: {
if (input.isAtField(FieldNames.nextPackage)) {
if (!input.trySkipNullValue()) {
input.readBytes(nextPackage);
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
}
} else {
input.skipUnknownField();
@@ -1737,7 +1815,7 @@ public final class ScoreBossRank {
if (input.isAtField(FieldNames.chars)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(chars);
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000010;
}
} else {
input.skipUnknownField();
@@ -1801,6 +1879,8 @@ public final class ScoreBossRank {
static final FieldName levelScore = FieldName.forField("LevelScore");
static final FieldName levelId = FieldName.forField("LevelId");
static final FieldName nextPackage = FieldName.forField("NextPackage");
static final FieldName chars = FieldName.forField("Chars");
+40 -19
View File
@@ -17,12 +17,16 @@ public class Config {
public HttpServerConfig httpServer = new HttpServerConfig(80);
public GameServerConfig gameServer = new GameServerConfig(80);
public ServerOptions serverOptions = new ServerOptions();
public ServerRates serverRates = new ServerRates();
public LogOptions logOptions = new LogOptions();
public RemoteCommand remoteCommand = new RemoteCommand();
public int customDataVersion = 0;
public String region = "global";
public String language = "en_US";
public String resourceDir = "./resources";
public String webFilesDir = "./web";
public String patchListPath = "./patchlist.json";
@@ -54,35 +58,35 @@ public class Config {
public int bindPort;
public String publicAddress = "127.0.0.1"; // Will return bindAddress if publicAddress is null
public Integer publicPort; // Will return bindPort if publicPort is null
public ServerConfig(int port) {
this.bindPort = port;
}
public String getPublicAddress() {
if (this.publicAddress != null && !this.publicAddress.isEmpty()) {
return this.publicAddress;
}
return this.bindAddress;
}
public int getPublicPort() {
if (this.publicPort != null && this.publicPort != 0) {
return this.publicPort;
}
return this.bindPort;
}
public String getDisplayAddress() {
return (useSSL ? "https" : "http") + "://" + getPublicAddress() + ":" + getPublicPort();
}
}
@Getter
public static class HttpServerConfig extends ServerConfig {
public HttpServerConfig(int port) {
super(port);
}
@@ -90,41 +94,59 @@ public class Config {
@Getter
public static class GameServerConfig extends ServerConfig {
public GameServerConfig(int port) {
super(port);
}
}
@Getter
public static class ServerOptions {
// Default permissions for accounts. By default, all commands are allowed. Reccomended to change if making a public server.
public Set<String> defaultPermissions = Set.of("*");
// Automatically creates an account when a player logs in for the first time on a new email.
public boolean autoCreateAccount = true;
// Skips the intro cinematics/stage when starting a new account.
public boolean skipIntro = false;
// Unlocks all instances (Monolith, Bounty Trials, etc) for players to enter without needing to do the previous levels.
public boolean unlockInstances = true;
// Unlocks all story CGs to use in the showcase
public boolean unlockAllStoryCGs = false;
// How long to wait (in seconds) after the last http request from a session before removing it from the server.
public int sessionTimeout = 300;
// The offset hour for when daily quests are refreshed in UTC. Example: "dailyResetHour = 4" means dailies will be refreshed at UTC+4 12:00 AM every day.
public int dailyResetHour = 0;
public int leaderboardRefreshTime = 60; // Leaderboard refresh time in seconds
// Leaderboard for Boss Blitz refresh time in seconds.
public int leaderboardRefreshTime = 60;
// The welcome mail to send when a player is created. Set to null to disable.
public WelcomeMail welcomeMail = new WelcomeMail();
}
@Getter
public static class ServerRates {
public double exp = 1.0;
}
@Getter
public static class LogOptions {
public boolean commands = true;
public boolean packets = false;
public boolean httpDebug = false;
}
@Getter
public static class RemoteCommand {
public boolean useRemoteServices = false;
public String serverAdminKey = "HJHASDPIIQWEASDHHAN";
}
@Getter
public static class WelcomeMail {
public String title;
public String sender;
public String content;
public List<ItemParam> attachments;
public WelcomeMail() {
this.title = "Welcome to a Nebula server";
this.sender = "Server";
@@ -133,9 +155,8 @@ public class Config {
new ItemParam(86009, 1),
new ItemParam(86002, 1),
new ItemParam(1, 1_000_000),
new ItemParam(2, 30_000)
);
new ItemParam(2, 30_000));
}
}
}
+48 -5
View File
@@ -6,21 +6,41 @@ import emu.nebula.game.inventory.ItemParam;
import emu.nebula.util.WeightedList;
public class GameConstants {
private static final int DATA_VERSION = 51;
private static final String VERSION = "1.2.0";
public static final String VERSION = "1.4.0";
public static int DATA_VERSION = 0;
// Set data versions for each region
// TODO move this to a json file inside the jar to make it easier to auto-update
static {
RegionConfig.getRegion("global")
.setDataVersion(75);
RegionConfig.getRegion("kr")
.setDataVersion(82);
RegionConfig.getRegion("jp")
.setDataVersion(79);
RegionConfig.getRegion("tw")
.setDataVersion(76);
RegionConfig.getRegion("cn")
.setDataVersion(77);
}
public static final ZoneId UTC_ZONE = ZoneId.of("UTC");
public static final String PROTO_BASE_TYPE_URL = "type.googleapis.com/proto.";
public static final int INTRO_GUIDE_ID = 1;
public static final int DEFAULT_HONOR_ID = 111001;
public static final int GOLD_ITEM_ID = 1;
public static final int GEM_ITEM_ID = 2;
public static final int PREM_GEM_ITEM_ID = 3;
public static final int ENERGY_BUY_ITEM_ID = GEM_ITEM_ID;
public static final int STAR_TOWER_GOLD_ITEM_ID = 11;
public static final int EXP_ITEM_ID = 21;
public static final int WEEKLY_ENTRY_ITEM_ID = 28;
public static final int MAX_ENERGY = 240;
public static final int ENERGY_REGEN_TIME = 360; // Seconds
@@ -29,7 +49,11 @@ public class GameConstants {
public static final int CHARACTER_MAX_GEM_PRESETS = 3;
public static final int CHARACTER_MAX_GEM_SLOTS = 3;
public static final int MAX_FORMATIONS = 5;
public static final int CHARACTER_TAG_VANGUARD = 101;
public static final int CHARACTER_TAG_VERSATILE = 102;
public static final int CHARACTER_TAG_SUPPORT = 103;
public static final int MAX_FORMATIONS = 6;
public static final int MAX_SHOWCASE_IDS = 5;
public static final int BATTLE_PASS_ID = 1;
@@ -37,6 +61,17 @@ public class GameConstants {
public static final int MAX_FRIENDSHIPS = 50;
public static final int MAX_PENDING_FRIENDSHIPS = 30;
public static final int TOWER_COIN_ITEM_ID = 11;
public static final int[] TOWER_EVENTS_IDS = new int[] {
101, 102, 104, 105, 106, 107, 108, 114, 115, 116, 126, 127, 128
};
public static int[][] VAMPIRE_SURVIVOR_BONUS_POWER = new int[][] {
new int[] {100, 120},
new int[] {200, 150},
new int[] {300, 200}
};
// Daily gifts (Custom)
public static final WeightedList<ItemParam> DAILY_GIFTS = new WeightedList<>();
@@ -44,13 +79,21 @@ public class GameConstants {
static {
DAILY_GIFTS.add(1000, new ItemParam(GOLD_ITEM_ID, 8888));
DAILY_GIFTS.add(250, new ItemParam(GOLD_ITEM_ID, 18888));
DAILY_GIFTS.add(250, new ItemParam(33001, 10));
DAILY_GIFTS.add(10, new ItemParam(GEM_ITEM_ID, 50));
}
// Helper functions
public static String getGameVersion() {
return VERSION + "." + getDataVersion();
// Load data version
var region = RegionConfig.getRegion(Nebula.getConfig().getRegion());
// Set data version from region
GameConstants.DATA_VERSION = region.getDataVersion();
// Init game version string
return VERSION + "." + getDataVersion() + " (" + region.getName().toUpperCase() + ")";
}
public static int getDataVersion() {
+8 -3
View File
@@ -17,6 +17,7 @@ import emu.nebula.game.GameContext;
import emu.nebula.net.PacketHelper;
import emu.nebula.plugin.PluginManager;
import emu.nebula.server.HttpServer;
import emu.nebula.util.AeadHelper;
import emu.nebula.util.Handbook;
import emu.nebula.util.JsonUtils;
import lombok.Getter;
@@ -52,6 +53,9 @@ public class Nebula {
boolean generateHandbook = true;
// Load keys
AeadHelper.loadKeys();
// Load plugin manager
Nebula.pluginManager = new PluginManager();
@@ -107,7 +111,7 @@ public class Nebula {
// Start servers
try {
// Always run http server as it is needed by for dispatch and gateserver
// Always run http server as it is needed by for login and game server
httpServer = new HttpServer(serverType);
httpServer.start();
} catch (Exception exception) {
@@ -223,7 +227,7 @@ public class Nebula {
/**
* Returns the current server time in seconds
*/
public static long getCurrentTime() {
public static long getCurrentServerTime() {
return System.currentTimeMillis() / 1000;
}
@@ -233,7 +237,8 @@ public class Nebula {
String input;
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
while ((input = br.readLine()) != null) {
Nebula.getCommandManager().invoke(null, input);
var result = Nebula.getCommandManager().invoke(null, input);
Nebula.getLogger().info(result.getMessage());
}
} catch (Exception e) {
Nebula.getLogger().error("Console error:", e);
@@ -0,0 +1,42 @@
package emu.nebula;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import lombok.Getter;
import lombok.Setter;
@Getter @Setter
public class RegionConfig {
private String name;
private int dataVersion;
private String serverMetaKey;
private String serverGarbleKey;
private static Object2ObjectMap<String, RegionConfig> REGIONS = new Object2ObjectOpenHashMap<>();
public RegionConfig(String name) {
this.name = name;
this.serverMetaKey = "";
this.serverGarbleKey = "";
}
public RegionConfig setDataVersion(int i) {
this.dataVersion = i;
return this;
}
public RegionConfig setServerMetaKey(String key) {
this.serverMetaKey = key;
return this;
}
public RegionConfig setServerGarbleKey(String key) {
this.serverGarbleKey = key;
return this;
}
public static RegionConfig getRegion(String name) {
String regionName = name.toLowerCase();
return REGIONS.computeIfAbsent(regionName, r -> new RegionConfig(regionName));
}
}
@@ -7,8 +7,8 @@ import emu.nebula.game.character.GameCharacter;
import emu.nebula.game.character.GameDisc;
import emu.nebula.game.player.Player;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.Int2IntLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2IntMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSet;
import lombok.Getter;
@@ -26,6 +26,7 @@ public class CommandArgs {
private int advance = -1;
private int talent = -1;
private int skill = -1;
private int affinity = -1;
private Int2IntMap map;
private ObjectSet<String> flags;
@@ -52,6 +53,9 @@ public class CommandArgs {
} else if (arg.startsWith("lv")) { // Level
this.level = Utils.parseSafeInt(arg.substring(2));
it.remove();
} else if (arg.startsWith("lvl")) { // Level
this.level = Utils.parseSafeInt(arg.substring(3));
it.remove();
} else if (arg.startsWith("a")) { // Advance
this.advance = Utils.parseSafeInt(arg.substring(1));
it.remove();
@@ -61,6 +65,9 @@ public class CommandArgs {
} else if (arg.startsWith("s")) { // Skill
this.skill = Utils.parseSafeInt(arg.substring(1));
it.remove();
} else if (arg.startsWith("f")) { // Affinity level
this.affinity = Utils.parseSafeInt(arg.substring(1));
it.remove();
}
} else if (arg.startsWith("-")) { // Flag
if (this.flags == null) this.flags = new ObjectOpenHashSet<>();
@@ -72,7 +79,7 @@ public class CommandArgs {
int key = Integer.parseInt(split[0]);
int value = Integer.parseInt(split[1]);
if (this.map == null) this.map = new Int2IntOpenHashMap();
if (this.map == null) this.map = new Int2IntLinkedOpenHashMap();
this.map.put(key, value);
it.remove();
@@ -109,18 +116,6 @@ public class CommandArgs {
return this.list.get(index);
}
/**
* Sends a message to the command sender
* @param message
*/
public void sendMessage(String message) {
if (sender != null) {
sender.sendMessage(message);
} else {
Nebula.getLogger().info(message);
}
}
public boolean hasFlag(String flag) {
if (this.flags == null) return false;
return this.flags.contains(flag);
@@ -190,6 +185,16 @@ public class CommandArgs {
hasChanged = true;
}
if (this.getAffinity() >= 0) {
int target = this.getAffinity();
if (target > 50) target = 50;
if (target < 0) target = 0;
if (character.getAffinityLevel() != target) {
character.setAffinityLevel(target);
hasChanged = true;
}
}
return hasChanged;
}
@@ -10,6 +10,6 @@ public interface CommandHandler {
return getData().label();
}
public void execute(CommandArgs args);
public String execute(CommandArgs args);
}
@@ -108,7 +108,7 @@ public class CommandManager {
return sender.getAccount().hasPermission("target." + command.permission());
}
public void invoke(Player sender, String message) {
public CommandResult invoke(Player sender, String message) {
// Parse message into arguments
List<String> args = Arrays.stream(message.split(" ")).collect(Collectors.toCollection(ArrayList::new));
@@ -122,6 +122,9 @@ public class CommandManager {
// Get command handler
CommandHandler handler = this.commands.get(label);
// Create result object
var result = CommandResult.builder();
// Execute command
if (handler != null) {
@@ -131,8 +134,8 @@ public class CommandManager {
// Check if sender has permission to run the command.
if (sender != null && !this.checkPermission(sender, command)) {
// We have a double null check here just in case
sender.sendMessage("You do not have permission to use this command.");
return;
result.message("Error - You do not have permission to use this command");
return result.build();
}
// Build command arguments
@@ -140,14 +143,14 @@ public class CommandManager {
// Check targeted permission
if (sender != cmdArgs.getTarget() && !this.checkTargetPermission(sender, command)) {
cmdArgs.sendMessage("You do not have permission to use this command on another player.");
return;
result.message("Error - You do not have permission to use this command on another player");
return result.build();
}
// Make sure our command has a target
if (command.requireTarget() && cmdArgs.getTarget() == null) {
cmdArgs.sendMessage("Error: Targeted player not found or offline");
return;
result.message("Error - Targeted player not found or offline");
return result.build();
}
// Log
@@ -156,13 +159,20 @@ public class CommandManager {
}
// Run command
handler.execute(cmdArgs);
} else {
if (sender != null) {
sender.sendMessage("Invalid Command!");
} else {
Nebula.getLogger().info("Invalid Command!");
String commandMessage = handler.execute(cmdArgs);
// Parse out last newline
if (commandMessage.endsWith("\n")) {
commandMessage = commandMessage.substring(0, commandMessage.length() - 1);
}
// Set result data
result.command(handler);
result.message(commandMessage);
} else {
result.message("Invalid Command!");
}
return result.build();
}
}
@@ -0,0 +1,19 @@
package emu.nebula.command;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
public class CommandResult {
private CommandHandler command;
private String message;
public boolean isCommandTypeOf(Class<? extends CommandHandler> handler) {
if (command == null) {
return false;
}
return command.getClass().equals(handler);
}
}
@@ -6,14 +6,13 @@ import emu.nebula.command.CommandHandler;
import emu.nebula.game.account.AccountHelper;
import emu.nebula.util.Utils;
@Command(label = "account", permission = "admin.account", desc = "/account {create | delete} [email] (reserved player uid). Creates or deletes an account.")
@Command(label = "account", permission = "admin.account", desc = "!account {create | delete} [email] (reserved player uid). Creates or deletes an account.")
public class AccountCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
if (args.size() < 2) {
args.sendMessage("Invalid amount of args");
return;
return "Invalid amount of args";
}
String command = args.get(0).toLowerCase();
@@ -29,19 +28,22 @@ public class AccountCommand implements CommandHandler {
}
if (AccountHelper.createAccount(username, null, reservedUid) != null) {
args.sendMessage("Account created");
return "Account created";
} else {
args.sendMessage("Account already exists");
return "Account already exists";
}
}
case "delete" -> {
if (AccountHelper.deleteAccount(username)) {
args.sendMessage("Account deleted");
return "Account deleted";
} else {
args.sendMessage("Account doesnt exist");
return "Account doesnt exist";
}
}
}
// Fallback
return "Account sub command not found";
}
}
@@ -0,0 +1,440 @@
package emu.nebula.command.commands;
import java.util.ArrayList;
import java.util.Collections;
import emu.nebula.GameConstants;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.command.commands.BuildCommand.StarTowerBuildData;
import emu.nebula.data.GameData;
import emu.nebula.game.character.GameCharacter;
import emu.nebula.game.character.GameDisc;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.net.NetMsgId;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.IntArrayList;
@Command(
label = "autobuild",
aliases = {"ab"},
permission = "player.build",
requireTarget = true,
desc = "!autobuild [character/disc/potential/melody ids...] lv[target record level] s[target record score] = Generates a record for the player with the target score/record level"
)
public class AutoBuildCommand implements CommandHandler {
private static final int[] COMMON_SUB_NOTE_SKILLS = new int[] {
90011, 90012, 90013, 90014, 90015, 90016, 90017
};
@Override
public String execute(CommandArgs args) {
// Create record
var target = args.getTarget();
var builder = new StarTowerBuildData(target);
// Parse items
for (String arg : args.getList()) {
int id = Utils.parseSafeInt(arg);
int count = 1;
builder.parseItem(id, count);
}
if (args.getMap() != null) {
for (var entry : args.getMap().int2IntEntrySet()) {
int id = entry.getIntKey();
int count = entry.getIntValue();
builder.parseItem(id, count);
}
}
// Remove extra characters/discs
while (builder.getCharacters().size() > 3) {
builder.getCharacters().removeLast();
}
while (builder.getDiscs().size() > 6) {
builder.getDiscs().removeLast();
}
// Add random characters/discs
if (builder.getCharacters().size() < 3) {
int count = 3 - builder.getCharacters().size();
for (int i = 0; i < count; i++) {
this.pickRandomCharacter(builder);
}
if (builder.getCharacters().size() < 3) {
return "Error: Not enough trekkers in the record";
}
}
if (builder.getDiscs().size() < 6) {
int count = 6 - builder.getDiscs().size();
for (int i = 0; i < count; i++) {
this.pickRandomDisc(builder);
}
}
// Get target level/score
int targetLevel = 0;
int targetScore = 0;
if (args.getSkill() < 0) {
// Default target level is 40
targetLevel = 40;
} else {
targetScore = args.getSkill();
}
if (args.getLevel() > 0) {
// Target level overrides target score.
targetLevel = args.getLevel();
}
// Get target score from record level
if (targetLevel > 0) {
var data = GameData.getStarTowerBuildRankDataTable().get(targetLevel);
if (data != null) {
targetScore = data.getMinGrade();
}
}
// Pick random potentials and sub notes
this.generate(builder, targetScore);
// Create record
var build = builder.toBuild();
// Add to star tower manager
target.getStarTowerManager().addBuild(build);
// Send package to player
target.addNextPackage(NetMsgId.st_import_build_notify, build.toProto());
// Send result to player
String result = "Generated record for " + target.getName();
if (args.getSender() == null) {
result += " (This command may take time to update on the client)";
}
return result;
}
private void pickRandomCharacter(StarTowerBuildData builder) {
// Random list
var list = new ArrayList<GameCharacter>();
// Create list of possible characters to add
var characters = builder.getPlayer().getCharacters().getCharacterCollection()
.stream()
.filter(c -> !builder.getCharacters().contains(c))
.toList();
// Check if record is empty
if (builder.getCharacters().isEmpty()) {
// Get random vanguard trekker
for (var character : characters) {
if (character.getData().getDes().getTag().contains(GameConstants.CHARACTER_TAG_VANGUARD)) {
list.add(character);
}
}
// Add any trekker if we dont have any vanguard trekkers
if (list.isEmpty()) {
list.addAll(characters);
}
} else {
// Get element of main trekker
var main = builder.getCharacters().get(0);
var element = main.getElementType();
// Get trekkers of the same element
for (var character : characters) {
if (character.getData().getElementType() == element) {
list.add(character);
}
}
// Add any trekker if we dont have any trekkers of the same element
if (list.isEmpty()) {
list.addAll(characters);
}
// Shuffle list to make it random
Collections.shuffle(list);
// Add first support trekker we find
for (var character : list) {
if (character.getData().getDes().getTag().contains(GameConstants.CHARACTER_TAG_SUPPORT)) {
builder.getCharacters().add(character);
return;
}
}
// If we have no support trekkers, then we look for versatile trekkers
for (var character : list) {
if (character.getData().getDes().getTag().contains(GameConstants.CHARACTER_TAG_VERSATILE)) {
builder.getCharacters().add(character);
return;
}
}
}
// If we have no versatile or support trekkers, add a random trekker from the remaining list
if (list.size() > 0) {
builder.getCharacters().add(Utils.randomElement(list));
}
}
private void pickRandomDisc(StarTowerBuildData builder) {
// Get element of main trekker
var main = builder.getCharacters().get(0);
var element = main.getElementType();
// Random list
var list = new ArrayList<GameDisc>();
// Create list of possible discs to add
var discs = builder.getPlayer().getCharacters().getDiscCollection()
.stream()
.filter(d -> !builder.getDiscs().contains(d))
.toList();
// Get discs of the same element
for (var disc : discs) {
if (disc.getData().getElementType() == element) {
list.add(disc);
}
}
if (list.isEmpty()) {
list.addAll(discs);
}
// End early if list is still empty
if (list.isEmpty()) {
return;
}
// Shuffle list to make it random
Collections.shuffle(list);
// Find random disc
for (var disc : list) {
var item = GameData.getItemDataTable().get(disc.getDiscId());
if (item.getRarity() == 1) {
builder.getDiscs().add(disc);
return;
}
}
for (var disc : list) {
var item = GameData.getItemDataTable().get(disc.getDiscId());
if (item.getRarity() == 2) {
builder.getDiscs().add(disc);
return;
}
}
// Just add the first disc that we can find
builder.getDiscs().add(list.get(0));
}
private void generate(StarTowerBuildData builder, int targetScore) {
// Get possible sub notes
int subNoteScore = (int) (targetScore * .4D);
// Get possible drops
var drops = new IntArrayList();
for (var character : builder.getCharacters()) {
var element = character.getData().getElementType();
if (element.getSubNoteSkillItemId() == 0) {
continue;
}
if (!drops.contains(element.getSubNoteSkillItemId())) {
drops.add(element.getSubNoteSkillItemId());
}
}
for (var disc : builder.getDiscs()) {
var element = disc.getData().getElementType();
if (element.getSubNoteSkillItemId() == 0) {
continue;
}
if (!drops.contains(element.getSubNoteSkillItemId())) {
drops.add(element.getSubNoteSkillItemId());
}
}
for (int id : COMMON_SUB_NOTE_SKILLS) {
drops.add(id);
}
// Randomize sub note ids
Collections.shuffle(drops);
// Distribute sub notes randomly
int amount = (int) Math.ceil(subNoteScore / 15D);
int totalSubNotes = amount;
// Allocate budget for each sub note
var budget = new ItemParamMap();
double totalValue = 0;
for (int subNote : drops) {
int value = Utils.randomRange(1, 10);
budget.add(subNote, value);
totalValue += value;
}
// Add random sub notes
for (int subNote : drops) {
// Get budgeted value
int value = budget.get(subNote);
int count = (int) Math.ceil((value / totalValue) * totalSubNotes);
// Get current sub notes
int cur = builder.getBuild().getSubNoteSkills().get(subNote);
int max = Math.max(99 - cur, 0);
// Clamp
count = Math.min(Math.min(count, amount), max);
amount -= count;
// Add sub notes
builder.getBuild().getSubNoteSkills().add(subNote, count);
}
// Add leftover sub notes
if (amount > 0) {
// Randomize again
Collections.shuffle(drops);
// Add to first sub note that has less than 99
for (int subNote : drops) {
// End if we have no more sub notes to give
if (amount <= 0) {
break;
}
// Get current sub notes
int cur = builder.getBuild().getSubNoteSkills().get(subNote);
if (cur >= 99) {
continue;
}
// Add
int count = Math.min(99 - cur, amount);
amount -= count;
builder.getBuild().getSubNoteSkills().add(subNote, count);
}
}
// Calcluate score
builder.toBuild().calculateScore();
// Get target potential score
int potentialScore = Math.max(targetScore - builder.getBuild().getScore(), 0);
// Init weighted list of characters
var characters = new ArrayList<GameCharacter>();
characters.add(builder.getCharacters().get(0));
characters.add(builder.getCharacters().get(0)); // Main character gets an extra chance to get more potentials
characters.add(builder.getCharacters().get(1));
characters.add(builder.getCharacters().get(2));
Collections.shuffle(characters);
// Get current amount of special potentials
var specialCounter = new ItemParamMap();
for (var entry : builder.getBuild().getPotentials()) {
var potential = GameData.getPotentialDataTable().get(entry.getIntKey());
if (potential == null) continue;
if (potential.isSpecial()) {
specialCounter.add(potential.getCharId(), 1);
}
}
// Cache main trekker
var main = builder.getCharacters().get(0);
// Get random potentials
while (potentialScore > 0 && !characters.isEmpty()) {
// Get random character
var character = Utils.randomElement(characters);
// Get character potential data
var data = GameData.getCharPotentialDataTable().get(character.getCharId());
if (data == null) {
break;
}
// Check if we should give a special potential
int sp = specialCounter.get(character.getCharId());
boolean special = false;
if (sp < 2 && potentialScore >= 180) {
special = Utils.randomChance(.25);
}
if (special) {
specialCounter.add(character.getCharId(), 1);
}
// Get possible potential list
var list = data.getPotentialList(main == character, special);
// Remove potentials we already have maxed out
var potentials = new IntArrayList();
for (int id : list) {
// Get potential data
var potential = GameData.getPotentialDataTable().get(id);
if (potential == null) continue;
// Filter out max level ones
int curLevel = builder.getBuild().getPotentials().get(id);
int maxLevel = potential.getMaxLevel();
if (curLevel >= maxLevel) {
continue;
}
// Add
potentials.add(id);
}
// Remove character if we dont have any possible potentials for it
if (potentials.isEmpty()) {
characters.removeIf(c -> c == character);
continue;
}
// Get random potential
int id = Utils.randomElement(potentials);
var potential = GameData.getPotentialDataTable().get(id);
// Add
builder.getBuild().getPotentials().add(id, 1);
// Decrement score
potentialScore -= potential.getBuildScore(1);
}
}
}
@@ -0,0 +1,115 @@
package emu.nebula.command.commands;
import emu.nebula.Nebula;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.game.player.Player;
import emu.nebula.util.Utils;
import java.util.Locale;
@Command(label = "ban",
permission = "admin.ban",
desc = """
!ban {all | ip | uid} [player uid | ip] (end timestamp) (reason) - Ban a player\
- all mode bans both the player object and their IP address by UID, so the next parameter should be UID instead of IP
- ip mode can only ban IP addresses, so the next parameter should be an IP
- uid mode can only ban UIDs, so the next parameter should be a UID
- If you don't fill in the end timestamp, it will be permanently banned by default\
""")
public class BanCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
if (args.size() < 2) {
return "Invalid amount of args";
}
int bannedUid = 0;
long banEndTime = 0;
String bannedIp = null;
String reason = null;
String mode = args.get(0).toLowerCase(Locale.ROOT);
switch (args.size()) {
case 4:
reason = args.get(3);
case 3: {
try {
banEndTime = Long.parseLong(args.get(2));
} catch (NumberFormatException ignored) {
return "Unable to parse timestamp.";
}
}
case 2: {
if (mode.equals("ip")) {
bannedIp = args.get(1);
} else {
try {
bannedUid = Integer.parseInt(args.get(1));
} catch (NumberFormatException ignored) {
return "Unable to parse uid.";
}
}
}
case 1: {
if (!mode.equals("all") && !mode.equals("uid") && !mode.equals("ip"))
return "Unable to parse mode.";
}
default: break;
}
if (banEndTime != 0 && banEndTime < System.currentTimeMillis()) {
return "Failed, the end timestamp must be greater than the current time";
}
var banModule = Nebula.getGameContext().getBanModule();
Player player;
if (!mode.equals("ip")) {
player = Nebula.getGameContext().getPlayerModule().getPlayer(bannedUid);
if (player == null) {
return "Failed, player not found.";
}
}
switch (mode) {
case "all" -> {
banModule.banPlayer(
bannedUid,
banEndTime,
reason,
true,
args.getSender() != null ? String.valueOf(args.getSender().getUid()) : "Console");
return "Banned player all mode " + bannedUid + " until " + Utils.formatTimestamp(banEndTime) +
(reason != null ? " (" + reason + ")" : "");
}
case "ip" -> {
banModule.banIp(
bannedIp,
banEndTime,
reason,
args.getSender() != null ? String.valueOf(args.getSender().getUid()) : "Console");
return "Banned ip " + bannedIp + " until " + Utils.formatTimestamp(banEndTime) +
(reason != null ? " (" + reason + ")" : "");
}
case "uid" -> {
banModule.banPlayer(
bannedUid,
banEndTime,
reason,
false,
args.getSender() != null ? String.valueOf(args.getSender().getUid()) : "Console");
return "Banned player " + bannedUid + " until " + Utils.formatTimestamp(banEndTime) +
(reason != null ? " (" + reason + ")" : "");
}
default -> {
return "Ban sub command not found";
}
}
}
}
@@ -0,0 +1,61 @@
package emu.nebula.command.commands;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.net.NetMsgId;
@Command(label = "battlepass", aliases = {"bp"}, permission = "player.battlepass", desc = "!battlepass [free | premium] lv(level) = Modifies the targeted player's battle pass")
public class BattlePassCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
// Get target
var target = args.getTarget();
var battlepass = target.getBattlePassManager().getBattlePass();
boolean changed = false;
// Check if we are changing premium status
int mode = -1;
for (var arg : args.getList()) {
if (arg.equalsIgnoreCase("free")) {
mode = 0;
} else if (arg.equalsIgnoreCase("premium")) {
mode = 2;
}
}
if (mode >= 0 && battlepass.getMode() != mode) {
battlepass.setMode(mode);
changed = true;
}
// Set level
int level = Math.min(args.getLevel(), 50);
if (level >= 0 && battlepass.getLevel() != level) {
battlepass.setLevel(level);
changed = true;
}
// Check if we have made any changes
if (changed) {
// Save battle pass to the database
battlepass.save();
// Send package to notify the client that the battle pass needs updating
target.addNextPackage(
NetMsgId.battle_pass_info_succeed_ack,
battlepass.toProto()
);
// Success message
return "Changed the battle pass successfully.";
}
// Result message
return "No changes were made to the battle pass.";
}
}
@@ -0,0 +1,185 @@
package emu.nebula.command.commands;
import java.util.ArrayList;
import java.util.List;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.data.GameData;
import emu.nebula.game.character.GameCharacter;
import emu.nebula.game.character.GameDisc;
import emu.nebula.game.player.Player;
import emu.nebula.game.tower.StarTowerBuild;
import emu.nebula.net.NetMsgId;
import emu.nebula.util.Utils;
import lombok.Getter;
@Command(
label = "build",
aliases = {"b", "record", "r"},
permission = "player.build",
requireTarget = true,
desc = "!build [char ids...] [disc ids...] [potential ids...] [melody ids...]"
)
public class BuildCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
// Create record
var target = args.getTarget();
var builder = new StarTowerBuildData(target);
// Parse items
for (String arg : args.getList()) {
int id = Utils.parseSafeInt(arg);
int count = 1;
builder.parseItem(id, count);
}
if (args.getMap() != null) {
for (var entry : args.getMap().int2IntEntrySet()) {
int id = entry.getIntKey();
int count = entry.getIntValue();
builder.parseItem(id, count);
}
}
// Check if build is valid
if (builder.getCharacters().size() != 3) {
return "Record must have 3 different characters";
}
if (builder.getDiscs().size() < 3 || builder.getDiscs().size() > 6) {
return "Record must have 3-6 different discs";
}
// Create record
var build = builder.toBuild();
// Add to star tower manager
target.getStarTowerManager().addBuild(build);
// Send package to player
target.addNextPackage(NetMsgId.st_import_build_notify, build.toProto());
// Send result to player
String result = "Created record for " + target.getName();
if (args.getSender() == null) {
result += " (This command may take time to update on the client)";
}
return result;
}
@Getter
public static class StarTowerBuildData {
private Player player;
private StarTowerBuild build;
private List<GameCharacter> characters;
private List<GameDisc> discs;
public StarTowerBuildData(Player player) {
this.player = player;
this.build = new StarTowerBuild(player);
this.characters = new ArrayList<>();
this.discs = new ArrayList<>();
}
public void parseItem(int id, int count) {
// Get item data
var itemData = GameData.getItemDataTable().get(id);
if (itemData == null) {
return;
}
// Clamp
count = Math.max(count, 1);
// Parse by item id
switch (itemData.getItemSubType()) {
case Char -> {
var character = this.getPlayer().getCharacters().getCharacterById(id);
if (character == null || !character.getData().isAvailable()) {
break;
}
this.addCharacter(character);
}
case Disc -> {
var disc = this.getPlayer().getCharacters().getDiscById(id);
if (disc == null || !disc.getData().isAvailable()) {
break;
}
this.addDisc(disc);
}
case Potential, SpecificPotential -> {
var potentialData = GameData.getPotentialDataTable().get(id);
if (potentialData == null) break;
int level = Math.min(count, potentialData.getMaxLevel());
this.getBuild().getPotentials().add(id, level);
}
case SubNoteSkill -> {
this.getBuild().getSubNoteSkills().add(id, count);
}
default -> {
// Ignored
}
}
}
public void addCharacter(GameCharacter character) {
if (this.characters.contains(character)) {
return;
}
this.characters.add(character);
}
public void addDisc(GameDisc disc) {
if (this.discs.contains(disc)) {
return;
}
this.discs.add(disc);
}
public StarTowerBuild toBuild() {
// Set characters and discs
build.setChars(this.getCharacters());
build.setDiscs(this.getDiscs());
// Clear character potential cache
build.getCharPots().clear();
for (int charId : build.getCharIds()) {
build.getCharPots().put(charId, 0);
}
// Add potentials to character potential cache
var it = build.getPotentials().iterator();
while (it.hasNext()) {
var potential = it.next();
var data = GameData.getPotentialDataTable().get(potential.getIntKey());
if (data == null || !build.getCharPots().containsKey(data.getCharId())) {
it.remove();
continue;
}
build.getCharPots().add(data.getCharId(), 1);
}
// Calculate score
build.calculateScore();
// Return build
return build;
}
}
}
@@ -16,13 +16,13 @@ import emu.nebula.command.CommandHandler;
label = "character",
aliases = {"c", "char"},
permission = "player.character",
requireTarget = true,
desc = "!c [all | {characterId}] lv(level) a(ascension) s(skill level) t(talent level)"
requireTarget = true,
desc = "!c [all | {characterId}] lv(level) a(ascension) s(skill level) t(talent level) f(affinity level)"
)
public class CharacterCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
// Init
var player = args.getTarget();
var characters = new HashSet<GameCharacter>();
@@ -51,7 +51,7 @@ public class CharacterCommand implements CommandHandler {
// Sanity check
if (characters.isEmpty()) {
return;
return "Error: No characters selected";
}
// List of modified characters that we send to the client for updates
@@ -72,7 +72,7 @@ public class CharacterCommand implements CommandHandler {
}
if (modified.isEmpty()) {
return;
return "No changes applied";
}
// Encode and send
@@ -83,5 +83,13 @@ public class CharacterCommand implements CommandHandler {
}
player.addNextPackage(NetMsgId.chars_final_notify, proto);
// Trigger achievements
if (args.getLevel() > 0 && args.getLevel() <= 90) {
player.getCharacters().triggerCharacterAchievements(modified, args.getLevel());
}
// Result
return "Updated " + modified.size() + " character(s)";
}
}
@@ -0,0 +1,129 @@
package emu.nebula.command.commands;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.data.GameData;
import emu.nebula.data.resources.ItemDef;
import emu.nebula.game.inventory.GameItem;
import emu.nebula.game.inventory.GameResource;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.game.inventory.ItemType;
import emu.nebula.game.player.PlayerChangeInfo;
import emu.nebula.net.NetMsgId;
import emu.nebula.util.Utils;
import java.util.HashSet;
@Command(
label = "clean",
aliases = {"cl", "clear"},
permission = "player.inventory",
requireTarget = true,
desc = "!clean [all | {id} ...] [items|resources] = Removes items/resources from the targeted player."
)
public class CleanCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
var player = args.getTarget();
var inv = player.getInventory();
boolean doItems = true;
boolean doResources = true;
boolean all = false;
var ids = new HashSet<Integer>();
for (String arg : args.getList()) {
arg = arg.toLowerCase();
switch (arg) {
case "items" -> {
doResources = false;
continue;
}
case "resources", "res" -> {
doItems = false;
continue;
}
case "all" -> {
all = true;
continue;
}
}
int id = Utils.parseSafeInt(arg);
if (id > 0) {
ids.add(id);
}
}
var change = new PlayerChangeInfo();
var removeMap = new ItemParamMap();
if (all) {
if (doItems) {
for (GameItem item : inv.getItems().values()) {
removeMap.add(item.getItemId(), item.getCount());
}
}
if (doResources) {
for (GameResource res : inv.getResources().values()) {
removeMap.add(res.getResourceId(), res.getCount());
}
}
} else {
for (int id : ids) {
ItemDef data = GameData.getItemDataTable().get(id);
if (data == null) continue;
ItemType type = data.getItemType();
switch (type) {
case Res -> {
if (doResources) {
int count = inv.getResourceCount(id);
if (count > 0) removeMap.add(id, count);
}
}
case Item -> {
if (doItems) {
int count = inv.getItemCount(id);
if (count > 0) removeMap.add(id, count);
}
}
case Disc, Char, CharacterSkin, Title, Honor -> {
}
default -> {
if (doItems) {
int count = inv.getItemCount(id);
if (count > 0) {
removeMap.add(id, count);
break;
}
}
if (doResources) {
int count = inv.getResourceCount(id);
if (count > 0) removeMap.add(id, count);
}
}
}
}
}
if (!removeMap.isEmpty()) {
change = inv.removeItems(removeMap, change);
}
if (change.isEmpty()) {
return "No items/resources removed";
}
player.addNextPackage(NetMsgId.items_change_notify, change.toProto());
return "Inventory cleaned";
}
}
@@ -21,7 +21,7 @@ import emu.nebula.command.CommandHandler;
public class DiscCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
// Init
var player = args.getTarget();
var discs = new HashSet<GameDisc>();
@@ -50,7 +50,7 @@ public class DiscCommand implements CommandHandler {
// Sanity check
if (discs.isEmpty()) {
return;
return "No discs selected";
}
// List of modified characters that we send to the client for updates
@@ -71,12 +71,15 @@ public class DiscCommand implements CommandHandler {
}
if (modified.isEmpty()) {
return;
return "No discs changed";
}
// Encode and send
for (var disc : modified) {
player.addNextPackage(NetMsgId.disc_reset_notify, disc.toProto());
}
// Return message
return "Changed " + modified.size() + " discs";
}
}
@@ -0,0 +1,104 @@
package emu.nebula.command.commands;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import emu.nebula.game.character.CharacterGem;
import emu.nebula.game.character.GameCharacter;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.PubilcGm.Chars;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.data.GameData;
@Command(
label = "emblem",
aliases = {"e", "gem"},
permission = "player.emblem",
requireTarget = true,
desc = "!emblem [characterId] [emblem slot] [attribute value ids....]"
)
public class EmblemCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
// Init
var player = args.getTarget();
// Sanity check
if (args.getList().size() < 6) {
return "Error: Not enough args";
}
// Parse args
var charId = Utils.parseSafeInt(args.getList().get(0));
var slotId = Utils.parseSafeInt(args.getList().get(1));
var attributes = new IntArrayList();
for (int i = 2; i < 6; i++) {
int attr = Utils.parseSafeInt(args.getList().get(i));
var data = GameData.getCharGemAttrValueDataTable().get(attr);
if (data == null) {
return "Error: Invalid attribute value id in position " + (i - 2);
}
attributes.add(attr);
}
// Get character
GameCharacter character = player.getCharacters().getCharacterById(charId);
if (character == null) {
return "Error: No trekker selected";
}
// Get gem slot
var slot = character.getGemSlot(slotId);
if (slot == null) {
return "Error: Invalid slot selected";
}
// Get gem
var preset = character.getCurrentGemPreset();
var gem = slot.getGem(preset.getGemIndex(slotId));
if (gem == null) {
if (slot.isFull()) {
// Equip the first gem we can find
preset.setGemIndex(slotId, 0);
gem = slot.getGem(preset.getGemIndex(slotId));
} else {
// Create a new gem and equip it
gem = new CharacterGem(attributes);
// Add gem to slot
slot.getGems().add(gem);
// Equip
preset.setGemIndex(slotId, slot.getGems().size() - 1);
}
// Make sure gem exists
if (gem == null) {
return "An unknown error has occured";
}
}
// Replace gem
gem.setAttributes(attributes);
// Save
character.save();
// Encode and send
var proto = Chars.newInstance()
.addList(character.toProto());
player.addNextPackage(NetMsgId.chars_final_notify, proto);
// Result
return "Updated emblem for character";
}
}
@@ -31,22 +31,21 @@ public class GiveAllCommand implements CommandHandler {
);
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
Player target = args.getTarget();
String type = args.get(0).toLowerCase();
var change = new PlayerChangeInfo();
var message = new StringBuilder();
switch (type) {
default -> args.sendMessage("Error: Invalid type");
case "m", "materials", "mats" -> {
// Create items map
var items = new ItemParamMap();
// Check sub type
for (ItemDef data : GameData.getItemDataTable()) {
if (!MATERIAL_ITEM_SUBTYPES.contains(data.getItemSubType())) {
if (data.getItemSubType() == null || !MATERIAL_ITEM_SUBTYPES.contains(data.getItemSubType())) {
continue;
}
@@ -66,7 +65,7 @@ public class GiveAllCommand implements CommandHandler {
target.getInventory().addItems(items, change);
// Send message
args.sendMessage("Giving " + target.getName() + " " + items.size() + " items");
message.append("Giving " + target.getName() + " " + items.size() + " items.\n");
}
case "d", "discs" -> {
// Get all discs
@@ -85,14 +84,18 @@ public class GiveAllCommand implements CommandHandler {
var disc = target.getCharacters().addDisc(data.getId());
// Set properties
args.setProperties(disc);
boolean shouldSave = args.setProperties(disc);
if (shouldSave) {
disc.save();
}
// Add to change info
change.add(disc.toProto());
}
// Send message
args.sendMessage("Giving " + target.getName() + " all discs");
message.append("Giving " + target.getName() + " all discs.\n");
}
case "c", "characters", "trekkers", "t" -> {
// Get all characters
@@ -111,23 +114,33 @@ public class GiveAllCommand implements CommandHandler {
var character = target.getCharacters().addCharacter(data.getId());
// Set properties
args.setProperties(character);
boolean shouldSave = args.setProperties(character);
if (shouldSave) {
character.save();
}
// Add to change info
change.add(character.toProto());
}
// Send message
args.sendMessage("Giving " + target.getName() + " all characters");
message.append("Giving " + target.getName() + " all characters.\n");
}
default -> {
// Ignored
}
}
if (change.isEmpty()) {
return;
return "No items given to the player";
}
// Encode and send
target.addNextPackage(NetMsgId.items_change_notify, change.toProto());
// Complete
return message.toString();
}
}
@@ -12,12 +12,12 @@ import emu.nebula.command.CommandHandler;
aliases = {"g", "item"},
permission = "player.give",
requireTarget = true,
desc = "/give [item id] x(amount). Gives the targeted player an item."
desc = "!give [item id] x(amount). Gives the targeted player an item."
)
public class GiveCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
// Setup mail
var mail = new GameMail("System", "Give Command Result", "");
@@ -31,18 +31,17 @@ public class GiveCommand implements CommandHandler {
var itemData = GameData.getItemDataTable().get(itemId);
if (itemData == null) {
args.sendMessage("Item \"" + arg + "\" does not exist!");
continue;
}
// Add
mail.addAttachment(itemId, amount);
// Log
args.sendMessage("Giving " + args.getTarget().getName() + " " + amount + " of " + itemId);
}
// Add mail
args.getTarget().getMailbox().sendMail(mail);
//
return "Give command success, check your mail";
}
}
@@ -5,12 +5,14 @@ import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
@Command(label = "help", permission = "player.help", desc = "/help. Displays a list of available commands.")
@Command(label = "help", permission = "player.help", desc = "!help = Displays a list of available commands. (Very spammy in-game)")
public class HelpCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
args.sendMessage("Displaying list of commands:");
public String execute(CommandArgs args) {
var message = new StringBuilder();
message.append("Displaying list of commands:\n");
// Sort command names
var labels = Nebula.getCommandManager().getLabels().keySet().stream().sorted().toList();
@@ -21,9 +23,11 @@ public class HelpCommand implements CommandHandler {
// Only send command description if the sender has permission to use the command
if (Nebula.getCommandManager().checkPermission(args.getSender(), command)) {
args.sendMessage(command.desc());
message.append(command.desc());
message.append("\n");
}
}
return message.toString();
}
}
@@ -0,0 +1,41 @@
package emu.nebula.command.commands;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.data.GameData;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.NotifyGm.GmWorldClass;
import emu.nebula.util.Utils;
@Command(label = "setlevel", aliases = {"level", "l"}, permission = "player.level", requireTarget = true, desc = "!level [level] = Set's the targeted player's level")
public class LevelCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
// Get target
var target = args.getTarget();
// Parse level
int level = Utils.parseSafeInt(args.get(0));
// Check to make sure world class data exists for this level
var data = GameData.getWorldClassDataTable().get(level);
if (data == null) {
return "The game does not support level " + level;
}
target.setLevel(level);
target.setExp(0);
// Update
target.addNextPackage(
NetMsgId.world_class_number_notify,
GmWorldClass.newInstance()
.setFinalClass(target.getLevel())
.setLastExp(target.getExp())
);
return "Level set to " + level;
}
}
@@ -14,44 +14,39 @@ import emu.nebula.util.Utils;
aliases = {"m"},
permission = "player.mail",
requireTarget = true,
desc = "/mail \"subject\" \"body\" [itemId xQty | itemId:qty ...]. Sends the targeted player a system mail."
desc = "!mail \"subject\" \"body\" [itemId xQty | itemId:qty ...] = Sends the targeted player a system mail."
)
public class MailCommand implements CommandHandler {
private static final String USAGE_TEXT = "Usage: /mail \"subject\" \"body\" [itemId xQty | itemId:qty ...]";
private static final Pattern QUOTED_TEXT = Pattern.compile("\"([^\"]*)\"");
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
var target = args.getTarget();
if (target == null) {
args.sendMessage("Error: Targeted player not found or offline");
return;
return "Error - Targeted player not found or offline";
}
String rawInput = args.getRaw() == null ? "" : args.getRaw().trim();
if (rawInput.isEmpty()) {
sendUsage(args);
return;
return USAGE_TEXT;
}
Matcher matcher = QUOTED_TEXT.matcher(rawInput);
if (!matcher.find()) {
sendUsage(args);
return;
return USAGE_TEXT;
}
String subject = matcher.group(1).trim();
if (!matcher.find()) {
args.sendMessage("Mail body must be wrapped in quotes after the subject.");
return;
return "Mail body must be wrapped in quotes after the subject.";
}
String body = matcher.group(1).trim();
int attachmentStartIndex = matcher.end();
if (subject.isEmpty()) {
args.sendMessage("Mail subject cannot be empty.");
return;
return "Mail subject cannot be empty.";
}
if (body.isEmpty()) {
@@ -68,7 +63,7 @@ public class MailCommand implements CommandHandler {
parseAttachments(attachmentSection, mail, args);
target.getMailbox().sendMail(mail);
args.sendMessage("Mail sent to " + target.getName() + " with subject \"" + subject + "\".");
return "Mail sent to " + target.getName() + " with subject \"" + subject + "\".";
}
private void parseAttachments(String attachmentSection, GameMail mail, CommandArgs args) {
@@ -93,7 +88,7 @@ public class MailCommand implements CommandHandler {
if (token.startsWith("x") && token.length() > 1) {
if (pendingItemId == null) {
args.sendMessage("Quantity token '" + token + "' must follow an item id.");
//args.sendMessage("Quantity token '" + token + "' must follow an item id.");
continue;
}
@@ -110,7 +105,7 @@ public class MailCommand implements CommandHandler {
int itemId = Utils.parseSafeInt(token);
if (itemId <= 0) {
args.sendMessage("Invalid item id '" + token + "'.");
//args.sendMessage("Invalid item id '" + token + "'.");
pendingItemId = null;
continue;
}
@@ -119,7 +114,7 @@ public class MailCommand implements CommandHandler {
continue;
}
args.sendMessage("Ignoring attachment token '" + token + "'.");
//args.sendMessage("Ignoring attachment token '" + token + "'.");
}
if (pendingItemId != null) {
@@ -129,7 +124,7 @@ public class MailCommand implements CommandHandler {
private void addAttachment(GameMail mail, CommandArgs args, int itemId, int quantity) {
if (itemId <= 0) {
args.sendMessage("Item id must be positive.");
//args.sendMessage("Item id must be positive.");
return;
}
@@ -145,8 +140,4 @@ public class MailCommand implements CommandHandler {
}
return !token.isEmpty();
}
private void sendUsage(CommandArgs args) {
args.sendMessage("Usage: /mail \"subject\" \"body\" [itemId xQty | itemId:qty ...]");
}
}
@@ -5,18 +5,21 @@ import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
@Command(label = "reload", permission = "admin.reload", desc = "/reload. Reloads the server config.")
@Command(label = "reload", permission = "admin.reload", desc = "!reload = Reloads the server config.")
public class ReloadCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
public String execute(CommandArgs args) {
// Reload config first
Nebula.loadConfig();
// Reload patch list if the server is running
if (Nebula.getHttpServer() != null) {
Nebula.getHttpServer().loadPatchList();
}
args.sendMessage("Reloaded the server config");
// Result message
return "Reloaded the server config";
}
}
@@ -0,0 +1,32 @@
package emu.nebula.command.commands;
import emu.nebula.Nebula;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import java.util.Random;
@Command(label = "remote", permission = "player.remote", requireTarget = true, desc = "!remote = Creates a player token for remote api usage")
public class RemoteKeyCommand implements CommandHandler {
private final String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
@Override
public String execute(CommandArgs args) {
if (Nebula.getConfig().getRemoteCommand().useRemoteServices) {
StringBuilder sb = new StringBuilder();
Random random = new Random();
for (int i = 0; i < 8; i++) {
int index = random.nextInt(characters.length());
sb.append(characters.charAt(index));
}
args.getTarget().setRemoteToken(sb.toString());
return "Key Generated: " + sb.toString();
} else {
args.getTarget().setRemoteToken(null);
return "Remote Command Disabled on Server";
}
}
}
@@ -0,0 +1,101 @@
package emu.nebula.command.commands;
import emu.nebula.GameConstants;
import emu.nebula.Nebula;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import java.io.File;
import java.lang.management.ManagementFactory;
@Command(label = "status", permission = "admin.status", desc = "!status = Displays server runtime status.")
public class StatusCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
var sb = new StringBuilder();
if (args.getRaw().contains("@")) {
if (args.getTarget() == null || !args.getTarget().hasSession()) {
return "Error - Targeted player not found or offline";
}
}
var runtime = Runtime.getRuntime();
var uptimeMs = ManagementFactory.getRuntimeMXBean().getUptime();
double usedMem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576.0;
double maxMem = runtime.maxMemory() / 1048576.0;
int players = 0;
if (Nebula.getGameContext() != null) {
players = Nebula.getGameContext().getPlayerModule().getCachedPlayers().size();
}
var http = Nebula.getHttpServer();
String addr = "-";
String scheme = "http";
int port = 0;
if (http != null) {
addr = http.getServerConfig().getPublicAddress();
port = http.getServerConfig().getPublicPort();
scheme = http.getServerConfig().isUseSSL() ? "https" : "http";
}
sb.append("Server Status\n");
sb.append("Git: ").append(Nebula.getGitHash()).append('\n');
sb.append("Game: ").append(GameConstants.getGameVersion()).append('\n');
sb.append("HTTP: ").append(scheme).append("://").append(addr).append(":").append(port).append('\n');
sb.append("Uptime: ").append(formatUptime(uptimeMs)).append('\n');
sb.append("CPU: ").append(getCpu()).append('\n');
sb.append("Load: ").append(getLoad()).append('\n');
sb.append("Disk: ").append(getDisk()).append('\n');
sb.append("Memory: ").append(String.format("%.1fMB (max %.1fMB)", usedMem, maxMem)).append('\n');
sb.append("Players: ").append(players);
return sb.toString();
}
private static String formatUptime(long ms) {
long s = ms / 1000;
long h = s / 3600;
long m = (s % 3600) / 60;
long sec = s % 60;
return String.format("%02dh:%02dm:%02ds", h, m, sec);
}
private static String getCpu() {
var os = ManagementFactory.getOperatingSystemMXBean();
double v = -1;
if (os instanceof com.sun.management.OperatingSystemMXBean) {
v = ((com.sun.management.OperatingSystemMXBean) os).getProcessCpuLoad();
}
return v >= 0 ? String.format("%.1f%%", v * 100.0) : "-";
}
private static String getLoad() {
var os = ManagementFactory.getOperatingSystemMXBean();
double v = -1;
if (os instanceof com.sun.management.OperatingSystemMXBean csm) {
v = csm.getCpuLoad();
}
if (v < 0) {
double avg = os.getSystemLoadAverage();
if (avg > 0) {
int cores = Runtime.getRuntime().availableProcessors();
v = Math.min(1.0, avg / cores);
}
}
return v >= 0 ? String.format("%.1f%%", v * 100.0) : "-";
}
private static String getDisk() {
var root = new File(".");
long total = root.getTotalSpace();
long usable = root.getUsableSpace();
if (total <= 0) return "-";
double usedPercent = (double) (total - usable) / (double) total * 100.0;
return String.format("%.1f%%", usedPercent);
}
}
@@ -0,0 +1,81 @@
package emu.nebula.command.commands;
import emu.nebula.Nebula;
import emu.nebula.command.Command;
import emu.nebula.command.CommandArgs;
import emu.nebula.command.CommandHandler;
import emu.nebula.game.ban.BanInfo;
import emu.nebula.game.player.Player;
import java.util.Locale;
@Command(label = "unban", permission = "admin.ban", desc = """
!unban {all | ip | uid} [player uid | ip]\
- all mode unbans both the player object and their IP address by UID, so the next parameter should be UID instead of IP
- ip mode can only unban IP addresses, so the next parameter should be an IP
- uid mode can only unban UIDs, so the next parameter should be a UID\
""")
public class UnbanCommand implements CommandHandler {
@Override
public String execute(CommandArgs args) {
if (args.size() < 2) {
return "Invalid amount of args";
}
int unbannedUid = 0;
String unbannedIp = null;
String mode = args.get(0).toLowerCase(Locale.ROOT);
if (!mode.equals("all") && !mode.equals("uid") && !mode.equals("ip"))
return "Unable to parse mode.";
if (mode.equals("ip")) {
unbannedIp = args.get(1);
} else {
try {
unbannedUid = Integer.parseInt(args.get(1));
} catch (NumberFormatException ignored) {
return "Unable to parse uid.";
}
}
var banModule = Nebula.getGameContext().getBanModule();
Player player = null;
if (!mode.equals("ip")) {
player = Nebula.getGameContext().getPlayerModule().getPlayer(unbannedUid);
if (player == null) {
return "Failed, player not found.";
}
}
switch (mode) {
case "all" -> {
BanInfo banInfo = banModule.getPlayerBanInfo(player.getUid());
banModule.unbanPlayer(player.getUid());
if (banInfo != null) {
unbannedIp = banInfo.getIpAddress();
if (unbannedIp != null)
banModule.unbanIp(unbannedIp);
}
return "Unban a player all mode " + unbannedUid;
} case "uid" -> {
banModule.unbanPlayer(player.getUid());
return "Unban a player " + unbannedUid;
} case "ip" -> {
banModule.unbanIp(unbannedIp);
return "Unban a ip " + unbannedIp;
}
default -> {
// Fallback
return "Unban sub command not found";
}
}
}
}
+93 -33
View File
@@ -11,14 +11,14 @@ import java.util.stream.Collectors;
import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import emu.nebula.data.custom.CharGemAttrGroupDef;
import emu.nebula.data.resources.*;
import lombok.Getter;
@SuppressWarnings("unused")
public class GameData {
// Characters
// ===== Characters =====
@Getter private static DataTable<CharacterDef> CharacterDataTable = new DataTable<>();
@Getter private static DataTable<CharacterAdvanceDef> CharacterAdvanceDataTable = new DataTable<>();
@Getter private static DataTable<CharacterSkillUpgradeDef> CharacterSkillUpgradeDataTable = new DataTable<>();
@@ -28,29 +28,43 @@ public class GameData {
@Getter private static DataTable<TalentGroupDef> TalentGroupDataTable = new DataTable<>();
@Getter private static DataTable<TalentDef> TalentDataTable = new DataTable<>();
// Characters: Emblems
@Getter private static DataTable<CharGemDef> CharGemDataTable = new DataTable<>();
@Getter private static DataTable<CharGemSlotControlDef> CharGemSlotControlDataTable = new DataTable<>();
@Getter private static DataTable<CharGemAttrGroupDef> CharGemAttrGroupDataTable = new DataTable<>();
@Getter private static DataTable<CharGemAttrTypeDef> CharGemAttrTypeDataTable = new DataTable<>();
@Getter private static DataTable<CharGemAttrValueDef> CharGemAttrValueDataTable = new DataTable<>();
// Characters: Affinity
@Getter private static DataTable<AffinityLevelDef> AffinityLevelDataTable = new DataTable<>();
@Getter private static DataTable<AffinityGiftDef> AffinityGiftDataTable = new DataTable<>();
@Getter private static DataTable<PlotDef> PlotDataTable = new DataTable<>();
// Characters: Phone
@Getter private static DataTable<ChatDef> ChatDataTable = new DataTable<>();
// Discs
// Characters: Dating
@Getter private static DataTable<DatingLandmarkDef> DatingLandmarkDataTable = new DataTable<>();
@Getter private static DataTable<DatingLandmarkEventDef> DatingLandmarkEventDataTable = new DataTable<>();
@Getter private static DataTable<DatingCharacterEventDef> DatingCharacterEventDataTable = new DataTable<>();
// ===== Discs =====
@Getter private static DataTable<DiscDef> DiscDataTable = new DataTable<>();
@Getter private static DataTable<DiscStrengthenDef> DiscStrengthenDataTable = new DataTable<>();
@Getter private static DataTable<DiscItemExpDef> DiscItemExpDataTable = new DataTable<>();
@Getter private static DataTable<DiscPromoteDef> DiscPromoteDataTable = new DataTable<>();
@Getter private static DataTable<DiscPromoteLimitDef> DiscPromoteLimitDataTable = new DataTable<>();
// Items
// Discs: Melody items
@Getter private static DataTable<SecondarySkillDef> SecondarySkillDataTable = new DataTable<>();
// ===== Items =====
@Getter private static DataTable<ItemDef> ItemDataTable = new DataTable<>();
@Getter private static DataTable<ProductionDef> ProductionDataTable = new DataTable<>();
@Getter private static DataTable<PlayerHeadDef> PlayerHeadDataTable = new DataTable<>();
@Getter private static DataTable<TitleDef> titleDataTable = new DataTable<>();
@Getter private static DataTable<HonorDef> honorDataTable = new DataTable<>();
// Shops
// ===== Shops =====
@Getter private static DataTable<MallMonthlyCardDef> MallMonthlyCardDataTable = new DataTable<>();
@Getter private static DataTable<MallPackageDef> MallPackageDataTable = new DataTable<>();
@Getter private static DataTable<MallShopDef> MallShopDataTable = new DataTable<>();
@@ -59,20 +73,43 @@ public class GameData {
@Getter private static DataTable<ResidentShopDef> ResidentShopDataTable = new DataTable<>();
@Getter private static DataTable<ResidentGoodsDef> ResidentGoodsDataTable = new DataTable<>();
// Battle Pass
// ===== Battle Pass =====
@Getter private static DataTable<BattlePassDef> BattlePassDataTable = new DataTable<>();
@Getter private static DataTable<BattlePassLevelDef> BattlePassLevelDataTable = new DataTable<>();
@Getter private static DataTable<BattlePassQuestDef> BattlePassQuestDataTable = new DataTable<>();
@Getter private static DataTable<BattlePassRewardDef> BattlePassRewardDataTable = new DataTable<>();
// Commissions
// ===== Commissions =====
@Getter private static DataTable<AgentDef> AgentDataTable = new DataTable<>();
// Dictionary
// ===== Dictionary =====
@Getter private static DataTable<DictionaryTabDef> DictionaryTabDataTable = new DataTable<>();
@Getter private static DataTable<DictionaryEntryDef> DictionaryEntryDataTable = new DataTable<>();
// Instances
// ===== Gacha =====
@Getter private static DataTable<GachaDef> GachaDataTable = new DataTable<>();
@Getter private static DataTable<GachaStorageDef> GachaStorageDataTable = new DataTable<>();
// ===== Story =====
@Getter private static DataTable<StoryDef> StoryDataTable = new DataTable<>();
@Getter private static DataTable<StorySetSectionDef> StorySetSectionDataTable = new DataTable<>();
@Getter private static DataTable<StoryEvidenceDef> StoryEvidenceDataTable = new DataTable<>();
@Getter private static DataTable<MainScreenCGDef> MainScreenCGDataTable = new DataTable<>();
// ===== Daily/Weekly Quests =====
@Getter private static DataTable<DailyQuestDef> DailyQuestDataTable = new DataTable<>();
@Getter private static DataTable<DailyQuestActiveDef> DailyQuestActiveDataTable = new DataTable<>();
@Getter private static DataTable<WeeklyQuestDef> WeeklyQuestDataTable = new DataTable<>();
@Getter private static DataTable<WeeklyQuestActiveDef> WeeklyQuestActiveDataTable = new DataTable<>();
// ===== Achievements =====
@Getter private static DataTable<AchievementDef> AchievementDataTable = new DataTable<>();
// ===== Tutorials =====
@Getter private static DataTable<TutorialLevelDef> TutorialLevelDataTable = new DataTable<>();
// ===== Instances =====
@Getter private static DataTable<DailyInstanceDef> DailyInstanceDataTable = new DataTable<>();
@Getter private static DataTable<DailyInstanceRewardGroupDef> DailyInstanceRewardGroupDataTable = new DataTable<>();
@Getter private static DataTable<RegionBossLevelDef> RegionBossLevelDataTable = new DataTable<>();
@@ -80,41 +117,64 @@ public class GameData {
@Getter private static DataTable<CharGemInstanceDef> CharGemInstanceDataTable = new DataTable<>();
@Getter private static DataTable<WeekBossLevelDef> WeekBossLevelDataTable = new DataTable<>();
@Getter private static DataTable<GachaDef> GachaDataTable = new DataTable<>();
@Getter private static DataTable<GachaStorageDef> GachaStorageDataTable = new DataTable<>();
@Getter private static DataTable<WorldClassDef> WorldClassDataTable = new DataTable<>();
@Getter private static DataTable<GuideGroupDef> GuideGroupDataTable = new DataTable<>();
@Getter private static DataTable<HandbookDef> HandbookDataTable = new DataTable<>();
@Getter private static DataTable<StoryDef> StoryDataTable = new DataTable<>();
@Getter private static DataTable<StorySetSectionDef> StorySetSectionDataTable = new DataTable<>();
// Daily quests
@Getter private static DataTable<DailyQuestDef> DailyQuestDataTable = new DataTable<>();
@Getter private static DataTable<DailyQuestActiveDef> DailyQuestActiveDataTable = new DataTable<>();
// Tutorial
@Getter private static DataTable<TutorialLevelDef> TutorialLevelDataTable = new DataTable<>();
// Star tower
// ===== Star Tower =====
@Getter private static DataTable<StarTowerDef> StarTowerDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerStageDef> StarTowerStageDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerGrowthNodeDef> StarTowerGrowthNodeDataTable = new DataTable<>();
@Getter private static DataTable<PotentialDef> PotentialDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerFloorExpDef> StarTowerFloorExpDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerTeamExpDef> StarTowerTeamExpDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerEventDef> StarTowerEventDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerBuildRankDef> StarTowerBuildRankDataTable = new DataTable<>();
@Getter private static DataTable<SubNoteSkillPromoteGroupDef> SubNoteSkillPromoteGroupDataTable = new DataTable<>();
@Getter private static DataTable<PotentialDef> PotentialDataTable = new DataTable<>();
@Getter private static DataTable<CharPotentialDef> CharPotentialDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerBookFateCardBundleDef> StarTowerBookFateCardBundleDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerBookFateCardQuestDef> StarTowerBookFateCardQuestDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerBookFateCardDef> StarTowerBookFateCardDataTable = new DataTable<>();
@Getter private static DataTable<FateCardDef> FateCardDataTable = new DataTable<>();
// Infinity Tower
// ===== Infinity Tower =====
@Getter private static DataTable<InfinityTowerLevelDef> InfinityTowerLevelDataTable = new DataTable<>();
@Getter private static DataTable<InfinityTowerDifficultyDef> InfinityTowerDifficultyDataTable = new DataTable<>();
// Vampire survivor
// ===== Vampire Survivor =====
@Getter private static DataTable<VampireSurvivorDef> VampireSurvivorDataTable = new DataTable<>();
@Getter private static DataTable<VampireTalentDef> VampireTalentDataTable = new DataTable<>();
// Score boss
// ===== Score Boss =====
@Getter private static DataTable<ScoreBossControlDef> ScoreBossControlDataTable = new DataTable<>();
}
@Getter private static DataTable<ScoreBossRewardDef> ScoreBossRewardDataTable = new DataTable<>();
// ===== Misc =====
@Getter private static DataTable<WorldClassDef> WorldClassDataTable = new DataTable<>();
@Getter private static DataTable<GuideGroupDef> GuideGroupDataTable = new DataTable<>();
@Getter private static DataTable<HandbookDef> HandbookDataTable = new DataTable<>();
@Getter private static DataTable<SignInDef> SignInDataTable = new DataTable<>();
// ===== Activity =====
@Getter private static DataTable<ActivityDef> ActivityDataTable = new DataTable<>();
// Activity: Login Reward
@Getter private static DataTable<LoginRewardGroupControlDef> LoginRewardGroupControlDataTable = new DataTable<>();
// Activity: Tower Defense
@Getter private static DataTable<TowerDefenseLevelDef> TowerDefenseLevelDataTable = new DataTable<>();
// Activity: Trials
@Getter private static DataTable<TrialControlDef> TrialControlDataTable = new DataTable<>();
@Getter private static DataTable<TrialGroupDef> TrialGroupDataTable = new DataTable<>();
// Activity: Levels
@Getter private static DataTable<ActivityLevelsLevelDef> ActivityLevelsLevelDataTable = new DataTable<>();
// Activity: Task
@Getter private static DataTable<ActivityTaskDef> ActivityTaskDataTable = new DataTable<>();
@Getter private static DataTable<ActivityTaskGroupDef> ActivityTaskGroupDataTable = new DataTable<>();
// Activity: Shop
@Getter private static DataTable<ActivityShopDef> ActivityShopDataTable = new DataTable<>();
@Getter private static DataTable<ActivityShopControlDef> ActivityShopControlDataTable = new DataTable<>();
@Getter private static DataTable<ActivityGoodsDef> ActivityGoodsDataTable = new DataTable<>();
}
@@ -1,5 +1,6 @@
package emu.nebula.data;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.util.List;
import java.util.stream.Collectors;
@@ -9,6 +10,7 @@ import org.reflections.Reflections;
import emu.nebula.util.JsonUtils;
import emu.nebula.util.Utils;
import emu.nebula.Nebula;
import emu.nebula.game.achievement.AchievementHelper;
public class ResourceLoader {
private static boolean loaded = false;
@@ -21,6 +23,9 @@ public class ResourceLoader {
// Load
loadResources();
// Add hardcoded achievements params
AchievementHelper.init();
// Done
loaded = true;
Nebula.getLogger().info("Resource loading complete");
@@ -54,9 +59,26 @@ public class ResourceLoader {
int count = 0;
try {
var json = JsonUtils.loadToMap(Nebula.getConfig().resourceDir + "/bin/" + type.name(), String.class, resourceClass);
// Init defs collection
Iterable<?> defs = null;
// Load resource file
if (type.useInternal()) {
// Load from internal resources in jar
try (var in = ResourceLoader.class.getResourceAsStream("/defs/" + type.name()); var reader = new InputStreamReader(in)) {
defs = JsonUtils.loadToList(reader, resourceClass);
} catch (Exception e) {
// Ignored
}
} else {
// Load json from ./resources/bin/ folder
var json = JsonUtils.loadToMap(Nebula.getConfig().resourceDir + "/bin/" + type.name(), String.class, resourceClass);
// Get json values
defs = json.values();
}
for (Object o : json.values()) {
for (Object o : defs) {
BaseDef res = (BaseDef) o;
if (res == null) {
@@ -10,13 +10,15 @@ public @interface ResourceType {
String name();
/**
* Load priority - dictates which order to load this resource, with "highest"
* being loaded first
* Load priority - dictates which order to load this resource, with "highest" being loaded first
*/
LoadPriority loadPriority() default LoadPriority.NORMAL;
Class<?> keyType() default int.class;
/**
* Loads the resource file from inside the jar (./resources/defs/) if set to true
*/
boolean useInternal() default false;
public enum LoadPriority {
HIGHEST(4), HIGH(3), NORMAL(2), LOW(1), LOWEST(0);
@@ -0,0 +1,33 @@
package emu.nebula.data.custom;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
@Getter
@ResourceType(name = "AchievementParam.json", useInternal = true, loadPriority = LoadPriority.LOW)
public class AchievementParamDef extends BaseDef {
private int Id;
private int Param1;
private int ParamCond1;
private int Param2;
private int ParamCond2;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
var achievement = GameData.getAchievementDataTable().get(this.Id);
if (achievement == null) {
return;
}
achievement.setParams(this);
}
}
@@ -1,32 +1,37 @@
package emu.nebula.data.resources;
package emu.nebula.data.custom;
import java.util.List;
import java.util.Map;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import emu.nebula.util.JsonUtils;
import emu.nebula.data.resources.CharGemAttrValueDef;
import emu.nebula.util.WeightedList;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import lombok.Getter;
@Getter
@ResourceType(name = "CharGemAttrGroup.json", loadPriority = LoadPriority.HIGH)
@ResourceType(name = "CharGemAttrGroups.json", useInternal = true)
public class CharGemAttrGroupDef extends BaseDef {
private int GroupId;
private int GroupType;
private int Id;
private int Weight;
private String UniqueAttrNumWeight;
private IntArrayList AttrTypes;
private Map<Integer, Integer> UniqueAttrNumWeights;
private transient WeightedList<Integer> uniqueAttrNum;
private transient List<CharGemAttrTypeDef> attributeTypes;
private transient List<CharGemAttrTypeData> attributeTypes;
public CharGemAttrGroupDef() {
this.AttrTypes = new IntArrayList();
}
@Override
public int getId() {
return GroupId;
return Id;
}
public int getRandomUniqueAttrNum() {
@@ -37,7 +42,7 @@ public class CharGemAttrGroupDef extends BaseDef {
return this.uniqueAttrNum.next();
}
public CharGemAttrTypeDef getRandomAttributeType(IntList list) {
public CharGemAttrTypeData getRandomAttributeType(IntList list) {
// Setup blacklist to prevent the same attribute from showing up twice
var blacklist = new IntOpenHashSet();
@@ -50,7 +55,7 @@ public class CharGemAttrGroupDef extends BaseDef {
}
// Create random generator
var random = new WeightedList<CharGemAttrTypeDef>();
var random = new WeightedList<CharGemAttrTypeData>();
for (var type : this.getAttributeTypes()) {
if (blacklist.contains(type.getId())) {
@@ -65,15 +70,44 @@ public class CharGemAttrGroupDef extends BaseDef {
@Override
public void onLoad() {
// Init unique attribute weights
this.uniqueAttrNum = new WeightedList<>();
this.attributeTypes = new ObjectArrayList<>();
if (this.UniqueAttrNumWeight != null) {
var json = JsonUtils.decodeMap(this.UniqueAttrNumWeight, Integer.class, Integer.class);
for (var entry : json.entrySet()) {
if (this.UniqueAttrNumWeights != null) {
for (var entry : this.UniqueAttrNumWeights.entrySet()) {
this.uniqueAttrNum.add(entry.getValue(), entry.getKey());
}
}
// Init attribute types
this.attributeTypes = new ObjectArrayList<>();
for (int id : this.getAttrTypes()) {
var type = new CharGemAttrTypeData(id);
this.attributeTypes.add(type);
}
}
@Getter
public static class CharGemAttrTypeData {
private int id;
private WeightedList<CharGemAttrValueDef> values;
public CharGemAttrTypeData(int id) {
this.id = id;
this.values = new WeightedList<>();
}
public void addValue(CharGemAttrValueDef value) {
this.values.add(value.getRarity(), value);
}
public CharGemAttrValueDef getRandomValueData() {
return this.getValues().next();
}
public int getRandomValue() {
return this.getRandomValueData().getId();
}
}
}
@@ -0,0 +1,77 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.data.custom.AchievementParamDef;
import emu.nebula.game.achievement.AchievementHelper;
import emu.nebula.game.achievement.AchievementParamCond;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import lombok.Getter;
@Getter
@ResourceType(name = "Achievement.json")
public class AchievementDef extends BaseDef {
private int Id;
private int Type;
private int CompleteCond;
private int AimNumShow;
private int[] Prerequisites;
// Reward
private int Tid1;
private int Qty1;
// Custom params
private transient int param1;
private transient AchievementParamCond paramCond1;
private transient int param2;
private transient AchievementParamCond paramCond2;
@Override
public int getId() {
return Id;
}
@Deprecated
public void setParams(int param1, int param2) {
this.param1 = param1;
this.param2 = param2;
}
public void setParams(AchievementParamDef params) {
this.param1 = params.getParam1();
this.param2 = params.getParam2();
this.paramCond1 = AchievementParamCond.getByValue(params.getParamCond1());
this.paramCond2 = AchievementParamCond.getByValue(params.getParamCond2());
}
/**
* Checks if this achievement requires params to match
*/
public boolean matchParam1(int value) {
if (this.paramCond1 == null) {
this.paramCond1 = AchievementParamCond.EQUALS;
}
return this.paramCond1.test(this.param1, value);
}
/**
* Checks if this achievement requires params to match
*/
public boolean matchParam2(int value) {
if (this.paramCond2 == null) {
this.paramCond2 = AchievementParamCond.EQUALS;
}
return this.paramCond2.test(this.param2, value);
}
@Override
public void onLoad() {
// Add to cached achievement list
var list = AchievementHelper.getCache().computeIfAbsent(this.CompleteCond, i -> new ObjectArrayList<>());
list.add(this);
}
}
@@ -0,0 +1,25 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "Activity.json")
public class ActivityDef extends BaseDef {
private int Id;
private int ActivityType;
private transient emu.nebula.game.activity.ActivityType type;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.type = emu.nebula.game.activity.ActivityType.getByValue(this.ActivityType);
}
}
@@ -0,0 +1,38 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityGoods.json", loadPriority = LoadPriority.LOW)
public class ActivityGoodsDef extends BaseDef {
private int Id;
private int ShopId;
private int ItemId;
private int ItemQuantity;
private int MaximumLimit;
private int Price;
private transient ItemParamMap items;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
var shop = GameData.getActivityShopDataTable().get(this.getShopId());
if (shop != null) {
shop.getGoods().put(this.getId(), this);
}
this.items = new ItemParamMap();
this.items.add(this.ItemId, this.ItemQuantity);
}
}
@@ -0,0 +1,65 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.instance.InstanceData;
import emu.nebula.game.inventory.ItemRewardList;
import emu.nebula.game.inventory.ItemRewardParam;
import emu.nebula.util.JsonUtils;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityLevelsLevel.json")
public class ActivityLevelsLevelDef extends BaseDef implements InstanceData {
private int Id;
private int ActivityId;
private int EnergyConsume;
private String CompleteRewardPreview;
private transient ItemRewardList firstRewards;
private transient ItemRewardList rewards;
@Override
public int getId() {
return Id;
}
@Override
public int getNeedWorldClass() {
return 0;
}
@Override
public void onLoad() {
// Init reward lists
this.firstRewards = new ItemRewardList();
this.rewards = new ItemRewardList();
// Parse rewards
var awards = JsonUtils.decodeList(this.CompleteRewardPreview, int[].class);
if (awards == null) {
return;
}
for (int[] award : awards) {
int itemId = award[0];
int min = award[1];
int max = award.length >= 4 ? award[2] : min;
boolean isFirst = award[award.length - 1] == 1;
if (min == -1) {
min = 0;
max = 1;
}
var reward = new ItemRewardParam(itemId, min, max);
if (isFirst) {
this.firstRewards.add(reward);
} else {
this.rewards.add(reward);
}
}
}
}
@@ -0,0 +1,18 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityShopControl.json")
public class ActivityShopControlDef extends BaseDef {
private int Id;
private int[] ShopIds;
@Override
public int getId() {
return Id;
}
}
@@ -0,0 +1,28 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityShop.json")
public class ActivityShopDef extends BaseDef {
private int Id;
private int CurrencyItemId;
private int ExchangeItemId;
private double Rate;
private Int2ObjectMap<ActivityGoodsDef> goods;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.goods = new Int2ObjectOpenHashMap<>();
}
}
@@ -0,0 +1,40 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityTask.json")
public class ActivityTaskDef extends BaseDef {
private int Id;
private int ActivityTaskGroupId;
private int CompleteCond;
private int AimNumShow;
private int Tid1;
private int Qty1;
private int Tid2;
private int Qty2;
private transient ItemParamMap rewards;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.rewards = new ItemParamMap();
if (this.Tid1 > 0) {
this.rewards.add(this.Tid1, this.Qty1);
}
if (this.Tid2 > 0) {
this.rewards.add(this.Tid2, this.Qty2);
}
}
}
@@ -0,0 +1,57 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityTaskGroup.json")
public class ActivityTaskGroupDef extends BaseDef {
private int Id;
private int ActivityId;
private int Reward1;
private int RewardQty1;
private int Reward2;
private int RewardQty2;
private int Reward3;
private int RewardQty3;
private int Reward4;
private int RewardQty4;
private int Reward5;
private int RewardQty5;
private int Reward6;
private int RewardQty6;
private transient ItemParamMap rewards;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.rewards = new ItemParamMap();
if (this.Reward1 > 0) {
this.rewards.add(this.Reward1, this.RewardQty1);
}
if (this.Reward2 > 0) {
this.rewards.add(this.Reward2, this.RewardQty2);
}
if (this.Reward3 > 0) {
this.rewards.add(this.Reward3, this.RewardQty3);
}
if (this.Reward4 > 0) {
this.rewards.add(this.Reward4, this.RewardQty4);
}
if (this.Reward5 > 0) {
this.rewards.add(this.Reward5, this.RewardQty5);
}
if (this.Reward6 > 0) {
this.rewards.add(this.Reward6, this.RewardQty6);
}
}
}
@@ -0,0 +1,20 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "AffinityGift.json")
public class AffinityGiftDef extends BaseDef {
private int Id;
private int BaseAffinity;
private int[] Tags;
@Override
public int getId() {
return Id;
}
}
@@ -0,0 +1,19 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "AffinityLevel.json")
public class AffinityLevelDef extends BaseDef {
private int AffinityLevel;
private int NeedExp;
@Override
public int getId() {
return AffinityLevel;
}
}
@@ -1,10 +1,15 @@
package emu.nebula.data.resources;
import java.util.List;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.character.GameCharacter;
import emu.nebula.game.inventory.ItemRewardList;
import emu.nebula.game.inventory.ItemRewardParam;
import emu.nebula.util.JsonUtils;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import lombok.Getter;
@@ -35,6 +40,8 @@ public class AgentDef extends BaseDef {
private String BonusPreview4;
private transient Int2ObjectMap<AgentDurationDef> durations;
private transient Int2IntOpenHashMap tags;
private transient Int2IntOpenHashMap extraTags;
@Override
public int getId() {
@@ -45,14 +52,83 @@ public class AgentDef extends BaseDef {
this.durations.put(duration.getTime(), duration);
}
public boolean hasTags(List<GameCharacter> characters) {
// Get character tags
var characterTags = new Int2IntOpenHashMap();
for (var character : characters) {
var data = character.getData().getDes();
for (int tag : data.getTag()) {
characterTags.addTo(tag, 1);
}
}
// Validate that we have the tags
for (var entry : this.tags.int2IntEntrySet()) {
int reqTagId = entry.getIntKey();
int reqTagCount = entry.getIntValue();
// Get amount of tags that we have from our characters
int characterTagCount = characterTags.get(reqTagId);
if (reqTagCount > characterTagCount) {
return false;
}
}
return true;
}
public boolean hasExtraTags(List<GameCharacter> characters) {
// Get character tags
var characterTags = new Int2IntOpenHashMap();
for (var character : characters) {
var data = character.getData().getDes();
for (int tag : data.getTag()) {
characterTags.addTo(tag, 1);
}
}
// Validate that we have the tags
for (var entry : this.extraTags.int2IntEntrySet()) {
int reqTagId = entry.getIntKey();
int reqTagCount = entry.getIntValue();
// Get amount of tags that we have from our characters
int characterTagCount = characterTags.get(reqTagId);
if (reqTagCount > characterTagCount) {
return false;
}
}
return true;
}
@Override
public void onLoad() {
// Cache durations
this.durations = new Int2ObjectOpenHashMap<>();
this.addDuration(new AgentDurationDef(this.Time1, this.RewardPreview1, this.BonusPreview1));
this.addDuration(new AgentDurationDef(this.Time2, this.RewardPreview2, this.BonusPreview2));
this.addDuration(new AgentDurationDef(this.Time3, this.RewardPreview3, this.BonusPreview3));
this.addDuration(new AgentDurationDef(this.Time4, this.RewardPreview4, this.BonusPreview4));
// Cache tags
this.tags = new Int2IntOpenHashMap();
this.extraTags = new Int2IntOpenHashMap();
for (int tag : this.Tags) {
this.tags.addTo(tag, 1);
}
for (int tag : this.ExtraTags) {
this.extraTags.addTo(tag, 1);
}
}
@Getter
@@ -23,6 +23,11 @@ public class BattlePassQuestDef extends BaseDef implements QuestData {
return Id;
}
@Override
public long getQuestKey() {
return Id;
}
public boolean isDaily() {
return this.Type == 1;
}
@@ -1,39 +0,0 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.util.WeightedList;
import lombok.Getter;
@Getter
@ResourceType(name = "CharGemAttrType.json")
public class CharGemAttrTypeDef extends BaseDef {
private int Id;
private int GroupId;
private transient WeightedList<CharGemAttrValueDef> values;
@Override
public int getId() {
return Id;
}
public CharGemAttrValueDef getRandomValueData() {
return this.getValues().next();
}
public int getRandomValue() {
return this.getRandomValueData().getId();
}
@Override
public void onLoad() {
this.values = new WeightedList<>();
var data = GameData.getCharGemAttrGroupDataTable().get(this.GroupId);
if (data != null) {
data.getAttributeTypes().add(this);
}
}
}
@@ -12,8 +12,6 @@ public class CharGemAttrValueDef extends BaseDef {
private int Id;
private int TypeId;
private int AttrType;
private int AttrTypeFirstSubtype;
private int AttrTypeSecondSubtype;
private int Rarity;
@Override
@@ -23,9 +21,18 @@ public class CharGemAttrValueDef extends BaseDef {
@Override
public void onLoad() {
var data = GameData.getCharGemAttrTypeDataTable().get(this.TypeId);
if (data != null) {
data.getValues().add(this.getRarity(), this);
// Cache attribute values into attribute group defs
// Honestly a horrible/inefficient way of doing this
for (var data : GameData.getCharGemAttrGroupDataTable()) {
for (var type : data.getAttributeTypes()) {
// Skip if type id doesnt match
if (type.getId() != this.getTypeId()) {
continue;
}
// Add
type.addValue(this);
}
}
}
}
@@ -1,7 +1,6 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@@ -17,8 +16,4 @@ public class CharGemDef extends BaseDef {
public int getId() {
return Id;
}
public CharGemSlotControlDef getControlData() {
return GameData.getCharGemSlotControlDataTable().get(this.Type);
}
}
@@ -3,8 +3,10 @@ package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.util.CustomIntArray;
import emu.nebula.data.custom.CharGemAttrGroupDef;
import emu.nebula.util.Utils;
import emu.nebula.util.WeightedList;
import emu.nebula.util.ints.CustomIntArray;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@@ -19,16 +21,15 @@ public class CharGemSlotControlDef extends BaseDef {
private int GeneratenCostQty;
private int RefreshCostQty;
private int UniqueAttrGroupProb;
private int UniqueAttrGroupId;
private int GuaranteeCount;
private int[] AttrGroupId;
private int LockableNum;
private int LockItemTid;
private int LockItemQty;
// These have to be hardcoded now
private transient int UniqueAttrGroupProb;
private transient int UniqueAttrGroupId;
private transient int[] AttrGroupId;
@Override
public int getId() {
return Id;
@@ -38,9 +39,15 @@ public class CharGemSlotControlDef extends BaseDef {
return this.generateAttributes(new CustomIntArray());
}
// Check if we should add unique attributes based on the probablity
private boolean shouldAddUniqueAttr() {
int random = Utils.randomRange(1, 10000);
return random <= this.UniqueAttrGroupProb;
}
public IntList generateAttributes(CustomIntArray list) {
// Add unique attributes
if (this.UniqueAttrGroupId > 0) {
if (this.UniqueAttrGroupId > 0 && this.shouldAddUniqueAttr()) {
var group = GameData.getCharGemAttrGroupDataTable().get(this.UniqueAttrGroupId);
int num = group.getRandomUniqueAttrNum();
@@ -49,7 +56,7 @@ public class CharGemSlotControlDef extends BaseDef {
list.add(attributeType.getRandomValue());
}
if (list.size() >= this.MaxAlterNum) {
if (list.getValueCount() >= this.MaxAlterNum) {
return list;
}
}
@@ -76,4 +83,25 @@ public class CharGemSlotControlDef extends BaseDef {
// Complete
return list;
}
@Override
public void onLoad() {
// Hard coded values
switch (this.Id) {
case 3:
this.UniqueAttrGroupProb = 3300;
this.UniqueAttrGroupId = 12;
this.AttrGroupId = new int[] {9, 10};
break;
case 2:
this.UniqueAttrGroupProb = 4000;
this.UniqueAttrGroupId = 11;
this.AttrGroupId = new int[] {5, 6, 7, 8};
break;
case 1:
default:
this.AttrGroupId = new int[] {1, 2, 3, 4};
break;
}
}
}
@@ -0,0 +1,51 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@Getter
@ResourceType(name = "CharPotential.json")
public class CharPotentialDef extends BaseDef {
private int Id;
private int[] MasterSpecificPotentialIds;
private int[] AssistSpecificPotentialIds;
private int[] CommonPotentialIds;
private int[] MasterNormalPotentialIds;
private int[] AssistNormalPotentialIds;
@Override
public int getId() {
return Id;
}
public IntList getPotentialList(boolean main, boolean special) {
// Create list
var list = new IntArrayList();
//
if (main) {
if (special) {
list.addElements(0, this.getMasterSpecificPotentialIds());
} else {
list.addElements(0, this.getMasterNormalPotentialIds());
}
} else {
if (special) {
list.addElements(0, this.getAssistSpecificPotentialIds());
} else {
list.addElements(0, this.getAssistNormalPotentialIds());
}
}
if (!special) {
list.addElements(0, this.getCommonPotentialIds());
}
// Complete
return list;
}
}
@@ -31,6 +31,7 @@ public class CharacterDef extends BaseDef {
private int[] GemSlots;
private transient CharacterDesDef des;
private transient ElementType elementType;
private transient List<ChatDef> chats;
@@ -38,6 +39,10 @@ public class CharacterDef extends BaseDef {
public int getId() {
return Id;
}
protected void setDes(CharacterDesDef des) {
this.des = des;
}
public int getSkillsUpgradeGroup(int index) {
if (index < 0 || index >= this.SkillsUpgradeGroup.length) {
@@ -0,0 +1,60 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import lombok.Getter;
@Getter
@ResourceType(name = "CharacterDes.json", loadPriority = LoadPriority.LOW)
public class CharacterDesDef extends BaseDef {
private int Id;
private IntOpenHashSet Tag;
private IntOpenHashSet PreferTags;
private IntOpenHashSet HateTags;
@Override
public int getId() {
return Id;
}
public boolean isPreferGift(AffinityGiftDef gift) {
if (this.getPreferTags() == null) {
return false;
}
for (int i = 0; i < gift.getTags().length; i++) {
int tag = gift.getTags()[i];
if (this.getPreferTags().contains(tag)) {
return true;
}
}
return false;
}
public boolean isHateGift(AffinityGiftDef gift) {
if (this.getHateTags() == null) {
return false;
}
for (int i = 0; i < gift.getTags().length; i++) {
int tag = gift.getTags()[i];
if (this.getHateTags().contains(tag)) {
return true;
}
}
return false;
}
@Override
public void onLoad() {
var character = GameData.getCharacterDataTable().get(this.getId());
if (character != null) {
character.setDes(this);
}
}
}
@@ -0,0 +1,32 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
@Getter
@ResourceType(name = "DatingBranch.json", loadPriority = LoadPriority.LOW)
public class DatingBranchDef extends BaseDef {
private int Id;
private int DatingEventType;
private int[] DatingEventParams;
@Override
public int getId() {
return Id;
}
public int getLandmarkId() {
if (this.DatingEventParams.length <= 0) {
return 0;
}
return this.DatingEventParams[0];
}
@Override
public void onLoad() {
}
}
@@ -0,0 +1,11 @@
package emu.nebula.data.resources;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
@Getter
@ResourceType(name = "DatingCharacterEvent.json", loadPriority = LoadPriority.LOW)
public class DatingCharacterEventDef extends DatingLandmarkEventDef {
}
@@ -0,0 +1,61 @@
package emu.nebula.data.resources;
import java.util.ArrayList;
import java.util.List;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.dating.DatingEvent;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import lombok.Getter;
@Getter
@ResourceType(name = "DatingLandmark.json")
public class DatingLandmarkDef extends BaseDef {
private int Id;
private transient List<DatingEvent> afterBranches;
private transient Object2ObjectMap<String, List<DatingEvent>> characterEvents;
private transient Object2ObjectMap<String, List<DatingEvent>> landmarkEvents;
@Override
public int getId() {
return Id;
}
public int getRandomAfterBranchId() {
var event = Utils.randomElement(this.afterBranches);
if (event == null) {
return 0;
}
return event.getId();
}
public int getRandomCharacterEventId() {
var list = new ArrayList<DatingEvent>();
for (var events : this.characterEvents.values()) {
list.addAll(events);
}
// Get random event
var event = Utils.randomElement(list);
if (event == null) {
return 0;
}
return event.getId();
}
@Override
public void onLoad() {
this.afterBranches = new ArrayList<>();
this.characterEvents = new Object2ObjectOpenHashMap<>();
this.landmarkEvents = new Object2ObjectOpenHashMap<>();
}
}
@@ -0,0 +1,66 @@
package emu.nebula.data.resources;
import java.util.ArrayList;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import emu.nebula.game.dating.DatingEvent;
import lombok.Getter;
@Getter
@ResourceType(name = "DatingLandmarkEvent.json", loadPriority = LoadPriority.LOW)
public class DatingLandmarkEventDef extends BaseDef implements DatingEvent {
private int Id;
private int DatingEventType;
private int Affinity;
private int[] DatingEventParams;
private String Response;
private transient emu.nebula.game.dating.DatingEventType type;
@Override
public int getId() {
return Id;
}
public int getLandmarkId() {
if (this.DatingEventParams.length <= 0) {
return 0;
}
return this.DatingEventParams[0];
}
@Override
public void onLoad() {
// Cache dating event type
this.type = emu.nebula.game.dating.DatingEventType.getByValue(this.getDatingEventType());
// Add to landmark data
var data = GameData.getDatingLandmarkDataTable().get(this.getLandmarkId());
if (data == null) {
return;
}
switch (this.getType()) {
case Landmark -> {
data.getLandmarkEvents()
.computeIfAbsent(this.getResponse(), s -> new ArrayList<>())
.add(this);
}
case Regular -> {
data.getCharacterEvents()
.computeIfAbsent(this.getResponse(), s -> new ArrayList<>())
.add(this);
}
case AfterBranch -> {
data.getAfterBranches().add(this);
}
default -> {
// Ignored
}
}
}
}
@@ -18,6 +18,9 @@ public class DiscDef extends BaseDef {
private int TransformItemId;
private int[] MaxStarTransformItem;
private int[] ReadReward;
private int SecondarySkillGroupId1;
private int SecondarySkillGroupId2;
private int SubNoteSkillGroupId;
private transient ElementType elementType;
@@ -0,0 +1,40 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@Getter
@ResourceType(name = "DropPkg.json")
public class DropPkgDef extends BaseDef {
private int PkgId;
private int ItemId;
private static Int2ObjectMap<IntList> PACKAGES = new Int2ObjectOpenHashMap<>();
@Override
public int getId() {
return PkgId;
}
@Override
public void onLoad() {
var packageList = PACKAGES.computeIfAbsent(this.PkgId, i -> new IntArrayList());
packageList.add(this.ItemId);
}
public static int getRandomDrop(int packageId) {
var packageList = PACKAGES.get(packageId);
if (packageList == null) {
return 0;
}
return Utils.randomElement(packageList);
}
}
@@ -0,0 +1,34 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
/**
* We don't need a DataTable for this, since we are only using this class to verify event options for the client
*/
@Getter
@ResourceType(name = "EventOptions.json", loadPriority = LoadPriority.LOW)
public class EventOptionsDef extends BaseDef {
private int Id;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
// Get event
var event = GameData.getStarTowerEventDataTable().get(this.Id / 100);
if (event == null) {
return;
}
// Add to avaliable options
event.getOptionIds().add(this.getId());
}
}
@@ -55,13 +55,14 @@ public class GachaDef extends BaseDef {
if (this.ATypePkg > 0) {
packageA.add(
10000 - storage.getATypeUpProb(),
new GachaPackage(GachaPackageType.A, this.ATypePkg)
10000 - storage.getATypeUpProb(),
new GachaPackage(GachaPackageType.A, this.ATypePkg)
);
} if (this.ATypeUpPkg > 0) {
}
if (this.ATypeUpPkg > 0) {
packageA.add(
storage.getATypeUpProb(),
new GachaPackage(GachaPackageType.A_UP, this.ATypeUpPkg)
storage.getATypeUpProb(),
new GachaPackage(GachaPackageType.A_UP, this.ATypeUpPkg)
);
}
@@ -70,18 +71,20 @@ public class GachaDef extends BaseDef {
if (this.BTypePkg > 0) {
packageB.add(
10000 - storage.getBTypeUpProb(),
new GachaPackage(GachaPackageType.B, this.BTypePkg)
storage.getBTypeProb(),
new GachaPackage(GachaPackageType.B, this.BTypePkg)
);
} else if (this.BGuaranteePkg > 0) {
}
if (this.BGuaranteePkg > 0) {
packageB.add(
10000 - storage.getBTypeUpProb(),
new GachaPackage(GachaPackageType.B, this.BGuaranteePkg)
storage.getBTypeGuaranteeProb(),
new GachaPackage(GachaPackageType.B, this.BGuaranteePkg)
);
} if (this.BTypeUpPkg > 0) {
}
if (this.BTypeUpPkg > 0) {
packageB.add(
storage.getBTypeUpProb(),
new GachaPackage(GachaPackageType.B_UP, this.BTypeUpPkg)
storage.getBTypeUpProb(),
new GachaPackage(GachaPackageType.B_UP, this.BTypeUpPkg)
);
}
@@ -90,8 +93,8 @@ public class GachaDef extends BaseDef {
if (this.CTypePkg > 0) {
packageC.add(
10000,
new GachaPackage(GachaPackageType.C, this.CTypePkg)
10000,
new GachaPackage(GachaPackageType.C, this.CTypePkg)
);
}
}
@@ -16,6 +16,7 @@ public class GachaStorageDef extends BaseDef {
private int CostQty;
private int ATypeUpProb;
private int BTypeProb;
private int BTypeUpProb;
private int BTypeGuaranteeProb;
@@ -1,6 +1,7 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@@ -9,9 +10,27 @@ import lombok.Getter;
public class HonorDef extends BaseDef {
private int Id;
private int Type;
private int[] Params;
@Override
public int getId() {
return Id;
}
public boolean isValid() {
if (this.Type == 2) {
if (this.Params.length < 1) {
return false;
}
int charId = this.Params[0];
var charData = GameData.getCharacterDataTable().get(charId);
if (charData == null || !charData.isAvailable()) {
return false;
}
}
return true;
}
}
@@ -0,0 +1,19 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "InfinityTowerDifficulty.json")
public class InfinityTowerDifficultyDef extends BaseDef {
private int Id;
private int TowerId;
@Override
public int getId() {
return Id;
}
}
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.game.inventory.ItemRewardParam;
@@ -25,8 +26,13 @@ public class InfinityTowerLevelDef extends BaseDef {
return Id;
}
public int getEnergyConsume() {
return 0;
public int getTowerId() {
var diff = GameData.getInfinityTowerDifficultyDataTable().get(this.DifficultyId);
if (diff == null) {
return 0;
}
return diff.getTowerId();
}
public ItemParamMap generateRewards() {
@@ -0,0 +1,36 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "LoginRewardGroup.json")
public class LoginRewardGroupControlDef extends BaseDef {
private int Id;
private int RewardId1;
private int Qty1;
private int RewardId2;
private int Qty2;
private transient ItemParamMap rewards;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.rewards = new ItemParamMap();
if (this.RewardId1 > 0) {
this.rewards.add(this.RewardId1, this.Qty1);
}
if (this.RewardId2 > 0) {
this.rewards.add(this.RewardId2, this.Qty2);
}
}
}
@@ -0,0 +1,19 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
@Getter
@ResourceType(name = "MainScreenCG.json", loadPriority = LoadPriority.LOW)
public class MainScreenCGDef extends BaseDef {
private int Id;
private boolean IsShown;
@Override
public int getId() {
return Id;
}
}
@@ -0,0 +1,31 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "Plot.json")
public class PlotDef extends BaseDef {
private int Id;
private int Char;
private int UnlockAffinityLevel;
private String Rewards;
private transient ItemParamMap rewards;
@Override
public int getId() {
return this.Id;
}
public ItemParamMap getRewards() {
return this.rewards;
}
@Override
public void onLoad() {
this.rewards = ItemParamMap.fromJsonString(this.Rewards);
}
}
@@ -2,6 +2,7 @@ package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.tower.StarTowerGame;
import lombok.Getter;
@Getter
@@ -10,11 +11,48 @@ public class PotentialDef extends BaseDef {
private int Id;
private int CharId;
private int Build;
private int BranchType;
private int MaxLevel;
private int[] BuildScore;
private String BriefDesc;
@Override
public int getId() {
return Id;
}
public boolean isSpecial() {
return this.BranchType != 3;
}
public int getMaxLevel() {
// Check if regular potential
if (this.BranchType == 3) {
return 6;
}
// Special potential should always have a max level of 1
return this.MaxLevel;
}
public int getMaxLevel(StarTowerGame game) {
// Check if regular potential
if (this.BranchType == 3) {
return this.MaxLevel + game.getModifiers().getExtraMaxPotentialLevel();
}
// Special potential should always have a max level of 1
return this.MaxLevel;
}
public int getBuildScore(int level) {
int index = level - 1;
if (index >= this.BuildScore.length) {
index = this.BuildScore.length - 1;
}
return this.BuildScore[index];
}
}
@@ -2,6 +2,7 @@ package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import lombok.Getter;
@@ -9,10 +10,21 @@ import lombok.Getter;
@ResourceType(name = "ScoreBossControl.json")
public class ScoreBossControlDef extends BaseDef {
private int Id;
private String StartTime;
private String EndTime;
private IntOpenHashSet LevelGroup;
private transient long startDate;
private transient long endDate;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.startDate = Utils.dateToMilliseconds(this.StartTime) / 1000;
this.endDate = Utils.dateToMilliseconds(this.EndTime) / 1000;
}
}
@@ -0,0 +1,19 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "ScoreBossReward.json")
public class ScoreBossRewardDef extends BaseDef {
private int StarNeed;
private int RewardItemId1;
private int RewardNum1;
@Override
public int getId() {
return StarNeed;
}
}
@@ -0,0 +1,118 @@
package emu.nebula.data.resources;
import java.util.ArrayList;
import java.util.List;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import lombok.Getter;
@Getter
@ResourceType(name = "SecondarySkill.json")
public class SecondarySkillDef extends BaseDef {
private int Id;
private int GroupId;
private int Score;
private String NeedSubNoteSkills;
private transient ItemParamMap reqSubNotes;
@Getter
private static transient Int2ObjectMap<List<SecondarySkillDef>> groups = new Int2ObjectOpenHashMap<>();
@Override
public int getId() {
return Id;
}
public boolean match(ItemParamMap subNotes) {
for (var item : this.reqSubNotes) {
int reqId = item.getIntKey();
int reqCount = item.getIntValue();
int curCount = subNotes.get(reqId);
if (curCount < reqCount) {
return false;
}
}
return true;
}
@Override
public void onLoad() {
// Setup required subnotes
this.reqSubNotes = ItemParamMap.fromJsonString(this.NeedSubNoteSkills);
// Add to group cache
var group = groups.computeIfAbsent(this.GroupId, id -> new ArrayList<>());
group.add(this);
// Clear to save memory
this.NeedSubNoteSkills = null;
}
// Static sub note skill group group
public static List<SecondarySkillDef> getGroup(int id) {
return groups.get(id);
}
public static IntSet calculateSecondarySkills(int[] discIds, ItemParamMap subNotes) {
var secondarySkills = new IntOpenHashSet();
// Get first 3 discs
for (int i = 0; i < 3; i++) {
// Disc id
int discId = discIds[i];
// Get disc data
var data = GameData.getDiscDataTable().get(discId);
if (data == null) continue;
// Add secondary skills
int s1= getSecondarySkill(subNotes, data.getSecondarySkillGroupId1());
if (s1 > 0) {
secondarySkills.add(s1);
}
int s2 = getSecondarySkill(subNotes, data.getSecondarySkillGroupId2());
if (s2 > 0) {
secondarySkills.add(s2);
}
}
return secondarySkills;
}
private static int getSecondarySkill(ItemParamMap subNotes, int groupId) {
// Check group id
if (groupId <= 0) {
return 0;
}
// Get group
var group = SecondarySkillDef.getGroup(groupId);
if (group == null) {
return 0;
}
// Reverse iterator to try and match highest secondary skill first
for (int i = group.size() - 1; i >= 0; i--) {
var data = group.get(i);
if (data.match(subNotes)) {
return data.getId();
}
}
// Failure
return 0;
}
}
@@ -0,0 +1,20 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "SignIn.json")
public class SignInDef extends BaseDef {
private int Group;
private int Day;
private int ItemId;
private int ItemQty;
@Override
public int getId() {
return (this.Group << 16) + this.Day;
}
}
@@ -0,0 +1,18 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTowerBuildRank.json")
public class StarTowerBuildRankDef extends BaseDef {
private int Id;
private int MinGrade;
private int Rarity;
@Override
public int getId() {
return Id;
}
}
@@ -4,12 +4,16 @@ import java.util.Arrays;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTower.json")
public class StarTowerDef extends BaseDef {
private int Id;
private int GroupId;
private int Difficulty;
private int SubNoteSkillDropGroupId;
private int[] FloorNum;
private transient int maxFloors;
@@ -19,8 +23,8 @@ public class StarTowerDef extends BaseDef {
return Id;
}
public int getMaxFloor(int stage) {
int index = stage - 1;
public int getMaxFloor(int stageNum) {
int index = stageNum - 1;
if (index < 0 || index >= this.FloorNum.length) {
return 0;
@@ -0,0 +1,35 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTowerEvent.json")
public class StarTowerEventDef extends BaseDef {
private int Id;
private int[] RelatedNPCs;
private transient IntList optionIds;
@Override
public int getId() {
return Id;
}
/**
* Returns a deep copy of our option ids
*/
public IntList getClonedOptionIds() {
var list = new IntArrayList();
list.addAll(this.getOptionIds());
return list;
}
@Override
public void onLoad() {
this.optionIds = new IntArrayList();
}
}
@@ -0,0 +1,22 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTowerFloorExp.json")
public class StarTowerFloorExpDef extends BaseDef {
private int Id;
private int StarTowerId;
private int Stage;
private int NormalExp;
private int EliteExp;
private int BossExp;
private int FinalBossExp;
@Override
public int getId() {
return Id;
}
}
@@ -1,7 +1,10 @@
package emu.nebula.data.resources;
import com.google.gson.annotations.SerializedName;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.tower.room.RoomType;
import lombok.Getter;
@Getter
@@ -10,10 +13,19 @@ public class StarTowerStageDef extends BaseDef {
private int Id;
private int Stage;
private int Floor;
private int RoomType;
private int InteriorCurrencyQuantity;
@SerializedName("RoomType")
private int RoomTypeValue;
private transient RoomType roomType;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
this.roomType = RoomType.getByValue(this.RoomTypeValue);
}
}
@@ -0,0 +1,19 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTowerTeamExp.json")
public class StarTowerTeamExpDef extends BaseDef {
private int Id;
private int GroupId;
private int Level;
private int NeedExp;
@Override
public int getId() {
return Id;
}
}
@@ -0,0 +1,17 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import lombok.Getter;
@Getter
@ResourceType(name = "StoryEvidence.json")
public class StoryEvidenceDef extends BaseDef {
private int Id;
@Override
public int getId() {
return Id;
}
}
@@ -0,0 +1,45 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.util.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@Getter
@ResourceType(name = "SubNoteSkillDropGroup.json")
public class SubNoteSkillDropGroupDef extends BaseDef {
private int Id;
private int GroupId;
private int SubNoteSkillId;
private static Int2ObjectMap<IntList> GROUPS = new Int2ObjectOpenHashMap<>();
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
var packageList = GROUPS.computeIfAbsent(this.GroupId, i -> new IntArrayList());
packageList.add(this.SubNoteSkillId);
}
public static int getRandomDrop(int groupId) {
var dropList = GROUPS.get(groupId);
if (dropList == null) {
return 0;
}
return Utils.randomElement(dropList);
}
public static IntList getGroup(int groupId) {
return GROUPS.get(groupId);
}
}
@@ -0,0 +1,33 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import lombok.Getter;
@Getter
@ResourceType(name = "TowerDefenseLevel.json")
public class TowerDefenseLevelDef extends BaseDef {
private int Id;
private int Condition2;
private int Condition3;
private int Item1;
private int Qty1;
private int Item2;
private int Qty2;
private transient ItemParamMap rewards;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
// Parse rewards
this.rewards = new ItemParamMap();
this.rewards.add(this.Item1, this.Qty1);
this.rewards.add(this.Item2, this.Qty2);
}
}
@@ -0,0 +1,18 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import lombok.Getter;
@Getter
@ResourceType(name = "TrialControl.json")
public class TrialControlDef extends BaseDef {
private int Id;
private IntOpenHashSet GroupIds;
@Override
public int getId() {
return Id;
}
}
Loaded 100 of 288 files, more files were not shown because too many files have changed in this diff. Show more