diff --git a/.editorconfig b/.editorconfig index dcb1ff3..f0a1794 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,6 @@ root = true [*] charset = utf-8 -end_of_line = lf indent_size = 4 indent_style = space insert_final_newline = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/README.md b/README.md index 5cdc6d7..aebc5cf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ -# Lunar Core -A game server reimplementation for version 1.5.0 of a certain turn-based anime game for educational purposes.\ -For any extra support, questions, or discussions, check out our [Discord](https://discord.gg/cfPKJ6N5hw). +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](README.md) | [简中](docs/README_zh-CN.md) | [繁中](docs/README_zh-TW.md) | [JP](docs/README_ja-JP.md) | [RU](docs/README_ru-RU.md) | [FR](docs/README_fr-FR.md) | [KR](docs/README_ko-KR.md) + +**Attention:** For any extra support, questions, or discussions, check out our [Discord](https://discord.gg/cfPKJ6N5hw). ### Notable features - Basic game features: Logging in, team setup, inventory, basic scene/entity management @@ -23,19 +28,18 @@ 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. Download the files from [https://gitlab.com/Melledy/LunarCore-Protos](https://gitlab.com/Melledy/LunarCore-Protos) and place the proto folder into your server directory -2. Open your system terminal, and compile the server with `./gradlew jar` -3. Create a folder named `resources` in your server directory -4. Download the `Config`, `TextMap`, and `ExcelBin` folders from [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) and place them into your resources folder. -5. Download the `Config` folder from [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) and place them into your resources folder. REPLACE any files that your system asks about. These are for world spawns and are quite important for the server. -6. Run the server with `java -jar LunarCore.jar` from your system terminal. Lunar Core 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. -7. If you have `autoCreateAccount` set to true in the config, then you can skip creating an account. Otherwise, use the `/account` command in the server console to create one. +1. Open your system terminal, and compile the server with `./gradlew jar` +2. Create a folder named `resources` in your server directory +3. Download the `Config`, `TextMap`, and `ExcelBin` folders from [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) and place them into your resources folder. +4. Download the `Config` folder from [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) and place them into your resources folder. REPLACE any files that your system asks about. These are for world spawns and are quite important for the server. +5. Run the server with `java -jar LunarCore.jar` from your system terminal. Lunar Core 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. +6. If you have `autoCreateAccount` set to true in the config, then you can skip creating an account. Otherwise, use the `/account` command in the server console to create one. ### Connecting with the client (Fiddler) -1. **Login with the client to an official server and HoYoverse account at least once to download game data.** +1. **Login with the client to an official server and Hoyoverse account at least once to download game data.** 2. Install and have [Fiddler Classic](https://www.telerik.com/fiddler) running. -3. Set Fiddler to decrypt https traffic. (Tools -> Options -> HTTPS -> Decrypt HTTPS traffic) Make sure `Ignore server certificate errors` is checked as well. -4. Copy and paste the following code into the `Fiddlerscript` tab of Fiddler Classic: +3. Set fiddler to decrypt https traffic. (Tools -> Options -> HTTPS -> Decrypt HTTPS traffic) Make sure `ignore server certificate errors` is checked as well. +4. Copy and paste the following code into the Fiddlerscript tab of Fiddler Classic: ``` import System; @@ -60,14 +64,17 @@ Server commands can be run in the server console or in-game. There is a dummy us ``` /account {create | delete} [username] (reserved player uid). Creates or deletes an account. -/avatar lv(level) p(ascension) r(eidolon) s(skill levels). Sets the current avatar's properties +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). Sets the current avatar's properties. /clear {relics | lightcones | materials | items}. Removes filtered items from the player inventory. /gender {male | female}. Sets the player gender. -/give [item id] x[amount]. Gives the targetted player an item. -/giveall {materials | avatars}. Gives the targeted player items. +/give [item id] x[amount] lv[number]. Gives the targetted player an item. +/giveall {materials | avatars | lightcones | relics}. Gives the targeted player items. +/heal. Heals your avatars. /help. Displays a list of available commands. +/kick @[player id]. Kicks a player from the server. /mail [content]. Sends the targeted player a system mail. /permission {add | remove | clear} [permission]. Gives/removes a permission from the targeted player. +/refill. Refill your skill points in open world. /reload. Reloads the server config. /scene [scene id] [floor id]. Teleports the player to the specified scene. /spawn [monster/prop id] x[amount] s[stage id]. Spawns a monster or prop near the targeted player. diff --git a/build.gradle b/build.gradle index 34cdea1..d96cacf 100644 --- a/build.gradle +++ b/build.gradle @@ -70,8 +70,8 @@ dependencies { implementation fileTree(dir: 'lib', include: ['*.jar']) implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.9' - implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.4.11' - implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.11' + implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.4.14' + implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.14' implementation group: 'it.unimi.dsi', name: 'fastutil-core', version: '8.5.12' implementation group: 'org.reflections', name: 'reflections', version: '0.10.2' @@ -79,19 +79,19 @@ dependencies { implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' implementation group: 'us.hebi.quickbuf', name: 'quickbuf-runtime', version: '1.3.1' - implementation group: 'io.javalin', name: 'javalin', version: '5.6.2' + implementation group: 'io.javalin', name: 'javalin', version: '5.6.3' - implementation group: 'io.netty', name: 'netty-common', version: '4.1.98.Final' - implementation group: 'io.netty', name: 'netty-handler', version: '4.1.98.Final' - implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.98.Final' - implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.98.Final' + implementation group: 'io.netty', name: 'netty-common', version: '4.1.101.Final' + implementation group: 'io.netty', name: 'netty-handler', version: '4.1.101.Final' + implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.101.Final' + implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.101.Final' - implementation group: 'dev.morphia.morphia', name: 'morphia-core', version: '2.3.8' + implementation group: 'dev.morphia.morphia', name: 'morphia-core', version: '2.3.9' implementation group: 'de.bwaldvogel', name: 'mongo-java-server', version: '1.44.0' implementation group: 'de.bwaldvogel', name: 'mongo-java-server-h2-backend', version: '1.44.0' - implementation group: 'org.jline', name: 'jline', version: '3.23.0' - implementation group: 'org.jline', name: 'jline-terminal-jansi', version: '3.23.0' + implementation group: 'org.jline', name: 'jline', version: '3.24.1' + implementation group: 'org.jline', name: 'jline-terminal-jansi', version: '3.24.1' protobuf files('proto/') diff --git a/data/Banners.json b/data/Banners.json index 0d7d052..95efc49 100644 --- a/data/Banners.json +++ b/data/Banners.json @@ -1,61 +1,374 @@ [ - { - "id": 1001, - "gachaType": "Normal", - "beginTime": 0, - "endTime": 0, - "rateUpItems5": [], - "rateUpItems4": [] - }, - { - "id": 2014, - "gachaType": "AvatarUp", - "beginTime": 0, - "endTime": 1924992000, - "rateUpItems5": [1217], - "rateUpItems4": [1002, 1008, 1103] - }, - { - "id": 3014, - "gachaType": "WeaponUp", - "beginTime": 0, - "endTime": 1924992000, - "eventChance": 75, - "rateUpItems5": [23017], - "rateUpItems4": [21007, 21016, 21017] - }, - { - "id": 2015, - "gachaType": "AvatarUp", - "beginTime": 0, - "endTime": 1924992000, - "rateUpItems5": [1302], - "rateUpItems4": [1009, 1110, 1215] - }, - { - "id": 3015, - "gachaType": "WeaponUp", - "beginTime": 0, - "endTime": 1924992000, - "eventChance": 75, - "rateUpItems5": [23018], - "rateUpItems4": [21000, 21006, 21019] - }, - { - "id": 2016, - "gachaType": "AvatarUp", - "beginTime": 0, - "endTime": 1924992000, - "rateUpItems5": [1006], - "rateUpItems4": [1009, 1110, 1215] - }, - { - "id": 3016, - "gachaType": "WeaponUp", - "beginTime": 0, - "endTime": 1924992000, - "eventChance": 75, - "rateUpItems5": [23007], - "rateUpItems4": [21000, 21006, 21019] - } + { + "id": 1001, + "gachaType": "Normal", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [1001,1002,1003,1004,1008,1009,1013,1101,1103,1104,1105,1106,1107,1108,1109,1201,1202,1206,1209,1211,21000,21001,21002,21003,21004,21005,21006,21007,21008,21009,21010,21011,21012,21013,21014,21015,21016,21017,21018,21019,21020,23000,23002,23003,23004,23005,23012,23013], + "rateUpItems4": [23002,1003,1101,1104,23000,23003] + }, + { + "id": 2001, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1102 + ], + "rateUpItems4": [ + 1105, + 1106, + 1109 + ] + }, + { + "id": 3001, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23001 + ], + "rateUpItems4": [ + 21001, + 21005, + 21000 + ] + }, + { + "id": 2002, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1204 + ], + "rateUpItems4": [ + 1206, + 1001, + 1103 + ] + }, + { + "id": 3002, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23010 + ], + "rateUpItems4": [ + 21003, + 21002, + 21013 + ] + }, + { + "id": 2005, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1006 + ], + "rateUpItems4": [ + 1002, + 1009, + 1103 + ] + }, + { + "id": 3005, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23007 + ], + "rateUpItems4": [ + 21017, + 21004, + 21013 + ] + }, + { + "id": 2006, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1203 + ], + "rateUpItems4": [ + 1106, + 1201, + 1207 + ] + }, + { + "id": 3006, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23008 + ], + "rateUpItems4": [ + 21001, + 21018, + 21020 + ] + }, + { + "id": 2007, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1205 + ], + "rateUpItems4": [ + 1008, + 1206, + 1105 + ] + }, + { + "id": 3007, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23009 + ], + "rateUpItems4": [ + 21012, + 21010, + 21007 + ] + }, + { + "id": 2008, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1005 + ], + "rateUpItems4": [ + 1111, + 1108, + 1103 + ] + }, + { + "id": 3008, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23006 + ], + "rateUpItems4": [ + 21015, + 21008, + 21006 + ] + }, + { + "id": 2009, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1213 + ], + "rateUpItems4": [ + 1207, + 1009, + 1001 + ] + }, + { + "id": 3009, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23015 + ], + "rateUpItems4": [ + 21011, + 21018, + 21009 + ] + }, + { + "id": 2010, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1208 + ], + "rateUpItems4": [ + 1110, + 1109, + 1106 + ] + }, + { + "id": 3010, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23011 + ], + "rateUpItems4": [ + 21016, + 21014, + 21019 + ] + }, + { + "id": 2011, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1212 + ], + "rateUpItems4": [ + 1202, + 1201, + 1108 + ] + }, + { + "id": 3011, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23014 + ], + "rateUpItems4": [ + 21008, + 21004, + 21013 + ] + }, + { + "id": 2012, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1112 + ], + "rateUpItems4": [ + 1210, + 1111, + 1206 + ] + }, + { + "id": 3012, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23016 + ], + "rateUpItems4": [ + 21003, + 21018, + 21015 + ] + }, + { + "id": 2014, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1217 + ], + "rateUpItems4": [ + 1002, + 1008, + 1103 + ] + }, + { + "id": 3014, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23017 + ], + "rateUpItems4": [ + 21007, + 21017, + 21016 + ] + }, + { + "id": 2015, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1302 + ], + "rateUpItems4": [ + 1215, + 1110, + 1009 + ] + }, + { + "id": 3015, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23018 + ], + "rateUpItems4": [ + 21019, + 21000, + 21006 + ] + }, + { + "id": 2016, + "gachaType": "AvatarUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 1006 + ], + "rateUpItems4": [ + 1215, + 1110, + 1009 + ] + }, + { + "id": 3016, + "gachaType": "WeaponUp", + "beginTime": 0, + "endTime": 1924992000, + "rateUpItems5": [ + 23007 + ], + "rateUpItems4": [ + 21019, + 21000, + 21006 + ] + } ] \ No newline at end of file diff --git a/data/RogueMapGen.json b/data/RogueMapGen.json index 49c3e76..39b0135 100644 --- a/data/RogueMapGen.json +++ b/data/RogueMapGen.json @@ -6,9 +6,9 @@ "32": [122311, 122321, 122331], "4": [122611, 122612, 131611, 131612], "5": [122511, 122512, 122513], - "6": [300121, 300122, 300132], + "6": [300112, 300122, 300132], "71": [300412, 300422, 300432], - "72": [300212, 300222, 300232, 300242], + "72": [300212, 300222, 300242], "8": [300611, 300612], "9": [300511, 300512, 300513], "10": [131213, 131223, 131233], diff --git a/docs/README_fr-FR.md b/docs/README_fr-FR.md new file mode 100644 index 0000000..a91a0f6 --- /dev/null +++ b/docs/README_fr-FR.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**Attention:** Pour tout soutien supplémentaire, questions ou discussions, consultez notre [Discord](https://discord.gg/cfPKJ6N5hw). + +### Caractéristiques notables +- Fonctionnalités de base du jeu : Connexion, configuration de l'équipe, inventaire, gestion de base des scènes et des entités +- Les batailles de monstres fonctionnent +- Apparition de monstres/prop/NPC dans le monde naturel +- La plupart des techniques de personnages sont gérées +- Les boutiques de PNJ sont gérées +- Système de Gacha +- Système de courrier +- Système d'amis (les aides ne fonctionnent pas encore) +- Salle oubliée (avec les fonctionnalités de la 1.4.0) +- Univers simulé (les runs peuvent être terminés, mais il manque de nombreuses fonctionnalités) + +# Exécution du serveur et du client + +### Prérequis +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### Recommandé +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +### Compilation du serveur +1. Ouvrez votre terminal système, et compilez le serveur avec `./gradlew jar` +2. Créez un dossier nommé `resources` dans le répertoire de votre serveur. +3. Téléchargez les dossiers `Config`, `TextMap`, et `ExcelBin` depuis [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) et placez-les dans votre dossier resources. +4. Téléchargez le dossier `Config` depuis [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) et placez-le dans votre dossier resources. Remplacez tous les fichiers demandés par votre système. Ceux-ci sont destinés à l'apparition des mondes et sont très importants pour le serveur. +5. Lancez le serveur avec `java -jar LunarCore.jar` depuis votre terminal. Lunar Core est livré avec un serveur MongoDB interne intégré pour sa base de données, donc aucune installation de Mongodb n'est nécessaire. Cependant, il est fortement recommandé d'installer Mongodb de toute façon. +6. Si vous avez mis `autoCreateAccount` à true dans la configuration, alors vous pouvez sauter la création d'un compte. Sinon, utilisez la commande `/account` dans la console du serveur pour en créer un. + +### Connexion avec le client (Fiddler) +1. **Connectez-vous avec le client à un serveur officiel et à un compte Hoyoverse au moins une fois pour télécharger les données du jeu**. +2. Installez et lancez [Fiddler Classic](https://www.telerik.com/fiddler). +3. Configurez fiddler pour décrypter le trafic https. (Tools -> Options -> HTTPS -> Decrypt HTTPS traffic) Assurez-vous que `ignore server certificate errors` est également coché. +4. Copiez et collez le code suivant dans l'onglet Fiddlerscript de Fiddler Classic : + +``` +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // Elle peut également être remplacée par une autre adresse IP. + } + } +}; +``` + +5. Connectez-vous avec votre nom de compte, le mot de passe peut être défini comme vous le souhaitez. + +### Commandes du serveur +Les commandes du serveur peuvent être exécutées dans la console du serveur ou dans le jeu. Il y a un utilisateur fictif nommé "Server" dans la liste d'amis de chaque joueur auquel vous pouvez envoyer un message pour utiliser les commandes dans le jeu. + +``` +/account {create | delete} [username] (reserved player uid). Crée ou supprime un compte. +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). Définit les propriétés de l'avatar actuel. +/clear {relics | lightcones | materials | items}. Supprime les objets filtrés de l'inventaire du joueur. +/gender {male | female}. Définit le sexe du joueur. +/give [item id] x[amount] lv[number]. Donne un objet au joueur ciblé. +/giveall {materials | avatars | lightcones | relics}. Donne des objets au joueur ciblé. +/heal. Guérit vos avatars. +/help. Affiche une liste des commandes disponibles. +/kick @[player id]. Expulse un joueur du serveur. +/mail [content]. Envoie un message système au joueur ciblé. +/permission {add | remove | clear} [permission]. Donne/retire une permission au joueur ciblé. +/refill. Recharge vos points de compétence en monde ouvert. +/reload. Recharge la configuration du serveur. +/scene [scene id] [floor id]. Téléporte le joueur vers la scène spécifiée. +/spawn [monster/prop id] x[amount] s[stage id]. Fait apparaître un monstre ou un accessoire à proximité du joueur ciblé. +/unstuck @[player id]. Décroche un joueur hors ligne s'il se trouve dans une scène qui ne se charge pas. +/worldlevel [world level]. Fixe le niveau d'équilibre du joueur ciblé. +``` diff --git a/docs/README_ja-JP.md b/docs/README_ja-JP.md new file mode 100644 index 0000000..61628e6 --- /dev/null +++ b/docs/README_ja-JP.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**Attention:** 追加のサポート、質問、または議論がある場合は、 [Discord](https://discord.gg/cfPKJ6N5hw). + +### 注目すべき機能 +- 基本ゲーム機能:ログイン、チームのセットアップ、バッグ、基本的なシーン/エンティティの管理 +- モンスター戦闘 +- オーバーワールドのモンスター/プロップ/NPCのスポーン +- ほぼ全ての秘技 +- NPCショップ +- ガチャシステム +- メールシステム +- フレンドシステム(アシストはまだ機能していません) +- 忘却の庭(1.4.0の機能付き) +- 模擬宇宙(ランは終了できますが、多くの機能が不足しています) + +# サーバーとクライアントの実行 + +### 必要条件 +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### お勧め +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +### サーバーのコンパイル +1. システムのターミナルを開き、`./gradlew jar` でサーバーをコンパイルします。 +2. サーバーディレクトリに `resources` という名前のフォルダを作成します。 +3. [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) から `Config`、`TextMap`、および `ExcelBin` フォルダをダウンロードし、それらをリソースフォルダに配置します。 +4. [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) から `Config` フォルダをダウンロードし、それをリソースフォルダに配置します。システムが問い合わせているファイルはすべて置き換えます。これらはワールドの生成に関するもので、サーバーにとって非常に重要です。 +5. システムのターミナルから `java -jar LunarCore.jar` を使用してサーバーを実行します。Lunar Coreにはデータベースのための組み込みの内部MongoDBサーバーが付属しているため、MongoDBのインストールは必要ありません。ただし、MongoDBのインストールを強くお勧めします。 +6. 設定で `autoCreateAccount` をtrueに設定している場合は、アカウントの作成をスキップできます。そうでない場合は、サーバーコンソールで `/account` コマンドを使用してアカウントを作成します。 + +### クライアントとの接続(Fiddler) +1. **同じクライアントで公式サーバーとHoyoverseアカウントに少なくとも一度ログインしてゲームデータをダウンロードしてください。** +2. [Fiddler Classic](https://www.telerik.com/fiddler) をインストールし、実行します。 +3. Fiddlerをhttpsトラフィックを復号化するように設定します(ツール -> オプション -> HTTPS -> HTTPSトラフィックを復号化)。 `サーバー証明書のエラーを無視する` がチェックされていることを確認してください。 +4. Fiddler ClassicのFiddlerscriptタブに以下のコードをコピーして貼り付けます: + +```javascript +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // これは別のIPアドレスに置き換えることもできます。 + } + } +}; +``` + +5. 作成したアカウント名と任意のパスワードでログインします。 + +### サーバーコマンド +サーバーコマンドはサーバーコンソールまたはゲーム内で実行できます。各プレイヤーのフレンドリストには、ゲーム内でコマンドを使用するための "Server" という名前のユーザーがいます。 + +``` +/account {create | delete} [username] (予約プレイヤーuid). アカウントを作成または削除します。 +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). 現在のアバターのプロパティを設定します。 +/clear {relics | lightcones | materials | items}. プレイヤーのインベントリからフィルタリングされたアイテムを削除します。 +/gender {male | female}. プレイヤーの性別を設定します。 +/give [item id] x[amount] lv[number]. ターゲットのプレイヤーにアイテムを与えます。 +/giveall {materials | avatars}. ターゲットのプレイヤーにアイテムを与えます。 +/heal. あなたのキャラクターを癒します。 +/help. 利用可能なコマンドの一覧を表示します。 +/kick @[player id]. サーバーからプレーヤーをキックする。 +/mail [content]. ターゲットのプレイヤーにシステムメールを送信します。 +/permission {add | remove | clear} [permission]. ターゲットのプレイヤーから権限を付与/削除します。 +/refill. SPを回復します。 +/reload. サーバーコンフィギュレーションを再読み込みします。 +/scene [scene id] [floor id]. プレイヤーを指定したシーンにテレポートします。 +/spawn [monster/prop id] x[amount] s[stage id]. ターゲットのプレイヤーの近くにモンスターまたはプロップを生成します。 +/unstuck @[player id]. オフラインプレイヤーが読み込み不可のシーンにいる場合、スタックを解除します。 +/worldlevel [world level]. ターゲットのプレイヤーの平衡レベルを設定します。 +``` diff --git a/docs/README_ko-KR.md b/docs/README_ko-KR.md new file mode 100644 index 0000000..137f9de --- /dev/null +++ b/docs/README_ko-KR.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**주의: **추가 지원, 질문 또는 토론이 필요한 경우, [Discord](https://discord.gg/cfPKJ6N5hw) 를 확인하세요. + +### 주목할 만한 기능 +- 기본적인 게임 기능: 로그인, 팀 설정, 인벤토리, 기본 장면/엔티티 관리 +- 몬스터 전투 작동 +- 자연계 몬스터/소품/NPC 생성 +- 대부분의 캐릭터 기술 처리 +- NPC 상점 처리 +- 뽑기 시스템 +- 메일 시스템 +- 친구 시스템(어시스트는 아직 작동하지 않음) +- 잊혀진 홀 (1.4.0 기능 포함) +- 시뮬레이션된 우주(실행은 가능하지만 많은 기능이 누락됨) + +# 서버 및 클라이언트 실행 + +### 전제 조건 +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### 추천 +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +서버 컴파일하기 ### +1. 시스템 터미널을 열고 다음을 사용하여 서버를 컴파일합니다. `./gradlew jar` +2. 서버 디렉터리에 `resources`라는 이름의 폴더를 만듭니다. +3. [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) 에서 `Config`, `TextMap`, `ExcelBin` 폴더를 다운로드하여 리소스 폴더에 넣습니다. +4. [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) 에서 `Config` 폴더를 다운로드하여 리소스 폴더에 넣습니다. 시스템에서 요청하는 파일을 모두 교체하세요. 이 파일들은 월드 스폰을 위한 것으로 서버에 매우 중요합니다. +5. 시스템 터미널에서 `java -jar LunarCore.jar`로 서버를 실행합니다. Lunar Core에는 데이터베이스를 위한 내부 MongoDB 서버가 내장되어 있으므로 Mongodb를 설치할 필요가 없습니다. 하지만 어쨌든 Mongodb를 설치하는 것을 적극 권장합니다. +6. 설정에서 `autoCreateAccount`가 true로 설정되어 있으면 계정 생성을 건너뛸 수 있습니다. 그렇지 않은 경우 서버 콘솔에서 `/account` 명령을 사용하여 계정을 생성합니다. + +### 클라이언트와 연결하기(피들러) +1. **게임 데이터를 다운로드하려면 클라이언트로 공식 서버와 호오버스 계정에 한 번 이상 로그인합니다. +2. [Fiddler Classic](https://www.telerik.com/fiddler) 을 설치하여 실행합니다. +3. 피들러가 https 트래픽을 복호화하도록 설정합니다. (도구 -> 옵션 -> HTTPS -> HTTPS 트래픽 복호화) '서버 인증서 오류 무시'도 체크되어 있는지 확인합니다. +4. 피들러 클래식의 피들러스크립트 탭에 다음 코드를 복사하여 붙여넣습니다: + +``` +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // 이 주소는 다른 IP 주소로 대체할 수도 있습니다. + } + } +}; +``` + +5. 계정 이름으로 로그인하며, 비밀번호는 아무거나 설정할 수 있습니다. + +### 서버 명령 +서버 명령은 서버 콘솔이나 게임 내에서 실행할 수 있습니다. 모든 플레이어의 친구 목록에 "서버"라는 이름의 더미 사용자가 있으며, 이 사용자에게 게임 내 명령을 사용하도록 메시지를 보낼 수 있습니다. + +``` +/account {create | delete} [username] (reserved player uid). 계정을 만들거나 삭제합니다. +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). 현재 아바타의 속성을 설정합니다. +/clear {relics | lightcones | materials | items}. 플레이어 인벤토리에서 필터링된 아이템을 제거합니다. +/gender {male | female}. 플레이어 성별을 설정합니다. +/give [item id] x[amount] lv[number]. 대상 플레이어에게 아이템을 부여합니다. +/giveall {materials | avatars | lightcones | relics}. 대상 플레이어에게 아이템을 부여합니다. +/heal. 아바타를 치료합니다. +/help. 사용 가능한 명령 목록을 표시합니다. +/kick @[player id]. 플레이어를 서버에서 내쫓습니다. +/mail [content]. 대상 플레이어에게 시스템 메일을 보냅니다. +/permission {add | remove | clear} [permission]. 대상 플레이어에게 권한을 부여/제거합니다. +/refill. 오픈 월드에서 스킬 포인트를 다시 채웁니다. +/reload. 서버 구성을 다시 로드합니다. +/scene [scene id] [floor id]. 플레이어를 지정된 장면으로 순간이동시킵니다. +/spawn [monster/prop id] x[amount] s[stage id]. 대상 플레이어 근처에 몬스터나 소품을 스폰합니다. +/unstuck @[player id]. 오프라인 플레이어가 로딩되지 않는 장면에 있을 경우 플레이어를 고정 해제합니다. +/worldlevel [world level]. 대상 플레이어의 평형 레벨을 설정합니다. +``` diff --git a/docs/README_ru-RU.md b/docs/README_ru-RU.md new file mode 100644 index 0000000..a2a9a1f --- /dev/null +++ b/docs/README_ru-RU.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**Внимание:** Для получения дополнительной поддержки, вопросов или обсуждений заходите на наш [Discord](https://discord.gg/cfPKJ6N5hw). + +### Примечательные особенности +- Основные возможности игры: Вход в игру, настройка команды, инвентарь, базовое управление сценой/содержимым +- Работают сражения с монстрами +- Спавны монстров/природы/NPC в естественном мире +- Работает большинство техник персонажей +- Работают магазины Npc +- Система гача +- Почтовая система +- Система друзей (помощники пока не работают) +- Забытый зал (с функциями 1.4.0) +- Симулированная вселенная (Запуск может быть закончен, но многие функции отсутствуют) + +# Запуск сервера и клиента + +### Необходимые условия +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### Рекомендуем +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +Компиляция сервера +1. Откройте системный терминал и скомпилируйте сервер с помощью `./gradlew jar`. +2. Создайте папку с именем `resources` в каталоге сервера. +3. Скачайте папки `Config`, `TextMap` и `ExcelBin` с сайта [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) и поместите их в папку resources. +4. Скачайте папку `Config` с сайта [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) и поместите ее в папку resources. Замените все файлы, которые запрашивает ваша система. Они предназначены для спавна мира и очень важны для сервера. +5. Запустите сервер с помощью команды `java -jar LunarCore.jar` из системного терминала. Lunar Core поставляется со встроенным внутренним сервером MongoDB для своей базы данных, поэтому установка Mongodb не требуется. Однако настоятельно рекомендуется установить Mongodb в любом случае. +6. Если в конфиге `autoCreateAccount` установлено значение true, то создание учетной записи можно пропустить. В противном случае используйте команду `/account` в консоли сервера для ее создания. + +### Подключение к клиенту (Fiddler) +1. **Войдите с клиентом на официальный сервер и в аккаунт Hoyoverse хотя бы один раз, чтобы загрузить игровые данные**. +2. Установите и запустите [Fiddler Classic](https://www.telerik.com/fiddler). +3. Настройте fiddler на расшифровку https-трафика. (Tools -> Options -> HTTPS -> Decrypt HTTPS traffic) Убедитесь, что `ignore server certificate errors` также отмечен. +4. Скопируйте и вставьте следующий код во вкладку Fiddlerscript в Fiddler Classic: + +``` +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // Его также можно заменить другим IP-адресом. + } + } +}; +``` + +5. Войдите в систему под своим именем, пароль может быть любым. + +### Команды сервера +Команды сервера можно выполнять в консоли сервера или в игре. В списке друзей каждого игрока есть фиктивный пользователь с именем "Сервер", которому можно написать сообщение, чтобы использовать внутриигровые команды. + +``` +/account {create | delete} [username] (reserved player uid). Создает или удаляет учетную запись. +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). Устанавливает свойства текущего аватара. +/clear {relics | lightcones | materials | items}. Удаляет отфильтрованные предметы из инвентаря игрока. +/gender {male | female}. Устанавливает пол игрока. +/give [item id] x[amount] lv[number]. Дает целевому игроку предмет. +/giveall {materials | avatars | lightcones | relics}. Дает целевому игроку предметы. +/heal. Лечит ваши аватары. +/help. Отображает список доступных команд. +/kick @[player id]. Выгоняет игрока с сервера. +/mail [content]. Отправляет целевому игроку системное письмо. +/permission {add | remove | clear} [permission]. Дает/снимает разрешение с выбранного игрока. +/refill. Пополнение очков навыков в открытом мире. +/reload. Перезагружает конфигурацию сервера. +/scene [scene id] [floor id]. Телепортирует игрока в указанную сцену. +/spawn [monster/prop id] x[amount] s[stage id]. Порождает монстра или реквизит рядом с игроком. +/unstuck @[player id]. Отключает оффлайн-игрока, если он находится в сцене, которая не загружается. +/worldlevel [world level]. Устанавливает равновесный уровень целевого игрока. +``` diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md new file mode 100644 index 0000000..d9f6c3a --- /dev/null +++ b/docs/README_zh-CN.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**注意:** 如果需要任何额外的支持、问题或者讨论,请查看我们的 [Discord](https://discord.gg/cfPKJ6N5hw). + +### 显著特点 +- 基本游戏功能:登录、队伍配置、背包、基本场景/实体管理 +- 战斗功能 +- 自然世界怪物/道具/NPC生成 +- 大多数角色技能已处理 +- NPC商店已处理 +- 祈愿系统 +- 邮件系统 +- 好友系统(好友支援尚未实现) +- 忘却之庭(带有1.4.0功能) +- 模拟宇宙(可以运行,但缺少许多功能) + +# 运行服务端和客户端 + +### 必需条件 +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### 推荐安装 +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +### 编译服务端核心 +1. 打开系统终端,使用 `./gradlew jar` 编译服务端核心 +2. 在服务器目录中创建一个名为 `resources` 的文件夹 +3. 从 [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) 下载 `Config`、`TextMap` 和 `ExcelBin` 文件夹,并将它们放入资源文件夹 +4. 从 [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) 下载 `Config` 文件夹,并将其放入资源文件夹。替换系统询问的任何文件。这些文件用于世界生成,对服务器非常重要。 +5. 从系统终端使用 `java -jar LunarCore.jar` 运行服务端。Lunar Core带有一个内置的MongoDB数据库服务,因此不需要安装MongoDB。但是,强烈建议安装MongoDB。 +6. 如果在配置中将 `autoCreateAccount` 设置为true,则可以跳过创建帐户的步骤。否则,需要在服务器控制台使用 `/account` 命令创建一个帐户。 + +### 与客户端(Fiddler)连接 +1. **使用客户端至少一次登录到官方服务器和Hoyoverse账户以下载游戏数据。** +2. 安装并运行 [Fiddler Classic](https://www.telerik.com/fiddler)。 +3. 将Fiddler设置为解密https流量(工具 -> 选项 -> HTTPS -> 解密HTTPS流量),确保选中 `忽略服务器证书错误`。 +4. 将以下代码复制并粘贴到Fiddler Classic的Fiddlerscript选项卡中: + +```javascript +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // 这也可以替换为其他IP地址。 + } + } +}; +``` + +5. 使用您的帐户名称登录,密码可以设置为任何值。 + +### 服务器命令 +服务器命令可以在服务器控制台或游戏中运行。每个玩家的好友列表中都有一个名为 "Server" 的虚拟用户,您可以向其发送消息以使用游戏中的命令。 + +``` +/account {create | delete} [username] (保留玩家uid). 创建或删除一个帐户。 +/avatar lv(level) p(ascension) r(eidolon) s(skill levels). 设置当前角色的属性。 +/clear {relics | lightcones | materials | items}. 从玩家库存中删除过滤的物品。 +/gender {male | female}. 设置玩家性别。 +/give [item id] x[amount] lv[number]. 给予目标玩家一个物品。 +/giveall {materials | avatars}. 给予目标玩家物品。 +/heal. 治疗你的角色。 +/help 显示可用命令列表。 +/kick @[player id]. 将一名玩家踢出服务器。 +/mail [content]. 发送系统邮件给目标玩家。 +/permission {add | remove | clear} [permission]. 向目标玩家授予/移除权限。 +/refill. 在开放世界中补充战技点。 +/reload. 重载服务器配置。 +/scene [scene id] [floor id]. 将玩家传送到指定的场景。 +/spawn [monster/prop id] x[amount] s[stage id]. 在目标玩家附近生成怪物或道具。 +/unstuck @[player id]. 如果离线玩家卡在不加载的场景中,解除卡住。 +/worldlevel [world level]. 设置目标玩家的均衡等级。 +``` diff --git a/docs/README_zh-TW.md b/docs/README_zh-TW.md new file mode 100644 index 0000000..88b2bd6 --- /dev/null +++ b/docs/README_zh-TW.md @@ -0,0 +1,83 @@ +![LunarCore](https://socialify.git.ci/Melledy/LunarCore/image?description=1&descriptionEditable=A%20game%20server%20reimplementation%20for%20version%201.5.0%20of%20a%20certain%20turn-based%20anime%20game%20for%20educational%20purposes.%20&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Light) +
GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
+ +
Discord - Grasscutter
+ +[EN](../README.md) | [简中](README_zh-CN.md) | [繁中](README_zh-TW.md) | [JP](README_ja-JP.md) | [RU](README_ru-RU.md) | [FR](README_fr-FR.md) | [KR](README_ko-KR.md) + +**請注意:** 如果需要任何額外的支持、問題或者討論,請查看我們的 [Discord](https://discord.gg/cfPKJ6N5hw). + +### 當前功能 +- 基本遊戲功能:登錄、隊伍配置、背包、基本場景/實體管理 +- 戰鬥功能 +- 自然世界怪物/道具/NPC生成 +- 大多數角色技能 +- NPC商店 +- 躍遷/抽卡系統 +- 郵件系統 +- 好友系統(支援角色尚未實現) +- 忘卻之庭(帶有1.4.0功能) +- 模擬宇宙(可以運行,但缺少許多功能) + +# 運行伺服器端和用戶端 + +### 必需條件 +* [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) + +### 推薦安裝 +* [MongoDB 4.0+](https://www.mongodb.com/try/download/community) + +### 編譯伺服器端核心 +1. 打開系統終端,使用 `./gradlew jar` 編譯伺服器端核心 +2. 在伺服器目錄中創建一個名為 `resources` 的文件夾 +3. 從 [https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) 下載 `Config`、`TextMap` 和 `ExcelBin` 文件夾,並將它們放入資源文件夾 +4. 從 [https://gitlab.com/Melledy/LunarCore-Configs](https://gitlab.com/Melledy/LunarCore-Configs) 下載 `Config` 文件夾,並將其放入資源文件夾。替換系統詢問的任何文件。這些文件用於世界生成,對伺服器非常重要。 +5. 從系統終端使用 `java -jar LunarCore.jar` 運行伺服器端。Lunar Core帶有一個內建的MongoDB資料庫服務,因此不需要安裝MongoDB。但是還是強烈建議安裝MongoDB。 +6. 如果在配置中將 `autoCreateAccount` 設置為true,則可以跳過創建帳戶的步驟。否則,需要在伺服器控制台使用 `/account` 命令創建一個帳戶。 + +### 與用戶端連接(Fiddler) +1. **使用用戶端至少一次登錄到官方伺服器和Hoyoverse帳戶以下載遊戲數據。** +2. 安裝並運行 [Fiddler Classic](https://www.telerik.com/fiddler)。 +3. 將Fiddler設置為解密https流量(工具 -> 選項 -> HTTPS -> 解密HTTPS流量),確保選中 `忽略伺服器證書錯誤 (Ignore server certificate errors)`。 +4. 將以下代碼複製並黏貼到Fiddler Classic的Fiddlerscript選項卡中: + +``` +import System; +import System.Windows.Forms; +import Fiddler; +import System.Text.RegularExpressions; + +class Handlers +{ + static function OnBeforeRequest(oS: Session) { + if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) { + oS.host = "localhost"; // 這也可以替換為其他IP位址。 + } + } +}; +``` + +5. 使用您的帳戶名稱登入,密碼可以隨機輸入。 + +### 伺服器命令 +伺服器命令可以在伺服器控制台或遊戲中運行。每個玩家的好友列表中都有一個名為 "Server" 的虛擬用戶,您可以向其發送消息以使用遊戲中的命令。 + +``` +/account {create | delete} [username] (玩家UID). 創建或刪除一個帳戶。 +/avatar lv(level) p(ascension) r(eidolon) s(skill levels) 設置當前角色的屬性。 +/clear {relics | lightcones | materials | items} 從玩家庫存中刪除過濾的物品。 +/gender {male | female} 設置目標玩家性別。 +/give [item id] x[amount] lv[number] 給予目標玩家指定物品。 +/giveall {materials | avatars} 給予目標玩家所有物品/角色。 +/heal. 治癒你的角色。 +/help 顯示可用命令列表。 +/kick @[player id]. 將一名玩家踢出伺服器。 +/mail [content] 發送系統郵件給目標玩家。 +/permission {add | remove | clear} [permission] 向目標玩家授予/移除權限。 +/refill. 在開放世界中補充戰技點。 +/reload 重載伺服器配置。 +/scene [scene id] [floor id] 將玩家傳送到指定的場景。 +/spawn [monster/prop id] x[amount] s[stage id] 在目標玩家附近生成怪物或實體。 +/unstuck @[player id]. 如果離線目標玩家卡在無法載入的場景中,將會把目標玩家傳送到初始場景。 +/worldlevel [world level]. 設置目標玩家的均衡等級。 +``` diff --git a/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java b/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java index 5b4c70c..3d60196 100644 --- a/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java @@ -11,6 +11,7 @@ import us.hebi.quickbuf.ProtoMessage; import us.hebi.quickbuf.ProtoSink; import us.hebi.quickbuf.ProtoSource; import us.hebi.quickbuf.RepeatedInt; +import us.hebi.quickbuf.RepeatedMessage; public final class ArchiveDataOuterClass { /** @@ -29,6 +30,16 @@ public final class ArchiveDataOuterClass { */ private final RepeatedInt archiveAvatarIdList = RepeatedInt.newEmptyInstance(); + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + */ + private final RepeatedMessage archiveMonsterIdList = RepeatedMessage.newEmptyInstance(MonsterArchiveOuterClass.MonsterArchive.getFactory()); + + /** + * repeated .RelicArchive archive_relic_list = 11; + */ + private final RepeatedMessage archiveRelicList = RepeatedMessage.newEmptyInstance(RelicArchiveOuterClass.RelicArchive.getFactory()); + private ArchiveData() { } @@ -175,6 +186,145 @@ public final class ArchiveDataOuterClass { return this; } + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * @return whether the archiveMonsterIdList field is set + */ + public boolean hasArchiveMonsterIdList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * @return this + */ + public ArchiveData clearArchiveMonsterIdList() { + bitField0_ &= ~0x00000004; + archiveMonsterIdList.clear(); + return this; + } + + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * + * 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 #getMutableArchiveMonsterIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getArchiveMonsterIdList() { + return archiveMonsterIdList; + } + + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * + * 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 getMutableArchiveMonsterIdList( + ) { + bitField0_ |= 0x00000004; + return archiveMonsterIdList; + } + + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * @param value the archiveMonsterIdList to add + * @return this + */ + public ArchiveData addArchiveMonsterIdList( + final MonsterArchiveOuterClass.MonsterArchive value) { + bitField0_ |= 0x00000004; + archiveMonsterIdList.add(value); + return this; + } + + /** + * repeated .MonsterArchive archive_monster_id_list = 7; + * @param values the archiveMonsterIdList to add + * @return this + */ + public ArchiveData addAllArchiveMonsterIdList( + final MonsterArchiveOuterClass.MonsterArchive... values) { + bitField0_ |= 0x00000004; + archiveMonsterIdList.addAll(values); + return this; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * @return whether the archiveRelicList field is set + */ + public boolean hasArchiveRelicList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * @return this + */ + public ArchiveData clearArchiveRelicList() { + bitField0_ &= ~0x00000008; + archiveRelicList.clear(); + return this; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * + * 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 #getMutableArchiveRelicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getArchiveRelicList() { + return archiveRelicList; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * + * 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 getMutableArchiveRelicList() { + bitField0_ |= 0x00000008; + return archiveRelicList; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * @param value the archiveRelicList to add + * @return this + */ + public ArchiveData addArchiveRelicList(final RelicArchiveOuterClass.RelicArchive value) { + bitField0_ |= 0x00000008; + archiveRelicList.add(value); + return this; + } + + /** + * repeated .RelicArchive archive_relic_list = 11; + * @param values the archiveRelicList to add + * @return this + */ + public ArchiveData addAllArchiveRelicList(final RelicArchiveOuterClass.RelicArchive... values) { + bitField0_ |= 0x00000008; + archiveRelicList.addAll(values); + return this; + } + @Override public ArchiveData copyFrom(final ArchiveData other) { cachedSize = other.cachedSize; @@ -182,6 +332,8 @@ public final class ArchiveDataOuterClass { bitField0_ = other.bitField0_; archiveEquipmentIdList.copyFrom(other.archiveEquipmentIdList); archiveAvatarIdList.copyFrom(other.archiveAvatarIdList); + archiveMonsterIdList.copyFrom(other.archiveMonsterIdList); + archiveRelicList.copyFrom(other.archiveRelicList); } return this; } @@ -198,6 +350,12 @@ public final class ArchiveDataOuterClass { if (other.hasArchiveAvatarIdList()) { getMutableArchiveAvatarIdList().addAll(other.archiveAvatarIdList); } + if (other.hasArchiveMonsterIdList()) { + getMutableArchiveMonsterIdList().addAll(other.archiveMonsterIdList); + } + if (other.hasArchiveRelicList()) { + getMutableArchiveRelicList().addAll(other.archiveRelicList); + } return this; } @@ -210,6 +368,8 @@ public final class ArchiveDataOuterClass { bitField0_ = 0; archiveEquipmentIdList.clear(); archiveAvatarIdList.clear(); + archiveMonsterIdList.clear(); + archiveRelicList.clear(); return this; } @@ -222,6 +382,8 @@ public final class ArchiveDataOuterClass { bitField0_ = 0; archiveEquipmentIdList.clear(); archiveAvatarIdList.clear(); + archiveMonsterIdList.clearQuick(); + archiveRelicList.clearQuick(); return this; } @@ -236,7 +398,9 @@ public final class ArchiveDataOuterClass { ArchiveData other = (ArchiveData) o; return bitField0_ == other.bitField0_ && (!hasArchiveEquipmentIdList() || archiveEquipmentIdList.equals(other.archiveEquipmentIdList)) - && (!hasArchiveAvatarIdList() || archiveAvatarIdList.equals(other.archiveAvatarIdList)); + && (!hasArchiveAvatarIdList() || archiveAvatarIdList.equals(other.archiveAvatarIdList)) + && (!hasArchiveMonsterIdList() || archiveMonsterIdList.equals(other.archiveMonsterIdList)) + && (!hasArchiveRelicList() || archiveRelicList.equals(other.archiveRelicList)); } @Override @@ -253,6 +417,18 @@ public final class ArchiveDataOuterClass { output.writeUInt32NoTag(archiveAvatarIdList.array()[i]); } } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < archiveMonsterIdList.length(); i++) { + output.writeRawByte((byte) 58); + output.writeMessageNoTag(archiveMonsterIdList.get(i)); + } + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < archiveRelicList.length(); i++) { + output.writeRawByte((byte) 90); + output.writeMessageNoTag(archiveRelicList.get(i)); + } + } } @Override @@ -264,6 +440,12 @@ public final class ArchiveDataOuterClass { if ((bitField0_ & 0x00000002) != 0) { size += (1 * archiveAvatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(archiveAvatarIdList); } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * archiveMonsterIdList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(archiveMonsterIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * archiveRelicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(archiveRelicList); + } return size; } @@ -288,6 +470,22 @@ public final class ArchiveDataOuterClass { input.readPackedUInt32(archiveAvatarIdList, tag); bitField0_ |= 0x00000002; tag = input.readTag(); + if (tag != 58) { + break; + } + } + case 58: { + // archiveMonsterIdList + tag = input.readRepeatedMessage(archiveMonsterIdList, tag); + bitField0_ |= 0x00000004; + if (tag != 90) { + break; + } + } + case 90: { + // archiveRelicList + tag = input.readRepeatedMessage(archiveRelicList, tag); + bitField0_ |= 0x00000008; if (tag != 0) { break; } @@ -327,6 +525,12 @@ public final class ArchiveDataOuterClass { if ((bitField0_ & 0x00000002) != 0) { output.writeRepeatedUInt32(FieldNames.archiveAvatarIdList, archiveAvatarIdList); } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.archiveMonsterIdList, archiveMonsterIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedMessage(FieldNames.archiveRelicList, archiveRelicList); + } output.endObject(); } @@ -361,6 +565,30 @@ public final class ArchiveDataOuterClass { } break; } + case 912174897: + case 1817787488: { + if (input.isAtField(FieldNames.archiveMonsterIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(archiveMonsterIdList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1742876687: + case 2101828999: { + if (input.isAtField(FieldNames.archiveRelicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(archiveRelicList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -416,6 +644,10 @@ public final class ArchiveDataOuterClass { static final FieldName archiveEquipmentIdList = FieldName.forField("archiveEquipmentIdList", "archive_equipment_id_list"); static final FieldName archiveAvatarIdList = FieldName.forField("archiveAvatarIdList", "archive_avatar_id_list"); + + static final FieldName archiveMonsterIdList = FieldName.forField("archiveMonsterIdList", "archive_monster_id_list"); + + static final FieldName archiveRelicList = FieldName.forField("archiveRelicList", "archive_relic_list"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java new file mode 100644 index 0000000..ed6597b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java @@ -0,0 +1,1320 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.ProtoEnum; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.ProtoUtil; + +public final class BattlePassInfoNotifyOuterClass { + /** + * Protobuf type {@code BattlePassInfoNotify} + */ + public static final class BattlePassInfoNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint64 taken_premium_extended_reward = 2; + */ + private long takenPremiumExtendedReward; + + /** + * optional uint64 taken_free_extended_reward = 5; + */ + private long takenFreeExtendedReward; + + /** + * optional uint64 unkfield = 6; + */ + private long unkfield; + + /** + * optional uint64 taken_premium_reward2 = 8; + */ + private long takenPremiumReward2; + + /** + * optional uint64 taken_free_reward = 9; + */ + private long takenFreeReward; + + /** + * optional uint64 taken_premium_reward1 = 10; + */ + private long takenPremiumReward1; + + /** + * optional uint64 taken_premium_optional_reward = 11; + */ + private long takenPremiumOptionalReward; + + /** + * optional uint32 exp = 4; + */ + private int exp; + + /** + * optional uint32 level = 7; + */ + private int level; + + /** + * optional uint32 cur_bp_id = 14; + */ + private int curBpId; + + /** + * optional uint32 cur_week_add_exp_sum = 15; + */ + private int curWeekAddExpSum; + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + */ + private int bpTierType; + + private BattlePassInfoNotify() { + } + + /** + * @return a new empty instance of {@code BattlePassInfoNotify} + */ + public static BattlePassInfoNotify newInstance() { + return new BattlePassInfoNotify(); + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return whether the takenPremiumExtendedReward field is set + */ + public boolean hasTakenPremiumExtendedReward() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumExtendedReward() { + bitField0_ &= ~0x00000001; + takenPremiumExtendedReward = 0L; + return this; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return the takenPremiumExtendedReward + */ + public long getTakenPremiumExtendedReward() { + return takenPremiumExtendedReward; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @param value the takenPremiumExtendedReward to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumExtendedReward(final long value) { + bitField0_ |= 0x00000001; + takenPremiumExtendedReward = value; + return this; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return whether the takenFreeExtendedReward field is set + */ + public boolean hasTakenFreeExtendedReward() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return this + */ + public BattlePassInfoNotify clearTakenFreeExtendedReward() { + bitField0_ &= ~0x00000002; + takenFreeExtendedReward = 0L; + return this; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return the takenFreeExtendedReward + */ + public long getTakenFreeExtendedReward() { + return takenFreeExtendedReward; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @param value the takenFreeExtendedReward to set + * @return this + */ + public BattlePassInfoNotify setTakenFreeExtendedReward(final long value) { + bitField0_ |= 0x00000002; + takenFreeExtendedReward = value; + return this; + } + + /** + * optional uint64 unkfield = 6; + * @return whether the unkfield field is set + */ + public boolean hasUnkfield() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint64 unkfield = 6; + * @return this + */ + public BattlePassInfoNotify clearUnkfield() { + bitField0_ &= ~0x00000004; + unkfield = 0L; + return this; + } + + /** + * optional uint64 unkfield = 6; + * @return the unkfield + */ + public long getUnkfield() { + return unkfield; + } + + /** + * optional uint64 unkfield = 6; + * @param value the unkfield to set + * @return this + */ + public BattlePassInfoNotify setUnkfield(final long value) { + bitField0_ |= 0x00000004; + unkfield = value; + return this; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return whether the takenPremiumReward2 field is set + */ + public boolean hasTakenPremiumReward2() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumReward2() { + bitField0_ &= ~0x00000008; + takenPremiumReward2 = 0L; + return this; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return the takenPremiumReward2 + */ + public long getTakenPremiumReward2() { + return takenPremiumReward2; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @param value the takenPremiumReward2 to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumReward2(final long value) { + bitField0_ |= 0x00000008; + takenPremiumReward2 = value; + return this; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return whether the takenFreeReward field is set + */ + public boolean hasTakenFreeReward() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return this + */ + public BattlePassInfoNotify clearTakenFreeReward() { + bitField0_ &= ~0x00000010; + takenFreeReward = 0L; + return this; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return the takenFreeReward + */ + public long getTakenFreeReward() { + return takenFreeReward; + } + + /** + * optional uint64 taken_free_reward = 9; + * @param value the takenFreeReward to set + * @return this + */ + public BattlePassInfoNotify setTakenFreeReward(final long value) { + bitField0_ |= 0x00000010; + takenFreeReward = value; + return this; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return whether the takenPremiumReward1 field is set + */ + public boolean hasTakenPremiumReward1() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumReward1() { + bitField0_ &= ~0x00000020; + takenPremiumReward1 = 0L; + return this; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return the takenPremiumReward1 + */ + public long getTakenPremiumReward1() { + return takenPremiumReward1; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @param value the takenPremiumReward1 to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumReward1(final long value) { + bitField0_ |= 0x00000020; + takenPremiumReward1 = value; + return this; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return whether the takenPremiumOptionalReward field is set + */ + public boolean hasTakenPremiumOptionalReward() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumOptionalReward() { + bitField0_ &= ~0x00000040; + takenPremiumOptionalReward = 0L; + return this; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return the takenPremiumOptionalReward + */ + public long getTakenPremiumOptionalReward() { + return takenPremiumOptionalReward; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @param value the takenPremiumOptionalReward to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumOptionalReward(final long value) { + bitField0_ |= 0x00000040; + takenPremiumOptionalReward = value; + return this; + } + + /** + * optional uint32 exp = 4; + * @return whether the exp field is set + */ + public boolean hasExp() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional uint32 exp = 4; + * @return this + */ + public BattlePassInfoNotify clearExp() { + bitField0_ &= ~0x00000080; + exp = 0; + return this; + } + + /** + * optional uint32 exp = 4; + * @return the exp + */ + public int getExp() { + return exp; + } + + /** + * optional uint32 exp = 4; + * @param value the exp to set + * @return this + */ + public BattlePassInfoNotify setExp(final int value) { + bitField0_ |= 0x00000080; + exp = value; + return this; + } + + /** + * optional uint32 level = 7; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * optional uint32 level = 7; + * @return this + */ + public BattlePassInfoNotify clearLevel() { + bitField0_ &= ~0x00000100; + level = 0; + return this; + } + + /** + * optional uint32 level = 7; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 7; + * @param value the level to set + * @return this + */ + public BattlePassInfoNotify setLevel(final int value) { + bitField0_ |= 0x00000100; + level = value; + return this; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return whether the curBpId field is set + */ + public boolean hasCurBpId() { + return (bitField0_ & 0x00000200) != 0; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return this + */ + public BattlePassInfoNotify clearCurBpId() { + bitField0_ &= ~0x00000200; + curBpId = 0; + return this; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return the curBpId + */ + public int getCurBpId() { + return curBpId; + } + + /** + * optional uint32 cur_bp_id = 14; + * @param value the curBpId to set + * @return this + */ + public BattlePassInfoNotify setCurBpId(final int value) { + bitField0_ |= 0x00000200; + curBpId = value; + return this; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return whether the curWeekAddExpSum field is set + */ + public boolean hasCurWeekAddExpSum() { + return (bitField0_ & 0x00000400) != 0; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return this + */ + public BattlePassInfoNotify clearCurWeekAddExpSum() { + bitField0_ &= ~0x00000400; + curWeekAddExpSum = 0; + return this; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return the curWeekAddExpSum + */ + public int getCurWeekAddExpSum() { + return curWeekAddExpSum; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @param value the curWeekAddExpSum to set + * @return this + */ + public BattlePassInfoNotify setCurWeekAddExpSum(final int value) { + bitField0_ |= 0x00000400; + curWeekAddExpSum = value; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return whether the bpTierType field is set + */ + public boolean hasBpTierType() { + return (bitField0_ & 0x00000800) != 0; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return this + */ + public BattlePassInfoNotify clearBpTierType() { + bitField0_ &= ~0x00000800; + bpTierType = 0; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return the bpTierType + */ + public BpTierType getBpTierType() { + return BpTierType.forNumber(bpTierType); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link BattlePassInfoNotify#getBpTierType()}.getNumber(). + * + * @return numeric wire representation + */ + public int getBpTierTypeValue() { + return bpTierType; + } + + /** + * Sets the value of the internal enum store. This does not + * do any validity checks, so be sure to use appropriate value + * constants from {@link BpTierType}. Setting an invalid value + * can cause {@link BattlePassInfoNotify#getBpTierType()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public BattlePassInfoNotify setBpTierTypeValue(final int value) { + bitField0_ |= 0x00000800; + bpTierType = value; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @param value the bpTierType to set + * @return this + */ + public BattlePassInfoNotify setBpTierType(final BpTierType value) { + bitField0_ |= 0x00000800; + bpTierType = value.getNumber(); + return this; + } + + @Override + public BattlePassInfoNotify copyFrom(final BattlePassInfoNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + takenPremiumExtendedReward = other.takenPremiumExtendedReward; + takenFreeExtendedReward = other.takenFreeExtendedReward; + unkfield = other.unkfield; + takenPremiumReward2 = other.takenPremiumReward2; + takenFreeReward = other.takenFreeReward; + takenPremiumReward1 = other.takenPremiumReward1; + takenPremiumOptionalReward = other.takenPremiumOptionalReward; + exp = other.exp; + level = other.level; + curBpId = other.curBpId; + curWeekAddExpSum = other.curWeekAddExpSum; + bpTierType = other.bpTierType; + } + return this; + } + + @Override + public BattlePassInfoNotify mergeFrom(final BattlePassInfoNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTakenPremiumExtendedReward()) { + setTakenPremiumExtendedReward(other.takenPremiumExtendedReward); + } + if (other.hasTakenFreeExtendedReward()) { + setTakenFreeExtendedReward(other.takenFreeExtendedReward); + } + if (other.hasUnkfield()) { + setUnkfield(other.unkfield); + } + if (other.hasTakenPremiumReward2()) { + setTakenPremiumReward2(other.takenPremiumReward2); + } + if (other.hasTakenFreeReward()) { + setTakenFreeReward(other.takenFreeReward); + } + if (other.hasTakenPremiumReward1()) { + setTakenPremiumReward1(other.takenPremiumReward1); + } + if (other.hasTakenPremiumOptionalReward()) { + setTakenPremiumOptionalReward(other.takenPremiumOptionalReward); + } + if (other.hasExp()) { + setExp(other.exp); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasCurBpId()) { + setCurBpId(other.curBpId); + } + if (other.hasCurWeekAddExpSum()) { + setCurWeekAddExpSum(other.curWeekAddExpSum); + } + if (other.hasBpTierType()) { + setBpTierTypeValue(other.bpTierType); + } + return this; + } + + @Override + public BattlePassInfoNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + takenPremiumExtendedReward = 0L; + takenFreeExtendedReward = 0L; + unkfield = 0L; + takenPremiumReward2 = 0L; + takenFreeReward = 0L; + takenPremiumReward1 = 0L; + takenPremiumOptionalReward = 0L; + exp = 0; + level = 0; + curBpId = 0; + curWeekAddExpSum = 0; + bpTierType = 0; + return this; + } + + @Override + public BattlePassInfoNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof BattlePassInfoNotify)) { + return false; + } + BattlePassInfoNotify other = (BattlePassInfoNotify) o; + return bitField0_ == other.bitField0_ + && (!hasTakenPremiumExtendedReward() || takenPremiumExtendedReward == other.takenPremiumExtendedReward) + && (!hasTakenFreeExtendedReward() || takenFreeExtendedReward == other.takenFreeExtendedReward) + && (!hasUnkfield() || unkfield == other.unkfield) + && (!hasTakenPremiumReward2() || takenPremiumReward2 == other.takenPremiumReward2) + && (!hasTakenFreeReward() || takenFreeReward == other.takenFreeReward) + && (!hasTakenPremiumReward1() || takenPremiumReward1 == other.takenPremiumReward1) + && (!hasTakenPremiumOptionalReward() || takenPremiumOptionalReward == other.takenPremiumOptionalReward) + && (!hasExp() || exp == other.exp) + && (!hasLevel() || level == other.level) + && (!hasCurBpId() || curBpId == other.curBpId) + && (!hasCurWeekAddExpSum() || curWeekAddExpSum == other.curWeekAddExpSum) + && (!hasBpTierType() || bpTierType == other.bpTierType); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt64NoTag(takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt64NoTag(takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt64NoTag(unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt64NoTag(takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt64NoTag(takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt64NoTag(takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt64NoTag(takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(exp); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeRawByte((byte) 8); + output.writeEnumNoTag(bpTierType); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(exp); + } + if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000200) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(bpTierType); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public BattlePassInfoNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // takenPremiumExtendedReward + takenPremiumExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 40) { + break; + } + } + case 40: { + // takenFreeExtendedReward + takenFreeExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 48) { + break; + } + } + case 48: { + // unkfield + unkfield = input.readUInt64(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // takenPremiumReward2 + takenPremiumReward2 = input.readUInt64(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // takenFreeReward + takenFreeReward = input.readUInt64(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // takenPremiumReward1 + takenPremiumReward1 = input.readUInt64(); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // takenPremiumOptionalReward + takenPremiumOptionalReward = input.readUInt64(); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // exp + exp = input.readUInt32(); + bitField0_ |= 0x00000080; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000100; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // curBpId + curBpId = input.readUInt32(); + bitField0_ |= 0x00000200; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // curWeekAddExpSum + curWeekAddExpSum = input.readUInt32(); + bitField0_ |= 0x00000400; + tag = input.readTag(); + if (tag != 8) { + break; + } + } + case 8: { + // bpTierType + final int value = input.readInt32(); + if (BpTierType.forNumber(value) != null) { + bpTierType = value; + bitField0_ |= 0x00000800; + } + 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.takenPremiumExtendedReward, takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt64(FieldNames.takenFreeExtendedReward, takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt64(FieldNames.unkfield, unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt64(FieldNames.takenPremiumReward2, takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt64(FieldNames.takenFreeReward, takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeUInt64(FieldNames.takenPremiumReward1, takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeUInt64(FieldNames.takenPremiumOptionalReward, takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeUInt32(FieldNames.exp, exp); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeUInt32(FieldNames.curBpId, curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeUInt32(FieldNames.curWeekAddExpSum, curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeEnum(FieldNames.bpTierType, bpTierType, BpTierType.converter()); + } + output.endObject(); + } + + @Override + public BattlePassInfoNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1290021512: + case -2138632299: { + if (input.isAtField(FieldNames.takenPremiumExtendedReward)) { + if (!input.trySkipNullValue()) { + takenPremiumExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1116117893: + case 1257087386: { + if (input.isAtField(FieldNames.takenFreeExtendedReward)) { + if (!input.trySkipNullValue()) { + takenFreeExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -247717048: { + if (input.isAtField(FieldNames.unkfield)) { + if (!input.trySkipNullValue()) { + unkfield = input.readUInt64(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 226926899: + case 1195903363: { + if (input.isAtField(FieldNames.takenPremiumReward2)) { + if (!input.trySkipNullValue()) { + takenPremiumReward2 = input.readUInt64(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1065549026: + case 135671018: { + if (input.isAtField(FieldNames.takenFreeReward)) { + if (!input.trySkipNullValue()) { + takenFreeReward = input.readUInt64(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case 226926898: + case 1195903362: { + if (input.isAtField(FieldNames.takenPremiumReward1)) { + if (!input.trySkipNullValue()) { + takenPremiumReward1 = input.readUInt64(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case 736311903: + case 548161422: { + if (input.isAtField(FieldNames.takenPremiumOptionalReward)) { + if (!input.trySkipNullValue()) { + takenPremiumOptionalReward = input.readUInt64(); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case 100893: { + if (input.isAtField(FieldNames.exp)) { + if (!input.trySkipNullValue()) { + exp = input.readUInt32(); + bitField0_ |= 0x00000080; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1125519465: + case 110923757: { + if (input.isAtField(FieldNames.curBpId)) { + if (!input.trySkipNullValue()) { + curBpId = input.readUInt32(); + bitField0_ |= 0x00000200; + } + } else { + input.skipUnknownField(); + } + break; + } + case 835771131: + case 26830815: { + if (input.isAtField(FieldNames.curWeekAddExpSum)) { + if (!input.trySkipNullValue()) { + curWeekAddExpSum = input.readUInt32(); + bitField0_ |= 0x00000400; + } + } else { + input.skipUnknownField(); + } + break; + } + case -584657238: + case 779964614: { + if (input.isAtField(FieldNames.bpTierType)) { + if (!input.trySkipNullValue()) { + final BpTierType value = input.readEnum(BpTierType.converter()); + if (value != null) { + bpTierType = value.getNumber(); + bitField0_ |= 0x00000800; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public BattlePassInfoNotify clone() { + return new BattlePassInfoNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static BattlePassInfoNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), data).checkInitialized(); + } + + public static BattlePassInfoNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), input).checkInitialized(); + } + + public static BattlePassInfoNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating BattlePassInfoNotify messages + */ + public static MessageFactory getFactory() { + return BattlePassInfoNotifyFactory.INSTANCE; + } + + /** + * Protobuf enum {@code BpTierType} + */ + public enum BpTierType implements ProtoEnum { + /** + * BP_TIER_TYPE_NONE = 0; + */ + BP_TIER_TYPE_NONE("BP_TIER_TYPE_NONE", 0), + + /** + * BP_TIER_TYPE_FREE = 1; + */ + BP_TIER_TYPE_FREE("BP_TIER_TYPE_FREE", 1), + + /** + * BP_TIER_TYPE_PREMIUM_1 = 2; + */ + BP_TIER_TYPE_PREMIUM_1("BP_TIER_TYPE_PREMIUM_1", 2), + + /** + * BP_TIER_TYPE_PREMIUM_2 = 3; + */ + BP_TIER_TYPE_PREMIUM_2("BP_TIER_TYPE_PREMIUM_2", 3); + + /** + * BP_TIER_TYPE_NONE = 0; + */ + public static final int BP_TIER_TYPE_NONE_VALUE = 0; + + /** + * BP_TIER_TYPE_FREE = 1; + */ + public static final int BP_TIER_TYPE_FREE_VALUE = 1; + + /** + * BP_TIER_TYPE_PREMIUM_1 = 2; + */ + public static final int BP_TIER_TYPE_PREMIUM_1_VALUE = 2; + + /** + * BP_TIER_TYPE_PREMIUM_2 = 3; + */ + public static final int BP_TIER_TYPE_PREMIUM_2_VALUE = 3; + + private final String name; + + private final int number; + + private BpTierType(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * @return the string representation of enum entry + */ + @Override + public String getName() { + return name; + } + + /** + * @return the numeric wire value of this enum entry + */ + @Override + public int getNumber() { + return number; + } + + /** + * @return a converter that maps between this enum's numeric and text representations + */ + public static ProtoEnum.EnumConverter converter() { + return BpTierTypeConverter.INSTANCE; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value, or null if unknown. + */ + public static BpTierType forNumber(int value) { + return BpTierTypeConverter.INSTANCE.forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @param other Fallback value in case the value is not known. + * @return The enum associated with the given numeric wire value, or the fallback value if unknown. + */ + public static BpTierType forNumberOr(int number, BpTierType other) { + BpTierType value = forNumber(number); + return value == null ? other : value; + } + + enum BpTierTypeConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final BpTierType[] lookup = new BpTierType[4]; + + static { + lookup[0] = BP_TIER_TYPE_NONE; + lookup[1] = BP_TIER_TYPE_FREE; + lookup[2] = BP_TIER_TYPE_PREMIUM_1; + lookup[3] = BP_TIER_TYPE_PREMIUM_2; + } + + @Override + public final BpTierType forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final BpTierType forName(final CharSequence value) { + if (value.length() == 17) { + if (ProtoUtil.isEqual("BP_TIER_TYPE_NONE", value)) { + return BP_TIER_TYPE_NONE; + } + if (ProtoUtil.isEqual("BP_TIER_TYPE_FREE", value)) { + return BP_TIER_TYPE_FREE; + } + } + if (value.length() == 22) { + if (ProtoUtil.isEqual("BP_TIER_TYPE_PREMIUM_1", value)) { + return BP_TIER_TYPE_PREMIUM_1; + } + if (ProtoUtil.isEqual("BP_TIER_TYPE_PREMIUM_2", value)) { + return BP_TIER_TYPE_PREMIUM_2; + } + } + return null; + } + } + } + + private enum BattlePassInfoNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public BattlePassInfoNotify create() { + return BattlePassInfoNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName takenPremiumExtendedReward = FieldName.forField("takenPremiumExtendedReward", "taken_premium_extended_reward"); + + static final FieldName takenFreeExtendedReward = FieldName.forField("takenFreeExtendedReward", "taken_free_extended_reward"); + + static final FieldName unkfield = FieldName.forField("unkfield"); + + static final FieldName takenPremiumReward2 = FieldName.forField("takenPremiumReward2", "taken_premium_reward2"); + + static final FieldName takenFreeReward = FieldName.forField("takenFreeReward", "taken_free_reward"); + + static final FieldName takenPremiumReward1 = FieldName.forField("takenPremiumReward1", "taken_premium_reward1"); + + static final FieldName takenPremiumOptionalReward = FieldName.forField("takenPremiumOptionalReward", "taken_premium_optional_reward"); + + static final FieldName exp = FieldName.forField("exp"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName curBpId = FieldName.forField("curBpId", "cur_bp_id"); + + static final FieldName curWeekAddExpSum = FieldName.forField("curWeekAddExpSum", "cur_week_add_exp_sum"); + + static final FieldName bpTierType = FieldName.forField("bpTierType", "bp_tier_type"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotOuterClass.java b/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotOuterClass.java new file mode 100644 index 0000000..9d97d0e --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotOuterClass.java @@ -0,0 +1,362 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class ClientTurnSnapshotOuterClass { + /** + * Protobuf type {@code ClientTurnSnapshot} + */ + public static final class ClientTurnSnapshot extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 battle_event_id = 1; + */ + private int battleEventId; + + /** + * optional .ClientTurnSnapshotStatus status = 2; + */ + private final ClientTurnSnapshotStatusOuterClass.ClientTurnSnapshotStatus status = ClientTurnSnapshotStatusOuterClass.ClientTurnSnapshotStatus.newInstance(); + + private ClientTurnSnapshot() { + } + + /** + * @return a new empty instance of {@code ClientTurnSnapshot} + */ + public static ClientTurnSnapshot newInstance() { + return new ClientTurnSnapshot(); + } + + /** + * optional uint32 battle_event_id = 1; + * @return whether the battleEventId field is set + */ + public boolean hasBattleEventId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 battle_event_id = 1; + * @return this + */ + public ClientTurnSnapshot clearBattleEventId() { + bitField0_ &= ~0x00000001; + battleEventId = 0; + return this; + } + + /** + * optional uint32 battle_event_id = 1; + * @return the battleEventId + */ + public int getBattleEventId() { + return battleEventId; + } + + /** + * optional uint32 battle_event_id = 1; + * @param value the battleEventId to set + * @return this + */ + public ClientTurnSnapshot setBattleEventId(final int value) { + bitField0_ |= 0x00000001; + battleEventId = value; + return this; + } + + /** + * optional .ClientTurnSnapshotStatus status = 2; + * @return whether the status field is set + */ + public boolean hasStatus() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .ClientTurnSnapshotStatus status = 2; + * @return this + */ + public ClientTurnSnapshot clearStatus() { + bitField0_ &= ~0x00000002; + status.clear(); + return this; + } + + /** + * optional .ClientTurnSnapshotStatus status = 2; + * + * 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 #getMutableStatus()} if you want to modify it. + * + * @return internal storage object for reading + */ + public ClientTurnSnapshotStatusOuterClass.ClientTurnSnapshotStatus getStatus() { + return status; + } + + /** + * optional .ClientTurnSnapshotStatus status = 2; + * + * 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 ClientTurnSnapshotStatusOuterClass.ClientTurnSnapshotStatus getMutableStatus() { + bitField0_ |= 0x00000002; + return status; + } + + /** + * optional .ClientTurnSnapshotStatus status = 2; + * @param value the status to set + * @return this + */ + public ClientTurnSnapshot setStatus( + final ClientTurnSnapshotStatusOuterClass.ClientTurnSnapshotStatus value) { + bitField0_ |= 0x00000002; + status.copyFrom(value); + return this; + } + + @Override + public ClientTurnSnapshot copyFrom(final ClientTurnSnapshot other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + battleEventId = other.battleEventId; + status.copyFrom(other.status); + } + return this; + } + + @Override + public ClientTurnSnapshot mergeFrom(final ClientTurnSnapshot other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBattleEventId()) { + setBattleEventId(other.battleEventId); + } + if (other.hasStatus()) { + getMutableStatus().mergeFrom(other.status); + } + return this; + } + + @Override + public ClientTurnSnapshot clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + battleEventId = 0; + status.clear(); + return this; + } + + @Override + public ClientTurnSnapshot clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + status.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ClientTurnSnapshot)) { + return false; + } + ClientTurnSnapshot other = (ClientTurnSnapshot) o; + return bitField0_ == other.bitField0_ + && (!hasBattleEventId() || battleEventId == other.battleEventId) + && (!hasStatus() || status.equals(other.status)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(battleEventId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(status); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(battleEventId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(status); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ClientTurnSnapshot mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // battleEventId + battleEventId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // status + input.readMessage(status); + bitField0_ |= 0x00000002; + 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.battleEventId, battleEventId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.status, status); + } + output.endObject(); + } + + @Override + public ClientTurnSnapshot mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -79510147: + case -766250873: { + if (input.isAtField(FieldNames.battleEventId)) { + if (!input.trySkipNullValue()) { + battleEventId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -892481550: { + if (input.isAtField(FieldNames.status)) { + if (!input.trySkipNullValue()) { + input.readMessage(status); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ClientTurnSnapshot clone() { + return new ClientTurnSnapshot().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ClientTurnSnapshot parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshot(), data).checkInitialized(); + } + + public static ClientTurnSnapshot parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshot(), input).checkInitialized(); + } + + public static ClientTurnSnapshot parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshot(), input).checkInitialized(); + } + + /** + * @return factory for creating ClientTurnSnapshot messages + */ + public static MessageFactory getFactory() { + return ClientTurnSnapshotFactory.INSTANCE; + } + + private enum ClientTurnSnapshotFactory implements MessageFactory { + INSTANCE; + + @Override + public ClientTurnSnapshot create() { + return ClientTurnSnapshot.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName battleEventId = FieldName.forField("battleEventId", "battle_event_id"); + + static final FieldName status = FieldName.forField("status"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotStatusOuterClass.java b/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotStatusOuterClass.java new file mode 100644 index 0000000..6d9f8cb --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ClientTurnSnapshotStatusOuterClass.java @@ -0,0 +1,281 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class ClientTurnSnapshotStatusOuterClass { + /** + * Protobuf type {@code ClientTurnSnapshotStatus} + */ + public static final class ClientTurnSnapshotStatus extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .SpBarInfo sp_bar = 2; + */ + private final SpBarInfoOuterClass.SpBarInfo spBar = SpBarInfoOuterClass.SpBarInfo.newInstance(); + + private ClientTurnSnapshotStatus() { + } + + /** + * @return a new empty instance of {@code ClientTurnSnapshotStatus} + */ + public static ClientTurnSnapshotStatus newInstance() { + return new ClientTurnSnapshotStatus(); + } + + /** + * optional .SpBarInfo sp_bar = 2; + * @return whether the spBar field is set + */ + public boolean hasSpBar() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .SpBarInfo sp_bar = 2; + * @return this + */ + public ClientTurnSnapshotStatus clearSpBar() { + bitField0_ &= ~0x00000001; + spBar.clear(); + return this; + } + + /** + * optional .SpBarInfo sp_bar = 2; + * + * 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 #getMutableSpBar()} if you want to modify it. + * + * @return internal storage object for reading + */ + public SpBarInfoOuterClass.SpBarInfo getSpBar() { + return spBar; + } + + /** + * optional .SpBarInfo sp_bar = 2; + * + * 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 SpBarInfoOuterClass.SpBarInfo getMutableSpBar() { + bitField0_ |= 0x00000001; + return spBar; + } + + /** + * optional .SpBarInfo sp_bar = 2; + * @param value the spBar to set + * @return this + */ + public ClientTurnSnapshotStatus setSpBar(final SpBarInfoOuterClass.SpBarInfo value) { + bitField0_ |= 0x00000001; + spBar.copyFrom(value); + return this; + } + + @Override + public ClientTurnSnapshotStatus copyFrom(final ClientTurnSnapshotStatus other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + spBar.copyFrom(other.spBar); + } + return this; + } + + @Override + public ClientTurnSnapshotStatus mergeFrom(final ClientTurnSnapshotStatus other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasSpBar()) { + getMutableSpBar().mergeFrom(other.spBar); + } + return this; + } + + @Override + public ClientTurnSnapshotStatus clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + spBar.clear(); + return this; + } + + @Override + public ClientTurnSnapshotStatus clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + spBar.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ClientTurnSnapshotStatus)) { + return false; + } + ClientTurnSnapshotStatus other = (ClientTurnSnapshotStatus) o; + return bitField0_ == other.bitField0_ + && (!hasSpBar() || spBar.equals(other.spBar)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(spBar); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(spBar); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ClientTurnSnapshotStatus mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 18: { + // spBar + input.readMessage(spBar); + bitField0_ |= 0x00000001; + 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.writeMessage(FieldNames.spBar, spBar); + } + output.endObject(); + } + + @Override + public ClientTurnSnapshotStatus mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 109608054: + case -896253135: { + if (input.isAtField(FieldNames.spBar)) { + if (!input.trySkipNullValue()) { + input.readMessage(spBar); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ClientTurnSnapshotStatus clone() { + return new ClientTurnSnapshotStatus().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ClientTurnSnapshotStatus parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshotStatus(), data).checkInitialized(); + } + + public static ClientTurnSnapshotStatus parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshotStatus(), input).checkInitialized(); + } + + public static ClientTurnSnapshotStatus parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientTurnSnapshotStatus(), input).checkInitialized(); + } + + /** + * @return factory for creating ClientTurnSnapshotStatus messages + */ + public static MessageFactory getFactory() { + return ClientTurnSnapshotStatusFactory.INSTANCE; + } + + private enum ClientTurnSnapshotStatusFactory implements MessageFactory { + INSTANCE; + + @Override + public ClientTurnSnapshotStatus create() { + return ClientTurnSnapshotStatus.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName spBar = FieldName.forField("spBar", "sp_bar"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java new file mode 100644 index 0000000..f7442e6 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java @@ -0,0 +1,501 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; +import us.hebi.quickbuf.RepeatedMessage; + +public final class DailyActiveInfoNotifyOuterClass { + /** + * Protobuf type {@code DailyActiveInfoNotify} + */ + public static final class DailyActiveInfoNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 daily_active_point = 12; + */ + private int dailyActivePoint; + + /** + * repeated uint32 daily_active_quest_id_list = 1; + */ + private final RepeatedInt dailyActiveQuestIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + */ + private final RepeatedMessage dailyActiveLevelList = RepeatedMessage.newEmptyInstance(DailyActivityInfoOuterClass.DailyActivityInfo.getFactory()); + + private DailyActiveInfoNotify() { + } + + /** + * @return a new empty instance of {@code DailyActiveInfoNotify} + */ + public static DailyActiveInfoNotify newInstance() { + return new DailyActiveInfoNotify(); + } + + /** + * optional uint32 daily_active_point = 12; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 daily_active_point = 12; + * @return this + */ + public DailyActiveInfoNotify clearDailyActivePoint() { + bitField0_ &= ~0x00000001; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 12; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 12; + * @param value the dailyActivePoint to set + * @return this + */ + public DailyActiveInfoNotify setDailyActivePoint(final int value) { + bitField0_ |= 0x00000001; + dailyActivePoint = value; + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @return whether the dailyActiveQuestIdList field is set + */ + public boolean hasDailyActiveQuestIdList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @return this + */ + public DailyActiveInfoNotify clearDailyActiveQuestIdList() { + bitField0_ &= ~0x00000002; + dailyActiveQuestIdList.clear(); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * + * 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 #getMutableDailyActiveQuestIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getDailyActiveQuestIdList() { + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * + * 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 getMutableDailyActiveQuestIdList() { + bitField0_ |= 0x00000002; + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @param value the dailyActiveQuestIdList to add + * @return this + */ + public DailyActiveInfoNotify addDailyActiveQuestIdList(final int value) { + bitField0_ |= 0x00000002; + dailyActiveQuestIdList.add(value); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @param values the dailyActiveQuestIdList to add + * @return this + */ + public DailyActiveInfoNotify addAllDailyActiveQuestIdList(final int... values) { + bitField0_ |= 0x00000002; + dailyActiveQuestIdList.addAll(values); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @return whether the dailyActiveLevelList field is set + */ + public boolean hasDailyActiveLevelList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @return this + */ + public DailyActiveInfoNotify clearDailyActiveLevelList() { + bitField0_ &= ~0x00000004; + dailyActiveLevelList.clear(); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * + * 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 #getMutableDailyActiveLevelList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDailyActiveLevelList( + ) { + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * + * 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 getMutableDailyActiveLevelList( + ) { + bitField0_ |= 0x00000004; + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @param value the dailyActiveLevelList to add + * @return this + */ + public DailyActiveInfoNotify addDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo value) { + bitField0_ |= 0x00000004; + dailyActiveLevelList.add(value); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @param values the dailyActiveLevelList to add + * @return this + */ + public DailyActiveInfoNotify addAllDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo... values) { + bitField0_ |= 0x00000004; + dailyActiveLevelList.addAll(values); + return this; + } + + @Override + public DailyActiveInfoNotify copyFrom(final DailyActiveInfoNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + dailyActivePoint = other.dailyActivePoint; + dailyActiveQuestIdList.copyFrom(other.dailyActiveQuestIdList); + dailyActiveLevelList.copyFrom(other.dailyActiveLevelList); + } + return this; + } + + @Override + public DailyActiveInfoNotify mergeFrom(final DailyActiveInfoNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasDailyActiveQuestIdList()) { + getMutableDailyActiveQuestIdList().addAll(other.dailyActiveQuestIdList); + } + if (other.hasDailyActiveLevelList()) { + getMutableDailyActiveLevelList().addAll(other.dailyActiveLevelList); + } + return this; + } + + @Override + public DailyActiveInfoNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActivePoint = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clear(); + return this; + } + + @Override + public DailyActiveInfoNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DailyActiveInfoNotify)) { + return false; + } + DailyActiveInfoNotify other = (DailyActiveInfoNotify) o; + return bitField0_ == other.bitField0_ + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasDailyActiveQuestIdList() || dailyActiveQuestIdList.equals(other.dailyActiveQuestIdList)) + && (!hasDailyActiveLevelList() || dailyActiveLevelList.equals(other.dailyActiveLevelList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < dailyActiveQuestIdList.length(); i++) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(dailyActiveQuestIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < dailyActiveLevelList.length(); i++) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(dailyActiveLevelList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * dailyActiveQuestIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * dailyActiveLevelList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dailyActiveLevelList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DailyActiveInfoNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 10) { + break; + } + } + case 10: { + // dailyActiveQuestIdList [packed=true] + input.readPackedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // dailyActiveLevelList + tag = input.readRepeatedMessage(dailyActiveLevelList, tag); + bitField0_ |= 0x00000004; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 8: { + // dailyActiveQuestIdList [packed=false] + tag = input.readRepeatedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000002; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.dailyActiveQuestIdList, dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.dailyActiveLevelList, dailyActiveLevelList); + } + output.endObject(); + } + + @Override + public DailyActiveInfoNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1903124444: + case -752691246: { + if (input.isAtField(FieldNames.dailyActiveQuestIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(dailyActiveQuestIdList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 705251971: + case 1821477548: { + if (input.isAtField(FieldNames.dailyActiveLevelList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(dailyActiveLevelList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DailyActiveInfoNotify clone() { + return new DailyActiveInfoNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DailyActiveInfoNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), data).checkInitialized(); + } + + public static DailyActiveInfoNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), input).checkInitialized(); + } + + public static DailyActiveInfoNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating DailyActiveInfoNotify messages + */ + public static MessageFactory getFactory() { + return DailyActiveInfoNotifyFactory.INSTANCE; + } + + private enum DailyActiveInfoNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public DailyActiveInfoNotify create() { + return DailyActiveInfoNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName dailyActiveQuestIdList = FieldName.forField("dailyActiveQuestIdList", "daily_active_quest_id_list"); + + static final FieldName dailyActiveLevelList = FieldName.forField("dailyActiveLevelList", "daily_active_level_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java new file mode 100644 index 0000000..0e2c7a1 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java @@ -0,0 +1,502 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class DailyActivityInfoOuterClass { + /** + * Protobuf type {@code DailyActivityInfo} + */ + public static final class DailyActivityInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 level = 5; + */ + private int level; + + /** + * optional uint32 daily_active_point = 9; + */ + private int dailyActivePoint; + + /** + * optional uint32 world_level = 10; + */ + private int worldLevel; + + /** + * optional bool is_has_taken = 13; + */ + private boolean isHasTaken; + + private DailyActivityInfo() { + } + + /** + * @return a new empty instance of {@code DailyActivityInfo} + */ + public static DailyActivityInfo newInstance() { + return new DailyActivityInfo(); + } + + /** + * optional uint32 level = 5; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 level = 5; + * @return this + */ + public DailyActivityInfo clearLevel() { + bitField0_ &= ~0x00000001; + level = 0; + return this; + } + + /** + * optional uint32 level = 5; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 5; + * @param value the level to set + * @return this + */ + public DailyActivityInfo setLevel(final int value) { + bitField0_ |= 0x00000001; + level = value; + return this; + } + + /** + * optional uint32 daily_active_point = 9; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 daily_active_point = 9; + * @return this + */ + public DailyActivityInfo clearDailyActivePoint() { + bitField0_ &= ~0x00000002; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 9; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 9; + * @param value the dailyActivePoint to set + * @return this + */ + public DailyActivityInfo setDailyActivePoint(final int value) { + bitField0_ |= 0x00000002; + dailyActivePoint = value; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return whether the worldLevel field is set + */ + public boolean hasWorldLevel() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 world_level = 10; + * @return this + */ + public DailyActivityInfo clearWorldLevel() { + bitField0_ &= ~0x00000004; + worldLevel = 0; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return the worldLevel + */ + public int getWorldLevel() { + return worldLevel; + } + + /** + * optional uint32 world_level = 10; + * @param value the worldLevel to set + * @return this + */ + public DailyActivityInfo setWorldLevel(final int value) { + bitField0_ |= 0x00000004; + worldLevel = value; + return this; + } + + /** + * optional bool is_has_taken = 13; + * @return whether the isHasTaken field is set + */ + public boolean hasIsHasTaken() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional bool is_has_taken = 13; + * @return this + */ + public DailyActivityInfo clearIsHasTaken() { + bitField0_ &= ~0x00000008; + isHasTaken = false; + return this; + } + + /** + * optional bool is_has_taken = 13; + * @return the isHasTaken + */ + public boolean getIsHasTaken() { + return isHasTaken; + } + + /** + * optional bool is_has_taken = 13; + * @param value the isHasTaken to set + * @return this + */ + public DailyActivityInfo setIsHasTaken(final boolean value) { + bitField0_ |= 0x00000008; + isHasTaken = value; + return this; + } + + @Override + public DailyActivityInfo copyFrom(final DailyActivityInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + level = other.level; + dailyActivePoint = other.dailyActivePoint; + worldLevel = other.worldLevel; + isHasTaken = other.isHasTaken; + } + return this; + } + + @Override + public DailyActivityInfo mergeFrom(final DailyActivityInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasWorldLevel()) { + setWorldLevel(other.worldLevel); + } + if (other.hasIsHasTaken()) { + setIsHasTaken(other.isHasTaken); + } + return this; + } + + @Override + public DailyActivityInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + level = 0; + dailyActivePoint = 0; + worldLevel = 0; + isHasTaken = false; + return this; + } + + @Override + public DailyActivityInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DailyActivityInfo)) { + return false; + } + DailyActivityInfo other = (DailyActivityInfo) o; + return bitField0_ == other.bitField0_ + && (!hasLevel() || level == other.level) + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasWorldLevel() || worldLevel == other.worldLevel) + && (!hasIsHasTaken() || isHasTaken == other.isHasTaken); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 104); + output.writeBoolNoTag(isHasTaken); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DailyActivityInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // worldLevel + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // isHasTaken + isHasTaken = input.readBool(); + 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.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.worldLevel, worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeBool(FieldNames.isHasTaken, isHasTaken); + } + output.endObject(); + } + + @Override + public DailyActivityInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 440007442: + case 1305257111: { + if (input.isAtField(FieldNames.worldLevel)) { + if (!input.trySkipNullValue()) { + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -663154281: + case -1240296947: { + if (input.isAtField(FieldNames.isHasTaken)) { + if (!input.trySkipNullValue()) { + isHasTaken = input.readBool(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DailyActivityInfo clone() { + return new DailyActivityInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DailyActivityInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), data).checkInitialized(); + } + + public static DailyActivityInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), input).checkInitialized(); + } + + public static DailyActivityInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating DailyActivityInfo messages + */ + public static MessageFactory getFactory() { + return DailyActivityInfoFactory.INSTANCE; + } + + private enum DailyActivityInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public DailyActivityInfo create() { + return DailyActivityInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName level = FieldName.forField("level"); + + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName worldLevel = FieldName.forField("worldLevel", "world_level"); + + static final FieldName isHasTaken = FieldName.forField("isHasTaken", "is_has_taken"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DoGachaScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/DoGachaScRspOuterClass.java index d21ce93..4788147 100644 --- a/src/generated/main/emu/lunarcore/proto/DoGachaScRspOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/DoGachaScRspOuterClass.java @@ -24,6 +24,11 @@ public final class DoGachaScRspOuterClass { */ private int gachaId; + /** + * optional uint32 ceiling_num = 5; + */ + private int ceilingNum; + /** * optional uint32 gacha_num = 11; */ @@ -86,12 +91,49 @@ public final class DoGachaScRspOuterClass { return this; } + /** + * optional uint32 ceiling_num = 5; + * @return whether the ceilingNum field is set + */ + public boolean hasCeilingNum() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 ceiling_num = 5; + * @return this + */ + public DoGachaScRsp clearCeilingNum() { + bitField0_ &= ~0x00000002; + ceilingNum = 0; + return this; + } + + /** + * optional uint32 ceiling_num = 5; + * @return the ceilingNum + */ + public int getCeilingNum() { + return ceilingNum; + } + + /** + * optional uint32 ceiling_num = 5; + * @param value the ceilingNum to set + * @return this + */ + public DoGachaScRsp setCeilingNum(final int value) { + bitField0_ |= 0x00000002; + ceilingNum = value; + return this; + } + /** * optional uint32 gacha_num = 11; * @return whether the gachaNum field is set */ public boolean hasGachaNum() { - return (bitField0_ & 0x00000002) != 0; + return (bitField0_ & 0x00000004) != 0; } /** @@ -99,7 +141,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp clearGachaNum() { - bitField0_ &= ~0x00000002; + bitField0_ &= ~0x00000004; gachaNum = 0; return this; } @@ -118,7 +160,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp setGachaNum(final int value) { - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; gachaNum = value; return this; } @@ -128,7 +170,7 @@ public final class DoGachaScRspOuterClass { * @return whether the retcode field is set */ public boolean hasRetcode() { - return (bitField0_ & 0x00000004) != 0; + return (bitField0_ & 0x00000008) != 0; } /** @@ -136,7 +178,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp clearRetcode() { - bitField0_ &= ~0x00000004; + bitField0_ &= ~0x00000008; retcode = 0; return this; } @@ -155,7 +197,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp setRetcode(final int value) { - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; retcode = value; return this; } @@ -165,7 +207,7 @@ public final class DoGachaScRspOuterClass { * @return whether the gachaItemList field is set */ public boolean hasGachaItemList() { - return (bitField0_ & 0x00000008) != 0; + return (bitField0_ & 0x00000010) != 0; } /** @@ -173,7 +215,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp clearGachaItemList() { - bitField0_ &= ~0x00000008; + bitField0_ &= ~0x00000010; gachaItemList.clear(); return this; } @@ -202,7 +244,7 @@ public final class DoGachaScRspOuterClass { * @return internal storage object for modifications */ public RepeatedMessage getMutableGachaItemList() { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; return gachaItemList; } @@ -212,7 +254,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp addGachaItemList(final GachaItemOuterClass.GachaItem value) { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; gachaItemList.add(value); return this; } @@ -223,7 +265,7 @@ public final class DoGachaScRspOuterClass { * @return this */ public DoGachaScRsp addAllGachaItemList(final GachaItemOuterClass.GachaItem... values) { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; gachaItemList.addAll(values); return this; } @@ -234,6 +276,7 @@ public final class DoGachaScRspOuterClass { if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; gachaId = other.gachaId; + ceilingNum = other.ceilingNum; gachaNum = other.gachaNum; retcode = other.retcode; gachaItemList.copyFrom(other.gachaItemList); @@ -250,6 +293,9 @@ public final class DoGachaScRspOuterClass { if (other.hasGachaId()) { setGachaId(other.gachaId); } + if (other.hasCeilingNum()) { + setCeilingNum(other.ceilingNum); + } if (other.hasGachaNum()) { setGachaNum(other.gachaNum); } @@ -270,6 +316,7 @@ public final class DoGachaScRspOuterClass { cachedSize = -1; bitField0_ = 0; gachaId = 0; + ceilingNum = 0; gachaNum = 0; retcode = 0; gachaItemList.clear(); @@ -298,6 +345,7 @@ public final class DoGachaScRspOuterClass { DoGachaScRsp other = (DoGachaScRsp) o; return bitField0_ == other.bitField0_ && (!hasGachaId() || gachaId == other.gachaId) + && (!hasCeilingNum() || ceilingNum == other.ceilingNum) && (!hasGachaNum() || gachaNum == other.gachaNum) && (!hasRetcode() || retcode == other.retcode) && (!hasGachaItemList() || gachaItemList.equals(other.gachaItemList)); @@ -310,14 +358,18 @@ public final class DoGachaScRspOuterClass { output.writeUInt32NoTag(gachaId); } if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(ceilingNum); + } + if ((bitField0_ & 0x00000004) != 0) { output.writeRawByte((byte) 88); output.writeUInt32NoTag(gachaNum); } - if ((bitField0_ & 0x00000004) != 0) { + if ((bitField0_ & 0x00000008) != 0) { output.writeRawByte((byte) 104); output.writeUInt32NoTag(retcode); } - if ((bitField0_ & 0x00000008) != 0) { + if ((bitField0_ & 0x00000010) != 0) { for (int i = 0; i < gachaItemList.length(); i++) { output.writeRawByte((byte) 74); output.writeMessageNoTag(gachaItemList.get(i)); @@ -332,12 +384,15 @@ public final class DoGachaScRspOuterClass { size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaId); } if ((bitField0_ & 0x00000002) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaNum); + size += 1 + ProtoSink.computeUInt32SizeNoTag(ceilingNum); } if ((bitField0_ & 0x00000004) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaNum); } if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000010) != 0) { size += (1 * gachaItemList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(gachaItemList); } return size; @@ -355,6 +410,15 @@ public final class DoGachaScRspOuterClass { gachaId = input.readUInt32(); bitField0_ |= 0x00000001; tag = input.readTag(); + if (tag != 40) { + break; + } + } + case 40: { + // ceilingNum + ceilingNum = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); if (tag != 88) { break; } @@ -362,7 +426,7 @@ public final class DoGachaScRspOuterClass { case 88: { // gachaNum gachaNum = input.readUInt32(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; tag = input.readTag(); if (tag != 104) { break; @@ -371,7 +435,7 @@ public final class DoGachaScRspOuterClass { case 104: { // retcode retcode = input.readUInt32(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; tag = input.readTag(); if (tag != 74) { break; @@ -380,7 +444,7 @@ public final class DoGachaScRspOuterClass { case 74: { // gachaItemList tag = input.readRepeatedMessage(gachaItemList, tag); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; if (tag != 0) { break; } @@ -406,12 +470,15 @@ public final class DoGachaScRspOuterClass { output.writeUInt32(FieldNames.gachaId, gachaId); } if ((bitField0_ & 0x00000002) != 0) { - output.writeUInt32(FieldNames.gachaNum, gachaNum); + output.writeUInt32(FieldNames.ceilingNum, ceilingNum); } if ((bitField0_ & 0x00000004) != 0) { - output.writeUInt32(FieldNames.retcode, retcode); + output.writeUInt32(FieldNames.gachaNum, gachaNum); } if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000010) != 0) { output.writeRepeatedMessage(FieldNames.gachaItemList, gachaItemList); } output.endObject(); @@ -436,12 +503,24 @@ public final class DoGachaScRspOuterClass { } break; } + case -1655838327: + case 209119492: { + if (input.isAtField(FieldNames.ceilingNum)) { + if (!input.trySkipNullValue()) { + ceilingNum = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } case -2052317532: case 803166025: { if (input.isAtField(FieldNames.gachaNum)) { if (!input.trySkipNullValue()) { gachaNum = input.readUInt32(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); @@ -452,7 +531,7 @@ public final class DoGachaScRspOuterClass { if (input.isAtField(FieldNames.retcode)) { if (!input.trySkipNullValue()) { retcode = input.readUInt32(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; } } else { input.skipUnknownField(); @@ -464,7 +543,7 @@ public final class DoGachaScRspOuterClass { if (input.isAtField(FieldNames.gachaItemList)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(gachaItemList); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; } } else { input.skipUnknownField(); @@ -525,6 +604,8 @@ public final class DoGachaScRspOuterClass { static class FieldNames { static final FieldName gachaId = FieldName.forField("gachaId", "gacha_id"); + static final FieldName ceilingNum = FieldName.forField("ceilingNum", "ceiling_num"); + static final FieldName gachaNum = FieldName.forField("gachaNum", "gacha_num"); static final FieldName retcode = FieldName.forField("retcode"); diff --git a/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingCsReqOuterClass.java new file mode 100644 index 0000000..f2e0121 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingCsReqOuterClass.java @@ -0,0 +1,341 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class ExchangeGachaCeilingCsReqOuterClass { + /** + * Protobuf type {@code ExchangeGachaCeilingCsReq} + */ + public static final class ExchangeGachaCeilingCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 gacha_type = 10; + */ + private int gachaType; + + /** + * optional uint32 avatar_id = 12; + */ + private int avatarId; + + private ExchangeGachaCeilingCsReq() { + } + + /** + * @return a new empty instance of {@code ExchangeGachaCeilingCsReq} + */ + public static ExchangeGachaCeilingCsReq newInstance() { + return new ExchangeGachaCeilingCsReq(); + } + + /** + * optional uint32 gacha_type = 10; + * @return whether the gachaType field is set + */ + public boolean hasGachaType() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 gacha_type = 10; + * @return this + */ + public ExchangeGachaCeilingCsReq clearGachaType() { + bitField0_ &= ~0x00000001; + gachaType = 0; + return this; + } + + /** + * optional uint32 gacha_type = 10; + * @return the gachaType + */ + public int getGachaType() { + return gachaType; + } + + /** + * optional uint32 gacha_type = 10; + * @param value the gachaType to set + * @return this + */ + public ExchangeGachaCeilingCsReq setGachaType(final int value) { + bitField0_ |= 0x00000001; + gachaType = value; + return this; + } + + /** + * optional uint32 avatar_id = 12; + * @return whether the avatarId field is set + */ + public boolean hasAvatarId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 avatar_id = 12; + * @return this + */ + public ExchangeGachaCeilingCsReq clearAvatarId() { + bitField0_ &= ~0x00000002; + avatarId = 0; + return this; + } + + /** + * optional uint32 avatar_id = 12; + * @return the avatarId + */ + public int getAvatarId() { + return avatarId; + } + + /** + * optional uint32 avatar_id = 12; + * @param value the avatarId to set + * @return this + */ + public ExchangeGachaCeilingCsReq setAvatarId(final int value) { + bitField0_ |= 0x00000002; + avatarId = value; + return this; + } + + @Override + public ExchangeGachaCeilingCsReq copyFrom(final ExchangeGachaCeilingCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + gachaType = other.gachaType; + avatarId = other.avatarId; + } + return this; + } + + @Override + public ExchangeGachaCeilingCsReq mergeFrom(final ExchangeGachaCeilingCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGachaType()) { + setGachaType(other.gachaType); + } + if (other.hasAvatarId()) { + setAvatarId(other.avatarId); + } + return this; + } + + @Override + public ExchangeGachaCeilingCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + gachaType = 0; + avatarId = 0; + return this; + } + + @Override + public ExchangeGachaCeilingCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ExchangeGachaCeilingCsReq)) { + return false; + } + ExchangeGachaCeilingCsReq other = (ExchangeGachaCeilingCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasGachaType() || gachaType == other.gachaType) + && (!hasAvatarId() || avatarId == other.avatarId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(avatarId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ExchangeGachaCeilingCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 80: { + // gachaType + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // avatarId + avatarId = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.gachaType, gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.avatarId, avatarId); + } + output.endObject(); + } + + @Override + public ExchangeGachaCeilingCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 802848732: + case -871474217: { + if (input.isAtField(FieldNames.gachaType)) { + if (!input.trySkipNullValue()) { + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1787287636: + case -428636735: { + if (input.isAtField(FieldNames.avatarId)) { + if (!input.trySkipNullValue()) { + avatarId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ExchangeGachaCeilingCsReq clone() { + return new ExchangeGachaCeilingCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ExchangeGachaCeilingCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingCsReq(), data).checkInitialized(); + } + + public static ExchangeGachaCeilingCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingCsReq(), input).checkInitialized(); + } + + public static ExchangeGachaCeilingCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating ExchangeGachaCeilingCsReq messages + */ + public static MessageFactory getFactory() { + return ExchangeGachaCeilingCsReqFactory.INSTANCE; + } + + private enum ExchangeGachaCeilingCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public ExchangeGachaCeilingCsReq create() { + return ExchangeGachaCeilingCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName gachaType = FieldName.forField("gachaType", "gacha_type"); + + static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingScRspOuterClass.java new file mode 100644 index 0000000..74d7d58 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ExchangeGachaCeilingScRspOuterClass.java @@ -0,0 +1,626 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class ExchangeGachaCeilingScRspOuterClass { + /** + * Protobuf type {@code ExchangeGachaCeilingScRsp} + */ + public static final class ExchangeGachaCeilingScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 avatar_id = 5; + */ + private int avatarId; + + /** + * optional uint32 retcode = 9; + */ + private int retcode; + + /** + * optional uint32 gacha_type = 12; + */ + private int gachaType; + + /** + * optional .ItemList transfer_item_list = 2; + */ + private final ItemListOuterClass.ItemList transferItemList = ItemListOuterClass.ItemList.newInstance(); + + /** + * optional .GachaCeiling gacha_ceiling = 7; + */ + private final GachaCeilingOuterClass.GachaCeiling gachaCeiling = GachaCeilingOuterClass.GachaCeiling.newInstance(); + + private ExchangeGachaCeilingScRsp() { + } + + /** + * @return a new empty instance of {@code ExchangeGachaCeilingScRsp} + */ + public static ExchangeGachaCeilingScRsp newInstance() { + return new ExchangeGachaCeilingScRsp(); + } + + /** + * optional uint32 avatar_id = 5; + * @return whether the avatarId field is set + */ + public boolean hasAvatarId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 avatar_id = 5; + * @return this + */ + public ExchangeGachaCeilingScRsp clearAvatarId() { + bitField0_ &= ~0x00000001; + avatarId = 0; + return this; + } + + /** + * optional uint32 avatar_id = 5; + * @return the avatarId + */ + public int getAvatarId() { + return avatarId; + } + + /** + * optional uint32 avatar_id = 5; + * @param value the avatarId to set + * @return this + */ + public ExchangeGachaCeilingScRsp setAvatarId(final int value) { + bitField0_ |= 0x00000001; + avatarId = value; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 9; + * @return this + */ + public ExchangeGachaCeilingScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 9; + * @param value the retcode to set + * @return this + */ + public ExchangeGachaCeilingScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * optional uint32 gacha_type = 12; + * @return whether the gachaType field is set + */ + public boolean hasGachaType() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 gacha_type = 12; + * @return this + */ + public ExchangeGachaCeilingScRsp clearGachaType() { + bitField0_ &= ~0x00000004; + gachaType = 0; + return this; + } + + /** + * optional uint32 gacha_type = 12; + * @return the gachaType + */ + public int getGachaType() { + return gachaType; + } + + /** + * optional uint32 gacha_type = 12; + * @param value the gachaType to set + * @return this + */ + public ExchangeGachaCeilingScRsp setGachaType(final int value) { + bitField0_ |= 0x00000004; + gachaType = value; + return this; + } + + /** + * optional .ItemList transfer_item_list = 2; + * @return whether the transferItemList field is set + */ + public boolean hasTransferItemList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional .ItemList transfer_item_list = 2; + * @return this + */ + public ExchangeGachaCeilingScRsp clearTransferItemList() { + bitField0_ &= ~0x00000008; + transferItemList.clear(); + return this; + } + + /** + * optional .ItemList transfer_item_list = 2; + * + * 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 #getMutableTransferItemList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public ItemListOuterClass.ItemList getTransferItemList() { + return transferItemList; + } + + /** + * optional .ItemList transfer_item_list = 2; + * + * 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 ItemListOuterClass.ItemList getMutableTransferItemList() { + bitField0_ |= 0x00000008; + return transferItemList; + } + + /** + * optional .ItemList transfer_item_list = 2; + * @param value the transferItemList to set + * @return this + */ + public ExchangeGachaCeilingScRsp setTransferItemList(final ItemListOuterClass.ItemList value) { + bitField0_ |= 0x00000008; + transferItemList.copyFrom(value); + return this; + } + + /** + * optional .GachaCeiling gacha_ceiling = 7; + * @return whether the gachaCeiling field is set + */ + public boolean hasGachaCeiling() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional .GachaCeiling gacha_ceiling = 7; + * @return this + */ + public ExchangeGachaCeilingScRsp clearGachaCeiling() { + bitField0_ &= ~0x00000010; + gachaCeiling.clear(); + return this; + } + + /** + * optional .GachaCeiling gacha_ceiling = 7; + * + * 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 #getMutableGachaCeiling()} if you want to modify it. + * + * @return internal storage object for reading + */ + public GachaCeilingOuterClass.GachaCeiling getGachaCeiling() { + return gachaCeiling; + } + + /** + * optional .GachaCeiling gacha_ceiling = 7; + * + * 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 GachaCeilingOuterClass.GachaCeiling getMutableGachaCeiling() { + bitField0_ |= 0x00000010; + return gachaCeiling; + } + + /** + * optional .GachaCeiling gacha_ceiling = 7; + * @param value the gachaCeiling to set + * @return this + */ + public ExchangeGachaCeilingScRsp setGachaCeiling( + final GachaCeilingOuterClass.GachaCeiling value) { + bitField0_ |= 0x00000010; + gachaCeiling.copyFrom(value); + return this; + } + + @Override + public ExchangeGachaCeilingScRsp copyFrom(final ExchangeGachaCeilingScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + avatarId = other.avatarId; + retcode = other.retcode; + gachaType = other.gachaType; + transferItemList.copyFrom(other.transferItemList); + gachaCeiling.copyFrom(other.gachaCeiling); + } + return this; + } + + @Override + public ExchangeGachaCeilingScRsp mergeFrom(final ExchangeGachaCeilingScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasAvatarId()) { + setAvatarId(other.avatarId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasGachaType()) { + setGachaType(other.gachaType); + } + if (other.hasTransferItemList()) { + getMutableTransferItemList().mergeFrom(other.transferItemList); + } + if (other.hasGachaCeiling()) { + getMutableGachaCeiling().mergeFrom(other.gachaCeiling); + } + return this; + } + + @Override + public ExchangeGachaCeilingScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + avatarId = 0; + retcode = 0; + gachaType = 0; + transferItemList.clear(); + gachaCeiling.clear(); + return this; + } + + @Override + public ExchangeGachaCeilingScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + transferItemList.clearQuick(); + gachaCeiling.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ExchangeGachaCeilingScRsp)) { + return false; + } + ExchangeGachaCeilingScRsp other = (ExchangeGachaCeilingScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasAvatarId() || avatarId == other.avatarId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasGachaType() || gachaType == other.gachaType) + && (!hasTransferItemList() || transferItemList.equals(other.transferItemList)) + && (!hasGachaCeiling() || gachaCeiling.equals(other.gachaCeiling)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(gachaType); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(transferItemList); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 58); + output.writeMessageNoTag(gachaCeiling); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaType); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(transferItemList); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(gachaCeiling); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ExchangeGachaCeilingScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // avatarId + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // gachaType + gachaType = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // transferItemList + input.readMessage(transferItemList); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 58) { + break; + } + } + case 58: { + // gachaCeiling + input.readMessage(gachaCeiling); + bitField0_ |= 0x00000010; + 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.avatarId, avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.gachaType, gachaType); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeMessage(FieldNames.transferItemList, transferItemList); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeMessage(FieldNames.gachaCeiling, gachaCeiling); + } + output.endObject(); + } + + @Override + public ExchangeGachaCeilingScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1787287636: + case -428636735: { + if (input.isAtField(FieldNames.avatarId)) { + if (!input.trySkipNullValue()) { + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 802848732: + case -871474217: { + if (input.isAtField(FieldNames.gachaType)) { + if (!input.trySkipNullValue()) { + gachaType = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -997597348: + case 263056118: { + if (input.isAtField(FieldNames.transferItemList)) { + if (!input.trySkipNullValue()) { + input.readMessage(transferItemList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 507275483: + case -1792489728: { + if (input.isAtField(FieldNames.gachaCeiling)) { + if (!input.trySkipNullValue()) { + input.readMessage(gachaCeiling); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ExchangeGachaCeilingScRsp clone() { + return new ExchangeGachaCeilingScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ExchangeGachaCeilingScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingScRsp(), data).checkInitialized(); + } + + public static ExchangeGachaCeilingScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingScRsp(), input).checkInitialized(); + } + + public static ExchangeGachaCeilingScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ExchangeGachaCeilingScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating ExchangeGachaCeilingScRsp messages + */ + public static MessageFactory getFactory() { + return ExchangeGachaCeilingScRspFactory.INSTANCE; + } + + private enum ExchangeGachaCeilingScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public ExchangeGachaCeilingScRsp create() { + return ExchangeGachaCeilingScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName gachaType = FieldName.forField("gachaType", "gacha_type"); + + static final FieldName transferItemList = FieldName.forField("transferItemList", "transfer_item_list"); + + static final FieldName gachaCeiling = FieldName.forField("gachaCeiling", "gacha_ceiling"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/FriendRecommendInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/FriendRecommendInfoOuterClass.java new file mode 100644 index 0000000..4afec1c --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/FriendRecommendInfoOuterClass.java @@ -0,0 +1,281 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class FriendRecommendInfoOuterClass { + /** + * Protobuf type {@code FriendRecommendInfo} + */ + public static final class FriendRecommendInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .SimpleInfo simple_info = 11; + */ + private final SimpleInfoOuterClass.SimpleInfo simpleInfo = SimpleInfoOuterClass.SimpleInfo.newInstance(); + + private FriendRecommendInfo() { + } + + /** + * @return a new empty instance of {@code FriendRecommendInfo} + */ + public static FriendRecommendInfo newInstance() { + return new FriendRecommendInfo(); + } + + /** + * optional .SimpleInfo simple_info = 11; + * @return whether the simpleInfo field is set + */ + public boolean hasSimpleInfo() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .SimpleInfo simple_info = 11; + * @return this + */ + public FriendRecommendInfo clearSimpleInfo() { + bitField0_ &= ~0x00000001; + simpleInfo.clear(); + return this; + } + + /** + * optional .SimpleInfo simple_info = 11; + * + * 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 #getMutableSimpleInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public SimpleInfoOuterClass.SimpleInfo getSimpleInfo() { + return simpleInfo; + } + + /** + * optional .SimpleInfo simple_info = 11; + * + * 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 SimpleInfoOuterClass.SimpleInfo getMutableSimpleInfo() { + bitField0_ |= 0x00000001; + return simpleInfo; + } + + /** + * optional .SimpleInfo simple_info = 11; + * @param value the simpleInfo to set + * @return this + */ + public FriendRecommendInfo setSimpleInfo(final SimpleInfoOuterClass.SimpleInfo value) { + bitField0_ |= 0x00000001; + simpleInfo.copyFrom(value); + return this; + } + + @Override + public FriendRecommendInfo copyFrom(final FriendRecommendInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + simpleInfo.copyFrom(other.simpleInfo); + } + return this; + } + + @Override + public FriendRecommendInfo mergeFrom(final FriendRecommendInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasSimpleInfo()) { + getMutableSimpleInfo().mergeFrom(other.simpleInfo); + } + return this; + } + + @Override + public FriendRecommendInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + simpleInfo.clear(); + return this; + } + + @Override + public FriendRecommendInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + simpleInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof FriendRecommendInfo)) { + return false; + } + FriendRecommendInfo other = (FriendRecommendInfo) o; + return bitField0_ == other.bitField0_ + && (!hasSimpleInfo() || simpleInfo.equals(other.simpleInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 90); + output.writeMessageNoTag(simpleInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(simpleInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public FriendRecommendInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 90: { + // simpleInfo + input.readMessage(simpleInfo); + bitField0_ |= 0x00000001; + 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.writeMessage(FieldNames.simpleInfo, simpleInfo); + } + output.endObject(); + } + + @Override + public FriendRecommendInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1431903872: + case -1419171045: { + if (input.isAtField(FieldNames.simpleInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(simpleInfo); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public FriendRecommendInfo clone() { + return new FriendRecommendInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static FriendRecommendInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new FriendRecommendInfo(), data).checkInitialized(); + } + + public static FriendRecommendInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new FriendRecommendInfo(), input).checkInitialized(); + } + + public static FriendRecommendInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new FriendRecommendInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating FriendRecommendInfo messages + */ + public static MessageFactory getFactory() { + return FriendRecommendInfoFactory.INSTANCE; + } + + private enum FriendRecommendInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public FriendRecommendInfo create() { + return FriendRecommendInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName simpleInfo = FieldName.forField("simpleInfo", "simple_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GachaCeilingOuterClass.java b/src/generated/main/emu/lunarcore/proto/GachaCeilingOuterClass.java index 42c6298..59930b6 100644 --- a/src/generated/main/emu/lunarcore/proto/GachaCeilingOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/GachaCeilingOuterClass.java @@ -19,6 +19,16 @@ public final class GachaCeilingOuterClass { public static final class GachaCeiling extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; + /** + * optional uint32 ceiling_num = 14; + */ + private int ceilingNum; + + /** + * optional bool is_claimed = 9; + */ + private boolean isClaimed; + /** * repeated .GachaCeilingAvatar avatar_list = 15; */ @@ -34,12 +44,86 @@ public final class GachaCeilingOuterClass { return new GachaCeiling(); } + /** + * optional uint32 ceiling_num = 14; + * @return whether the ceilingNum field is set + */ + public boolean hasCeilingNum() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 ceiling_num = 14; + * @return this + */ + public GachaCeiling clearCeilingNum() { + bitField0_ &= ~0x00000001; + ceilingNum = 0; + return this; + } + + /** + * optional uint32 ceiling_num = 14; + * @return the ceilingNum + */ + public int getCeilingNum() { + return ceilingNum; + } + + /** + * optional uint32 ceiling_num = 14; + * @param value the ceilingNum to set + * @return this + */ + public GachaCeiling setCeilingNum(final int value) { + bitField0_ |= 0x00000001; + ceilingNum = value; + return this; + } + + /** + * optional bool is_claimed = 9; + * @return whether the isClaimed field is set + */ + public boolean hasIsClaimed() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional bool is_claimed = 9; + * @return this + */ + public GachaCeiling clearIsClaimed() { + bitField0_ &= ~0x00000002; + isClaimed = false; + return this; + } + + /** + * optional bool is_claimed = 9; + * @return the isClaimed + */ + public boolean getIsClaimed() { + return isClaimed; + } + + /** + * optional bool is_claimed = 9; + * @param value the isClaimed to set + * @return this + */ + public GachaCeiling setIsClaimed(final boolean value) { + bitField0_ |= 0x00000002; + isClaimed = value; + return this; + } + /** * repeated .GachaCeilingAvatar avatar_list = 15; * @return whether the avatarList field is set */ public boolean hasAvatarList() { - return (bitField0_ & 0x00000001) != 0; + return (bitField0_ & 0x00000004) != 0; } /** @@ -47,7 +131,7 @@ public final class GachaCeilingOuterClass { * @return this */ public GachaCeiling clearAvatarList() { - bitField0_ &= ~0x00000001; + bitField0_ &= ~0x00000004; avatarList.clear(); return this; } @@ -76,7 +160,7 @@ public final class GachaCeilingOuterClass { * @return internal storage object for modifications */ public RepeatedMessage getMutableAvatarList() { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; return avatarList; } @@ -86,7 +170,7 @@ public final class GachaCeilingOuterClass { * @return this */ public GachaCeiling addAvatarList(final GachaCeilingAvatarOuterClass.GachaCeilingAvatar value) { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; avatarList.add(value); return this; } @@ -98,7 +182,7 @@ public final class GachaCeilingOuterClass { */ public GachaCeiling addAllAvatarList( final GachaCeilingAvatarOuterClass.GachaCeilingAvatar... values) { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; avatarList.addAll(values); return this; } @@ -108,6 +192,8 @@ public final class GachaCeilingOuterClass { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; + ceilingNum = other.ceilingNum; + isClaimed = other.isClaimed; avatarList.copyFrom(other.avatarList); } return this; @@ -119,6 +205,12 @@ public final class GachaCeilingOuterClass { return this; } cachedSize = -1; + if (other.hasCeilingNum()) { + setCeilingNum(other.ceilingNum); + } + if (other.hasIsClaimed()) { + setIsClaimed(other.isClaimed); + } if (other.hasAvatarList()) { getMutableAvatarList().addAll(other.avatarList); } @@ -132,6 +224,8 @@ public final class GachaCeilingOuterClass { } cachedSize = -1; bitField0_ = 0; + ceilingNum = 0; + isClaimed = false; avatarList.clear(); return this; } @@ -157,12 +251,22 @@ public final class GachaCeilingOuterClass { } GachaCeiling other = (GachaCeiling) o; return bitField0_ == other.bitField0_ + && (!hasCeilingNum() || ceilingNum == other.ceilingNum) + && (!hasIsClaimed() || isClaimed == other.isClaimed) && (!hasAvatarList() || avatarList.equals(other.avatarList)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(ceilingNum); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeBoolNoTag(isClaimed); + } + if ((bitField0_ & 0x00000004) != 0) { for (int i = 0; i < avatarList.length(); i++) { output.writeRawByte((byte) 122); output.writeMessageNoTag(avatarList.get(i)); @@ -174,6 +278,12 @@ public final class GachaCeilingOuterClass { protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(ceilingNum); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000004) != 0) { size += (1 * avatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(avatarList); } return size; @@ -186,10 +296,28 @@ public final class GachaCeilingOuterClass { int tag = input.readTag(); while (true) { switch (tag) { + case 112: { + // ceilingNum + ceilingNum = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // isClaimed + isClaimed = input.readBool(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 122) { + break; + } + } case 122: { // avatarList tag = input.readRepeatedMessage(avatarList, tag); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; if (tag != 0) { break; } @@ -212,6 +340,12 @@ public final class GachaCeilingOuterClass { public void writeTo(final JsonSink output) throws IOException { output.beginObject(); if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.ceilingNum, ceilingNum); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeBool(FieldNames.isClaimed, isClaimed); + } + if ((bitField0_ & 0x00000004) != 0) { output.writeRepeatedMessage(FieldNames.avatarList, avatarList); } output.endObject(); @@ -224,12 +358,36 @@ public final class GachaCeilingOuterClass { } while (!input.isAtEnd()) { switch (input.readFieldHash()) { + case -1655838327: + case 209119492: { + if (input.isAtField(FieldNames.ceilingNum)) { + if (!input.trySkipNullValue()) { + ceilingNum = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 273538385: + case -1941340218: { + if (input.isAtField(FieldNames.isClaimed)) { + if (!input.trySkipNullValue()) { + isClaimed = input.readBool(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } case -403402345: case 397055940: { if (input.isAtField(FieldNames.avatarList)) { if (!input.trySkipNullValue()) { input.readRepeatedMessage(avatarList); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } else { input.skipUnknownField(); @@ -288,6 +446,10 @@ public final class GachaCeilingOuterClass { * Contains name constants used for serializing JSON */ static class FieldNames { + static final FieldName ceilingNum = FieldName.forField("ceilingNum", "ceiling_num"); + + static final FieldName isClaimed = FieldName.forField("isClaimed", "is_claimed"); + static final FieldName avatarList = FieldName.forField("avatarList", "avatar_list"); } } diff --git a/src/generated/main/emu/lunarcore/proto/GateserverOuterClass.java b/src/generated/main/emu/lunarcore/proto/GateserverOuterClass.java index 827addc..014bf75 100644 --- a/src/generated/main/emu/lunarcore/proto/GateserverOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/GateserverOuterClass.java @@ -91,7 +91,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -107,6 +107,11 @@ public final class GateserverOuterClass { */ private final Utf8String ifixVersion = Utf8String.newEmptyInstance(); + /** + * optional string msg = 1550; + */ + private final Utf8String msg = Utf8String.newEmptyInstance(); + private Gateserver() { } @@ -833,7 +838,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -845,7 +850,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -859,7 +864,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -871,7 +876,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -883,7 +888,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -896,7 +901,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -911,7 +916,7 @@ public final class GateserverOuterClass { /** *
-     *  lua version
+     *  lua versionf
      * 
* * optional string mdk_res_version = 1213; @@ -1017,6 +1022,71 @@ public final class GateserverOuterClass { return this; } + /** + * optional string msg = 1550; + * @return whether the msg field is set + */ + public boolean hasMsg() { + return (bitField0_ & 0x00010000) != 0; + } + + /** + * optional string msg = 1550; + * @return this + */ + public Gateserver clearMsg() { + bitField0_ &= ~0x00010000; + msg.clear(); + return this; + } + + /** + * optional string msg = 1550; + * @return the msg + */ + public String getMsg() { + return msg.getString(); + } + + /** + * optional string msg = 1550; + * @return internal {@code Utf8String} representation of msg for reading + */ + public Utf8String getMsgBytes() { + return this.msg; + } + + /** + * optional string msg = 1550; + * @return internal {@code Utf8String} representation of msg for modifications + */ + public Utf8String getMutableMsgBytes() { + bitField0_ |= 0x00010000; + return this.msg; + } + + /** + * optional string msg = 1550; + * @param value the msg to set + * @return this + */ + public Gateserver setMsg(final CharSequence value) { + bitField0_ |= 0x00010000; + msg.copyFrom(value); + return this; + } + + /** + * optional string msg = 1550; + * @param value the msg to set + * @return this + */ + public Gateserver setMsg(final Utf8String value) { + bitField0_ |= 0x00010000; + msg.copyFrom(value); + return this; + } + @Override public Gateserver copyFrom(final Gateserver other) { cachedSize = other.cachedSize; @@ -1038,6 +1108,7 @@ public final class GateserverOuterClass { clientSecretKey.copyFrom(other.clientSecretKey); mdkResVersion.copyFrom(other.mdkResVersion); ifixVersion.copyFrom(other.ifixVersion); + msg.copyFrom(other.msg); } return this; } @@ -1096,6 +1167,9 @@ public final class GateserverOuterClass { if (other.hasIfixVersion()) { getMutableIfixVersionBytes().copyFrom(other.ifixVersion); } + if (other.hasMsg()) { + getMutableMsgBytes().copyFrom(other.msg); + } return this; } @@ -1122,6 +1196,7 @@ public final class GateserverOuterClass { clientSecretKey.clear(); mdkResVersion.clear(); ifixVersion.clear(); + msg.clear(); return this; } @@ -1141,6 +1216,7 @@ public final class GateserverOuterClass { clientSecretKey.clear(); mdkResVersion.clear(); ifixVersion.clear(); + msg.clear(); return this; } @@ -1169,7 +1245,8 @@ public final class GateserverOuterClass { && (!hasIfixUrl() || ifixUrl.equals(other.ifixUrl)) && (!hasClientSecretKey() || clientSecretKey.equals(other.clientSecretKey)) && (!hasMdkResVersion() || mdkResVersion.equals(other.mdkResVersion)) - && (!hasIfixVersion() || ifixVersion.equals(other.ifixVersion)); + && (!hasIfixVersion() || ifixVersion.equals(other.ifixVersion)) + && (!hasMsg() || msg.equals(other.msg)); } @Override @@ -1238,6 +1315,10 @@ public final class GateserverOuterClass { output.writeRawLittleEndian16((short) 20386); output.writeStringNoTag(ifixVersion); } + if ((bitField0_ & 0x00010000) != 0) { + output.writeRawLittleEndian16((short) 24818); + output.writeStringNoTag(msg); + } } @Override @@ -1291,6 +1372,9 @@ public final class GateserverOuterClass { if ((bitField0_ & 0x00008000) != 0) { size += 2 + ProtoSink.computeStringSizeNoTag(ifixVersion); } + if ((bitField0_ & 0x00010000) != 0) { + size += 2 + ProtoSink.computeStringSizeNoTag(msg); + } return size; } @@ -1441,6 +1525,15 @@ public final class GateserverOuterClass { input.readString(ifixVersion); bitField0_ |= 0x00008000; tag = input.readTag(); + if (tag != 12402) { + break; + } + } + case 12402: { + // msg + input.readString(msg); + bitField0_ |= 0x00010000; + tag = input.readTag(); if (tag != 0) { break; } @@ -1510,6 +1603,9 @@ public final class GateserverOuterClass { if ((bitField0_ & 0x00008000) != 0) { output.writeString(FieldNames.ifixVersion, ifixVersion); } + if ((bitField0_ & 0x00010000) != 0) { + output.writeString(FieldNames.msg, msg); + } output.endObject(); } @@ -1704,6 +1800,17 @@ public final class GateserverOuterClass { } break; } + case 108417: { + if (input.isAtField(FieldNames.msg)) { + if (!input.trySkipNullValue()) { + input.readString(msg); + bitField0_ |= 0x00010000; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -1787,6 +1894,8 @@ public final class GateserverOuterClass { static final FieldName mdkResVersion = FieldName.forField("mdkResVersion", "mdk_res_version"); static final FieldName ifixVersion = FieldName.forField("ifixVersion", "ifix_version"); + + static final FieldName msg = FieldName.forField("msg"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java new file mode 100644 index 0000000..ea51047 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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; + +public final class GetDailyActiveInfoCsReqOuterClass { + /** + * Protobuf type {@code GetDailyActiveInfoCsReq} + */ + public static final class GetDailyActiveInfoCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetDailyActiveInfoCsReq() { + } + + /** + * @return a new empty instance of {@code GetDailyActiveInfoCsReq} + */ + public static GetDailyActiveInfoCsReq newInstance() { + return new GetDailyActiveInfoCsReq(); + } + + @Override + public GetDailyActiveInfoCsReq copyFrom(final GetDailyActiveInfoCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetDailyActiveInfoCsReq mergeFrom(final GetDailyActiveInfoCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetDailyActiveInfoCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetDailyActiveInfoCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetDailyActiveInfoCsReq)) { + return false; + } + GetDailyActiveInfoCsReq other = (GetDailyActiveInfoCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetDailyActiveInfoCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetDailyActiveInfoCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetDailyActiveInfoCsReq clone() { + return new GetDailyActiveInfoCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetDailyActiveInfoCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), data).checkInitialized(); + } + + public static GetDailyActiveInfoCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), input).checkInitialized(); + } + + public static GetDailyActiveInfoCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetDailyActiveInfoCsReq messages + */ + public static MessageFactory getFactory() { + return GetDailyActiveInfoCsReqFactory.INSTANCE; + } + + private enum GetDailyActiveInfoCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetDailyActiveInfoCsReq create() { + return GetDailyActiveInfoCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java new file mode 100644 index 0000000..c9e713b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java @@ -0,0 +1,581 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; +import us.hebi.quickbuf.RepeatedMessage; + +public final class GetDailyActiveInfoScRspOuterClass { + /** + * Protobuf type {@code GetDailyActiveInfoScRsp} + */ + public static final class GetDailyActiveInfoScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 daily_active_point = 2; + */ + private int dailyActivePoint; + + /** + * optional uint32 retcode = 15; + */ + private int retcode; + + /** + * repeated uint32 daily_active_quest_id_list = 3; + */ + private final RepeatedInt dailyActiveQuestIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + */ + private final RepeatedMessage dailyActiveLevelList = RepeatedMessage.newEmptyInstance(DailyActivityInfoOuterClass.DailyActivityInfo.getFactory()); + + private GetDailyActiveInfoScRsp() { + } + + /** + * @return a new empty instance of {@code GetDailyActiveInfoScRsp} + */ + public static GetDailyActiveInfoScRsp newInstance() { + return new GetDailyActiveInfoScRsp(); + } + + /** + * optional uint32 daily_active_point = 2; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 daily_active_point = 2; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActivePoint() { + bitField0_ &= ~0x00000001; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 2; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 2; + * @param value the dailyActivePoint to set + * @return this + */ + public GetDailyActiveInfoScRsp setDailyActivePoint(final int value) { + bitField0_ |= 0x00000001; + dailyActivePoint = value; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 15; + * @return this + */ + public GetDailyActiveInfoScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 15; + * @param value the retcode to set + * @return this + */ + public GetDailyActiveInfoScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @return whether the dailyActiveQuestIdList field is set + */ + public boolean hasDailyActiveQuestIdList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActiveQuestIdList() { + bitField0_ &= ~0x00000004; + dailyActiveQuestIdList.clear(); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * + * 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 #getMutableDailyActiveQuestIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getDailyActiveQuestIdList() { + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * + * 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 getMutableDailyActiveQuestIdList() { + bitField0_ |= 0x00000004; + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @param value the dailyActiveQuestIdList to add + * @return this + */ + public GetDailyActiveInfoScRsp addDailyActiveQuestIdList(final int value) { + bitField0_ |= 0x00000004; + dailyActiveQuestIdList.add(value); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @param values the dailyActiveQuestIdList to add + * @return this + */ + public GetDailyActiveInfoScRsp addAllDailyActiveQuestIdList(final int... values) { + bitField0_ |= 0x00000004; + dailyActiveQuestIdList.addAll(values); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @return whether the dailyActiveLevelList field is set + */ + public boolean hasDailyActiveLevelList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActiveLevelList() { + bitField0_ &= ~0x00000008; + dailyActiveLevelList.clear(); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * + * 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 #getMutableDailyActiveLevelList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDailyActiveLevelList( + ) { + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * + * 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 getMutableDailyActiveLevelList( + ) { + bitField0_ |= 0x00000008; + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @param value the dailyActiveLevelList to add + * @return this + */ + public GetDailyActiveInfoScRsp addDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo value) { + bitField0_ |= 0x00000008; + dailyActiveLevelList.add(value); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @param values the dailyActiveLevelList to add + * @return this + */ + public GetDailyActiveInfoScRsp addAllDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo... values) { + bitField0_ |= 0x00000008; + dailyActiveLevelList.addAll(values); + return this; + } + + @Override + public GetDailyActiveInfoScRsp copyFrom(final GetDailyActiveInfoScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + dailyActivePoint = other.dailyActivePoint; + retcode = other.retcode; + dailyActiveQuestIdList.copyFrom(other.dailyActiveQuestIdList); + dailyActiveLevelList.copyFrom(other.dailyActiveLevelList); + } + return this; + } + + @Override + public GetDailyActiveInfoScRsp mergeFrom(final GetDailyActiveInfoScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasDailyActiveQuestIdList()) { + getMutableDailyActiveQuestIdList().addAll(other.dailyActiveQuestIdList); + } + if (other.hasDailyActiveLevelList()) { + getMutableDailyActiveLevelList().addAll(other.dailyActiveLevelList); + } + return this; + } + + @Override + public GetDailyActiveInfoScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActivePoint = 0; + retcode = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clear(); + return this; + } + + @Override + public GetDailyActiveInfoScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetDailyActiveInfoScRsp)) { + return false; + } + GetDailyActiveInfoScRsp other = (GetDailyActiveInfoScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasRetcode() || retcode == other.retcode) + && (!hasDailyActiveQuestIdList() || dailyActiveQuestIdList.equals(other.dailyActiveQuestIdList)) + && (!hasDailyActiveLevelList() || dailyActiveLevelList.equals(other.dailyActiveLevelList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < dailyActiveQuestIdList.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(dailyActiveQuestIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < dailyActiveLevelList.length(); i++) { + output.writeRawByte((byte) 82); + output.writeMessageNoTag(dailyActiveLevelList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * dailyActiveQuestIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * dailyActiveLevelList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dailyActiveLevelList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetDailyActiveInfoScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // dailyActiveQuestIdList [packed=true] + input.readPackedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // dailyActiveLevelList + tag = input.readRepeatedMessage(dailyActiveLevelList, tag); + bitField0_ |= 0x00000008; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // dailyActiveQuestIdList [packed=false] + tag = input.readRepeatedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000004; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedUInt32(FieldNames.dailyActiveQuestIdList, dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedMessage(FieldNames.dailyActiveLevelList, dailyActiveLevelList); + } + output.endObject(); + } + + @Override + public GetDailyActiveInfoScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1903124444: + case -752691246: { + if (input.isAtField(FieldNames.dailyActiveQuestIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(dailyActiveQuestIdList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 705251971: + case 1821477548: { + if (input.isAtField(FieldNames.dailyActiveLevelList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(dailyActiveLevelList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetDailyActiveInfoScRsp clone() { + return new GetDailyActiveInfoScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetDailyActiveInfoScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), data).checkInitialized(); + } + + public static GetDailyActiveInfoScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), input).checkInitialized(); + } + + public static GetDailyActiveInfoScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetDailyActiveInfoScRsp messages + */ + public static MessageFactory getFactory() { + return GetDailyActiveInfoScRspFactory.INSTANCE; + } + + private enum GetDailyActiveInfoScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetDailyActiveInfoScRsp create() { + return GetDailyActiveInfoScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName dailyActiveQuestIdList = FieldName.forField("dailyActiveQuestIdList", "daily_active_quest_id_list"); + + static final FieldName dailyActiveLevelList = FieldName.forField("dailyActiveLevelList", "daily_active_level_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetFriendRecommendListInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetFriendRecommendListInfoScRspOuterClass.java new file mode 100644 index 0000000..51a27de --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetFriendRecommendListInfoScRspOuterClass.java @@ -0,0 +1,380 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; + +public final class GetFriendRecommendListInfoScRspOuterClass { + /** + * Protobuf type {@code GetFriendRecommendListInfoScRsp} + */ + public static final class GetFriendRecommendListInfoScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 12; + */ + private int retcode; + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + */ + private final RepeatedMessage friendRecommendList = RepeatedMessage.newEmptyInstance(FriendRecommendInfoOuterClass.FriendRecommendInfo.getFactory()); + + private GetFriendRecommendListInfoScRsp() { + } + + /** + * @return a new empty instance of {@code GetFriendRecommendListInfoScRsp} + */ + public static GetFriendRecommendListInfoScRsp newInstance() { + return new GetFriendRecommendListInfoScRsp(); + } + + /** + * optional uint32 retcode = 12; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 12; + * @return this + */ + public GetFriendRecommendListInfoScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 12; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 12; + * @param value the retcode to set + * @return this + */ + public GetFriendRecommendListInfoScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * @return whether the friendRecommendList field is set + */ + public boolean hasFriendRecommendList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * @return this + */ + public GetFriendRecommendListInfoScRsp clearFriendRecommendList() { + bitField0_ &= ~0x00000002; + friendRecommendList.clear(); + return this; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * + * 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 #getMutableFriendRecommendList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getFriendRecommendList( + ) { + return friendRecommendList; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * + * 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 getMutableFriendRecommendList( + ) { + bitField0_ |= 0x00000002; + return friendRecommendList; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * @param value the friendRecommendList to add + * @return this + */ + public GetFriendRecommendListInfoScRsp addFriendRecommendList( + final FriendRecommendInfoOuterClass.FriendRecommendInfo value) { + bitField0_ |= 0x00000002; + friendRecommendList.add(value); + return this; + } + + /** + * repeated .FriendRecommendInfo friend_recommend_list = 5; + * @param values the friendRecommendList to add + * @return this + */ + public GetFriendRecommendListInfoScRsp addAllFriendRecommendList( + final FriendRecommendInfoOuterClass.FriendRecommendInfo... values) { + bitField0_ |= 0x00000002; + friendRecommendList.addAll(values); + return this; + } + + @Override + public GetFriendRecommendListInfoScRsp copyFrom(final GetFriendRecommendListInfoScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + friendRecommendList.copyFrom(other.friendRecommendList); + } + return this; + } + + @Override + public GetFriendRecommendListInfoScRsp mergeFrom(final GetFriendRecommendListInfoScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasFriendRecommendList()) { + getMutableFriendRecommendList().addAll(other.friendRecommendList); + } + return this; + } + + @Override + public GetFriendRecommendListInfoScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + friendRecommendList.clear(); + return this; + } + + @Override + public GetFriendRecommendListInfoScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + friendRecommendList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetFriendRecommendListInfoScRsp)) { + return false; + } + GetFriendRecommendListInfoScRsp other = (GetFriendRecommendListInfoScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasFriendRecommendList() || friendRecommendList.equals(other.friendRecommendList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < friendRecommendList.length(); i++) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(friendRecommendList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * friendRecommendList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(friendRecommendList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetFriendRecommendListInfoScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // friendRecommendList + tag = input.readRepeatedMessage(friendRecommendList, tag); + bitField0_ |= 0x00000002; + 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.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.friendRecommendList, friendRecommendList); + } + output.endObject(); + } + + @Override + public GetFriendRecommendListInfoScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1367821692: + case -194477566: { + if (input.isAtField(FieldNames.friendRecommendList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(friendRecommendList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetFriendRecommendListInfoScRsp clone() { + return new GetFriendRecommendListInfoScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetFriendRecommendListInfoScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetFriendRecommendListInfoScRsp(), data).checkInitialized(); + } + + public static GetFriendRecommendListInfoScRsp parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetFriendRecommendListInfoScRsp(), input).checkInitialized(); + } + + public static GetFriendRecommendListInfoScRsp parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetFriendRecommendListInfoScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetFriendRecommendListInfoScRsp messages + */ + public static MessageFactory getFactory() { + return GetFriendRecommendListInfoScRspFactory.INSTANCE; + } + + private enum GetFriendRecommendListInfoScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetFriendRecommendListInfoScRsp create() { + return GetFriendRecommendListInfoScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName friendRecommendList = FieldName.forField("friendRecommendList", "friend_recommend_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetGachaCeilingCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetGachaCeilingCsReqOuterClass.java new file mode 100644 index 0000000..c9ae508 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetGachaCeilingCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class GetGachaCeilingCsReqOuterClass { + /** + * Protobuf type {@code GetGachaCeilingCsReq} + */ + public static final class GetGachaCeilingCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 gacha_type = 4; + */ + private int gachaType; + + private GetGachaCeilingCsReq() { + } + + /** + * @return a new empty instance of {@code GetGachaCeilingCsReq} + */ + public static GetGachaCeilingCsReq newInstance() { + return new GetGachaCeilingCsReq(); + } + + /** + * optional uint32 gacha_type = 4; + * @return whether the gachaType field is set + */ + public boolean hasGachaType() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 gacha_type = 4; + * @return this + */ + public GetGachaCeilingCsReq clearGachaType() { + bitField0_ &= ~0x00000001; + gachaType = 0; + return this; + } + + /** + * optional uint32 gacha_type = 4; + * @return the gachaType + */ + public int getGachaType() { + return gachaType; + } + + /** + * optional uint32 gacha_type = 4; + * @param value the gachaType to set + * @return this + */ + public GetGachaCeilingCsReq setGachaType(final int value) { + bitField0_ |= 0x00000001; + gachaType = value; + return this; + } + + @Override + public GetGachaCeilingCsReq copyFrom(final GetGachaCeilingCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + gachaType = other.gachaType; + } + return this; + } + + @Override + public GetGachaCeilingCsReq mergeFrom(final GetGachaCeilingCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGachaType()) { + setGachaType(other.gachaType); + } + return this; + } + + @Override + public GetGachaCeilingCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + gachaType = 0; + return this; + } + + @Override + public GetGachaCeilingCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetGachaCeilingCsReq)) { + return false; + } + GetGachaCeilingCsReq other = (GetGachaCeilingCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasGachaType() || gachaType == other.gachaType); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(gachaType); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaType); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetGachaCeilingCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 32: { + // gachaType + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + 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.gachaType, gachaType); + } + output.endObject(); + } + + @Override + public GetGachaCeilingCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 802848732: + case -871474217: { + if (input.isAtField(FieldNames.gachaType)) { + if (!input.trySkipNullValue()) { + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetGachaCeilingCsReq clone() { + return new GetGachaCeilingCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetGachaCeilingCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetGachaCeilingCsReq(), data).checkInitialized(); + } + + public static GetGachaCeilingCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetGachaCeilingCsReq(), input).checkInitialized(); + } + + public static GetGachaCeilingCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetGachaCeilingCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetGachaCeilingCsReq messages + */ + public static MessageFactory getFactory() { + return GetGachaCeilingCsReqFactory.INSTANCE; + } + + private enum GetGachaCeilingCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetGachaCeilingCsReq create() { + return GetGachaCeilingCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName gachaType = FieldName.forField("gachaType", "gacha_type"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetGachaCeilingScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetGachaCeilingScRspOuterClass.java new file mode 100644 index 0000000..131c21d --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetGachaCeilingScRspOuterClass.java @@ -0,0 +1,442 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class GetGachaCeilingScRspOuterClass { + /** + * Protobuf type {@code GetGachaCeilingScRsp} + */ + public static final class GetGachaCeilingScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 gacha_type = 14; + */ + private int gachaType; + + /** + * optional uint32 retcode = 15; + */ + private int retcode; + + /** + * optional .GachaCeiling gacha_ceiling = 6; + */ + private final GachaCeilingOuterClass.GachaCeiling gachaCeiling = GachaCeilingOuterClass.GachaCeiling.newInstance(); + + private GetGachaCeilingScRsp() { + } + + /** + * @return a new empty instance of {@code GetGachaCeilingScRsp} + */ + public static GetGachaCeilingScRsp newInstance() { + return new GetGachaCeilingScRsp(); + } + + /** + * optional uint32 gacha_type = 14; + * @return whether the gachaType field is set + */ + public boolean hasGachaType() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 gacha_type = 14; + * @return this + */ + public GetGachaCeilingScRsp clearGachaType() { + bitField0_ &= ~0x00000001; + gachaType = 0; + return this; + } + + /** + * optional uint32 gacha_type = 14; + * @return the gachaType + */ + public int getGachaType() { + return gachaType; + } + + /** + * optional uint32 gacha_type = 14; + * @param value the gachaType to set + * @return this + */ + public GetGachaCeilingScRsp setGachaType(final int value) { + bitField0_ |= 0x00000001; + gachaType = value; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 15; + * @return this + */ + public GetGachaCeilingScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 15; + * @param value the retcode to set + * @return this + */ + public GetGachaCeilingScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * optional .GachaCeiling gacha_ceiling = 6; + * @return whether the gachaCeiling field is set + */ + public boolean hasGachaCeiling() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional .GachaCeiling gacha_ceiling = 6; + * @return this + */ + public GetGachaCeilingScRsp clearGachaCeiling() { + bitField0_ &= ~0x00000004; + gachaCeiling.clear(); + return this; + } + + /** + * optional .GachaCeiling gacha_ceiling = 6; + * + * 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 #getMutableGachaCeiling()} if you want to modify it. + * + * @return internal storage object for reading + */ + public GachaCeilingOuterClass.GachaCeiling getGachaCeiling() { + return gachaCeiling; + } + + /** + * optional .GachaCeiling gacha_ceiling = 6; + * + * 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 GachaCeilingOuterClass.GachaCeiling getMutableGachaCeiling() { + bitField0_ |= 0x00000004; + return gachaCeiling; + } + + /** + * optional .GachaCeiling gacha_ceiling = 6; + * @param value the gachaCeiling to set + * @return this + */ + public GetGachaCeilingScRsp setGachaCeiling(final GachaCeilingOuterClass.GachaCeiling value) { + bitField0_ |= 0x00000004; + gachaCeiling.copyFrom(value); + return this; + } + + @Override + public GetGachaCeilingScRsp copyFrom(final GetGachaCeilingScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + gachaType = other.gachaType; + retcode = other.retcode; + gachaCeiling.copyFrom(other.gachaCeiling); + } + return this; + } + + @Override + public GetGachaCeilingScRsp mergeFrom(final GetGachaCeilingScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGachaType()) { + setGachaType(other.gachaType); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasGachaCeiling()) { + getMutableGachaCeiling().mergeFrom(other.gachaCeiling); + } + return this; + } + + @Override + public GetGachaCeilingScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + gachaType = 0; + retcode = 0; + gachaCeiling.clear(); + return this; + } + + @Override + public GetGachaCeilingScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + gachaCeiling.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetGachaCeilingScRsp)) { + return false; + } + GetGachaCeilingScRsp other = (GetGachaCeilingScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasGachaType() || gachaType == other.gachaType) + && (!hasRetcode() || retcode == other.retcode) + && (!hasGachaCeiling() || gachaCeiling.equals(other.gachaCeiling)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 50); + output.writeMessageNoTag(gachaCeiling); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(gachaCeiling); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetGachaCeilingScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 112: { + // gachaType + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // gachaCeiling + input.readMessage(gachaCeiling); + 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.gachaType, gachaType); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeMessage(FieldNames.gachaCeiling, gachaCeiling); + } + output.endObject(); + } + + @Override + public GetGachaCeilingScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 802848732: + case -871474217: { + if (input.isAtField(FieldNames.gachaType)) { + if (!input.trySkipNullValue()) { + gachaType = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 507275483: + case -1792489728: { + if (input.isAtField(FieldNames.gachaCeiling)) { + if (!input.trySkipNullValue()) { + input.readMessage(gachaCeiling); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetGachaCeilingScRsp clone() { + return new GetGachaCeilingScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetGachaCeilingScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetGachaCeilingScRsp(), data).checkInitialized(); + } + + public static GetGachaCeilingScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetGachaCeilingScRsp(), input).checkInitialized(); + } + + public static GetGachaCeilingScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetGachaCeilingScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetGachaCeilingScRsp messages + */ + public static MessageFactory getFactory() { + return GetGachaCeilingScRspFactory.INSTANCE; + } + + private enum GetGachaCeilingScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetGachaCeilingScRsp create() { + return GetGachaCeilingScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName gachaType = FieldName.forField("gachaType", "gacha_type"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName gachaCeiling = FieldName.forField("gachaCeiling", "gacha_ceiling"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java new file mode 100644 index 0000000..15f7785 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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; + +public final class GetJukeboxDataCsReqOuterClass { + /** + * Protobuf type {@code GetJukeboxDataCsReq} + */ + public static final class GetJukeboxDataCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetJukeboxDataCsReq() { + } + + /** + * @return a new empty instance of {@code GetJukeboxDataCsReq} + */ + public static GetJukeboxDataCsReq newInstance() { + return new GetJukeboxDataCsReq(); + } + + @Override + public GetJukeboxDataCsReq copyFrom(final GetJukeboxDataCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetJukeboxDataCsReq mergeFrom(final GetJukeboxDataCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetJukeboxDataCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetJukeboxDataCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetJukeboxDataCsReq)) { + return false; + } + GetJukeboxDataCsReq other = (GetJukeboxDataCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetJukeboxDataCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetJukeboxDataCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetJukeboxDataCsReq clone() { + return new GetJukeboxDataCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetJukeboxDataCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), data).checkInitialized(); + } + + public static GetJukeboxDataCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), input).checkInitialized(); + } + + public static GetJukeboxDataCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetJukeboxDataCsReq messages + */ + public static MessageFactory getFactory() { + return GetJukeboxDataCsReqFactory.INSTANCE; + } + + private enum GetJukeboxDataCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetJukeboxDataCsReq create() { + return GetJukeboxDataCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java new file mode 100644 index 0000000..2c22642 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java @@ -0,0 +1,861 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; + +public final class GetJukeboxDataScRspOuterClass { + /** + * Protobuf type {@code GetJukeboxDataScRsp} + */ + public static final class GetJukeboxDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 playing_id = 3; + */ + private int playingId; + + /** + * optional uint32 retcode = 14; + */ + private int retcode; + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + */ + private final RepeatedMessage musicList = RepeatedMessage.newEmptyInstance(UnlockedMusic.getFactory()); + + private GetJukeboxDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetJukeboxDataScRsp} + */ + public static GetJukeboxDataScRsp newInstance() { + return new GetJukeboxDataScRsp(); + } + + /** + * optional uint32 playing_id = 3; + * @return whether the playingId field is set + */ + public boolean hasPlayingId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 playing_id = 3; + * @return this + */ + public GetJukeboxDataScRsp clearPlayingId() { + bitField0_ &= ~0x00000001; + playingId = 0; + return this; + } + + /** + * optional uint32 playing_id = 3; + * @return the playingId + */ + public int getPlayingId() { + return playingId; + } + + /** + * optional uint32 playing_id = 3; + * @param value the playingId to set + * @return this + */ + public GetJukeboxDataScRsp setPlayingId(final int value) { + bitField0_ |= 0x00000001; + playingId = value; + return this; + } + + /** + * optional uint32 retcode = 14; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 14; + * @return this + */ + public GetJukeboxDataScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 14; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 14; + * @param value the retcode to set + * @return this + */ + public GetJukeboxDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @return whether the musicList field is set + */ + public boolean hasMusicList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @return this + */ + public GetJukeboxDataScRsp clearMusicList() { + bitField0_ &= ~0x00000004; + musicList.clear(); + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * + * 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 #getMutableMusicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMusicList() { + return musicList; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * + * 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 getMutableMusicList() { + bitField0_ |= 0x00000004; + return musicList; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @param value the musicList to add + * @return this + */ + public GetJukeboxDataScRsp addMusicList(final UnlockedMusic value) { + bitField0_ |= 0x00000004; + musicList.add(value); + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @param values the musicList to add + * @return this + */ + public GetJukeboxDataScRsp addAllMusicList(final UnlockedMusic... values) { + bitField0_ |= 0x00000004; + musicList.addAll(values); + return this; + } + + @Override + public GetJukeboxDataScRsp copyFrom(final GetJukeboxDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + playingId = other.playingId; + retcode = other.retcode; + musicList.copyFrom(other.musicList); + } + return this; + } + + @Override + public GetJukeboxDataScRsp mergeFrom(final GetJukeboxDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPlayingId()) { + setPlayingId(other.playingId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasMusicList()) { + getMutableMusicList().addAll(other.musicList); + } + return this; + } + + @Override + public GetJukeboxDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + playingId = 0; + retcode = 0; + musicList.clear(); + return this; + } + + @Override + public GetJukeboxDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + musicList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetJukeboxDataScRsp)) { + return false; + } + GetJukeboxDataScRsp other = (GetJukeboxDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasPlayingId() || playingId == other.playingId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasMusicList() || musicList.equals(other.musicList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < musicList.length(); i++) { + output.writeRawByte((byte) 58); + output.writeMessageNoTag(musicList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * musicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(musicList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetJukeboxDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 24: { + // playingId + playingId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 58) { + break; + } + } + case 58: { + // musicList + tag = input.readRepeatedMessage(musicList, 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.writeUInt32(FieldNames.playingId, playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.musicList, musicList); + } + output.endObject(); + } + + @Override + public GetJukeboxDataScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1868462615: + case -2087744820: { + if (input.isAtField(FieldNames.playingId)) { + if (!input.trySkipNullValue()) { + playingId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 389904483: + case -780236168: { + if (input.isAtField(FieldNames.musicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(musicList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetJukeboxDataScRsp clone() { + return new GetJukeboxDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetJukeboxDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), data).checkInitialized(); + } + + public static GetJukeboxDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), input).checkInitialized(); + } + + public static GetJukeboxDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetJukeboxDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetJukeboxDataScRspFactory.INSTANCE; + } + + /** + * Protobuf type {@code UnlockedMusic} + */ + public static final class UnlockedMusic extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 group_id = 1; + */ + private int groupId; + + /** + * optional uint32 id = 8; + */ + private int id; + + /** + * optional bool unkbool = 7; + */ + private boolean unkbool; + + private UnlockedMusic() { + } + + /** + * @return a new empty instance of {@code UnlockedMusic} + */ + public static UnlockedMusic newInstance() { + return new UnlockedMusic(); + } + + /** + * optional uint32 group_id = 1; + * @return whether the groupId field is set + */ + public boolean hasGroupId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 group_id = 1; + * @return this + */ + public UnlockedMusic clearGroupId() { + bitField0_ &= ~0x00000001; + groupId = 0; + return this; + } + + /** + * optional uint32 group_id = 1; + * @return the groupId + */ + public int getGroupId() { + return groupId; + } + + /** + * optional uint32 group_id = 1; + * @param value the groupId to set + * @return this + */ + public UnlockedMusic setGroupId(final int value) { + bitField0_ |= 0x00000001; + groupId = value; + return this; + } + + /** + * optional uint32 id = 8; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 id = 8; + * @return this + */ + public UnlockedMusic clearId() { + bitField0_ &= ~0x00000002; + id = 0; + return this; + } + + /** + * optional uint32 id = 8; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 8; + * @param value the id to set + * @return this + */ + public UnlockedMusic setId(final int value) { + bitField0_ |= 0x00000002; + id = value; + return this; + } + + /** + * optional bool unkbool = 7; + * @return whether the unkbool field is set + */ + public boolean hasUnkbool() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool unkbool = 7; + * @return this + */ + public UnlockedMusic clearUnkbool() { + bitField0_ &= ~0x00000004; + unkbool = false; + return this; + } + + /** + * optional bool unkbool = 7; + * @return the unkbool + */ + public boolean getUnkbool() { + return unkbool; + } + + /** + * optional bool unkbool = 7; + * @param value the unkbool to set + * @return this + */ + public UnlockedMusic setUnkbool(final boolean value) { + bitField0_ |= 0x00000004; + unkbool = value; + return this; + } + + @Override + public UnlockedMusic copyFrom(final UnlockedMusic other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + groupId = other.groupId; + id = other.id; + unkbool = other.unkbool; + } + return this; + } + + @Override + public UnlockedMusic mergeFrom(final UnlockedMusic other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGroupId()) { + setGroupId(other.groupId); + } + if (other.hasId()) { + setId(other.id); + } + if (other.hasUnkbool()) { + setUnkbool(other.unkbool); + } + return this; + } + + @Override + public UnlockedMusic clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + groupId = 0; + id = 0; + unkbool = false; + return this; + } + + @Override + public UnlockedMusic clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockedMusic)) { + return false; + } + UnlockedMusic other = (UnlockedMusic) o; + return bitField0_ == other.bitField0_ + && (!hasGroupId() || groupId == other.groupId) + && (!hasId() || id == other.id) + && (!hasUnkbool() || unkbool == other.unkbool); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 56); + output.writeBoolNoTag(unkbool); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockedMusic mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // groupId + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // unkbool + unkbool = input.readBool(); + 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.groupId, groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.id, id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.unkbool, unkbool); + } + output.endObject(); + } + + @Override + public UnlockedMusic mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 293428218: + case 506361563: { + if (input.isAtField(FieldNames.groupId)) { + if (!input.trySkipNullValue()) { + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -285198628: { + if (input.isAtField(FieldNames.unkbool)) { + if (!input.trySkipNullValue()) { + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockedMusic clone() { + return new UnlockedMusic().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockedMusic parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), data).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockedMusic messages + */ + public static MessageFactory getFactory() { + return UnlockedMusicFactory.INSTANCE; + } + + private enum UnlockedMusicFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockedMusic create() { + return UnlockedMusic.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName groupId = FieldName.forField("groupId", "group_id"); + + static final FieldName id = FieldName.forField("id"); + + static final FieldName unkbool = FieldName.forField("unkbool"); + } + } + + private enum GetJukeboxDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetJukeboxDataScRsp create() { + return GetJukeboxDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName playingId = FieldName.forField("playingId", "playing_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName musicList = FieldName.forField("musicList", "music_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueCsReqOuterClass.java new file mode 100644 index 0000000..189dcce --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueCsReqOuterClass.java @@ -0,0 +1,303 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; + +public final class GetMainMissionCustomValueCsReqOuterClass { + /** + * Protobuf type {@code GetMainMissionCustomValueCsReq} + */ + public static final class GetMainMissionCustomValueCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 main_mission_id_list = 13; + */ + private final RepeatedInt mainMissionIdList = RepeatedInt.newEmptyInstance(); + + private GetMainMissionCustomValueCsReq() { + } + + /** + * @return a new empty instance of {@code GetMainMissionCustomValueCsReq} + */ + public static GetMainMissionCustomValueCsReq newInstance() { + return new GetMainMissionCustomValueCsReq(); + } + + /** + * repeated uint32 main_mission_id_list = 13; + * @return whether the mainMissionIdList field is set + */ + public boolean hasMainMissionIdList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 main_mission_id_list = 13; + * @return this + */ + public GetMainMissionCustomValueCsReq clearMainMissionIdList() { + bitField0_ &= ~0x00000001; + mainMissionIdList.clear(); + return this; + } + + /** + * repeated uint32 main_mission_id_list = 13; + * + * 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 #getMutableMainMissionIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getMainMissionIdList() { + return mainMissionIdList; + } + + /** + * repeated uint32 main_mission_id_list = 13; + * + * 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 getMutableMainMissionIdList() { + bitField0_ |= 0x00000001; + return mainMissionIdList; + } + + /** + * repeated uint32 main_mission_id_list = 13; + * @param value the mainMissionIdList to add + * @return this + */ + public GetMainMissionCustomValueCsReq addMainMissionIdList(final int value) { + bitField0_ |= 0x00000001; + mainMissionIdList.add(value); + return this; + } + + /** + * repeated uint32 main_mission_id_list = 13; + * @param values the mainMissionIdList to add + * @return this + */ + public GetMainMissionCustomValueCsReq addAllMainMissionIdList(final int... values) { + bitField0_ |= 0x00000001; + mainMissionIdList.addAll(values); + return this; + } + + @Override + public GetMainMissionCustomValueCsReq copyFrom(final GetMainMissionCustomValueCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + mainMissionIdList.copyFrom(other.mainMissionIdList); + } + return this; + } + + @Override + public GetMainMissionCustomValueCsReq mergeFrom(final GetMainMissionCustomValueCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasMainMissionIdList()) { + getMutableMainMissionIdList().addAll(other.mainMissionIdList); + } + return this; + } + + @Override + public GetMainMissionCustomValueCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mainMissionIdList.clear(); + return this; + } + + @Override + public GetMainMissionCustomValueCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mainMissionIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetMainMissionCustomValueCsReq)) { + return false; + } + GetMainMissionCustomValueCsReq other = (GetMainMissionCustomValueCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasMainMissionIdList() || mainMissionIdList.equals(other.mainMissionIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < mainMissionIdList.length(); i++) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(mainMissionIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * mainMissionIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(mainMissionIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetMainMissionCustomValueCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 106: { + // mainMissionIdList [packed=true] + input.readPackedUInt32(mainMissionIdList, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 104: { + // mainMissionIdList [packed=false] + tag = input.readRepeatedUInt32(mainMissionIdList, tag); + bitField0_ |= 0x00000001; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.mainMissionIdList, mainMissionIdList); + } + output.endObject(); + } + + @Override + public GetMainMissionCustomValueCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1438400460: + case -1382679799: { + if (input.isAtField(FieldNames.mainMissionIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(mainMissionIdList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetMainMissionCustomValueCsReq clone() { + return new GetMainMissionCustomValueCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetMainMissionCustomValueCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), data).checkInitialized(); + } + + public static GetMainMissionCustomValueCsReq parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), input).checkInitialized(); + } + + public static GetMainMissionCustomValueCsReq parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetMainMissionCustomValueCsReq messages + */ + public static MessageFactory getFactory() { + return GetMainMissionCustomValueCsReqFactory.INSTANCE; + } + + private enum GetMainMissionCustomValueCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetMainMissionCustomValueCsReq create() { + return GetMainMissionCustomValueCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName mainMissionIdList = FieldName.forField("mainMissionIdList", "main_mission_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueScRspOuterClass.java new file mode 100644 index 0000000..419952e --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetMainMissionCustomValueScRspOuterClass.java @@ -0,0 +1,378 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; + +public final class GetMainMissionCustomValueScRspOuterClass { + /** + * Protobuf type {@code GetMainMissionCustomValueScRsp} + */ + public static final class GetMainMissionCustomValueScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 2; + */ + private int retcode; + + /** + * repeated .MainMission main_mission_list = 5; + */ + private final RepeatedMessage mainMissionList = RepeatedMessage.newEmptyInstance(MainMissionOuterClass.MainMission.getFactory()); + + private GetMainMissionCustomValueScRsp() { + } + + /** + * @return a new empty instance of {@code GetMainMissionCustomValueScRsp} + */ + public static GetMainMissionCustomValueScRsp newInstance() { + return new GetMainMissionCustomValueScRsp(); + } + + /** + * optional uint32 retcode = 2; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 2; + * @return this + */ + public GetMainMissionCustomValueScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 2; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 2; + * @param value the retcode to set + * @return this + */ + public GetMainMissionCustomValueScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated .MainMission main_mission_list = 5; + * @return whether the mainMissionList field is set + */ + public boolean hasMainMissionList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .MainMission main_mission_list = 5; + * @return this + */ + public GetMainMissionCustomValueScRsp clearMainMissionList() { + bitField0_ &= ~0x00000002; + mainMissionList.clear(); + return this; + } + + /** + * repeated .MainMission main_mission_list = 5; + * + * 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 #getMutableMainMissionList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMainMissionList() { + return mainMissionList; + } + + /** + * repeated .MainMission main_mission_list = 5; + * + * 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 getMutableMainMissionList() { + bitField0_ |= 0x00000002; + return mainMissionList; + } + + /** + * repeated .MainMission main_mission_list = 5; + * @param value the mainMissionList to add + * @return this + */ + public GetMainMissionCustomValueScRsp addMainMissionList( + final MainMissionOuterClass.MainMission value) { + bitField0_ |= 0x00000002; + mainMissionList.add(value); + return this; + } + + /** + * repeated .MainMission main_mission_list = 5; + * @param values the mainMissionList to add + * @return this + */ + public GetMainMissionCustomValueScRsp addAllMainMissionList( + final MainMissionOuterClass.MainMission... values) { + bitField0_ |= 0x00000002; + mainMissionList.addAll(values); + return this; + } + + @Override + public GetMainMissionCustomValueScRsp copyFrom(final GetMainMissionCustomValueScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + mainMissionList.copyFrom(other.mainMissionList); + } + return this; + } + + @Override + public GetMainMissionCustomValueScRsp mergeFrom(final GetMainMissionCustomValueScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasMainMissionList()) { + getMutableMainMissionList().addAll(other.mainMissionList); + } + return this; + } + + @Override + public GetMainMissionCustomValueScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + mainMissionList.clear(); + return this; + } + + @Override + public GetMainMissionCustomValueScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mainMissionList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetMainMissionCustomValueScRsp)) { + return false; + } + GetMainMissionCustomValueScRsp other = (GetMainMissionCustomValueScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasMainMissionList() || mainMissionList.equals(other.mainMissionList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < mainMissionList.length(); i++) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(mainMissionList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * mainMissionList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(mainMissionList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetMainMissionCustomValueScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // mainMissionList + tag = input.readRepeatedMessage(mainMissionList, tag); + bitField0_ |= 0x00000002; + 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.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.mainMissionList, mainMissionList); + } + output.endObject(); + } + + @Override + public GetMainMissionCustomValueScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1352596271: + case 939604023: { + if (input.isAtField(FieldNames.mainMissionList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(mainMissionList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetMainMissionCustomValueScRsp clone() { + return new GetMainMissionCustomValueScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetMainMissionCustomValueScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), data).checkInitialized(); + } + + public static GetMainMissionCustomValueScRsp parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), input).checkInitialized(); + } + + public static GetMainMissionCustomValueScRsp parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetMainMissionCustomValueScRsp messages + */ + public static MessageFactory getFactory() { + return GetMainMissionCustomValueScRspFactory.INSTANCE; + } + + private enum GetMainMissionCustomValueScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetMainMissionCustomValueScRsp create() { + return GetMainMissionCustomValueScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName mainMissionList = FieldName.forField("mainMissionList", "main_mission_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java new file mode 100644 index 0000000..82ae830 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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; + +public final class GetPhoneDataCsReqOuterClass { + /** + * Protobuf type {@code GetPhoneDataCsReq} + */ + public static final class GetPhoneDataCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetPhoneDataCsReq() { + } + + /** + * @return a new empty instance of {@code GetPhoneDataCsReq} + */ + public static GetPhoneDataCsReq newInstance() { + return new GetPhoneDataCsReq(); + } + + @Override + public GetPhoneDataCsReq copyFrom(final GetPhoneDataCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetPhoneDataCsReq mergeFrom(final GetPhoneDataCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetPhoneDataCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetPhoneDataCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetPhoneDataCsReq)) { + return false; + } + GetPhoneDataCsReq other = (GetPhoneDataCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetPhoneDataCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetPhoneDataCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetPhoneDataCsReq clone() { + return new GetPhoneDataCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetPhoneDataCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), data).checkInitialized(); + } + + public static GetPhoneDataCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), input).checkInitialized(); + } + + public static GetPhoneDataCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetPhoneDataCsReq messages + */ + public static MessageFactory getFactory() { + return GetPhoneDataCsReqFactory.INSTANCE; + } + + private enum GetPhoneDataCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetPhoneDataCsReq create() { + return GetPhoneDataCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java new file mode 100644 index 0000000..09c5e66 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java @@ -0,0 +1,664 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; + +public final class GetPhoneDataScRspOuterClass { + /** + * Protobuf type {@code GetPhoneDataScRsp} + */ + public static final class GetPhoneDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_chat_bubble = 2; + */ + private int curChatBubble; + + /** + * optional uint32 cur_phone_theme = 3; + */ + private int curPhoneTheme; + + /** + * optional uint32 retcode = 9; + */ + private int retcode; + + /** + * repeated uint32 owned_chat_bubbles = 10; + */ + private final RepeatedInt ownedChatBubbles = RepeatedInt.newEmptyInstance(); + + /** + * repeated uint32 owned_phone_themes = 13; + */ + private final RepeatedInt ownedPhoneThemes = RepeatedInt.newEmptyInstance(); + + private GetPhoneDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetPhoneDataScRsp} + */ + public static GetPhoneDataScRsp newInstance() { + return new GetPhoneDataScRsp(); + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return whether the curChatBubble field is set + */ + public boolean hasCurChatBubble() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return this + */ + public GetPhoneDataScRsp clearCurChatBubble() { + bitField0_ &= ~0x00000001; + curChatBubble = 0; + return this; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return the curChatBubble + */ + public int getCurChatBubble() { + return curChatBubble; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @param value the curChatBubble to set + * @return this + */ + public GetPhoneDataScRsp setCurChatBubble(final int value) { + bitField0_ |= 0x00000001; + curChatBubble = value; + return this; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return whether the curPhoneTheme field is set + */ + public boolean hasCurPhoneTheme() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return this + */ + public GetPhoneDataScRsp clearCurPhoneTheme() { + bitField0_ &= ~0x00000002; + curPhoneTheme = 0; + return this; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return the curPhoneTheme + */ + public int getCurPhoneTheme() { + return curPhoneTheme; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @param value the curPhoneTheme to set + * @return this + */ + public GetPhoneDataScRsp setCurPhoneTheme(final int value) { + bitField0_ |= 0x00000002; + curPhoneTheme = value; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 retcode = 9; + * @return this + */ + public GetPhoneDataScRsp clearRetcode() { + bitField0_ &= ~0x00000004; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 9; + * @param value the retcode to set + * @return this + */ + public GetPhoneDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000004; + retcode = value; + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @return whether the ownedChatBubbles field is set + */ + public boolean hasOwnedChatBubbles() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @return this + */ + public GetPhoneDataScRsp clearOwnedChatBubbles() { + bitField0_ &= ~0x00000008; + ownedChatBubbles.clear(); + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * + * 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 #getMutableOwnedChatBubbles()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getOwnedChatBubbles() { + return ownedChatBubbles; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * + * 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 getMutableOwnedChatBubbles() { + bitField0_ |= 0x00000008; + return ownedChatBubbles; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @param value the ownedChatBubbles to add + * @return this + */ + public GetPhoneDataScRsp addOwnedChatBubbles(final int value) { + bitField0_ |= 0x00000008; + ownedChatBubbles.add(value); + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @param values the ownedChatBubbles to add + * @return this + */ + public GetPhoneDataScRsp addAllOwnedChatBubbles(final int... values) { + bitField0_ |= 0x00000008; + ownedChatBubbles.addAll(values); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @return whether the ownedPhoneThemes field is set + */ + public boolean hasOwnedPhoneThemes() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @return this + */ + public GetPhoneDataScRsp clearOwnedPhoneThemes() { + bitField0_ &= ~0x00000010; + ownedPhoneThemes.clear(); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * + * 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 #getMutableOwnedPhoneThemes()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getOwnedPhoneThemes() { + return ownedPhoneThemes; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * + * 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 getMutableOwnedPhoneThemes() { + bitField0_ |= 0x00000010; + return ownedPhoneThemes; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @param value the ownedPhoneThemes to add + * @return this + */ + public GetPhoneDataScRsp addOwnedPhoneThemes(final int value) { + bitField0_ |= 0x00000010; + ownedPhoneThemes.add(value); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @param values the ownedPhoneThemes to add + * @return this + */ + public GetPhoneDataScRsp addAllOwnedPhoneThemes(final int... values) { + bitField0_ |= 0x00000010; + ownedPhoneThemes.addAll(values); + return this; + } + + @Override + public GetPhoneDataScRsp copyFrom(final GetPhoneDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curChatBubble = other.curChatBubble; + curPhoneTheme = other.curPhoneTheme; + retcode = other.retcode; + ownedChatBubbles.copyFrom(other.ownedChatBubbles); + ownedPhoneThemes.copyFrom(other.ownedPhoneThemes); + } + return this; + } + + @Override + public GetPhoneDataScRsp mergeFrom(final GetPhoneDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurChatBubble()) { + setCurChatBubble(other.curChatBubble); + } + if (other.hasCurPhoneTheme()) { + setCurPhoneTheme(other.curPhoneTheme); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasOwnedChatBubbles()) { + getMutableOwnedChatBubbles().addAll(other.ownedChatBubbles); + } + if (other.hasOwnedPhoneThemes()) { + getMutableOwnedPhoneThemes().addAll(other.ownedPhoneThemes); + } + return this; + } + + @Override + public GetPhoneDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curChatBubble = 0; + curPhoneTheme = 0; + retcode = 0; + ownedChatBubbles.clear(); + ownedPhoneThemes.clear(); + return this; + } + + @Override + public GetPhoneDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + ownedChatBubbles.clear(); + ownedPhoneThemes.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetPhoneDataScRsp)) { + return false; + } + GetPhoneDataScRsp other = (GetPhoneDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurChatBubble() || curChatBubble == other.curChatBubble) + && (!hasCurPhoneTheme() || curPhoneTheme == other.curPhoneTheme) + && (!hasRetcode() || retcode == other.retcode) + && (!hasOwnedChatBubbles() || ownedChatBubbles.equals(other.ownedChatBubbles)) + && (!hasOwnedPhoneThemes() || ownedPhoneThemes.equals(other.ownedPhoneThemes)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < ownedChatBubbles.length(); i++) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(ownedChatBubbles.array()[i]); + } + } + if ((bitField0_ & 0x00000010) != 0) { + for (int i = 0; i < ownedPhoneThemes.length(); i++) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(ownedPhoneThemes.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * ownedChatBubbles.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(ownedChatBubbles); + } + if ((bitField0_ & 0x00000010) != 0) { + size += (1 * ownedPhoneThemes.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(ownedPhoneThemes); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetPhoneDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // curChatBubble + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 24) { + break; + } + } + case 24: { + // curPhoneTheme + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // ownedChatBubbles [packed=true] + input.readPackedUInt32(ownedChatBubbles, tag); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 106) { + break; + } + } + case 106: { + // ownedPhoneThemes [packed=true] + input.readPackedUInt32(ownedPhoneThemes, 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 80: { + // ownedChatBubbles [packed=false] + tag = input.readRepeatedUInt32(ownedChatBubbles, tag); + bitField0_ |= 0x00000008; + break; + } + case 104: { + // ownedPhoneThemes [packed=false] + tag = input.readRepeatedUInt32(ownedPhoneThemes, tag); + bitField0_ |= 0x00000010; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.curChatBubble, curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.curPhoneTheme, curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedUInt32(FieldNames.ownedChatBubbles, ownedChatBubbles); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRepeatedUInt32(FieldNames.ownedPhoneThemes, ownedPhoneThemes); + } + output.endObject(); + } + + @Override + public GetPhoneDataScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 94167140: + case 1828957140: { + if (input.isAtField(FieldNames.curChatBubble)) { + if (!input.trySkipNullValue()) { + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 405670747: + case -514634695: { + if (input.isAtField(FieldNames.curPhoneTheme)) { + if (!input.trySkipNullValue()) { + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1579353334: + case -1491735846: { + if (input.isAtField(FieldNames.ownedChatBubbles)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(ownedChatBubbles); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case -512676109: + case -1128638699: { + if (input.isAtField(FieldNames.ownedPhoneThemes)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(ownedPhoneThemes); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetPhoneDataScRsp clone() { + return new GetPhoneDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetPhoneDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), data).checkInitialized(); + } + + public static GetPhoneDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), input).checkInitialized(); + } + + public static GetPhoneDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetPhoneDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetPhoneDataScRspFactory.INSTANCE; + } + + private enum GetPhoneDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetPhoneDataScRsp create() { + return GetPhoneDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curChatBubble = FieldName.forField("curChatBubble", "cur_chat_bubble"); + + static final FieldName curPhoneTheme = FieldName.forField("curPhoneTheme", "cur_phone_theme"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName ownedChatBubbles = FieldName.forField("ownedChatBubbles", "owned_chat_bubbles"); + + static final FieldName ownedPhoneThemes = FieldName.forField("ownedPhoneThemes", "owned_phone_themes"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetQuestDataCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetQuestDataCsReqOuterClass.java new file mode 100644 index 0000000..de1eec4 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetQuestDataCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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; + +public final class GetQuestDataCsReqOuterClass { + /** + * Protobuf type {@code GetQuestDataCsReq} + */ + public static final class GetQuestDataCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetQuestDataCsReq() { + } + + /** + * @return a new empty instance of {@code GetQuestDataCsReq} + */ + public static GetQuestDataCsReq newInstance() { + return new GetQuestDataCsReq(); + } + + @Override + public GetQuestDataCsReq copyFrom(final GetQuestDataCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetQuestDataCsReq mergeFrom(final GetQuestDataCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetQuestDataCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetQuestDataCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetQuestDataCsReq)) { + return false; + } + GetQuestDataCsReq other = (GetQuestDataCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetQuestDataCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetQuestDataCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetQuestDataCsReq clone() { + return new GetQuestDataCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetQuestDataCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetQuestDataCsReq(), data).checkInitialized(); + } + + public static GetQuestDataCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetQuestDataCsReq(), input).checkInitialized(); + } + + public static GetQuestDataCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetQuestDataCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetQuestDataCsReq messages + */ + public static MessageFactory getFactory() { + return GetQuestDataCsReqFactory.INSTANCE; + } + + private enum GetQuestDataCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetQuestDataCsReq create() { + return GetQuestDataCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetQuestDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetQuestDataScRspOuterClass.java new file mode 100644 index 0000000..ce69d93 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetQuestDataScRspOuterClass.java @@ -0,0 +1,455 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; + +public final class GetQuestDataScRspOuterClass { + /** + * Protobuf type {@code GetQuestDataScRsp} + */ + public static final class GetQuestDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 7; + */ + private int retcode; + + /** + * optional uint32 total_achievement_exp = 11; + */ + private int totalAchievementExp; + + /** + * repeated .Quest quest_list = 9; + */ + private final RepeatedMessage questList = RepeatedMessage.newEmptyInstance(QuestOuterClass.Quest.getFactory()); + + private GetQuestDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetQuestDataScRsp} + */ + public static GetQuestDataScRsp newInstance() { + return new GetQuestDataScRsp(); + } + + /** + * optional uint32 retcode = 7; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 7; + * @return this + */ + public GetQuestDataScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 7; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 7; + * @param value the retcode to set + * @return this + */ + public GetQuestDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional uint32 total_achievement_exp = 11; + * @return whether the totalAchievementExp field is set + */ + public boolean hasTotalAchievementExp() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 total_achievement_exp = 11; + * @return this + */ + public GetQuestDataScRsp clearTotalAchievementExp() { + bitField0_ &= ~0x00000002; + totalAchievementExp = 0; + return this; + } + + /** + * optional uint32 total_achievement_exp = 11; + * @return the totalAchievementExp + */ + public int getTotalAchievementExp() { + return totalAchievementExp; + } + + /** + * optional uint32 total_achievement_exp = 11; + * @param value the totalAchievementExp to set + * @return this + */ + public GetQuestDataScRsp setTotalAchievementExp(final int value) { + bitField0_ |= 0x00000002; + totalAchievementExp = value; + return this; + } + + /** + * repeated .Quest quest_list = 9; + * @return whether the questList field is set + */ + public boolean hasQuestList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .Quest quest_list = 9; + * @return this + */ + public GetQuestDataScRsp clearQuestList() { + bitField0_ &= ~0x00000004; + questList.clear(); + return this; + } + + /** + * repeated .Quest quest_list = 9; + * + * 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 #getMutableQuestList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getQuestList() { + return questList; + } + + /** + * repeated .Quest quest_list = 9; + * + * 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 getMutableQuestList() { + bitField0_ |= 0x00000004; + return questList; + } + + /** + * repeated .Quest quest_list = 9; + * @param value the questList to add + * @return this + */ + public GetQuestDataScRsp addQuestList(final QuestOuterClass.Quest value) { + bitField0_ |= 0x00000004; + questList.add(value); + return this; + } + + /** + * repeated .Quest quest_list = 9; + * @param values the questList to add + * @return this + */ + public GetQuestDataScRsp addAllQuestList(final QuestOuterClass.Quest... values) { + bitField0_ |= 0x00000004; + questList.addAll(values); + return this; + } + + @Override + public GetQuestDataScRsp copyFrom(final GetQuestDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + totalAchievementExp = other.totalAchievementExp; + questList.copyFrom(other.questList); + } + return this; + } + + @Override + public GetQuestDataScRsp mergeFrom(final GetQuestDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasTotalAchievementExp()) { + setTotalAchievementExp(other.totalAchievementExp); + } + if (other.hasQuestList()) { + getMutableQuestList().addAll(other.questList); + } + return this; + } + + @Override + public GetQuestDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + totalAchievementExp = 0; + questList.clear(); + return this; + } + + @Override + public GetQuestDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + questList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetQuestDataScRsp)) { + return false; + } + GetQuestDataScRsp other = (GetQuestDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasTotalAchievementExp() || totalAchievementExp == other.totalAchievementExp) + && (!hasQuestList() || questList.equals(other.questList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(totalAchievementExp); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < questList.length(); i++) { + output.writeRawByte((byte) 74); + output.writeMessageNoTag(questList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(totalAchievementExp); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * questList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(questList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetQuestDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 56: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // totalAchievementExp + totalAchievementExp = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 74) { + break; + } + } + case 74: { + // questList + tag = input.readRepeatedMessage(questList, 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.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.totalAchievementExp, totalAchievementExp); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.questList, questList); + } + output.endObject(); + } + + @Override + public GetQuestDataScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 255336658: + case -1295039982: { + if (input.isAtField(FieldNames.totalAchievementExp)) { + if (!input.trySkipNullValue()) { + totalAchievementExp = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1783104352: + case 575966683: { + if (input.isAtField(FieldNames.questList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(questList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetQuestDataScRsp clone() { + return new GetQuestDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetQuestDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetQuestDataScRsp(), data).checkInitialized(); + } + + public static GetQuestDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetQuestDataScRsp(), input).checkInitialized(); + } + + public static GetQuestDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetQuestDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetQuestDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetQuestDataScRspFactory.INSTANCE; + } + + private enum GetQuestDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetQuestDataScRsp create() { + return GetQuestDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName totalAchievementExp = FieldName.forField("totalAchievementExp", "total_achievement_exp"); + + static final FieldName questList = FieldName.forField("questList", "quest_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/MainMissionOuterClass.java b/src/generated/main/emu/lunarcore/proto/MainMissionOuterClass.java new file mode 100644 index 0000000..1699aae --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/MainMissionOuterClass.java @@ -0,0 +1,391 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class MainMissionOuterClass { + /** + * Protobuf type {@code MainMission} + */ + public static final class MainMission extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 id = 4; + */ + private int id; + + /** + *
+     *  repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
+     * 
+ * + * optional .MissionStatus status = 9; + */ + private int status; + + private MainMission() { + } + + /** + * @return a new empty instance of {@code MainMission} + */ + public static MainMission newInstance() { + return new MainMission(); + } + + /** + * optional uint32 id = 4; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 id = 4; + * @return this + */ + public MainMission clearId() { + bitField0_ &= ~0x00000001; + id = 0; + return this; + } + + /** + * optional uint32 id = 4; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 4; + * @param value the id to set + * @return this + */ + public MainMission setId(final int value) { + bitField0_ |= 0x00000001; + id = value; + return this; + } + + /** + *
+     *  repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
+     * 
+ * + * optional .MissionStatus status = 9; + * @return whether the status field is set + */ + public boolean hasStatus() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + *
+     *  repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
+     * 
+ * + * optional .MissionStatus status = 9; + * @return this + */ + public MainMission clearStatus() { + bitField0_ &= ~0x00000002; + status = 0; + return this; + } + + /** + *
+     *  repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
+     * 
+ * + * optional .MissionStatus status = 9; + * @return the status + */ + public MissionStatusOuterClass.MissionStatus getStatus() { + return MissionStatusOuterClass.MissionStatus.forNumber(status); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link MainMission#getStatus()}.getNumber(). + * + * @return numeric wire representation + */ + public int getStatusValue() { + return status; + } + + /** + * Sets the value of the internal enum store. This does not + * do any validity checks, so be sure to use appropriate value + * constants from {@link MissionStatusOuterClass.MissionStatus}. Setting an invalid value + * can cause {@link MainMission#getStatus()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public MainMission setStatusValue(final int value) { + bitField0_ |= 0x00000002; + status = value; + return this; + } + + /** + *
+     *  repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
+     * 
+ * + * optional .MissionStatus status = 9; + * @param value the status to set + * @return this + */ + public MainMission setStatus(final MissionStatusOuterClass.MissionStatus value) { + bitField0_ |= 0x00000002; + status = value.getNumber(); + return this; + } + + @Override + public MainMission copyFrom(final MainMission other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + id = other.id; + status = other.status; + } + return this; + } + + @Override + public MainMission mergeFrom(final MainMission other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasId()) { + setId(other.id); + } + if (other.hasStatus()) { + setStatusValue(other.status); + } + return this; + } + + @Override + public MainMission clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + id = 0; + status = 0; + return this; + } + + @Override + public MainMission clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof MainMission)) { + return false; + } + MainMission other = (MainMission) o; + return bitField0_ == other.bitField0_ + && (!hasId() || id == other.id) + && (!hasStatus() || status == other.status); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeEnumNoTag(status); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(status); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public MainMission mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 32: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // status + final int value = input.readInt32(); + if (MissionStatusOuterClass.MissionStatus.forNumber(value) != null) { + status = value; + bitField0_ |= 0x00000002; + } + 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.id, id); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeEnum(FieldNames.status, status, MissionStatusOuterClass.MissionStatus.converter()); + } + output.endObject(); + } + + @Override + public MainMission mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -892481550: { + if (input.isAtField(FieldNames.status)) { + if (!input.trySkipNullValue()) { + final MissionStatusOuterClass.MissionStatus value = input.readEnum(MissionStatusOuterClass.MissionStatus.converter()); + if (value != null) { + status = value.getNumber(); + bitField0_ |= 0x00000002; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public MainMission clone() { + return new MainMission().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static MainMission parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new MainMission(), data).checkInitialized(); + } + + public static MainMission parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new MainMission(), input).checkInitialized(); + } + + public static MainMission parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new MainMission(), input).checkInitialized(); + } + + /** + * @return factory for creating MainMission messages + */ + public static MessageFactory getFactory() { + return MainMissionFactory.INSTANCE; + } + + private enum MainMissionFactory implements MessageFactory { + INSTANCE; + + @Override + public MainMission create() { + return MainMission.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName id = FieldName.forField("id"); + + static final FieldName status = FieldName.forField("status"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/MonsterArchiveOuterClass.java b/src/generated/main/emu/lunarcore/proto/MonsterArchiveOuterClass.java new file mode 100644 index 0000000..c3d1840 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/MonsterArchiveOuterClass.java @@ -0,0 +1,340 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class MonsterArchiveOuterClass { + /** + * Protobuf type {@code MonsterArchive} + */ + public static final class MonsterArchive extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 num = 9; + */ + private int num; + + /** + * optional uint32 monster_id = 11; + */ + private int monsterId; + + private MonsterArchive() { + } + + /** + * @return a new empty instance of {@code MonsterArchive} + */ + public static MonsterArchive newInstance() { + return new MonsterArchive(); + } + + /** + * optional uint32 num = 9; + * @return whether the num field is set + */ + public boolean hasNum() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 num = 9; + * @return this + */ + public MonsterArchive clearNum() { + bitField0_ &= ~0x00000001; + num = 0; + return this; + } + + /** + * optional uint32 num = 9; + * @return the num + */ + public int getNum() { + return num; + } + + /** + * optional uint32 num = 9; + * @param value the num to set + * @return this + */ + public MonsterArchive setNum(final int value) { + bitField0_ |= 0x00000001; + num = value; + return this; + } + + /** + * optional uint32 monster_id = 11; + * @return whether the monsterId field is set + */ + public boolean hasMonsterId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 monster_id = 11; + * @return this + */ + public MonsterArchive clearMonsterId() { + bitField0_ &= ~0x00000002; + monsterId = 0; + return this; + } + + /** + * optional uint32 monster_id = 11; + * @return the monsterId + */ + public int getMonsterId() { + return monsterId; + } + + /** + * optional uint32 monster_id = 11; + * @param value the monsterId to set + * @return this + */ + public MonsterArchive setMonsterId(final int value) { + bitField0_ |= 0x00000002; + monsterId = value; + return this; + } + + @Override + public MonsterArchive copyFrom(final MonsterArchive other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + num = other.num; + monsterId = other.monsterId; + } + return this; + } + + @Override + public MonsterArchive mergeFrom(final MonsterArchive other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasNum()) { + setNum(other.num); + } + if (other.hasMonsterId()) { + setMonsterId(other.monsterId); + } + return this; + } + + @Override + public MonsterArchive clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + num = 0; + monsterId = 0; + return this; + } + + @Override + public MonsterArchive clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof MonsterArchive)) { + return false; + } + MonsterArchive other = (MonsterArchive) o; + return bitField0_ == other.bitField0_ + && (!hasNum() || num == other.num) + && (!hasMonsterId() || monsterId == other.monsterId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(num); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(monsterId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(num); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(monsterId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public MonsterArchive mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 72: { + // num + num = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // monsterId + monsterId = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.num, num); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.monsterId, monsterId); + } + output.endObject(); + } + + @Override + public MonsterArchive mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 109446: { + if (input.isAtField(FieldNames.num)) { + if (!input.trySkipNullValue()) { + num = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1316830571: + case 2127946656: { + if (input.isAtField(FieldNames.monsterId)) { + if (!input.trySkipNullValue()) { + monsterId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public MonsterArchive clone() { + return new MonsterArchive().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static MonsterArchive parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new MonsterArchive(), data).checkInitialized(); + } + + public static MonsterArchive parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new MonsterArchive(), input).checkInitialized(); + } + + public static MonsterArchive parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new MonsterArchive(), input).checkInitialized(); + } + + /** + * @return factory for creating MonsterArchive messages + */ + public static MessageFactory getFactory() { + return MonsterArchiveFactory.INSTANCE; + } + + private enum MonsterArchiveFactory implements MessageFactory { + INSTANCE; + + @Override + public MonsterArchive create() { + return MonsterArchive.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName num = FieldName.forField("num"); + + static final FieldName monsterId = FieldName.forField("monsterId", "monster_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java new file mode 100644 index 0000000..86aee44 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class PlayBackGroundMusicCsReqOuterClass { + /** + * Protobuf type {@code PlayBackGroundMusicCsReq} + */ + public static final class PlayBackGroundMusicCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 play_music_id = 6; + */ + private int playMusicId; + + private PlayBackGroundMusicCsReq() { + } + + /** + * @return a new empty instance of {@code PlayBackGroundMusicCsReq} + */ + public static PlayBackGroundMusicCsReq newInstance() { + return new PlayBackGroundMusicCsReq(); + } + + /** + * optional uint32 play_music_id = 6; + * @return whether the playMusicId field is set + */ + public boolean hasPlayMusicId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 play_music_id = 6; + * @return this + */ + public PlayBackGroundMusicCsReq clearPlayMusicId() { + bitField0_ &= ~0x00000001; + playMusicId = 0; + return this; + } + + /** + * optional uint32 play_music_id = 6; + * @return the playMusicId + */ + public int getPlayMusicId() { + return playMusicId; + } + + /** + * optional uint32 play_music_id = 6; + * @param value the playMusicId to set + * @return this + */ + public PlayBackGroundMusicCsReq setPlayMusicId(final int value) { + bitField0_ |= 0x00000001; + playMusicId = value; + return this; + } + + @Override + public PlayBackGroundMusicCsReq copyFrom(final PlayBackGroundMusicCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + playMusicId = other.playMusicId; + } + return this; + } + + @Override + public PlayBackGroundMusicCsReq mergeFrom(final PlayBackGroundMusicCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPlayMusicId()) { + setPlayMusicId(other.playMusicId); + } + return this; + } + + @Override + public PlayBackGroundMusicCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + playMusicId = 0; + return this; + } + + @Override + public PlayBackGroundMusicCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof PlayBackGroundMusicCsReq)) { + return false; + } + PlayBackGroundMusicCsReq other = (PlayBackGroundMusicCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasPlayMusicId() || playMusicId == other.playMusicId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(playMusicId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playMusicId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public PlayBackGroundMusicCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // playMusicId + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000001; + 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.playMusicId, playMusicId); + } + output.endObject(); + } + + @Override + public PlayBackGroundMusicCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 835898444: + case -1319856608: { + if (input.isAtField(FieldNames.playMusicId)) { + if (!input.trySkipNullValue()) { + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public PlayBackGroundMusicCsReq clone() { + return new PlayBackGroundMusicCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static PlayBackGroundMusicCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), data).checkInitialized(); + } + + public static PlayBackGroundMusicCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), input).checkInitialized(); + } + + public static PlayBackGroundMusicCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating PlayBackGroundMusicCsReq messages + */ + public static MessageFactory getFactory() { + return PlayBackGroundMusicCsReqFactory.INSTANCE; + } + + private enum PlayBackGroundMusicCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public PlayBackGroundMusicCsReq create() { + return PlayBackGroundMusicCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName playMusicId = FieldName.forField("playMusicId", "play_music_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java new file mode 100644 index 0000000..3f86cea --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java @@ -0,0 +1,421 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class PlayBackGroundMusicScRspOuterClass { + /** + * Protobuf type {@code PlayBackGroundMusicScRsp} + */ + public static final class PlayBackGroundMusicScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 6; + */ + private int retcode; + + /** + * optional uint32 playing_id = 7; + */ + private int playingId; + + /** + * optional uint32 play_music_id = 8; + */ + private int playMusicId; + + private PlayBackGroundMusicScRsp() { + } + + /** + * @return a new empty instance of {@code PlayBackGroundMusicScRsp} + */ + public static PlayBackGroundMusicScRsp newInstance() { + return new PlayBackGroundMusicScRsp(); + } + + /** + * optional uint32 retcode = 6; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 6; + * @return this + */ + public PlayBackGroundMusicScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 6; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 6; + * @param value the retcode to set + * @return this + */ + public PlayBackGroundMusicScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional uint32 playing_id = 7; + * @return whether the playingId field is set + */ + public boolean hasPlayingId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 playing_id = 7; + * @return this + */ + public PlayBackGroundMusicScRsp clearPlayingId() { + bitField0_ &= ~0x00000002; + playingId = 0; + return this; + } + + /** + * optional uint32 playing_id = 7; + * @return the playingId + */ + public int getPlayingId() { + return playingId; + } + + /** + * optional uint32 playing_id = 7; + * @param value the playingId to set + * @return this + */ + public PlayBackGroundMusicScRsp setPlayingId(final int value) { + bitField0_ |= 0x00000002; + playingId = value; + return this; + } + + /** + * optional uint32 play_music_id = 8; + * @return whether the playMusicId field is set + */ + public boolean hasPlayMusicId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 play_music_id = 8; + * @return this + */ + public PlayBackGroundMusicScRsp clearPlayMusicId() { + bitField0_ &= ~0x00000004; + playMusicId = 0; + return this; + } + + /** + * optional uint32 play_music_id = 8; + * @return the playMusicId + */ + public int getPlayMusicId() { + return playMusicId; + } + + /** + * optional uint32 play_music_id = 8; + * @param value the playMusicId to set + * @return this + */ + public PlayBackGroundMusicScRsp setPlayMusicId(final int value) { + bitField0_ |= 0x00000004; + playMusicId = value; + return this; + } + + @Override + public PlayBackGroundMusicScRsp copyFrom(final PlayBackGroundMusicScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + playingId = other.playingId; + playMusicId = other.playMusicId; + } + return this; + } + + @Override + public PlayBackGroundMusicScRsp mergeFrom(final PlayBackGroundMusicScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasPlayingId()) { + setPlayingId(other.playingId); + } + if (other.hasPlayMusicId()) { + setPlayMusicId(other.playMusicId); + } + return this; + } + + @Override + public PlayBackGroundMusicScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + playingId = 0; + playMusicId = 0; + return this; + } + + @Override + public PlayBackGroundMusicScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof PlayBackGroundMusicScRsp)) { + return false; + } + PlayBackGroundMusicScRsp other = (PlayBackGroundMusicScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasPlayingId() || playingId == other.playingId) + && (!hasPlayMusicId() || playMusicId == other.playMusicId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(playMusicId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playMusicId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public PlayBackGroundMusicScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // playingId + playingId = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // playMusicId + playMusicId = input.readUInt32(); + 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.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.playingId, playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.playMusicId, playMusicId); + } + output.endObject(); + } + + @Override + public PlayBackGroundMusicScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1868462615: + case -2087744820: { + if (input.isAtField(FieldNames.playingId)) { + if (!input.trySkipNullValue()) { + playingId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 835898444: + case -1319856608: { + if (input.isAtField(FieldNames.playMusicId)) { + if (!input.trySkipNullValue()) { + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public PlayBackGroundMusicScRsp clone() { + return new PlayBackGroundMusicScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static PlayBackGroundMusicScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), data).checkInitialized(); + } + + public static PlayBackGroundMusicScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), input).checkInitialized(); + } + + public static PlayBackGroundMusicScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating PlayBackGroundMusicScRsp messages + */ + public static MessageFactory getFactory() { + return PlayBackGroundMusicScRspFactory.INSTANCE; + } + + private enum PlayBackGroundMusicScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public PlayBackGroundMusicScRsp create() { + return PlayBackGroundMusicScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName playingId = FieldName.forField("playingId", "playing_id"); + + static final FieldName playMusicId = FieldName.forField("playMusicId", "play_music_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/QuestOuterClass.java b/src/generated/main/emu/lunarcore/proto/QuestOuterClass.java new file mode 100644 index 0000000..8243878 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/QuestOuterClass.java @@ -0,0 +1,809 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.ProtoEnum; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.ProtoUtil; +import us.hebi.quickbuf.RepeatedInt; + +public final class QuestOuterClass { + /** + * Protobuf type {@code Quest} + */ + public static final class Quest extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional int64 finish_time = 13; + */ + private long finishTime; + + /** + * optional uint32 id = 3; + */ + private int id; + + /** + * optional uint32 progress = 9; + */ + private int progress; + + /** + * optional .Quest.QuestStatus status = 5; + */ + private int status; + + /** + * repeated uint32 taken_achievement_level_list = 7; + */ + private final RepeatedInt takenAchievementLevelList = RepeatedInt.newEmptyInstance(); + + private Quest() { + } + + /** + * @return a new empty instance of {@code Quest} + */ + public static Quest newInstance() { + return new Quest(); + } + + /** + * optional int64 finish_time = 13; + * @return whether the finishTime field is set + */ + public boolean hasFinishTime() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional int64 finish_time = 13; + * @return this + */ + public Quest clearFinishTime() { + bitField0_ &= ~0x00000001; + finishTime = 0L; + return this; + } + + /** + * optional int64 finish_time = 13; + * @return the finishTime + */ + public long getFinishTime() { + return finishTime; + } + + /** + * optional int64 finish_time = 13; + * @param value the finishTime to set + * @return this + */ + public Quest setFinishTime(final long value) { + bitField0_ |= 0x00000001; + finishTime = value; + return this; + } + + /** + * optional uint32 id = 3; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 id = 3; + * @return this + */ + public Quest clearId() { + bitField0_ &= ~0x00000002; + id = 0; + return this; + } + + /** + * optional uint32 id = 3; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 3; + * @param value the id to set + * @return this + */ + public Quest setId(final int value) { + bitField0_ |= 0x00000002; + id = value; + return this; + } + + /** + * optional uint32 progress = 9; + * @return whether the progress field is set + */ + public boolean hasProgress() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 progress = 9; + * @return this + */ + public Quest clearProgress() { + bitField0_ &= ~0x00000004; + progress = 0; + return this; + } + + /** + * optional uint32 progress = 9; + * @return the progress + */ + public int getProgress() { + return progress; + } + + /** + * optional uint32 progress = 9; + * @param value the progress to set + * @return this + */ + public Quest setProgress(final int value) { + bitField0_ |= 0x00000004; + progress = value; + return this; + } + + /** + * optional .Quest.QuestStatus status = 5; + * @return whether the status field is set + */ + public boolean hasStatus() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional .Quest.QuestStatus status = 5; + * @return this + */ + public Quest clearStatus() { + bitField0_ &= ~0x00000008; + status = 0; + return this; + } + + /** + * optional .Quest.QuestStatus status = 5; + * @return the status + */ + public QuestStatus getStatus() { + return QuestStatus.forNumber(status); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link Quest#getStatus()}.getNumber(). + * + * @return numeric wire representation + */ + public int getStatusValue() { + return status; + } + + /** + * Sets the value of the internal enum store. This does not + * do any validity checks, so be sure to use appropriate value + * constants from {@link QuestStatus}. Setting an invalid value + * can cause {@link Quest#getStatus()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public Quest setStatusValue(final int value) { + bitField0_ |= 0x00000008; + status = value; + return this; + } + + /** + * optional .Quest.QuestStatus status = 5; + * @param value the status to set + * @return this + */ + public Quest setStatus(final QuestStatus value) { + bitField0_ |= 0x00000008; + status = value.getNumber(); + return this; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * @return whether the takenAchievementLevelList field is set + */ + public boolean hasTakenAchievementLevelList() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * @return this + */ + public Quest clearTakenAchievementLevelList() { + bitField0_ &= ~0x00000010; + takenAchievementLevelList.clear(); + return this; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * + * 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 #getMutableTakenAchievementLevelList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getTakenAchievementLevelList() { + return takenAchievementLevelList; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * + * 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 getMutableTakenAchievementLevelList() { + bitField0_ |= 0x00000010; + return takenAchievementLevelList; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * @param value the takenAchievementLevelList to add + * @return this + */ + public Quest addTakenAchievementLevelList(final int value) { + bitField0_ |= 0x00000010; + takenAchievementLevelList.add(value); + return this; + } + + /** + * repeated uint32 taken_achievement_level_list = 7; + * @param values the takenAchievementLevelList to add + * @return this + */ + public Quest addAllTakenAchievementLevelList(final int... values) { + bitField0_ |= 0x00000010; + takenAchievementLevelList.addAll(values); + return this; + } + + @Override + public Quest copyFrom(final Quest other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + finishTime = other.finishTime; + id = other.id; + progress = other.progress; + status = other.status; + takenAchievementLevelList.copyFrom(other.takenAchievementLevelList); + } + return this; + } + + @Override + public Quest mergeFrom(final Quest other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasFinishTime()) { + setFinishTime(other.finishTime); + } + if (other.hasId()) { + setId(other.id); + } + if (other.hasProgress()) { + setProgress(other.progress); + } + if (other.hasStatus()) { + setStatusValue(other.status); + } + if (other.hasTakenAchievementLevelList()) { + getMutableTakenAchievementLevelList().addAll(other.takenAchievementLevelList); + } + return this; + } + + @Override + public Quest clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + finishTime = 0L; + id = 0; + progress = 0; + status = 0; + takenAchievementLevelList.clear(); + return this; + } + + @Override + public Quest clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + takenAchievementLevelList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof Quest)) { + return false; + } + Quest other = (Quest) o; + return bitField0_ == other.bitField0_ + && (!hasFinishTime() || finishTime == other.finishTime) + && (!hasId() || id == other.id) + && (!hasProgress() || progress == other.progress) + && (!hasStatus() || status == other.status) + && (!hasTakenAchievementLevelList() || takenAchievementLevelList.equals(other.takenAchievementLevelList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 104); + output.writeInt64NoTag(finishTime); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(progress); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 40); + output.writeEnumNoTag(status); + } + if ((bitField0_ & 0x00000010) != 0) { + for (int i = 0; i < takenAchievementLevelList.length(); i++) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(takenAchievementLevelList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeInt64SizeNoTag(finishTime); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(progress); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(status); + } + if ((bitField0_ & 0x00000010) != 0) { + size += (1 * takenAchievementLevelList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(takenAchievementLevelList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public Quest mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 104: { + // finishTime + finishTime = input.readInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 24) { + break; + } + } + case 24: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // progress + progress = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 40) { + break; + } + } + case 40: { + // status + final int value = input.readInt32(); + if (QuestStatus.forNumber(value) != null) { + status = value; + bitField0_ |= 0x00000008; + } + tag = input.readTag(); + if (tag != 58) { + break; + } + } + case 58: { + // takenAchievementLevelList [packed=true] + input.readPackedUInt32(takenAchievementLevelList, 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 56: { + // takenAchievementLevelList [packed=false] + tag = input.readRepeatedUInt32(takenAchievementLevelList, tag); + bitField0_ |= 0x00000010; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeInt64(FieldNames.finishTime, finishTime); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.id, id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.progress, progress); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeEnum(FieldNames.status, status, QuestStatus.converter()); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRepeatedUInt32(FieldNames.takenAchievementLevelList, takenAchievementLevelList); + } + output.endObject(); + } + + @Override + public Quest mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1151521280: + case 1347904249: { + if (input.isAtField(FieldNames.finishTime)) { + if (!input.trySkipNullValue()) { + finishTime = input.readInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1001078227: { + if (input.isAtField(FieldNames.progress)) { + if (!input.trySkipNullValue()) { + progress = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -892481550: { + if (input.isAtField(FieldNames.status)) { + if (!input.trySkipNullValue()) { + final QuestStatus value = input.readEnum(QuestStatus.converter()); + if (value != null) { + status = value.getNumber(); + bitField0_ |= 0x00000008; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + case 149879610: + case 1076639233: { + if (input.isAtField(FieldNames.takenAchievementLevelList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(takenAchievementLevelList); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public Quest clone() { + return new Quest().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static Quest parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new Quest(), data).checkInitialized(); + } + + public static Quest parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new Quest(), input).checkInitialized(); + } + + public static Quest parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new Quest(), input).checkInitialized(); + } + + /** + * @return factory for creating Quest messages + */ + public static MessageFactory getFactory() { + return QuestFactory.INSTANCE; + } + + /** + * Protobuf enum {@code QuestStatus} + */ + public enum QuestStatus implements ProtoEnum { + /** + * QUEST_NONE = 0; + */ + QUEST_NONE("QUEST_NONE", 0), + + /** + * QUEST_DOING = 1; + */ + QUEST_DOING("QUEST_DOING", 1), + + /** + * QUEST_FINISH = 2; + */ + QUEST_FINISH("QUEST_FINISH", 2), + + /** + * QUEST_CLOSE = 3; + */ + QUEST_CLOSE("QUEST_CLOSE", 3), + + /** + * QUEST_DELETE = 4; + */ + QUEST_DELETE("QUEST_DELETE", 4); + + /** + * QUEST_NONE = 0; + */ + public static final int QUEST_NONE_VALUE = 0; + + /** + * QUEST_DOING = 1; + */ + public static final int QUEST_DOING_VALUE = 1; + + /** + * QUEST_FINISH = 2; + */ + public static final int QUEST_FINISH_VALUE = 2; + + /** + * QUEST_CLOSE = 3; + */ + public static final int QUEST_CLOSE_VALUE = 3; + + /** + * QUEST_DELETE = 4; + */ + public static final int QUEST_DELETE_VALUE = 4; + + private final String name; + + private final int number; + + private QuestStatus(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * @return the string representation of enum entry + */ + @Override + public String getName() { + return name; + } + + /** + * @return the numeric wire value of this enum entry + */ + @Override + public int getNumber() { + return number; + } + + /** + * @return a converter that maps between this enum's numeric and text representations + */ + public static ProtoEnum.EnumConverter converter() { + return QuestStatusConverter.INSTANCE; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value, or null if unknown. + */ + public static QuestStatus forNumber(int value) { + return QuestStatusConverter.INSTANCE.forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @param other Fallback value in case the value is not known. + * @return The enum associated with the given numeric wire value, or the fallback value if unknown. + */ + public static QuestStatus forNumberOr(int number, QuestStatus other) { + QuestStatus value = forNumber(number); + return value == null ? other : value; + } + + enum QuestStatusConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final QuestStatus[] lookup = new QuestStatus[5]; + + static { + lookup[0] = QUEST_NONE; + lookup[1] = QUEST_DOING; + lookup[2] = QUEST_FINISH; + lookup[3] = QUEST_CLOSE; + lookup[4] = QUEST_DELETE; + } + + @Override + public final QuestStatus forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final QuestStatus forName(final CharSequence value) { + if (value.length() == 10) { + if (ProtoUtil.isEqual("QUEST_NONE", value)) { + return QUEST_NONE; + } + } + if (value.length() == 11) { + if (ProtoUtil.isEqual("QUEST_DOING", value)) { + return QUEST_DOING; + } + if (ProtoUtil.isEqual("QUEST_CLOSE", value)) { + return QUEST_CLOSE; + } + } + if (value.length() == 12) { + if (ProtoUtil.isEqual("QUEST_FINISH", value)) { + return QUEST_FINISH; + } + if (ProtoUtil.isEqual("QUEST_DELETE", value)) { + return QUEST_DELETE; + } + } + return null; + } + } + } + + private enum QuestFactory implements MessageFactory { + INSTANCE; + + @Override + public Quest create() { + return Quest.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName finishTime = FieldName.forField("finishTime", "finish_time"); + + static final FieldName id = FieldName.forField("id"); + + static final FieldName progress = FieldName.forField("progress"); + + static final FieldName status = FieldName.forField("status"); + + static final FieldName takenAchievementLevelList = FieldName.forField("takenAchievementLevelList", "taken_achievement_level_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RelicArchiveOuterClass.java b/src/generated/main/emu/lunarcore/proto/RelicArchiveOuterClass.java new file mode 100644 index 0000000..56712d5 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RelicArchiveOuterClass.java @@ -0,0 +1,339 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class RelicArchiveOuterClass { + /** + * Protobuf type {@code RelicArchive} + */ + public static final class RelicArchive extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 type = 6; + */ + private int type; + + /** + * optional uint32 relic_id = 8; + */ + private int relicId; + + private RelicArchive() { + } + + /** + * @return a new empty instance of {@code RelicArchive} + */ + public static RelicArchive newInstance() { + return new RelicArchive(); + } + + /** + * optional uint32 type = 6; + * @return whether the type field is set + */ + public boolean hasType() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 type = 6; + * @return this + */ + public RelicArchive clearType() { + bitField0_ &= ~0x00000001; + type = 0; + return this; + } + + /** + * optional uint32 type = 6; + * @return the type + */ + public int getType() { + return type; + } + + /** + * optional uint32 type = 6; + * @param value the type to set + * @return this + */ + public RelicArchive setType(final int value) { + bitField0_ |= 0x00000001; + type = value; + return this; + } + + /** + * optional uint32 relic_id = 8; + * @return whether the relicId field is set + */ + public boolean hasRelicId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 relic_id = 8; + * @return this + */ + public RelicArchive clearRelicId() { + bitField0_ &= ~0x00000002; + relicId = 0; + return this; + } + + /** + * optional uint32 relic_id = 8; + * @return the relicId + */ + public int getRelicId() { + return relicId; + } + + /** + * optional uint32 relic_id = 8; + * @param value the relicId to set + * @return this + */ + public RelicArchive setRelicId(final int value) { + bitField0_ |= 0x00000002; + relicId = value; + return this; + } + + @Override + public RelicArchive copyFrom(final RelicArchive other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + type = other.type; + relicId = other.relicId; + } + return this; + } + + @Override + public RelicArchive mergeFrom(final RelicArchive other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasType()) { + setType(other.type); + } + if (other.hasRelicId()) { + setRelicId(other.relicId); + } + return this; + } + + @Override + public RelicArchive clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + type = 0; + relicId = 0; + return this; + } + + @Override + public RelicArchive clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RelicArchive)) { + return false; + } + RelicArchive other = (RelicArchive) o; + return bitField0_ == other.bitField0_ + && (!hasType() || type == other.type) + && (!hasRelicId() || relicId == other.relicId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(type); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(relicId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(type); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(relicId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RelicArchive mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // type + type = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // relicId + relicId = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.type, type); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.relicId, relicId); + } + output.endObject(); + } + + @Override + public RelicArchive mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 3575610: { + if (input.isAtField(FieldNames.type)) { + if (!input.trySkipNullValue()) { + type = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1090714606: + case -547564185: { + if (input.isAtField(FieldNames.relicId)) { + if (!input.trySkipNullValue()) { + relicId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RelicArchive clone() { + return new RelicArchive().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RelicArchive parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RelicArchive(), data).checkInitialized(); + } + + public static RelicArchive parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RelicArchive(), input).checkInitialized(); + } + + public static RelicArchive parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RelicArchive(), input).checkInitialized(); + } + + /** + * @return factory for creating RelicArchive messages + */ + public static MessageFactory getFactory() { + return RelicArchiveFactory.INSTANCE; + } + + private enum RelicArchiveFactory implements MessageFactory { + INSTANCE; + + @Override + public RelicArchive create() { + return RelicArchive.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName type = FieldName.forField("type"); + + static final FieldName relicId = FieldName.forField("relicId", "relic_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SceneBattleInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SceneBattleInfoOuterClass.java index 7434357..9a57c87 100644 --- a/src/generated/main/emu/lunarcore/proto/SceneBattleInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/SceneBattleInfoOuterClass.java @@ -59,6 +59,11 @@ public final class SceneBattleInfoOuterClass { */ private final RepeatedMessage buffList = RepeatedMessage.newEmptyInstance(BattleBuffOuterClass.BattleBuff.getFactory()); + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + */ + private final RepeatedMessage turnSnapshotList = RepeatedMessage.newEmptyInstance(ClientTurnSnapshotOuterClass.ClientTurnSnapshot.getFactory()); + private SceneBattleInfo() { } @@ -462,6 +467,77 @@ public final class SceneBattleInfoOuterClass { return this; } + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * @return whether the turnSnapshotList field is set + */ + public boolean hasTurnSnapshotList() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * @return this + */ + public SceneBattleInfo clearTurnSnapshotList() { + bitField0_ &= ~0x00000100; + turnSnapshotList.clear(); + return this; + } + + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * + * 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 #getMutableTurnSnapshotList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getTurnSnapshotList() { + return turnSnapshotList; + } + + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * + * 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 getMutableTurnSnapshotList( + ) { + bitField0_ |= 0x00000100; + return turnSnapshotList; + } + + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * @param value the turnSnapshotList to add + * @return this + */ + public SceneBattleInfo addTurnSnapshotList( + final ClientTurnSnapshotOuterClass.ClientTurnSnapshot value) { + bitField0_ |= 0x00000100; + turnSnapshotList.add(value); + return this; + } + + /** + * repeated .ClientTurnSnapshot turn_snapshot_list = 219; + * @param values the turnSnapshotList to add + * @return this + */ + public SceneBattleInfo addAllTurnSnapshotList( + final ClientTurnSnapshotOuterClass.ClientTurnSnapshot... values) { + bitField0_ |= 0x00000100; + turnSnapshotList.addAll(values); + return this; + } + @Override public SceneBattleInfo copyFrom(final SceneBattleInfo other) { cachedSize = other.cachedSize; @@ -475,6 +551,7 @@ public final class SceneBattleInfoOuterClass { battleAvatarList.copyFrom(other.battleAvatarList); monsterWaveList.copyFrom(other.monsterWaveList); buffList.copyFrom(other.buffList); + turnSnapshotList.copyFrom(other.turnSnapshotList); } return this; } @@ -509,6 +586,9 @@ public final class SceneBattleInfoOuterClass { if (other.hasBuffList()) { getMutableBuffList().addAll(other.buffList); } + if (other.hasTurnSnapshotList()) { + getMutableTurnSnapshotList().addAll(other.turnSnapshotList); + } return this; } @@ -527,6 +607,7 @@ public final class SceneBattleInfoOuterClass { battleAvatarList.clear(); monsterWaveList.clear(); buffList.clear(); + turnSnapshotList.clear(); return this; } @@ -540,6 +621,7 @@ public final class SceneBattleInfoOuterClass { battleAvatarList.clearQuick(); monsterWaveList.clearQuick(); buffList.clearQuick(); + turnSnapshotList.clearQuick(); return this; } @@ -560,7 +642,8 @@ public final class SceneBattleInfoOuterClass { && (!hasBattleId() || battleId == other.battleId) && (!hasBattleAvatarList() || battleAvatarList.equals(other.battleAvatarList)) && (!hasMonsterWaveList() || monsterWaveList.equals(other.monsterWaveList)) - && (!hasBuffList() || buffList.equals(other.buffList)); + && (!hasBuffList() || buffList.equals(other.buffList)) + && (!hasTurnSnapshotList() || turnSnapshotList.equals(other.turnSnapshotList)); } @Override @@ -603,6 +686,12 @@ public final class SceneBattleInfoOuterClass { output.writeMessageNoTag(buffList.get(i)); } } + if ((bitField0_ & 0x00000100) != 0) { + for (int i = 0; i < turnSnapshotList.length(); i++) { + output.writeRawLittleEndian16((short) 3546); + output.writeMessageNoTag(turnSnapshotList.get(i)); + } + } } @Override @@ -632,6 +721,9 @@ public final class SceneBattleInfoOuterClass { if ((bitField0_ & 0x00000080) != 0) { size += (1 * buffList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(buffList); } + if ((bitField0_ & 0x00000100) != 0) { + size += (2 * turnSnapshotList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(turnSnapshotList); + } return size; } @@ -707,6 +799,14 @@ public final class SceneBattleInfoOuterClass { // buffList tag = input.readRepeatedMessage(buffList, tag); bitField0_ |= 0x00000080; + if (tag != 1754) { + break; + } + } + case 1754: { + // turnSnapshotList + tag = input.readRepeatedMessage(turnSnapshotList, tag); + bitField0_ |= 0x00000100; if (tag != 0) { break; } @@ -752,6 +852,9 @@ public final class SceneBattleInfoOuterClass { if ((bitField0_ & 0x00000080) != 0) { output.writeRepeatedMessage(FieldNames.buffList, buffList); } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRepeatedMessage(FieldNames.turnSnapshotList, turnSnapshotList); + } output.endObject(); } @@ -858,6 +961,18 @@ public final class SceneBattleInfoOuterClass { } break; } + case 716339615: + case 397197815: { + if (input.isAtField(FieldNames.turnSnapshotList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(turnSnapshotList); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -926,6 +1041,8 @@ public final class SceneBattleInfoOuterClass { static final FieldName monsterWaveList = FieldName.forField("monsterWaveList", "monster_wave_list"); static final FieldName buffList = FieldName.forField("buffList", "buff_list"); + + static final FieldName turnSnapshotList = FieldName.forField("turnSnapshotList", "turn_snapshot_list"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java new file mode 100644 index 0000000..c40b6a0 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class SelectChatBubbleCsReqOuterClass { + /** + * Protobuf type {@code SelectChatBubbleCsReq} + */ + public static final class SelectChatBubbleCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 bubble_id = 7; + */ + private int bubbleId; + + private SelectChatBubbleCsReq() { + } + + /** + * @return a new empty instance of {@code SelectChatBubbleCsReq} + */ + public static SelectChatBubbleCsReq newInstance() { + return new SelectChatBubbleCsReq(); + } + + /** + * optional uint32 bubble_id = 7; + * @return whether the bubbleId field is set + */ + public boolean hasBubbleId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 bubble_id = 7; + * @return this + */ + public SelectChatBubbleCsReq clearBubbleId() { + bitField0_ &= ~0x00000001; + bubbleId = 0; + return this; + } + + /** + * optional uint32 bubble_id = 7; + * @return the bubbleId + */ + public int getBubbleId() { + return bubbleId; + } + + /** + * optional uint32 bubble_id = 7; + * @param value the bubbleId to set + * @return this + */ + public SelectChatBubbleCsReq setBubbleId(final int value) { + bitField0_ |= 0x00000001; + bubbleId = value; + return this; + } + + @Override + public SelectChatBubbleCsReq copyFrom(final SelectChatBubbleCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + bubbleId = other.bubbleId; + } + return this; + } + + @Override + public SelectChatBubbleCsReq mergeFrom(final SelectChatBubbleCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBubbleId()) { + setBubbleId(other.bubbleId); + } + return this; + } + + @Override + public SelectChatBubbleCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + bubbleId = 0; + return this; + } + + @Override + public SelectChatBubbleCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectChatBubbleCsReq)) { + return false; + } + SelectChatBubbleCsReq other = (SelectChatBubbleCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasBubbleId() || bubbleId == other.bubbleId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(bubbleId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(bubbleId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectChatBubbleCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 56: { + // bubbleId + bubbleId = input.readUInt32(); + bitField0_ |= 0x00000001; + 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.bubbleId, bubbleId); + } + output.endObject(); + } + + @Override + public SelectChatBubbleCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1640052025: + case 698016174: { + if (input.isAtField(FieldNames.bubbleId)) { + if (!input.trySkipNullValue()) { + bubbleId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectChatBubbleCsReq clone() { + return new SelectChatBubbleCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectChatBubbleCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), data).checkInitialized(); + } + + public static SelectChatBubbleCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), input).checkInitialized(); + } + + public static SelectChatBubbleCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectChatBubbleCsReq messages + */ + public static MessageFactory getFactory() { + return SelectChatBubbleCsReqFactory.INSTANCE; + } + + private enum SelectChatBubbleCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectChatBubbleCsReq create() { + return SelectChatBubbleCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName bubbleId = FieldName.forField("bubbleId", "bubble_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java new file mode 100644 index 0000000..a0617bc --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java @@ -0,0 +1,340 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class SelectChatBubbleScRspOuterClass { + /** + * Protobuf type {@code SelectChatBubbleScRsp} + */ + public static final class SelectChatBubbleScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_chat_bubble = 1; + */ + private int curChatBubble; + + /** + * optional uint32 retcode = 10; + */ + private int retcode; + + private SelectChatBubbleScRsp() { + } + + /** + * @return a new empty instance of {@code SelectChatBubbleScRsp} + */ + public static SelectChatBubbleScRsp newInstance() { + return new SelectChatBubbleScRsp(); + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return whether the curChatBubble field is set + */ + public boolean hasCurChatBubble() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return this + */ + public SelectChatBubbleScRsp clearCurChatBubble() { + bitField0_ &= ~0x00000001; + curChatBubble = 0; + return this; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return the curChatBubble + */ + public int getCurChatBubble() { + return curChatBubble; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @param value the curChatBubble to set + * @return this + */ + public SelectChatBubbleScRsp setCurChatBubble(final int value) { + bitField0_ |= 0x00000001; + curChatBubble = value; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 10; + * @return this + */ + public SelectChatBubbleScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 10; + * @param value the retcode to set + * @return this + */ + public SelectChatBubbleScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + @Override + public SelectChatBubbleScRsp copyFrom(final SelectChatBubbleScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curChatBubble = other.curChatBubble; + retcode = other.retcode; + } + return this; + } + + @Override + public SelectChatBubbleScRsp mergeFrom(final SelectChatBubbleScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurChatBubble()) { + setCurChatBubble(other.curChatBubble); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + return this; + } + + @Override + public SelectChatBubbleScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curChatBubble = 0; + retcode = 0; + return this; + } + + @Override + public SelectChatBubbleScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectChatBubbleScRsp)) { + return false; + } + SelectChatBubbleScRsp other = (SelectChatBubbleScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurChatBubble() || curChatBubble == other.curChatBubble) + && (!hasRetcode() || retcode == other.retcode); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(retcode); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectChatBubbleScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // curChatBubble + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.curChatBubble, curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + output.endObject(); + } + + @Override + public SelectChatBubbleScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 94167140: + case 1828957140: { + if (input.isAtField(FieldNames.curChatBubble)) { + if (!input.trySkipNullValue()) { + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectChatBubbleScRsp clone() { + return new SelectChatBubbleScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectChatBubbleScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), data).checkInitialized(); + } + + public static SelectChatBubbleScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), input).checkInitialized(); + } + + public static SelectChatBubbleScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectChatBubbleScRsp messages + */ + public static MessageFactory getFactory() { + return SelectChatBubbleScRspFactory.INSTANCE; + } + + private enum SelectChatBubbleScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectChatBubbleScRsp create() { + return SelectChatBubbleScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curChatBubble = FieldName.forField("curChatBubble", "cur_chat_bubble"); + + static final FieldName retcode = FieldName.forField("retcode"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java new file mode 100644 index 0000000..f21bdf3 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class SelectPhoneThemeCsReqOuterClass { + /** + * Protobuf type {@code SelectPhoneThemeCsReq} + */ + public static final class SelectPhoneThemeCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 theme_id = 2; + */ + private int themeId; + + private SelectPhoneThemeCsReq() { + } + + /** + * @return a new empty instance of {@code SelectPhoneThemeCsReq} + */ + public static SelectPhoneThemeCsReq newInstance() { + return new SelectPhoneThemeCsReq(); + } + + /** + * optional uint32 theme_id = 2; + * @return whether the themeId field is set + */ + public boolean hasThemeId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 theme_id = 2; + * @return this + */ + public SelectPhoneThemeCsReq clearThemeId() { + bitField0_ &= ~0x00000001; + themeId = 0; + return this; + } + + /** + * optional uint32 theme_id = 2; + * @return the themeId + */ + public int getThemeId() { + return themeId; + } + + /** + * optional uint32 theme_id = 2; + * @param value the themeId to set + * @return this + */ + public SelectPhoneThemeCsReq setThemeId(final int value) { + bitField0_ |= 0x00000001; + themeId = value; + return this; + } + + @Override + public SelectPhoneThemeCsReq copyFrom(final SelectPhoneThemeCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + themeId = other.themeId; + } + return this; + } + + @Override + public SelectPhoneThemeCsReq mergeFrom(final SelectPhoneThemeCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasThemeId()) { + setThemeId(other.themeId); + } + return this; + } + + @Override + public SelectPhoneThemeCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + themeId = 0; + return this; + } + + @Override + public SelectPhoneThemeCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectPhoneThemeCsReq)) { + return false; + } + SelectPhoneThemeCsReq other = (SelectPhoneThemeCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasThemeId() || themeId == other.themeId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(themeId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(themeId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectPhoneThemeCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // themeId + themeId = input.readUInt32(); + bitField0_ |= 0x00000001; + 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.themeId, themeId); + } + output.endObject(); + } + + @Override + public SelectPhoneThemeCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1349701436: + case 1108949841: { + if (input.isAtField(FieldNames.themeId)) { + if (!input.trySkipNullValue()) { + themeId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectPhoneThemeCsReq clone() { + return new SelectPhoneThemeCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectPhoneThemeCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), data).checkInitialized(); + } + + public static SelectPhoneThemeCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), input).checkInitialized(); + } + + public static SelectPhoneThemeCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectPhoneThemeCsReq messages + */ + public static MessageFactory getFactory() { + return SelectPhoneThemeCsReqFactory.INSTANCE; + } + + private enum SelectPhoneThemeCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectPhoneThemeCsReq create() { + return SelectPhoneThemeCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName themeId = FieldName.forField("themeId", "theme_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java new file mode 100644 index 0000000..b1b3beb --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java @@ -0,0 +1,340 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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; + +public final class SelectPhoneThemeScRspOuterClass { + /** + * Protobuf type {@code SelectPhoneThemeScRsp} + */ + public static final class SelectPhoneThemeScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_phone_theme = 6; + */ + private int curPhoneTheme; + + /** + * optional uint32 retcode = 8; + */ + private int retcode; + + private SelectPhoneThemeScRsp() { + } + + /** + * @return a new empty instance of {@code SelectPhoneThemeScRsp} + */ + public static SelectPhoneThemeScRsp newInstance() { + return new SelectPhoneThemeScRsp(); + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return whether the curPhoneTheme field is set + */ + public boolean hasCurPhoneTheme() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return this + */ + public SelectPhoneThemeScRsp clearCurPhoneTheme() { + bitField0_ &= ~0x00000001; + curPhoneTheme = 0; + return this; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return the curPhoneTheme + */ + public int getCurPhoneTheme() { + return curPhoneTheme; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @param value the curPhoneTheme to set + * @return this + */ + public SelectPhoneThemeScRsp setCurPhoneTheme(final int value) { + bitField0_ |= 0x00000001; + curPhoneTheme = value; + return this; + } + + /** + * optional uint32 retcode = 8; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 8; + * @return this + */ + public SelectPhoneThemeScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 8; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 8; + * @param value the retcode to set + * @return this + */ + public SelectPhoneThemeScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + @Override + public SelectPhoneThemeScRsp copyFrom(final SelectPhoneThemeScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curPhoneTheme = other.curPhoneTheme; + retcode = other.retcode; + } + return this; + } + + @Override + public SelectPhoneThemeScRsp mergeFrom(final SelectPhoneThemeScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurPhoneTheme()) { + setCurPhoneTheme(other.curPhoneTheme); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + return this; + } + + @Override + public SelectPhoneThemeScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curPhoneTheme = 0; + retcode = 0; + return this; + } + + @Override + public SelectPhoneThemeScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectPhoneThemeScRsp)) { + return false; + } + SelectPhoneThemeScRsp other = (SelectPhoneThemeScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurPhoneTheme() || curPhoneTheme == other.curPhoneTheme) + && (!hasRetcode() || retcode == other.retcode); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(retcode); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectPhoneThemeScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // curPhoneTheme + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.curPhoneTheme, curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + output.endObject(); + } + + @Override + public SelectPhoneThemeScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 405670747: + case -514634695: { + if (input.isAtField(FieldNames.curPhoneTheme)) { + if (!input.trySkipNullValue()) { + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectPhoneThemeScRsp clone() { + return new SelectPhoneThemeScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectPhoneThemeScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), data).checkInitialized(); + } + + public static SelectPhoneThemeScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), input).checkInitialized(); + } + + public static SelectPhoneThemeScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectPhoneThemeScRsp messages + */ + public static MessageFactory getFactory() { + return SelectPhoneThemeScRspFactory.INSTANCE; + } + + private enum SelectPhoneThemeScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectPhoneThemeScRsp create() { + return SelectPhoneThemeScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curPhoneTheme = FieldName.forField("curPhoneTheme", "cur_phone_theme"); + + static final FieldName retcode = FieldName.forField("retcode"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/ServerAnnounceNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/ServerAnnounceNotifyOuterClass.java new file mode 100644 index 0000000..c31beda --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ServerAnnounceNotifyOuterClass.java @@ -0,0 +1,1276 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; +import us.hebi.quickbuf.Utf8String; + +public final class ServerAnnounceNotifyOuterClass { + /** + * Protobuf type {@code ServerAnnounceNotify} + */ + public static final class ServerAnnounceNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + */ + private final RepeatedMessage announceDataList = RepeatedMessage.newEmptyInstance(AnnounceData.getFactory()); + + private ServerAnnounceNotify() { + } + + /** + * @return a new empty instance of {@code ServerAnnounceNotify} + */ + public static ServerAnnounceNotify newInstance() { + return new ServerAnnounceNotify(); + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * @return whether the announceDataList field is set + */ + public boolean hasAnnounceDataList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * @return this + */ + public ServerAnnounceNotify clearAnnounceDataList() { + bitField0_ &= ~0x00000001; + announceDataList.clear(); + return this; + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * + * 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 #getMutableAnnounceDataList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getAnnounceDataList() { + return announceDataList; + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * + * 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 getMutableAnnounceDataList() { + bitField0_ |= 0x00000001; + return announceDataList; + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * @param value the announceDataList to add + * @return this + */ + public ServerAnnounceNotify addAnnounceDataList(final AnnounceData value) { + bitField0_ |= 0x00000001; + announceDataList.add(value); + return this; + } + + /** + * repeated .ServerAnnounceNotify.AnnounceData announce_data_list = 2; + * @param values the announceDataList to add + * @return this + */ + public ServerAnnounceNotify addAllAnnounceDataList(final AnnounceData... values) { + bitField0_ |= 0x00000001; + announceDataList.addAll(values); + return this; + } + + @Override + public ServerAnnounceNotify copyFrom(final ServerAnnounceNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + announceDataList.copyFrom(other.announceDataList); + } + return this; + } + + @Override + public ServerAnnounceNotify mergeFrom(final ServerAnnounceNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasAnnounceDataList()) { + getMutableAnnounceDataList().addAll(other.announceDataList); + } + return this; + } + + @Override + public ServerAnnounceNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + announceDataList.clear(); + return this; + } + + @Override + public ServerAnnounceNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + announceDataList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ServerAnnounceNotify)) { + return false; + } + ServerAnnounceNotify other = (ServerAnnounceNotify) o; + return bitField0_ == other.bitField0_ + && (!hasAnnounceDataList() || announceDataList.equals(other.announceDataList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < announceDataList.length(); i++) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(announceDataList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * announceDataList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(announceDataList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ServerAnnounceNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 18: { + // announceDataList + tag = input.readRepeatedMessage(announceDataList, tag); + bitField0_ |= 0x00000001; + 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.writeRepeatedMessage(FieldNames.announceDataList, announceDataList); + } + output.endObject(); + } + + @Override + public ServerAnnounceNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1895739121: + case 121672637: { + if (input.isAtField(FieldNames.announceDataList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(announceDataList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ServerAnnounceNotify clone() { + return new ServerAnnounceNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ServerAnnounceNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ServerAnnounceNotify(), data).checkInitialized(); + } + + public static ServerAnnounceNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ServerAnnounceNotify(), input).checkInitialized(); + } + + public static ServerAnnounceNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ServerAnnounceNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating ServerAnnounceNotify messages + */ + public static MessageFactory getFactory() { + return ServerAnnounceNotifyFactory.INSTANCE; + } + + /** + * Protobuf type {@code AnnounceData} + */ + public static final class AnnounceData extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional int64 begin_time = 1; + */ + private long beginTime; + + /** + * optional int64 end_time = 4; + */ + private long endTime; + + /** + * optional uint32 config_id = 6; + */ + private int configId; + + /** + * optional uint32 center_system_frequency = 7; + */ + private int centerSystemFrequency; + + /** + * optional uint32 count_down_frequency = 9; + */ + private int countDownFrequency; + + /** + * optional bool is_center_system_last_5_every_minutes = 11; + */ + private boolean isCenterSystemLast5EveryMinutes; + + /** + * optional string count_down_text = 5; + */ + private final Utf8String countDownText = Utf8String.newEmptyInstance(); + + /** + * optional string center_system_text = 8; + */ + private final Utf8String centerSystemText = Utf8String.newEmptyInstance(); + + /** + * optional string dungeon_confirm_text = 14; + */ + private final Utf8String dungeonConfirmText = Utf8String.newEmptyInstance(); + + private AnnounceData() { + } + + /** + * @return a new empty instance of {@code AnnounceData} + */ + public static AnnounceData newInstance() { + return new AnnounceData(); + } + + /** + * optional int64 begin_time = 1; + * @return whether the beginTime field is set + */ + public boolean hasBeginTime() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional int64 begin_time = 1; + * @return this + */ + public AnnounceData clearBeginTime() { + bitField0_ &= ~0x00000001; + beginTime = 0L; + return this; + } + + /** + * optional int64 begin_time = 1; + * @return the beginTime + */ + public long getBeginTime() { + return beginTime; + } + + /** + * optional int64 begin_time = 1; + * @param value the beginTime to set + * @return this + */ + public AnnounceData setBeginTime(final long value) { + bitField0_ |= 0x00000001; + beginTime = value; + return this; + } + + /** + * optional int64 end_time = 4; + * @return whether the endTime field is set + */ + public boolean hasEndTime() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional int64 end_time = 4; + * @return this + */ + public AnnounceData clearEndTime() { + bitField0_ &= ~0x00000002; + endTime = 0L; + return this; + } + + /** + * optional int64 end_time = 4; + * @return the endTime + */ + public long getEndTime() { + return endTime; + } + + /** + * optional int64 end_time = 4; + * @param value the endTime to set + * @return this + */ + public AnnounceData setEndTime(final long value) { + bitField0_ |= 0x00000002; + endTime = value; + return this; + } + + /** + * optional uint32 config_id = 6; + * @return whether the configId field is set + */ + public boolean hasConfigId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 config_id = 6; + * @return this + */ + public AnnounceData clearConfigId() { + bitField0_ &= ~0x00000004; + configId = 0; + return this; + } + + /** + * optional uint32 config_id = 6; + * @return the configId + */ + public int getConfigId() { + return configId; + } + + /** + * optional uint32 config_id = 6; + * @param value the configId to set + * @return this + */ + public AnnounceData setConfigId(final int value) { + bitField0_ |= 0x00000004; + configId = value; + return this; + } + + /** + * optional uint32 center_system_frequency = 7; + * @return whether the centerSystemFrequency field is set + */ + public boolean hasCenterSystemFrequency() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 center_system_frequency = 7; + * @return this + */ + public AnnounceData clearCenterSystemFrequency() { + bitField0_ &= ~0x00000008; + centerSystemFrequency = 0; + return this; + } + + /** + * optional uint32 center_system_frequency = 7; + * @return the centerSystemFrequency + */ + public int getCenterSystemFrequency() { + return centerSystemFrequency; + } + + /** + * optional uint32 center_system_frequency = 7; + * @param value the centerSystemFrequency to set + * @return this + */ + public AnnounceData setCenterSystemFrequency(final int value) { + bitField0_ |= 0x00000008; + centerSystemFrequency = value; + return this; + } + + /** + * optional uint32 count_down_frequency = 9; + * @return whether the countDownFrequency field is set + */ + public boolean hasCountDownFrequency() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 count_down_frequency = 9; + * @return this + */ + public AnnounceData clearCountDownFrequency() { + bitField0_ &= ~0x00000010; + countDownFrequency = 0; + return this; + } + + /** + * optional uint32 count_down_frequency = 9; + * @return the countDownFrequency + */ + public int getCountDownFrequency() { + return countDownFrequency; + } + + /** + * optional uint32 count_down_frequency = 9; + * @param value the countDownFrequency to set + * @return this + */ + public AnnounceData setCountDownFrequency(final int value) { + bitField0_ |= 0x00000010; + countDownFrequency = value; + return this; + } + + /** + * optional bool is_center_system_last_5_every_minutes = 11; + * @return whether the isCenterSystemLast5EveryMinutes field is set + */ + public boolean hasIsCenterSystemLast5EveryMinutes() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional bool is_center_system_last_5_every_minutes = 11; + * @return this + */ + public AnnounceData clearIsCenterSystemLast5EveryMinutes() { + bitField0_ &= ~0x00000020; + isCenterSystemLast5EveryMinutes = false; + return this; + } + + /** + * optional bool is_center_system_last_5_every_minutes = 11; + * @return the isCenterSystemLast5EveryMinutes + */ + public boolean getIsCenterSystemLast5EveryMinutes() { + return isCenterSystemLast5EveryMinutes; + } + + /** + * optional bool is_center_system_last_5_every_minutes = 11; + * @param value the isCenterSystemLast5EveryMinutes to set + * @return this + */ + public AnnounceData setIsCenterSystemLast5EveryMinutes(final boolean value) { + bitField0_ |= 0x00000020; + isCenterSystemLast5EveryMinutes = value; + return this; + } + + /** + * optional string count_down_text = 5; + * @return whether the countDownText field is set + */ + public boolean hasCountDownText() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional string count_down_text = 5; + * @return this + */ + public AnnounceData clearCountDownText() { + bitField0_ &= ~0x00000040; + countDownText.clear(); + return this; + } + + /** + * optional string count_down_text = 5; + * @return the countDownText + */ + public String getCountDownText() { + return countDownText.getString(); + } + + /** + * optional string count_down_text = 5; + * @return internal {@code Utf8String} representation of countDownText for reading + */ + public Utf8String getCountDownTextBytes() { + return this.countDownText; + } + + /** + * optional string count_down_text = 5; + * @return internal {@code Utf8String} representation of countDownText for modifications + */ + public Utf8String getMutableCountDownTextBytes() { + bitField0_ |= 0x00000040; + return this.countDownText; + } + + /** + * optional string count_down_text = 5; + * @param value the countDownText to set + * @return this + */ + public AnnounceData setCountDownText(final CharSequence value) { + bitField0_ |= 0x00000040; + countDownText.copyFrom(value); + return this; + } + + /** + * optional string count_down_text = 5; + * @param value the countDownText to set + * @return this + */ + public AnnounceData setCountDownText(final Utf8String value) { + bitField0_ |= 0x00000040; + countDownText.copyFrom(value); + return this; + } + + /** + * optional string center_system_text = 8; + * @return whether the centerSystemText field is set + */ + public boolean hasCenterSystemText() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional string center_system_text = 8; + * @return this + */ + public AnnounceData clearCenterSystemText() { + bitField0_ &= ~0x00000080; + centerSystemText.clear(); + return this; + } + + /** + * optional string center_system_text = 8; + * @return the centerSystemText + */ + public String getCenterSystemText() { + return centerSystemText.getString(); + } + + /** + * optional string center_system_text = 8; + * @return internal {@code Utf8String} representation of centerSystemText for reading + */ + public Utf8String getCenterSystemTextBytes() { + return this.centerSystemText; + } + + /** + * optional string center_system_text = 8; + * @return internal {@code Utf8String} representation of centerSystemText for modifications + */ + public Utf8String getMutableCenterSystemTextBytes() { + bitField0_ |= 0x00000080; + return this.centerSystemText; + } + + /** + * optional string center_system_text = 8; + * @param value the centerSystemText to set + * @return this + */ + public AnnounceData setCenterSystemText(final CharSequence value) { + bitField0_ |= 0x00000080; + centerSystemText.copyFrom(value); + return this; + } + + /** + * optional string center_system_text = 8; + * @param value the centerSystemText to set + * @return this + */ + public AnnounceData setCenterSystemText(final Utf8String value) { + bitField0_ |= 0x00000080; + centerSystemText.copyFrom(value); + return this; + } + + /** + * optional string dungeon_confirm_text = 14; + * @return whether the dungeonConfirmText field is set + */ + public boolean hasDungeonConfirmText() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * optional string dungeon_confirm_text = 14; + * @return this + */ + public AnnounceData clearDungeonConfirmText() { + bitField0_ &= ~0x00000100; + dungeonConfirmText.clear(); + return this; + } + + /** + * optional string dungeon_confirm_text = 14; + * @return the dungeonConfirmText + */ + public String getDungeonConfirmText() { + return dungeonConfirmText.getString(); + } + + /** + * optional string dungeon_confirm_text = 14; + * @return internal {@code Utf8String} representation of dungeonConfirmText for reading + */ + public Utf8String getDungeonConfirmTextBytes() { + return this.dungeonConfirmText; + } + + /** + * optional string dungeon_confirm_text = 14; + * @return internal {@code Utf8String} representation of dungeonConfirmText for modifications + */ + public Utf8String getMutableDungeonConfirmTextBytes() { + bitField0_ |= 0x00000100; + return this.dungeonConfirmText; + } + + /** + * optional string dungeon_confirm_text = 14; + * @param value the dungeonConfirmText to set + * @return this + */ + public AnnounceData setDungeonConfirmText(final CharSequence value) { + bitField0_ |= 0x00000100; + dungeonConfirmText.copyFrom(value); + return this; + } + + /** + * optional string dungeon_confirm_text = 14; + * @param value the dungeonConfirmText to set + * @return this + */ + public AnnounceData setDungeonConfirmText(final Utf8String value) { + bitField0_ |= 0x00000100; + dungeonConfirmText.copyFrom(value); + return this; + } + + @Override + public AnnounceData copyFrom(final AnnounceData other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + beginTime = other.beginTime; + endTime = other.endTime; + configId = other.configId; + centerSystemFrequency = other.centerSystemFrequency; + countDownFrequency = other.countDownFrequency; + isCenterSystemLast5EveryMinutes = other.isCenterSystemLast5EveryMinutes; + countDownText.copyFrom(other.countDownText); + centerSystemText.copyFrom(other.centerSystemText); + dungeonConfirmText.copyFrom(other.dungeonConfirmText); + } + return this; + } + + @Override + public AnnounceData mergeFrom(final AnnounceData other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBeginTime()) { + setBeginTime(other.beginTime); + } + if (other.hasEndTime()) { + setEndTime(other.endTime); + } + if (other.hasConfigId()) { + setConfigId(other.configId); + } + if (other.hasCenterSystemFrequency()) { + setCenterSystemFrequency(other.centerSystemFrequency); + } + if (other.hasCountDownFrequency()) { + setCountDownFrequency(other.countDownFrequency); + } + if (other.hasIsCenterSystemLast5EveryMinutes()) { + setIsCenterSystemLast5EveryMinutes(other.isCenterSystemLast5EveryMinutes); + } + if (other.hasCountDownText()) { + getMutableCountDownTextBytes().copyFrom(other.countDownText); + } + if (other.hasCenterSystemText()) { + getMutableCenterSystemTextBytes().copyFrom(other.centerSystemText); + } + if (other.hasDungeonConfirmText()) { + getMutableDungeonConfirmTextBytes().copyFrom(other.dungeonConfirmText); + } + return this; + } + + @Override + public AnnounceData clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + beginTime = 0L; + endTime = 0L; + configId = 0; + centerSystemFrequency = 0; + countDownFrequency = 0; + isCenterSystemLast5EveryMinutes = false; + countDownText.clear(); + centerSystemText.clear(); + dungeonConfirmText.clear(); + return this; + } + + @Override + public AnnounceData clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + countDownText.clear(); + centerSystemText.clear(); + dungeonConfirmText.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof AnnounceData)) { + return false; + } + AnnounceData other = (AnnounceData) o; + return bitField0_ == other.bitField0_ + && (!hasBeginTime() || beginTime == other.beginTime) + && (!hasEndTime() || endTime == other.endTime) + && (!hasConfigId() || configId == other.configId) + && (!hasCenterSystemFrequency() || centerSystemFrequency == other.centerSystemFrequency) + && (!hasCountDownFrequency() || countDownFrequency == other.countDownFrequency) + && (!hasIsCenterSystemLast5EveryMinutes() || isCenterSystemLast5EveryMinutes == other.isCenterSystemLast5EveryMinutes) + && (!hasCountDownText() || countDownText.equals(other.countDownText)) + && (!hasCenterSystemText() || centerSystemText.equals(other.centerSystemText)) + && (!hasDungeonConfirmText() || dungeonConfirmText.equals(other.dungeonConfirmText)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeInt64NoTag(beginTime); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 32); + output.writeInt64NoTag(endTime); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(configId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(centerSystemFrequency); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(countDownFrequency); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 88); + output.writeBoolNoTag(isCenterSystemLast5EveryMinutes); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 42); + output.writeStringNoTag(countDownText); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 66); + output.writeStringNoTag(centerSystemText); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRawByte((byte) 114); + output.writeStringNoTag(dungeonConfirmText); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeInt64SizeNoTag(beginTime); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeInt64SizeNoTag(endTime); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(configId); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(centerSystemFrequency); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(countDownFrequency); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(countDownText); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(centerSystemText); + } + if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(dungeonConfirmText); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public AnnounceData mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // beginTime + beginTime = input.readInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // endTime + endTime = input.readInt64(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 48) { + break; + } + } + case 48: { + // configId + configId = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // centerSystemFrequency + centerSystemFrequency = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // countDownFrequency + countDownFrequency = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // isCenterSystemLast5EveryMinutes + isCenterSystemLast5EveryMinutes = input.readBool(); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // countDownText + input.readString(countDownText); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 66) { + break; + } + } + case 66: { + // centerSystemText + input.readString(centerSystemText); + bitField0_ |= 0x00000080; + tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // dungeonConfirmText + input.readString(dungeonConfirmText); + bitField0_ |= 0x00000100; + 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.writeInt64(FieldNames.beginTime, beginTime); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeInt64(FieldNames.endTime, endTime); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.configId, configId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.centerSystemFrequency, centerSystemFrequency); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.countDownFrequency, countDownFrequency); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeBool(FieldNames.isCenterSystemLast5EveryMinutes, isCenterSystemLast5EveryMinutes); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeString(FieldNames.countDownText, countDownText); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeString(FieldNames.centerSystemText, centerSystemText); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeString(FieldNames.dungeonConfirmText, dungeonConfirmText); + } + output.endObject(); + } + + @Override + public AnnounceData mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1072839914: + case 1112183971: { + if (input.isAtField(FieldNames.beginTime)) { + if (!input.trySkipNullValue()) { + beginTime = input.readInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1607243192: + case 1725551537: { + if (input.isAtField(FieldNames.endTime)) { + if (!input.trySkipNullValue()) { + endTime = input.readInt64(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -580140035: + case -804450504: { + if (input.isAtField(FieldNames.configId)) { + if (!input.trySkipNullValue()) { + configId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1285402920: + case 671051254: { + if (input.isAtField(FieldNames.centerSystemFrequency)) { + if (!input.trySkipNullValue()) { + centerSystemFrequency = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1551558155: + case -1526415569: { + if (input.isAtField(FieldNames.countDownFrequency)) { + if (!input.trySkipNullValue()) { + countDownFrequency = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case -68660299: + case -630028317: { + if (input.isAtField(FieldNames.isCenterSystemLast5EveryMinutes)) { + if (!input.trySkipNullValue()) { + isCenterSystemLast5EveryMinutes = input.readBool(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case 515044126: + case 1806103418: { + if (input.isAtField(FieldNames.countDownText)) { + if (!input.trySkipNullValue()) { + input.readString(countDownText); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1011450319: + case 1305338963: { + if (input.isAtField(FieldNames.centerSystemText)) { + if (!input.trySkipNullValue()) { + input.readString(centerSystemText); + bitField0_ |= 0x00000080; + } + } else { + input.skipUnknownField(); + } + break; + } + case 136983795: + case 1723587761: { + if (input.isAtField(FieldNames.dungeonConfirmText)) { + if (!input.trySkipNullValue()) { + input.readString(dungeonConfirmText); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public AnnounceData clone() { + return new AnnounceData().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static AnnounceData parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new AnnounceData(), data).checkInitialized(); + } + + public static AnnounceData parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new AnnounceData(), input).checkInitialized(); + } + + public static AnnounceData parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new AnnounceData(), input).checkInitialized(); + } + + /** + * @return factory for creating AnnounceData messages + */ + public static MessageFactory getFactory() { + return AnnounceDataFactory.INSTANCE; + } + + private enum AnnounceDataFactory implements MessageFactory { + INSTANCE; + + @Override + public AnnounceData create() { + return AnnounceData.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName beginTime = FieldName.forField("beginTime", "begin_time"); + + static final FieldName endTime = FieldName.forField("endTime", "end_time"); + + static final FieldName configId = FieldName.forField("configId", "config_id"); + + static final FieldName centerSystemFrequency = FieldName.forField("centerSystemFrequency", "center_system_frequency"); + + static final FieldName countDownFrequency = FieldName.forField("countDownFrequency", "count_down_frequency"); + + static final FieldName isCenterSystemLast5EveryMinutes = FieldName.forField("isCenterSystemLast5EveryMinutes", "is_center_system_last_5_every_minutes"); + + static final FieldName countDownText = FieldName.forField("countDownText", "count_down_text"); + + static final FieldName centerSystemText = FieldName.forField("centerSystemText", "center_system_text"); + + static final FieldName dungeonConfirmText = FieldName.forField("dungeonConfirmText", "dungeon_confirm_text"); + } + } + + private enum ServerAnnounceNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public ServerAnnounceNotify create() { + return ServerAnnounceNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName announceDataList = FieldName.forField("announceDataList", "announce_data_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java index 23bb698..8bd432b 100644 --- a/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java @@ -39,6 +39,11 @@ public final class SimpleInfoOuterClass { */ private int uid; + /** + * optional uint32 chat_bubble_id = 13; + */ + private int chatBubbleId; + /** * optional .PlatformType platform_type = 7; */ @@ -222,12 +227,49 @@ public final class SimpleInfoOuterClass { return this; } + /** + * optional uint32 chat_bubble_id = 13; + * @return whether the chatBubbleId field is set + */ + public boolean hasChatBubbleId() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 chat_bubble_id = 13; + * @return this + */ + public SimpleInfo clearChatBubbleId() { + bitField0_ &= ~0x00000010; + chatBubbleId = 0; + return this; + } + + /** + * optional uint32 chat_bubble_id = 13; + * @return the chatBubbleId + */ + public int getChatBubbleId() { + return chatBubbleId; + } + + /** + * optional uint32 chat_bubble_id = 13; + * @param value the chatBubbleId to set + * @return this + */ + public SimpleInfo setChatBubbleId(final int value) { + bitField0_ |= 0x00000010; + chatBubbleId = value; + return this; + } + /** * optional .PlatformType platform_type = 7; * @return whether the platformType field is set */ public boolean hasPlatformType() { - return (bitField0_ & 0x00000010) != 0; + return (bitField0_ & 0x00000020) != 0; } /** @@ -235,7 +277,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo clearPlatformType() { - bitField0_ &= ~0x00000010; + bitField0_ &= ~0x00000020; platformType = 0; return this; } @@ -268,7 +310,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setPlatformTypeValue(final int value) { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; platformType = value; return this; } @@ -279,7 +321,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setPlatformType(final PlatformTypeOuterClass.PlatformType value) { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; platformType = value.getNumber(); return this; } @@ -289,7 +331,7 @@ public final class SimpleInfoOuterClass { * @return whether the onlineStatus field is set */ public boolean hasOnlineStatus() { - return (bitField0_ & 0x00000020) != 0; + return (bitField0_ & 0x00000040) != 0; } /** @@ -297,7 +339,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo clearOnlineStatus() { - bitField0_ &= ~0x00000020; + bitField0_ &= ~0x00000040; onlineStatus = 0; return this; } @@ -330,7 +372,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setOnlineStatusValue(final int value) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onlineStatus = value; return this; } @@ -341,7 +383,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setOnlineStatus(final FriendOnlineStatusOuterClass.FriendOnlineStatus value) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onlineStatus = value.getNumber(); return this; } @@ -351,7 +393,7 @@ public final class SimpleInfoOuterClass { * @return whether the simpleAvatarInfo field is set */ public boolean hasSimpleAvatarInfo() { - return (bitField0_ & 0x00000040) != 0; + return (bitField0_ & 0x00000080) != 0; } /** @@ -359,7 +401,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo clearSimpleAvatarInfo() { - bitField0_ &= ~0x00000040; + bitField0_ &= ~0x00000080; simpleAvatarInfo.clear(); return this; } @@ -388,7 +430,7 @@ public final class SimpleInfoOuterClass { * @return internal storage object for modifications */ public SimpleAvatarInfoOuterClass.SimpleAvatarInfo getMutableSimpleAvatarInfo() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; return simpleAvatarInfo; } @@ -398,7 +440,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setSimpleAvatarInfo(final SimpleAvatarInfoOuterClass.SimpleAvatarInfo value) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; simpleAvatarInfo.copyFrom(value); return this; } @@ -408,7 +450,7 @@ public final class SimpleInfoOuterClass { * @return whether the nickname field is set */ public boolean hasNickname() { - return (bitField0_ & 0x00000080) != 0; + return (bitField0_ & 0x00000100) != 0; } /** @@ -416,7 +458,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo clearNickname() { - bitField0_ &= ~0x00000080; + bitField0_ &= ~0x00000100; nickname.clear(); return this; } @@ -442,7 +484,7 @@ public final class SimpleInfoOuterClass { * @return internal {@code Utf8String} representation of nickname for modifications */ public Utf8String getMutableNicknameBytes() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; return this.nickname; } @@ -452,7 +494,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setNickname(final CharSequence value) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; nickname.copyFrom(value); return this; } @@ -463,7 +505,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setNickname(final Utf8String value) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; nickname.copyFrom(value); return this; } @@ -473,7 +515,7 @@ public final class SimpleInfoOuterClass { * @return whether the signature field is set */ public boolean hasSignature() { - return (bitField0_ & 0x00000100) != 0; + return (bitField0_ & 0x00000200) != 0; } /** @@ -481,7 +523,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo clearSignature() { - bitField0_ &= ~0x00000100; + bitField0_ &= ~0x00000200; signature.clear(); return this; } @@ -507,7 +549,7 @@ public final class SimpleInfoOuterClass { * @return internal {@code Utf8String} representation of signature for modifications */ public Utf8String getMutableSignatureBytes() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; return this.signature; } @@ -517,7 +559,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setSignature(final CharSequence value) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; signature.copyFrom(value); return this; } @@ -528,7 +570,7 @@ public final class SimpleInfoOuterClass { * @return this */ public SimpleInfo setSignature(final Utf8String value) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; signature.copyFrom(value); return this; } @@ -542,6 +584,7 @@ public final class SimpleInfoOuterClass { level = other.level; headIcon = other.headIcon; uid = other.uid; + chatBubbleId = other.chatBubbleId; platformType = other.platformType; onlineStatus = other.onlineStatus; simpleAvatarInfo.copyFrom(other.simpleAvatarInfo); @@ -569,6 +612,9 @@ public final class SimpleInfoOuterClass { if (other.hasUid()) { setUid(other.uid); } + if (other.hasChatBubbleId()) { + setChatBubbleId(other.chatBubbleId); + } if (other.hasPlatformType()) { setPlatformTypeValue(other.platformType); } @@ -598,6 +644,7 @@ public final class SimpleInfoOuterClass { level = 0; headIcon = 0; uid = 0; + chatBubbleId = 0; platformType = 0; onlineStatus = 0; simpleAvatarInfo.clear(); @@ -633,6 +680,7 @@ public final class SimpleInfoOuterClass { && (!hasLevel() || level == other.level) && (!hasHeadIcon() || headIcon == other.headIcon) && (!hasUid() || uid == other.uid) + && (!hasChatBubbleId() || chatBubbleId == other.chatBubbleId) && (!hasPlatformType() || platformType == other.platformType) && (!hasOnlineStatus() || onlineStatus == other.onlineStatus) && (!hasSimpleAvatarInfo() || simpleAvatarInfo.equals(other.simpleAvatarInfo)) @@ -659,22 +707,26 @@ public final class SimpleInfoOuterClass { output.writeUInt32NoTag(uid); } if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(chatBubbleId); + } + if ((bitField0_ & 0x00000020) != 0) { output.writeRawByte((byte) 56); output.writeEnumNoTag(platformType); } - if ((bitField0_ & 0x00000020) != 0) { + if ((bitField0_ & 0x00000040) != 0) { output.writeRawByte((byte) 120); output.writeEnumNoTag(onlineStatus); } - if ((bitField0_ & 0x00000040) != 0) { + if ((bitField0_ & 0x00000080) != 0) { output.writeRawByte((byte) 26); output.writeMessageNoTag(simpleAvatarInfo); } - if ((bitField0_ & 0x00000080) != 0) { + if ((bitField0_ & 0x00000100) != 0) { output.writeRawByte((byte) 34); output.writeStringNoTag(nickname); } - if ((bitField0_ & 0x00000100) != 0) { + if ((bitField0_ & 0x00000200) != 0) { output.writeRawByte((byte) 74); output.writeStringNoTag(signature); } @@ -696,18 +748,21 @@ public final class SimpleInfoOuterClass { size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); } if ((bitField0_ & 0x00000010) != 0) { - size += 1 + ProtoSink.computeEnumSizeNoTag(platformType); + size += 1 + ProtoSink.computeUInt32SizeNoTag(chatBubbleId); } if ((bitField0_ & 0x00000020) != 0) { - size += 1 + ProtoSink.computeEnumSizeNoTag(onlineStatus); + size += 1 + ProtoSink.computeEnumSizeNoTag(platformType); } if ((bitField0_ & 0x00000040) != 0) { - size += 1 + ProtoSink.computeMessageSizeNoTag(simpleAvatarInfo); + size += 1 + ProtoSink.computeEnumSizeNoTag(onlineStatus); } if ((bitField0_ & 0x00000080) != 0) { - size += 1 + ProtoSink.computeStringSizeNoTag(nickname); + size += 1 + ProtoSink.computeMessageSizeNoTag(simpleAvatarInfo); } if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(nickname); + } + if ((bitField0_ & 0x00000200) != 0) { size += 1 + ProtoSink.computeStringSizeNoTag(signature); } return size; @@ -752,6 +807,15 @@ public final class SimpleInfoOuterClass { uid = input.readUInt32(); bitField0_ |= 0x00000008; tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // chatBubbleId + chatBubbleId = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); if (tag != 56) { break; } @@ -761,7 +825,7 @@ public final class SimpleInfoOuterClass { final int value = input.readInt32(); if (PlatformTypeOuterClass.PlatformType.forNumber(value) != null) { platformType = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; } tag = input.readTag(); if (tag != 120) { @@ -773,7 +837,7 @@ public final class SimpleInfoOuterClass { final int value = input.readInt32(); if (FriendOnlineStatusOuterClass.FriendOnlineStatus.forNumber(value) != null) { onlineStatus = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; } tag = input.readTag(); if (tag != 26) { @@ -783,7 +847,7 @@ public final class SimpleInfoOuterClass { case 26: { // simpleAvatarInfo input.readMessage(simpleAvatarInfo); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; tag = input.readTag(); if (tag != 34) { break; @@ -792,7 +856,7 @@ public final class SimpleInfoOuterClass { case 34: { // nickname input.readString(nickname); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; tag = input.readTag(); if (tag != 74) { break; @@ -801,7 +865,7 @@ public final class SimpleInfoOuterClass { case 74: { // signature input.readString(signature); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; tag = input.readTag(); if (tag != 0) { break; @@ -837,18 +901,21 @@ public final class SimpleInfoOuterClass { output.writeUInt32(FieldNames.uid, uid); } if ((bitField0_ & 0x00000010) != 0) { - output.writeEnum(FieldNames.platformType, platformType, PlatformTypeOuterClass.PlatformType.converter()); + output.writeUInt32(FieldNames.chatBubbleId, chatBubbleId); } if ((bitField0_ & 0x00000020) != 0) { - output.writeEnum(FieldNames.onlineStatus, onlineStatus, FriendOnlineStatusOuterClass.FriendOnlineStatus.converter()); + output.writeEnum(FieldNames.platformType, platformType, PlatformTypeOuterClass.PlatformType.converter()); } if ((bitField0_ & 0x00000040) != 0) { - output.writeMessage(FieldNames.simpleAvatarInfo, simpleAvatarInfo); + output.writeEnum(FieldNames.onlineStatus, onlineStatus, FriendOnlineStatusOuterClass.FriendOnlineStatus.converter()); } if ((bitField0_ & 0x00000080) != 0) { - output.writeString(FieldNames.nickname, nickname); + output.writeMessage(FieldNames.simpleAvatarInfo, simpleAvatarInfo); } if ((bitField0_ & 0x00000100) != 0) { + output.writeString(FieldNames.nickname, nickname); + } + if ((bitField0_ & 0x00000200) != 0) { output.writeString(FieldNames.signature, signature); } output.endObject(); @@ -907,6 +974,18 @@ public final class SimpleInfoOuterClass { } break; } + case -678761921: + case 1892426119: { + if (input.isAtField(FieldNames.chatBubbleId)) { + if (!input.trySkipNullValue()) { + chatBubbleId = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } case 155581005: case 538062726: { if (input.isAtField(FieldNames.platformType)) { @@ -914,7 +993,7 @@ public final class SimpleInfoOuterClass { final PlatformTypeOuterClass.PlatformType value = input.readEnum(PlatformTypeOuterClass.PlatformType.converter()); if (value != null) { platformType = value.getNumber(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; } else { input.skipUnknownEnumValue(); } @@ -931,7 +1010,7 @@ public final class SimpleInfoOuterClass { final FriendOnlineStatusOuterClass.FriendOnlineStatus value = input.readEnum(FriendOnlineStatusOuterClass.FriendOnlineStatus.converter()); if (value != null) { onlineStatus = value.getNumber(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; } else { input.skipUnknownEnumValue(); } @@ -946,7 +1025,7 @@ public final class SimpleInfoOuterClass { if (input.isAtField(FieldNames.simpleAvatarInfo)) { if (!input.trySkipNullValue()) { input.readMessage(simpleAvatarInfo); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; } } else { input.skipUnknownField(); @@ -957,7 +1036,7 @@ public final class SimpleInfoOuterClass { if (input.isAtField(FieldNames.nickname)) { if (!input.trySkipNullValue()) { input.readString(nickname); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; } } else { input.skipUnknownField(); @@ -968,7 +1047,7 @@ public final class SimpleInfoOuterClass { if (input.isAtField(FieldNames.signature)) { if (!input.trySkipNullValue()) { input.readString(signature); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; } } else { input.skipUnknownField(); @@ -1035,6 +1114,8 @@ public final class SimpleInfoOuterClass { static final FieldName uid = FieldName.forField("uid"); + static final FieldName chatBubbleId = FieldName.forField("chatBubbleId", "chat_bubble_id"); + static final FieldName platformType = FieldName.forField("platformType", "platform_type"); static final FieldName onlineStatus = FieldName.forField("onlineStatus", "online_status"); diff --git a/src/generated/main/emu/lunarcore/proto/TextJoinQueryCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/TextJoinQueryCsReqOuterClass.java new file mode 100644 index 0000000..b3ce615 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/TextJoinQueryCsReqOuterClass.java @@ -0,0 +1,301 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; + +public final class TextJoinQueryCsReqOuterClass { + /** + * Protobuf type {@code TextJoinQueryCsReq} + */ + public static final class TextJoinQueryCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 text_join_id_list = 7; + */ + private final RepeatedInt textJoinIdList = RepeatedInt.newEmptyInstance(); + + private TextJoinQueryCsReq() { + } + + /** + * @return a new empty instance of {@code TextJoinQueryCsReq} + */ + public static TextJoinQueryCsReq newInstance() { + return new TextJoinQueryCsReq(); + } + + /** + * repeated uint32 text_join_id_list = 7; + * @return whether the textJoinIdList field is set + */ + public boolean hasTextJoinIdList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 text_join_id_list = 7; + * @return this + */ + public TextJoinQueryCsReq clearTextJoinIdList() { + bitField0_ &= ~0x00000001; + textJoinIdList.clear(); + return this; + } + + /** + * repeated uint32 text_join_id_list = 7; + * + * 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 #getMutableTextJoinIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getTextJoinIdList() { + return textJoinIdList; + } + + /** + * repeated uint32 text_join_id_list = 7; + * + * 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 getMutableTextJoinIdList() { + bitField0_ |= 0x00000001; + return textJoinIdList; + } + + /** + * repeated uint32 text_join_id_list = 7; + * @param value the textJoinIdList to add + * @return this + */ + public TextJoinQueryCsReq addTextJoinIdList(final int value) { + bitField0_ |= 0x00000001; + textJoinIdList.add(value); + return this; + } + + /** + * repeated uint32 text_join_id_list = 7; + * @param values the textJoinIdList to add + * @return this + */ + public TextJoinQueryCsReq addAllTextJoinIdList(final int... values) { + bitField0_ |= 0x00000001; + textJoinIdList.addAll(values); + return this; + } + + @Override + public TextJoinQueryCsReq copyFrom(final TextJoinQueryCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + textJoinIdList.copyFrom(other.textJoinIdList); + } + return this; + } + + @Override + public TextJoinQueryCsReq mergeFrom(final TextJoinQueryCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTextJoinIdList()) { + getMutableTextJoinIdList().addAll(other.textJoinIdList); + } + return this; + } + + @Override + public TextJoinQueryCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + textJoinIdList.clear(); + return this; + } + + @Override + public TextJoinQueryCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + textJoinIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof TextJoinQueryCsReq)) { + return false; + } + TextJoinQueryCsReq other = (TextJoinQueryCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasTextJoinIdList() || textJoinIdList.equals(other.textJoinIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < textJoinIdList.length(); i++) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(textJoinIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * textJoinIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(textJoinIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public TextJoinQueryCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 58: { + // textJoinIdList [packed=true] + input.readPackedUInt32(textJoinIdList, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 56: { + // textJoinIdList [packed=false] + tag = input.readRepeatedUInt32(textJoinIdList, tag); + bitField0_ |= 0x00000001; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.textJoinIdList, textJoinIdList); + } + output.endObject(); + } + + @Override + public TextJoinQueryCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1149123376: + case 449627391: { + if (input.isAtField(FieldNames.textJoinIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(textJoinIdList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public TextJoinQueryCsReq clone() { + return new TextJoinQueryCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static TextJoinQueryCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new TextJoinQueryCsReq(), data).checkInitialized(); + } + + public static TextJoinQueryCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinQueryCsReq(), input).checkInitialized(); + } + + public static TextJoinQueryCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinQueryCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating TextJoinQueryCsReq messages + */ + public static MessageFactory getFactory() { + return TextJoinQueryCsReqFactory.INSTANCE; + } + + private enum TextJoinQueryCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public TextJoinQueryCsReq create() { + return TextJoinQueryCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName textJoinIdList = FieldName.forField("textJoinIdList", "text_join_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/TextJoinQueryScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/TextJoinQueryScRspOuterClass.java new file mode 100644 index 0000000..9dd489e --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/TextJoinQueryScRspOuterClass.java @@ -0,0 +1,701 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedMessage; + +public final class TextJoinQueryScRspOuterClass { + /** + * Protobuf type {@code TextJoinQueryScRsp} + */ + public static final class TextJoinQueryScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 13; + */ + private int retcode; + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + */ + private final RepeatedMessage textJoinList = RepeatedMessage.newEmptyInstance(TextJoinInfo.getFactory()); + + private TextJoinQueryScRsp() { + } + + /** + * @return a new empty instance of {@code TextJoinQueryScRsp} + */ + public static TextJoinQueryScRsp newInstance() { + return new TextJoinQueryScRsp(); + } + + /** + * optional uint32 retcode = 13; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 13; + * @return this + */ + public TextJoinQueryScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 13; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 13; + * @param value the retcode to set + * @return this + */ + public TextJoinQueryScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * @return whether the textJoinList field is set + */ + public boolean hasTextJoinList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * @return this + */ + public TextJoinQueryScRsp clearTextJoinList() { + bitField0_ &= ~0x00000002; + textJoinList.clear(); + return this; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * + * 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 #getMutableTextJoinList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getTextJoinList() { + return textJoinList; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * + * 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 getMutableTextJoinList() { + bitField0_ |= 0x00000002; + return textJoinList; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * @param value the textJoinList to add + * @return this + */ + public TextJoinQueryScRsp addTextJoinList(final TextJoinInfo value) { + bitField0_ |= 0x00000002; + textJoinList.add(value); + return this; + } + + /** + * repeated .TextJoinQueryScRsp.TextJoinInfo text_join_list = 4; + * @param values the textJoinList to add + * @return this + */ + public TextJoinQueryScRsp addAllTextJoinList(final TextJoinInfo... values) { + bitField0_ |= 0x00000002; + textJoinList.addAll(values); + return this; + } + + @Override + public TextJoinQueryScRsp copyFrom(final TextJoinQueryScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + textJoinList.copyFrom(other.textJoinList); + } + return this; + } + + @Override + public TextJoinQueryScRsp mergeFrom(final TextJoinQueryScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasTextJoinList()) { + getMutableTextJoinList().addAll(other.textJoinList); + } + return this; + } + + @Override + public TextJoinQueryScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + textJoinList.clear(); + return this; + } + + @Override + public TextJoinQueryScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + textJoinList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof TextJoinQueryScRsp)) { + return false; + } + TextJoinQueryScRsp other = (TextJoinQueryScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasTextJoinList() || textJoinList.equals(other.textJoinList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < textJoinList.length(); i++) { + output.writeRawByte((byte) 34); + output.writeMessageNoTag(textJoinList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * textJoinList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(textJoinList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public TextJoinQueryScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 104: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 34) { + break; + } + } + case 34: { + // textJoinList + tag = input.readRepeatedMessage(textJoinList, tag); + bitField0_ |= 0x00000002; + 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.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.textJoinList, textJoinList); + } + output.endObject(); + } + + @Override + public TextJoinQueryScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1670215371: + case 249668097: { + if (input.isAtField(FieldNames.textJoinList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(textJoinList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public TextJoinQueryScRsp clone() { + return new TextJoinQueryScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static TextJoinQueryScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new TextJoinQueryScRsp(), data).checkInitialized(); + } + + public static TextJoinQueryScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinQueryScRsp(), input).checkInitialized(); + } + + public static TextJoinQueryScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinQueryScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating TextJoinQueryScRsp messages + */ + public static MessageFactory getFactory() { + return TextJoinQueryScRspFactory.INSTANCE; + } + + /** + * Protobuf type {@code TextJoinInfo} + */ + public static final class TextJoinInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 text_item_id = 2; + */ + private int textItemId; + + /** + * optional uint32 text_item_config_id = 3; + */ + private int textItemConfigId; + + private TextJoinInfo() { + } + + /** + * @return a new empty instance of {@code TextJoinInfo} + */ + public static TextJoinInfo newInstance() { + return new TextJoinInfo(); + } + + /** + * optional uint32 text_item_id = 2; + * @return whether the textItemId field is set + */ + public boolean hasTextItemId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 text_item_id = 2; + * @return this + */ + public TextJoinInfo clearTextItemId() { + bitField0_ &= ~0x00000001; + textItemId = 0; + return this; + } + + /** + * optional uint32 text_item_id = 2; + * @return the textItemId + */ + public int getTextItemId() { + return textItemId; + } + + /** + * optional uint32 text_item_id = 2; + * @param value the textItemId to set + * @return this + */ + public TextJoinInfo setTextItemId(final int value) { + bitField0_ |= 0x00000001; + textItemId = value; + return this; + } + + /** + * optional uint32 text_item_config_id = 3; + * @return whether the textItemConfigId field is set + */ + public boolean hasTextItemConfigId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 text_item_config_id = 3; + * @return this + */ + public TextJoinInfo clearTextItemConfigId() { + bitField0_ &= ~0x00000002; + textItemConfigId = 0; + return this; + } + + /** + * optional uint32 text_item_config_id = 3; + * @return the textItemConfigId + */ + public int getTextItemConfigId() { + return textItemConfigId; + } + + /** + * optional uint32 text_item_config_id = 3; + * @param value the textItemConfigId to set + * @return this + */ + public TextJoinInfo setTextItemConfigId(final int value) { + bitField0_ |= 0x00000002; + textItemConfigId = value; + return this; + } + + @Override + public TextJoinInfo copyFrom(final TextJoinInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + textItemId = other.textItemId; + textItemConfigId = other.textItemConfigId; + } + return this; + } + + @Override + public TextJoinInfo mergeFrom(final TextJoinInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTextItemId()) { + setTextItemId(other.textItemId); + } + if (other.hasTextItemConfigId()) { + setTextItemConfigId(other.textItemConfigId); + } + return this; + } + + @Override + public TextJoinInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + textItemId = 0; + textItemConfigId = 0; + return this; + } + + @Override + public TextJoinInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof TextJoinInfo)) { + return false; + } + TextJoinInfo other = (TextJoinInfo) o; + return bitField0_ == other.bitField0_ + && (!hasTextItemId() || textItemId == other.textItemId) + && (!hasTextItemConfigId() || textItemConfigId == other.textItemConfigId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(textItemId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(textItemConfigId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(textItemId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(textItemConfigId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public TextJoinInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // textItemId + textItemId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 24) { + break; + } + } + case 24: { + // textItemConfigId + textItemConfigId = input.readUInt32(); + bitField0_ |= 0x00000002; + 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.textItemId, textItemId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.textItemConfigId, textItemConfigId); + } + output.endObject(); + } + + @Override + public TextJoinInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1565189915: + case -153409355: { + if (input.isAtField(FieldNames.textItemId)) { + if (!input.trySkipNullValue()) { + textItemId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1448403459: + case -1174236578: { + if (input.isAtField(FieldNames.textItemConfigId)) { + if (!input.trySkipNullValue()) { + textItemConfigId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public TextJoinInfo clone() { + return new TextJoinInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static TextJoinInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new TextJoinInfo(), data).checkInitialized(); + } + + public static TextJoinInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinInfo(), input).checkInitialized(); + } + + public static TextJoinInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new TextJoinInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating TextJoinInfo messages + */ + public static MessageFactory getFactory() { + return TextJoinInfoFactory.INSTANCE; + } + + private enum TextJoinInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public TextJoinInfo create() { + return TextJoinInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName textItemId = FieldName.forField("textItemId", "text_item_id"); + + static final FieldName textItemConfigId = FieldName.forField("textItemConfigId", "text_item_config_id"); + } + } + + private enum TextJoinQueryScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public TextJoinQueryScRsp create() { + return TextJoinQueryScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName textJoinList = FieldName.forField("textJoinList", "text_join_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java new file mode 100644 index 0000000..8bc796a --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java @@ -0,0 +1,301 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; + +public final class UnlockBackGroundMusicCsReqOuterClass { + /** + * Protobuf type {@code UnlockBackGroundMusicCsReq} + */ + public static final class UnlockBackGroundMusicCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 unlock_ids = 11; + */ + private final RepeatedInt unlockIds = RepeatedInt.newEmptyInstance(); + + private UnlockBackGroundMusicCsReq() { + } + + /** + * @return a new empty instance of {@code UnlockBackGroundMusicCsReq} + */ + public static UnlockBackGroundMusicCsReq newInstance() { + return new UnlockBackGroundMusicCsReq(); + } + + /** + * repeated uint32 unlock_ids = 11; + * @return whether the unlockIds field is set + */ + public boolean hasUnlockIds() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 unlock_ids = 11; + * @return this + */ + public UnlockBackGroundMusicCsReq clearUnlockIds() { + bitField0_ &= ~0x00000001; + unlockIds.clear(); + return this; + } + + /** + * repeated uint32 unlock_ids = 11; + * + * 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 #getMutableUnlockIds()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getUnlockIds() { + return unlockIds; + } + + /** + * repeated uint32 unlock_ids = 11; + * + * 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 getMutableUnlockIds() { + bitField0_ |= 0x00000001; + return unlockIds; + } + + /** + * repeated uint32 unlock_ids = 11; + * @param value the unlockIds to add + * @return this + */ + public UnlockBackGroundMusicCsReq addUnlockIds(final int value) { + bitField0_ |= 0x00000001; + unlockIds.add(value); + return this; + } + + /** + * repeated uint32 unlock_ids = 11; + * @param values the unlockIds to add + * @return this + */ + public UnlockBackGroundMusicCsReq addAllUnlockIds(final int... values) { + bitField0_ |= 0x00000001; + unlockIds.addAll(values); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq copyFrom(final UnlockBackGroundMusicCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + unlockIds.copyFrom(other.unlockIds); + } + return this; + } + + @Override + public UnlockBackGroundMusicCsReq mergeFrom(final UnlockBackGroundMusicCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUnlockIds()) { + getMutableUnlockIds().addAll(other.unlockIds); + } + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockIds.clear(); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockIds.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockBackGroundMusicCsReq)) { + return false; + } + UnlockBackGroundMusicCsReq other = (UnlockBackGroundMusicCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasUnlockIds() || unlockIds.equals(other.unlockIds)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < unlockIds.length(); i++) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(unlockIds.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * unlockIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(unlockIds); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockBackGroundMusicCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 90: { + // unlockIds [packed=true] + input.readPackedUInt32(unlockIds, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 88: { + // unlockIds [packed=false] + tag = input.readRepeatedUInt32(unlockIds, tag); + bitField0_ |= 0x00000001; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.unlockIds, unlockIds); + } + output.endObject(); + } + + @Override + public UnlockBackGroundMusicCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 2050476244: + case -859086019: { + if (input.isAtField(FieldNames.unlockIds)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(unlockIds); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clone() { + return new UnlockBackGroundMusicCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), data).checkInitialized(); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), input).checkInitialized(); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockBackGroundMusicCsReq messages + */ + public static MessageFactory getFactory() { + return UnlockBackGroundMusicCsReqFactory.INSTANCE; + } + + private enum UnlockBackGroundMusicCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockBackGroundMusicCsReq create() { + return UnlockBackGroundMusicCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName unlockIds = FieldName.forField("unlockIds", "unlock_ids"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java new file mode 100644 index 0000000..7e5a902 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java @@ -0,0 +1,902 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.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.RepeatedInt; +import us.hebi.quickbuf.RepeatedMessage; + +public final class UnlockBackGroundMusicScRspOuterClass { + /** + * Protobuf type {@code UnlockBackGroundMusicScRsp} + */ + public static final class UnlockBackGroundMusicScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 12; + */ + private int retcode; + + /** + * repeated uint32 unlocked_ids = 3; + */ + private final RepeatedInt unlockedIds = RepeatedInt.newEmptyInstance(); + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + */ + private final RepeatedMessage musicList = RepeatedMessage.newEmptyInstance(UnlockedMusic.getFactory()); + + private UnlockBackGroundMusicScRsp() { + } + + /** + * @return a new empty instance of {@code UnlockBackGroundMusicScRsp} + */ + public static UnlockBackGroundMusicScRsp newInstance() { + return new UnlockBackGroundMusicScRsp(); + } + + /** + * optional uint32 retcode = 12; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 12; + * @return this + */ + public UnlockBackGroundMusicScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 12; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 12; + * @param value the retcode to set + * @return this + */ + public UnlockBackGroundMusicScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @return whether the unlockedIds field is set + */ + public boolean hasUnlockedIds() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @return this + */ + public UnlockBackGroundMusicScRsp clearUnlockedIds() { + bitField0_ &= ~0x00000002; + unlockedIds.clear(); + return this; + } + + /** + * repeated uint32 unlocked_ids = 3; + * + * 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 #getMutableUnlockedIds()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getUnlockedIds() { + return unlockedIds; + } + + /** + * repeated uint32 unlocked_ids = 3; + * + * 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 getMutableUnlockedIds() { + bitField0_ |= 0x00000002; + return unlockedIds; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @param value the unlockedIds to add + * @return this + */ + public UnlockBackGroundMusicScRsp addUnlockedIds(final int value) { + bitField0_ |= 0x00000002; + unlockedIds.add(value); + return this; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @param values the unlockedIds to add + * @return this + */ + public UnlockBackGroundMusicScRsp addAllUnlockedIds(final int... values) { + bitField0_ |= 0x00000002; + unlockedIds.addAll(values); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @return whether the musicList field is set + */ + public boolean hasMusicList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @return this + */ + public UnlockBackGroundMusicScRsp clearMusicList() { + bitField0_ &= ~0x00000004; + musicList.clear(); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * + * 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 #getMutableMusicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMusicList() { + return musicList; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * + * 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 getMutableMusicList() { + bitField0_ |= 0x00000004; + return musicList; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @param value the musicList to add + * @return this + */ + public UnlockBackGroundMusicScRsp addMusicList(final UnlockedMusic value) { + bitField0_ |= 0x00000004; + musicList.add(value); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @param values the musicList to add + * @return this + */ + public UnlockBackGroundMusicScRsp addAllMusicList(final UnlockedMusic... values) { + bitField0_ |= 0x00000004; + musicList.addAll(values); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp copyFrom(final UnlockBackGroundMusicScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + unlockedIds.copyFrom(other.unlockedIds); + musicList.copyFrom(other.musicList); + } + return this; + } + + @Override + public UnlockBackGroundMusicScRsp mergeFrom(final UnlockBackGroundMusicScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasUnlockedIds()) { + getMutableUnlockedIds().addAll(other.unlockedIds); + } + if (other.hasMusicList()) { + getMutableMusicList().addAll(other.musicList); + } + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + unlockedIds.clear(); + musicList.clear(); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockedIds.clear(); + musicList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockBackGroundMusicScRsp)) { + return false; + } + UnlockBackGroundMusicScRsp other = (UnlockBackGroundMusicScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasUnlockedIds() || unlockedIds.equals(other.unlockedIds)) + && (!hasMusicList() || musicList.equals(other.musicList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < unlockedIds.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(unlockedIds.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < musicList.length(); i++) { + output.writeRawByte((byte) 50); + output.writeMessageNoTag(musicList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * unlockedIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(unlockedIds); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * musicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(musicList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockBackGroundMusicScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // unlockedIds [packed=true] + input.readPackedUInt32(unlockedIds, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // musicList + tag = input.readRepeatedMessage(musicList, tag); + bitField0_ |= 0x00000004; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // unlockedIds [packed=false] + tag = input.readRepeatedUInt32(unlockedIds, tag); + bitField0_ |= 0x00000002; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.unlockedIds, unlockedIds); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.musicList, musicList); + } + output.endObject(); + } + + @Override + public UnlockBackGroundMusicScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -856496939: + case -780941476: { + if (input.isAtField(FieldNames.unlockedIds)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(unlockedIds); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 389904483: + case -780236168: { + if (input.isAtField(FieldNames.musicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(musicList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clone() { + return new UnlockBackGroundMusicScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), data).checkInitialized(); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), input).checkInitialized(); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockBackGroundMusicScRsp messages + */ + public static MessageFactory getFactory() { + return UnlockBackGroundMusicScRspFactory.INSTANCE; + } + + /** + * Protobuf type {@code UnlockedMusic} + */ + public static final class UnlockedMusic extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 group_id = 1; + */ + private int groupId; + + /** + * optional uint32 id = 8; + */ + private int id; + + /** + * optional bool unkbool = 7; + */ + private boolean unkbool; + + private UnlockedMusic() { + } + + /** + * @return a new empty instance of {@code UnlockedMusic} + */ + public static UnlockedMusic newInstance() { + return new UnlockedMusic(); + } + + /** + * optional uint32 group_id = 1; + * @return whether the groupId field is set + */ + public boolean hasGroupId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 group_id = 1; + * @return this + */ + public UnlockedMusic clearGroupId() { + bitField0_ &= ~0x00000001; + groupId = 0; + return this; + } + + /** + * optional uint32 group_id = 1; + * @return the groupId + */ + public int getGroupId() { + return groupId; + } + + /** + * optional uint32 group_id = 1; + * @param value the groupId to set + * @return this + */ + public UnlockedMusic setGroupId(final int value) { + bitField0_ |= 0x00000001; + groupId = value; + return this; + } + + /** + * optional uint32 id = 8; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 id = 8; + * @return this + */ + public UnlockedMusic clearId() { + bitField0_ &= ~0x00000002; + id = 0; + return this; + } + + /** + * optional uint32 id = 8; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 8; + * @param value the id to set + * @return this + */ + public UnlockedMusic setId(final int value) { + bitField0_ |= 0x00000002; + id = value; + return this; + } + + /** + * optional bool unkbool = 7; + * @return whether the unkbool field is set + */ + public boolean hasUnkbool() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool unkbool = 7; + * @return this + */ + public UnlockedMusic clearUnkbool() { + bitField0_ &= ~0x00000004; + unkbool = false; + return this; + } + + /** + * optional bool unkbool = 7; + * @return the unkbool + */ + public boolean getUnkbool() { + return unkbool; + } + + /** + * optional bool unkbool = 7; + * @param value the unkbool to set + * @return this + */ + public UnlockedMusic setUnkbool(final boolean value) { + bitField0_ |= 0x00000004; + unkbool = value; + return this; + } + + @Override + public UnlockedMusic copyFrom(final UnlockedMusic other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + groupId = other.groupId; + id = other.id; + unkbool = other.unkbool; + } + return this; + } + + @Override + public UnlockedMusic mergeFrom(final UnlockedMusic other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGroupId()) { + setGroupId(other.groupId); + } + if (other.hasId()) { + setId(other.id); + } + if (other.hasUnkbool()) { + setUnkbool(other.unkbool); + } + return this; + } + + @Override + public UnlockedMusic clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + groupId = 0; + id = 0; + unkbool = false; + return this; + } + + @Override + public UnlockedMusic clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockedMusic)) { + return false; + } + UnlockedMusic other = (UnlockedMusic) o; + return bitField0_ == other.bitField0_ + && (!hasGroupId() || groupId == other.groupId) + && (!hasId() || id == other.id) + && (!hasUnkbool() || unkbool == other.unkbool); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 56); + output.writeBoolNoTag(unkbool); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockedMusic mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // groupId + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // unkbool + unkbool = input.readBool(); + 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.groupId, groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.id, id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.unkbool, unkbool); + } + output.endObject(); + } + + @Override + public UnlockedMusic mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 293428218: + case 506361563: { + if (input.isAtField(FieldNames.groupId)) { + if (!input.trySkipNullValue()) { + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -285198628: { + if (input.isAtField(FieldNames.unkbool)) { + if (!input.trySkipNullValue()) { + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockedMusic clone() { + return new UnlockedMusic().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockedMusic parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), data).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockedMusic messages + */ + public static MessageFactory getFactory() { + return UnlockedMusicFactory.INSTANCE; + } + + private enum UnlockedMusicFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockedMusic create() { + return UnlockedMusic.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName groupId = FieldName.forField("groupId", "group_id"); + + static final FieldName id = FieldName.forField("id"); + + static final FieldName unkbool = FieldName.forField("unkbool"); + } + } + + private enum UnlockBackGroundMusicScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockBackGroundMusicScRsp create() { + return UnlockBackGroundMusicScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName unlockedIds = FieldName.forField("unlockedIds", "unlocked_ids"); + + static final FieldName musicList = FieldName.forField("musicList", "music_list"); + } + } +} diff --git a/src/main/java/emu/lunarcore/Config.java b/src/main/java/emu/lunarcore/Config.java index 120de83..f903684 100644 --- a/src/main/java/emu/lunarcore/Config.java +++ b/src/main/java/emu/lunarcore/Config.java @@ -86,13 +86,15 @@ public class Config { @Getter public static class ServerOptions { public boolean autoCreateAccount = true; - public int entitySceneLimit = 2000; + public int sceneMaxEntites = 500; public boolean spendStamina = true; public boolean unlockAllChallenges = true; public int staminaRecoveryRate = 5 * 60; public int staminaReserveRecoveryRate = 18 * 60; public String language = "EN"; public Set defaultPermissions = Set.of("*"); + + public ServerProfile serverFriendInfo = new ServerProfile(); public WelcomeMail welcomeMail = new WelcomeMail(); public int getStaminaRecoveryRate() { @@ -104,6 +106,17 @@ public class Config { } } + @Getter + public static class ServerProfile { + public String name = "Server"; + public String signature = "Type /help for a list of commands"; + public int level = 1; + public int headIcon = 201001; + public int chatBubbleId = 0; + public int displayAvatarId = 1001; + public int displayAvatarLevel = 1; + } + @Getter public static class WelcomeMail { public String title; @@ -130,6 +143,7 @@ public class Config { public boolean commands = true; public boolean connections = true; public boolean packets = false; + public boolean filterLoopingPackets = false; } @Getter diff --git a/src/main/java/emu/lunarcore/GameConstants.java b/src/main/java/emu/lunarcore/GameConstants.java index f46af09..4f38a5f 100644 --- a/src/main/java/emu/lunarcore/GameConstants.java +++ b/src/main/java/emu/lunarcore/GameConstants.java @@ -18,20 +18,33 @@ public class GameConstants { public static final int MAX_STAMINA = 240; public static final int MAX_STAMINA_RESERVE = 2400; public static final int MAX_AVATARS_IN_TEAM = 4; - public static final int MAX_FRIENDSHIPS = 100; public static final int DEFAULT_TEAMS = 6; public static final int MAX_MP = 5; // Client doesnt like more than 5 + // Chat/Social + public static final int MAX_FRIENDSHIPS = 100; public static final int MAX_CHAT_HISTORY = 100; // Max chat messages per conversation + + // Inventory + public static final int MATERIAL_HCOIN_ID = 1; // Material id for jades. DO NOT CHANGE + public static final int MATERIAL_COIN_ID = 2; // Material id for credits. DO NOT CHANGE + public static final int TRAILBLAZER_EXP_ID = 22; + public static final int INVENTORY_MAX_EQUIPMENT = 1500; + public static final int INVENTORY_MAX_RELIC = 1500; + public static final int INVENTORY_MAX_MATERIAL = 2000; + + // Start position public static final int START_PLANE_ID = 20001; public static final int START_FLOOR_ID = 20001001; public static final int START_ENTRY_ID = 2000101; public static final Position START_POS = new Position(99, 62, -4800); - public static final int MATERIAL_HCOIN_ID = 1; // Material id for jades. DO NOT CHANGE - public static final int MATERIAL_COIN_ID = 2; // Material id for credits. DO NOT CHANGE - public static final int TRAILBLAZER_EXP_ID = 22; + // Battle + public static final int BATTLE_AMBUSH_BUFF_ID = 1000102; + + // Gacha + public static final int GACHA_CEILING_MAX = 300; // Yes, I know this is in an excel // Challenge public static final int CHALLENGE_ENTRANCE = 100000103; diff --git a/src/main/java/emu/lunarcore/LunarCore.java b/src/main/java/emu/lunarcore/LunarCore.java index 8d933bd..1b6f1d6 100644 --- a/src/main/java/emu/lunarcore/LunarCore.java +++ b/src/main/java/emu/lunarcore/LunarCore.java @@ -255,4 +255,6 @@ public class LunarCore { return (this.flags & 0x2) == 0x2; } } + + // Hiro was here } diff --git a/src/main/java/emu/lunarcore/command/Command.java b/src/main/java/emu/lunarcore/command/Command.java index 5afb734..f393f94 100644 --- a/src/main/java/emu/lunarcore/command/Command.java +++ b/src/main/java/emu/lunarcore/command/Command.java @@ -12,4 +12,6 @@ public @interface Command { public String desc() default ""; public String permission() default ""; + + public boolean requireTarget() default false; } diff --git a/src/main/java/emu/lunarcore/command/CommandArgs.java b/src/main/java/emu/lunarcore/command/CommandArgs.java index e221cba..9554025 100644 --- a/src/main/java/emu/lunarcore/command/CommandArgs.java +++ b/src/main/java/emu/lunarcore/command/CommandArgs.java @@ -6,13 +6,17 @@ import emu.lunarcore.LunarCore; import emu.lunarcore.data.GameData; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.inventory.GameItem; +import emu.lunarcore.game.inventory.GameItemSubAffix; import emu.lunarcore.game.player.Player; import emu.lunarcore.util.Utils; +import it.unimi.dsi.fastutil.ints.Int2IntMap; +import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import lombok.Getter; @Getter public class CommandArgs { private List list; + private Player sender; private Player target; private int targetUid; @@ -21,10 +25,12 @@ public class CommandArgs { private int rank = -1; private int promotion = -1; private int stage = -1; + private Int2IntMap map; private static String EMPTY_STRING = ""; public CommandArgs(Player sender, List args) { + this.sender = sender; this.list = args; // Parse args. Maybe regex is better. @@ -35,23 +41,37 @@ public class CommandArgs { try { if (arg.length() >= 2 && !Character.isDigit(arg.charAt(0)) && Character.isDigit(arg.charAt(arg.length() - 1))) { - if (arg.startsWith("@")) { + if (arg.startsWith("@")) { // Target UID this.targetUid = Utils.parseSafeInt(arg.substring(1)); it.remove(); - } else if (arg.startsWith("x")) { + } else if (arg.startsWith("x")) { // Amount this.amount = Utils.parseSafeInt(arg.substring(1)); it.remove(); - } else if (arg.startsWith("lv")) { + } else if (arg.startsWith("lv")) { // Level this.level = Utils.parseSafeInt(arg.substring(2)); it.remove(); - } else if (arg.startsWith("r")) { + } else if (arg.startsWith("r")) { // Rank this.rank = Utils.parseSafeInt(arg.substring(1)); it.remove(); - } else if (arg.startsWith("p")) { + } else if (arg.startsWith("e")) { // Eidolons + this.rank = Utils.parseSafeInt(arg.substring(1)); + it.remove(); + } else if (arg.startsWith("p")) { // Promotion this.promotion = Utils.parseSafeInt(arg.substring(1)); it.remove(); - } else if (arg.startsWith("s")) { + } else if (arg.startsWith("s")) { // Stage or Superimposition this.stage = Utils.parseSafeInt(arg.substring(1)); + it.remove(); + } + } else if (arg.contains(":")) { + String[] split = arg.split(":"); + if (split.length >= 2) { + int key = Integer.parseInt(split[0]); + int value = Integer.parseInt(split[1]); + + if (this.map == null) this.map = new Int2IntOpenHashMap(); + this.map.put(key, value); + it.remove(); } } @@ -85,6 +105,18 @@ 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 { + LunarCore.getLogger().info(message); + } + } + // Utility commands /** @@ -144,22 +176,60 @@ public class CommandArgs { if (this.getLevel() > 0) { item.setLevel(Math.min(this.getLevel(), 80)); item.setPromotion(Utils.getMinPromotionForLevel(item.getLevel())); + hasChanged = true; } // Try to set promotion if (this.getPromotion() >= 0) { item.setPromotion(Math.min(this.getPromotion(), item.getExcel().getEquipmentExcel().getMaxPromotion())); + hasChanged = true; } // Try to set rank (superimposition) if (this.getRank() >= 0) { item.setRank(Math.min(this.getRank(), item.getExcel().getEquipmentExcel().getMaxRank())); + hasChanged = true; + } else if (this.getStage() >= 0) { + item.setRank(Math.min(this.getStage(), item.getExcel().getEquipmentExcel().getMaxRank())); + hasChanged = true; } } else if (item.getExcel().isRelic()) { + // Sub stats + if (this.getMap() != null) { + item.resetSubAffixes(); + hasChanged = true; + + for (var entry : this.getMap().int2IntEntrySet()) { + if (entry.getIntValue() <= 0) continue; + + var subAffix = GameData.getRelicSubAffixExcel(item.getExcel().getRelicExcel().getSubAffixGroup(), entry.getIntKey()); + if (subAffix == null) continue; + + item.getSubAffixes().add(new GameItemSubAffix(subAffix, entry.getIntValue())); + } + } + + // Main stat + if (this.getStage() > 0) { + var mainAffix = GameData.getRelicMainAffixExcel(item.getExcel().getRelicExcel().getMainAffixGroup(), this.getStage()); + if (mainAffix != null) { + item.setMainAffix(mainAffix.getAffixID()); + hasChanged = true; + } + } + // Try to set level if (this.getLevel() > 0) { - item.setLevel(Math.min(this.getLevel(), 15)); - // TODO add substats + // Set relic level + item.setLevel(Math.min(this.getLevel(), 999)); + + // Apply sub stat upgrades to the relic + int upgrades = item.getMaxNormalSubAffixCount() - item.getCurrentSubAffixCount(); + if (upgrades > 0) { + item.addSubAffixes(upgrades); + } + + hasChanged = true; } } diff --git a/src/main/java/emu/lunarcore/command/CommandHandler.java b/src/main/java/emu/lunarcore/command/CommandHandler.java index 102611e..84d340e 100644 --- a/src/main/java/emu/lunarcore/command/CommandHandler.java +++ b/src/main/java/emu/lunarcore/command/CommandHandler.java @@ -1,22 +1,15 @@ package emu.lunarcore.command; -import emu.lunarcore.LunarCore; -import emu.lunarcore.game.player.Player; - public interface CommandHandler { + public default Command getData() { + return this.getClass().getAnnotation(Command.class); + } + public default String getLabel() { - return this.getClass().getAnnotation(Command.class).label(); + return getData().label(); } - public default void sendMessage(Player player, String message) { - if (player != null) { - player.sendMessage(message); - } else { - LunarCore.getLogger().info(message); - } - } - - public void execute(Player sender, CommandArgs args); + public void execute(CommandArgs args); } diff --git a/src/main/java/emu/lunarcore/command/CommandManager.java b/src/main/java/emu/lunarcore/command/CommandManager.java index 3475a9b..95f15f6 100644 --- a/src/main/java/emu/lunarcore/command/CommandManager.java +++ b/src/main/java/emu/lunarcore/command/CommandManager.java @@ -39,11 +39,12 @@ public class CommandManager { } } + /** + * Adds a command that players and server console users can use. Command handlers must have the proper command annotation attached to them. + */ public CommandManager registerCommand(CommandHandler handler) { Command command = handler.getClass().getAnnotation(Command.class); - if (command == null) { - return this; - } + if (command == null) return this; this.getLabels().put(command.label(), handler); this.getCommands().put(command.label(), handler); @@ -55,11 +56,14 @@ public class CommandManager { return this; } + /** + * Removes a command from use. + * @param label The command name + * @return + */ public CommandManager unregisterCommand(String label) { CommandHandler handler = this.getLabels().get(label); - if (handler == null) { - return this; - } + if (handler == null) return this; Command command = handler.getClass().getAnnotation(Command.class); if (command == null) { @@ -76,6 +80,12 @@ public class CommandManager { return this; } + /** + * Checks if the sender has permission to use this command. Will always return true if the sender is the server console. + * @param sender The sender of the command. + * @param command + * @return true if the sender has permission to use this command + */ private boolean checkPermission(Player sender, Command command) { if (sender == null || command.permission().isEmpty()) { return true; @@ -84,6 +94,12 @@ public class CommandManager { return sender.getAccount().hasPermission(command.permission()); } + /** + * Checks if the sender has permission to use this command on other players. Will always return true if the sender is the server console. + * @param sender The sender of the command. + * @param command + * @return true if the sender has permission to use this command + */ private boolean checkTargetPermission(Player sender, Command command) { if (sender == null || command.permission().isEmpty()) { return true; @@ -93,44 +109,59 @@ public class CommandManager { } public void invoke(Player sender, String message) { + // Parse message into arguments List args = Arrays.stream(message.split(" ")).collect(Collectors.toCollection(ArrayList::new)); // Get command label String label = args.remove(0).toLowerCase(); + // Filter out command prefixes if (label.startsWith("/") || label.startsWith("!")) { label = label.substring(1); } - // Get handler + // Get command handler CommandHandler handler = this.commands.get(label); - // Execute + // Execute command if (handler != null) { - // Command annotation data - Command command = handler.getClass().getAnnotation(Command.class); - // Check permission - if (this.checkPermission(sender, command)) { - // Check targeted permission - CommandArgs cmdArgs = new CommandArgs(sender, args); - if (sender != cmdArgs.getTarget() && !this.checkTargetPermission(sender, command)) { - handler.sendMessage(sender, "You do not have permission to use this command on another player."); - return; - } - // Log - if (sender != null && LunarCore.getConfig().getLogOptions().commands) { - LunarCore.getLogger().info("[UID: " + sender.getUid() + "] " + sender.getName() + " used command: " + message); - } - // Run command - handler.execute(sender, cmdArgs); - } else { - handler.sendMessage(sender, "You do not have permission to use this command."); + // Get command annotation data + Command command = handler.getData(); + + // 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; } + + // Build command arguments + CommandArgs cmdArgs = new CommandArgs(sender, args); + + // 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; + } + + // Make sure our command has a target + if (command.requireTarget() && cmdArgs.getTarget() == null) { + cmdArgs.sendMessage("Error: Targeted player not found or offline"); + return; + } + + // Log + if (sender != null && LunarCore.getConfig().getLogOptions().commands) { + LunarCore.getLogger().info("[UID: " + sender.getUid() + "] " + sender.getName() + " used command: " + message); + } + + // Run command + handler.execute(cmdArgs); } else { if (sender != null) { - sender.sendMessage("Inavlid Command!"); + sender.sendMessage("Invalid Command!"); } else { - LunarCore.getLogger().info("Inavlid Command!"); + LunarCore.getLogger().info("Invalid Command!"); } } } diff --git a/src/main/java/emu/lunarcore/command/commands/AccountCommand.java b/src/main/java/emu/lunarcore/command/commands/AccountCommand.java index 402ac3b..1ae37bc 100644 --- a/src/main/java/emu/lunarcore/command/commands/AccountCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/AccountCommand.java @@ -4,16 +4,15 @@ import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; import emu.lunarcore.game.account.AccountHelper; -import emu.lunarcore.game.player.Player; import emu.lunarcore.util.Utils; @Command(label = "account", permission = "admin.account", desc = "/account {create | delete} [username] (reserved player uid). Creates or deletes an account.") public class AccountCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { + public void execute(CommandArgs args) { if (args.size() < 2) { - this.sendMessage(sender, "Invalid amount of args"); + args.sendMessage("Invalid amount of args"); return; } @@ -30,16 +29,16 @@ public class AccountCommand implements CommandHandler { } if (AccountHelper.createAccount(username, null, reservedUid) != null) { - this.sendMessage(sender, "Account created"); + args.sendMessage("Account created"); } else { - this.sendMessage(sender, "Account already exists"); + args.sendMessage("Account already exists"); } } case "delete" -> { if (AccountHelper.deleteAccount(username)) { - this.sendMessage(sender, "Account deleted"); + args.sendMessage("Account deleted"); } else { - this.sendMessage(sender, "Account doesnt exist"); + args.sendMessage("Account doesnt exist"); } } } diff --git a/src/main/java/emu/lunarcore/command/commands/AvatarCommand.java b/src/main/java/emu/lunarcore/command/commands/AvatarCommand.java index f1fe39e..4bc1268 100644 --- a/src/main/java/emu/lunarcore/command/commands/AvatarCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/AvatarCommand.java @@ -1,42 +1,59 @@ package emu.lunarcore.command.commands; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; import emu.lunarcore.game.avatar.GameAvatar; -import emu.lunarcore.game.player.Player; import emu.lunarcore.server.packet.send.PacketPlayerSyncScNotify; -@Command(label = "avatar", aliases = {"a"}, permission = "player.avatar", desc = "/avatar lv(level) p(ascension) r(eidolon) s(skill levels). Sets the current avatar's properties") +@Command(label = "avatar", aliases = {"a"}, requireTarget = true, permission = "player.avatar", desc = "/avatar {cur | all | lineup} lv(level) p(ascension) r(eidolon) s(skill levels). Sets the current avatar's properties") public class AvatarCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; + public void execute(CommandArgs args) { + // Temp avatar list + List changeList = new ArrayList<>(); + + // Handle optional arguments + switch (args.get(0).toLowerCase()) { + case "all": + args.getTarget().getAvatars().forEach(changeList::add); + break; + case "lineup": + args.getTarget().getCurrentLineup().forEachAvatar(changeList::add); + break; + case "cur": + default: + changeList.add(args.getTarget().getCurrentLeaderAvatar()); + break; } - // Get current leader avatar - GameAvatar avatar = args.getTarget().getCurrentLeaderAvatar(); - if (avatar == null) { - // No leader! - return; - } - - // Change properties - if (args.setProperties(avatar)) { - // Save avatar - avatar.save(); + // Try to set properties of avatars + Iterator it = changeList.iterator(); + while (it.hasNext()) { + GameAvatar avatar = it.next(); + if (args.setProperties(avatar)) { + // Save avatar + avatar.save(); + } else { + // Remove from list if nothing was changed + it.remove(); + } + } + + + if (changeList.size() > 0) { // Send packet - args.getTarget().sendPacket(new PacketPlayerSyncScNotify(avatar)); - + args.getTarget().sendPacket(new PacketPlayerSyncScNotify(changeList.toArray(GameAvatar[]::new))); // Send message - sender.sendMessage("Set avatar properties successfully"); + args.sendMessage("Set avatar(s) properties successfully"); } else { - sender.sendMessage("No avatar properties to change"); + args.sendMessage("No avatar properties to change"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/ClearCommand.java b/src/main/java/emu/lunarcore/command/commands/ClearCommand.java index 3cf418d..5d5a9fe 100644 --- a/src/main/java/emu/lunarcore/command/commands/ClearCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/ClearCommand.java @@ -8,33 +8,28 @@ import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.inventory.GameItem; -import emu.lunarcore.game.player.Player; -@Command(label = "clear", permission = "player.clear", desc = "/clear {relics | lightcones | materials | items}. Removes filtered items from the player inventory.") +@Command(label = "clear", permission = "player.clear", requireTarget = true, desc = "/clear {relics | lightcones | materials | items} lv(filter level). Removes filter items from the targeted player's inventory.") public class ClearCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { List toRemove = new LinkedList<>(); String type = args.get(0).toLowerCase(); + int filterLevel = Math.max(args.getLevel(), 1); + switch (type) { case "relics", "r" -> { for (GameItem item : args.getTarget().getInventory().getItems().values()) { - if (item.getItemMainType() == ItemMainType.Relic && item.getLevel() <= 1 && item.getExp() == 0 && !item.isLocked() && !item.isEquipped()) { + if (item.getItemMainType() == ItemMainType.Relic && item.getLevel() <= filterLevel && !item.isLocked() && !item.isEquipped()) { toRemove.add(item); } } } case "equipment", "lightcones", "lc" -> { for (GameItem item : args.getTarget().getInventory().getItems().values()) { - if (item.getItemMainType() == ItemMainType.Equipment && item.getLevel() <= 1 && item.getExp() == 0 && !item.isLocked() && !item.isEquipped()) { + if (item.getItemMainType() == ItemMainType.Equipment && item.getLevel() <= filterLevel && !item.isLocked() && !item.isEquipped()) { toRemove.add(item); } } @@ -56,7 +51,7 @@ public class ClearCommand implements CommandHandler { } args.getTarget().getInventory().removeItems(toRemove); - this.sendMessage(sender, "Removed " + toRemove.size() + " items"); + args.sendMessage("Removed " + toRemove.size() + " items"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/GenderCommand.java b/src/main/java/emu/lunarcore/command/commands/GenderCommand.java index 4f01e55..38ec131 100644 --- a/src/main/java/emu/lunarcore/command/commands/GenderCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/GenderCommand.java @@ -8,17 +8,11 @@ import emu.lunarcore.game.player.Player; import emu.lunarcore.game.player.PlayerGender; import emu.lunarcore.server.packet.send.PacketGetHeroBasicTypeInfoScRsp; -@Command(label = "gender", permission = "player.gender", desc = "/gender {male | female}. Sets the player gender.") +@Command(label = "gender", permission = "player.gender", requireTarget = true, desc = "/gender {male | female}. Sets the player gender.") public class GenderCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { // Set world level Player target = args.getTarget(); PlayerGender playerGender = null; @@ -48,9 +42,9 @@ public class GenderCommand implements CommandHandler { // Send packet and response message target.sendPacket(new PacketGetHeroBasicTypeInfoScRsp(target)); - this.sendMessage(sender, "Gender for " + target.getName() + " set successfully"); + args.sendMessage("Gender for " + target.getName() + " set successfully"); } else { - this.sendMessage(sender, "Error: Invalid input"); + args.sendMessage("Error: Invalid input"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/GiveAllCommand.java b/src/main/java/emu/lunarcore/command/commands/GiveAllCommand.java index 6f6d0e3..245804c 100644 --- a/src/main/java/emu/lunarcore/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/GiveAllCommand.java @@ -15,22 +15,22 @@ import emu.lunarcore.game.enums.ItemSubType; import emu.lunarcore.game.inventory.GameItem; import emu.lunarcore.game.player.Player; -@Command(label = "giveall", aliases = {"ga"}, permission = "player.give", desc = "/giveall {materials | avatars | lightcones | relics}. Gives the targeted player items.") +@Command( + label = "giveall", + aliases = {"ga"}, + permission = "player.give", + requireTarget = true, + desc = "/giveall {materials | avatars | lightcones | relics} lv(level). Gives the targeted player items." +) public class GiveAllCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { Player target = args.getTarget(); String type = args.get(0).toLowerCase(); switch (type) { - default -> this.sendMessage(sender, "Error: Invalid type"); + default -> args.sendMessage("Error: Invalid type"); case "m", "materials", "mats" -> { List items = new ArrayList<>(); @@ -49,9 +49,16 @@ public class GiveAllCommand implements CommandHandler { target.getInventory().addItems(items, true); // Send message - this.sendMessage(sender, "Giving " + target.getName() + " " + items.size() + " items"); + args.sendMessage("Giving " + target.getName() + " " + items.size() + " items"); } case "lc", "lightcones" -> { + // Make sure we dont go over the inventory limit + var tab = args.getTarget().getInventory().getTabByItemType(ItemMainType.Equipment); + if (tab.getSize() >= tab.getMaxCapacity()) { + args.sendMessage(target.getName() + " has too many of this item type"); + return; + } + // Get lightcones List items = GameData.getItemExcelMap().values() .stream() @@ -67,9 +74,16 @@ public class GiveAllCommand implements CommandHandler { target.getInventory().addItems(items, true); // Send message - this.sendMessage(sender, "Giving " + target.getName() + " " + items.size() + " light cones"); + args.sendMessage("Giving " + target.getName() + " " + items.size() + " light cones"); } case "r", "relics" -> { + // Make sure we dont go over the inventory limit + var tab = args.getTarget().getInventory().getTabByItemType(ItemMainType.Relic); + if (tab.getSize() >= tab.getMaxCapacity()) { + args.sendMessage(target.getName() + " has too many of this item type"); + return; + } + // Get relics List items = GameData.getItemExcelMap().values() .stream() @@ -80,12 +94,12 @@ public class GiveAllCommand implements CommandHandler { return item; }) .toList(); - + // Add to target's inventory target.getInventory().addItems(items, true); // Send message - this.sendMessage(sender, "Giving " + target.getName() + " " + items.size() + " relics"); + args.sendMessage("Giving " + target.getName() + " " + items.size() + " relics"); } case "a", "characters", "avatars" -> { // All avatars and their eidolons @@ -111,7 +125,31 @@ public class GiveAllCommand implements CommandHandler { } // Send message - this.sendMessage(sender, "Giving " + target.getName() + " all avatars"); + args.sendMessage("Giving " + target.getName() + " all avatars"); + } + case "ic", "icons" -> { + // Get UnlockedHeads + for (var iconhead : GameData.getPlayerIconExcelMap().values()) { + // This function will handle any duplicate head icons + target.addHeadIcon(iconhead.getId()); + } + + // Send message + args.sendMessage("Added all icons to " + target.getName()); + } + case "consumables", "food" -> { + // Get consumables + List items = GameData.getItemExcelMap().values() + .stream() + .filter(excel -> excel.getItemSubType() == ItemSubType.Food) + .map(excel -> new GameItem(excel, 1000)) + .toList(); + + // Add to target's inventory + target.getInventory().addItems(items, true); + + // Send message + args.sendMessage("Added all consumables to " + target.getName()); } } } diff --git a/src/main/java/emu/lunarcore/command/commands/GiveCommand.java b/src/main/java/emu/lunarcore/command/commands/GiveCommand.java index 677c58a..7bab447 100644 --- a/src/main/java/emu/lunarcore/command/commands/GiveCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/GiveCommand.java @@ -11,72 +11,63 @@ import emu.lunarcore.data.excel.ItemExcel; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.inventory.GameItem; -import emu.lunarcore.game.player.Player; import emu.lunarcore.util.Utils; -@Command(label = "give", aliases = {"g"}, permission = "player.give", desc = "/give [item id] x[amount]. Gives the targetted player an item.") +@Command( + label = "give", + aliases = {"g", "item"}, + permission = "player.give", + requireTarget = true, + desc = "/give [item id] x(amount) lv(level) r(rank) p(promotion). Gives the targeted player an item." +) public class GiveCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - - int itemId = Utils.parseSafeInt(args.get(0)); - int amount = Math.max(args.getAmount(), 1); - - ItemExcel itemData = GameData.getItemExcelMap().get(itemId); - - if (itemData == null) { - this.sendMessage(sender, "Error: Item data not found"); - return; - } - + public void execute(CommandArgs args) { // Setup items List items = new LinkedList<>(); - if (itemData.getItemMainType() == ItemMainType.AvatarCard) { - // Add avatar - GameAvatar avatar = new GameAvatar(itemData.getId()); + // Get amount to give + int amount = Math.max(args.getAmount(), 1); + + // Parse items + for (String arg : args.getList()) { + // Parse item id + int itemId = Utils.parseSafeInt(arg); - if (args.getTarget().addAvatar(avatar)) { - // Change avatar properties + ItemExcel itemData = GameData.getItemExcelMap().get(itemId); + if (itemData == null) { + args.sendMessage("Item \"" + arg + "\" does not exist!"); + continue; + } + + // Add item + if (itemData.getItemMainType() == ItemMainType.AvatarCard) { + // Add avatar to target + GameAvatar avatar = new GameAvatar(itemData.getId()); args.setProperties(avatar); - } - } else if (itemData.isEquippable()) { - for (int i = 0; i < amount; i++) { - GameItem item = new GameItem(itemData); + args.getTarget().addAvatar(avatar); + } else if (itemData.isEquippable()) { + // Make sure we dont go over the inventory limit + var tab = args.getTarget().getInventory().getTabByItemType(itemData.getItemMainType()); + amount = Math.min(amount, tab.getAvailableCapacity()); - if (item.getExcel().isEquipment()) { - // Try to set level - if (args.getLevel() > 0) { - item.setLevel(Math.min(args.getLevel(), 80)); - item.setPromotion(Utils.getMinPromotionForLevel(item.getLevel())); - } + // Add items + for (int i = 0; i < amount; i++) { + GameItem item = new GameItem(itemData); + args.setProperties(item); - // Try to set promotion - if (args.getPromotion() >= 0) { - item.setPromotion(Math.min(args.getPromotion(), item.getExcel().getEquipmentExcel().getMaxPromotion())); - } - - // Try to set rank (superimposition) - if (args.getRank() >= 0) { - item.setRank(Math.min(args.getRank(), item.getExcel().getEquipmentExcel().getMaxRank())); - } + items.add(item); } - - items.add(item); + } else { + items.add(new GameItem(itemData, amount)); } - } else { - items.add(new GameItem(itemData, amount)); + + // Send message + args.sendMessage("Giving " + args.getTarget().getName() + " " + amount + " of " + itemId); } - // Add and send message to player + // Add to player inventory args.getTarget().getInventory().addItems(items, true); - args.getTarget().sendMessage("Giving " + args.getTarget().getName() + " " + amount + " of " + itemId); } - } diff --git a/src/main/java/emu/lunarcore/command/commands/HealCommand.java b/src/main/java/emu/lunarcore/command/commands/HealCommand.java new file mode 100644 index 0000000..9b41abd --- /dev/null +++ b/src/main/java/emu/lunarcore/command/commands/HealCommand.java @@ -0,0 +1,23 @@ +package emu.lunarcore.command.commands; + +import emu.lunarcore.command.Command; +import emu.lunarcore.command.CommandArgs; +import emu.lunarcore.command.CommandHandler; +import emu.lunarcore.game.player.lineup.PlayerLineup; + +@Command(label = "heal", permission = "player.heal", requireTarget = true, desc = "/heal. Heals your avatars.") +public class HealCommand implements CommandHandler { + + @Override + public void execute(CommandArgs args) { + PlayerLineup lineup = args.getTarget().getCurrentLineup(); + lineup.forEachAvatar(avatar -> { + avatar.setCurrentHp(lineup, 10000); + avatar.save(); + }); + lineup.refreshLineup(); + + args.sendMessage("Healed all avatars for " + args.getTarget().getName()); + } + +} diff --git a/src/main/java/emu/lunarcore/command/commands/HelpCommand.java b/src/main/java/emu/lunarcore/command/commands/HelpCommand.java index dfb248d..9dad813 100644 --- a/src/main/java/emu/lunarcore/command/commands/HelpCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/HelpCommand.java @@ -4,21 +4,20 @@ import emu.lunarcore.LunarCore; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; -import emu.lunarcore.game.player.Player; @Command(label = "help", permission = "player.help", desc = "/help. Displays a list of available commands.") public class HelpCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - this.sendMessage(sender, "Displaying list of commands:"); + public void execute(CommandArgs args) { + args.sendMessage("Displaying list of commands:"); var labels = LunarCore.getCommandManager().getLabels().keySet().stream().sorted().toList(); for (var label : labels) { Command command = LunarCore.getCommandManager().getLabels().get(label).getClass().getAnnotation(Command.class); if (command == null) continue; - this.sendMessage(sender, command.desc()); + args.sendMessage(command.desc()); } } diff --git a/src/main/java/emu/lunarcore/command/commands/KickCommand.java b/src/main/java/emu/lunarcore/command/commands/KickCommand.java index 10c1d52..90510cf 100644 --- a/src/main/java/emu/lunarcore/command/commands/KickCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/KickCommand.java @@ -3,27 +3,21 @@ package emu.lunarcore.command.commands; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; -import emu.lunarcore.game.player.Player; @Command( label = "kick", desc = "/kick @[player id]. Kicks a player from the server.", + requireTarget = true, permission = "player.kick" ) public final class KickCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { // Kick player args.getTarget().getSession().close(); // Send message - this.sendMessage(sender, "Player kicked successfully"); + args.sendMessage("Player kicked successfully"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/LineupCommand.java b/src/main/java/emu/lunarcore/command/commands/LineupCommand.java new file mode 100644 index 0000000..2d8eb9d --- /dev/null +++ b/src/main/java/emu/lunarcore/command/commands/LineupCommand.java @@ -0,0 +1,65 @@ +package emu.lunarcore.command.commands; + +import java.util.ArrayList; +import java.util.List; + +import emu.lunarcore.GameConstants; +import emu.lunarcore.command.Command; +import emu.lunarcore.command.CommandArgs; +import emu.lunarcore.command.CommandHandler; +import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.game.player.lineup.PlayerLineup; +import emu.lunarcore.util.Utils; + +@Command(label = "lineup", permission = "player.lineup", requireTarget = true, desc = "/lineup [avatar ids]. USE AT YOUR OWN RISK. Sets your current lineup with the specified avatar ids.") +public class LineupCommand implements CommandHandler { + + @Override + public void execute(CommandArgs args) { + // Get target player + Player target = args.getTarget(); + + // Do not set lineup while the target player is in a battle + if (target.isInBattle()) { + args.sendMessage("Error: The targeted player is in a battle"); + return; + } + + // Temp avatar list + List avatars = new ArrayList<>(); + + // Validate avatars in temp list + for (String arg : args.getList()) { + // Make sure the avatar actually exist + GameAvatar avatar = target.getAvatarById(Utils.parseSafeInt(arg)); + if (avatar == null) continue; + + avatars.add(avatar.getAvatarId()); + + // Soft cap check + if (avatars.size() >= GameConstants.MAX_AVATARS_IN_TEAM) { + break; + } + } + + // Replace cleanly + if (avatars.size() > 0) { + // Only replace lineup if we have avatars to replace with + // The client wont like it if we have a lineup with 0 avatars. + PlayerLineup lineup = target.getCurrentLineup(); + lineup.getAvatars().clear(); + lineup.getAvatars().addAll(avatars); + lineup.save(); + + // Send client packets to sync lineup + lineup.refreshLineup(); + target.getScene().syncLineup(); + + args.sendMessage("Set the lineup of " + target.getName() + " successfully"); + } else { + args.sendMessage("No avatars could be added"); + } + } + +} diff --git a/src/main/java/emu/lunarcore/command/commands/MailCommand.java b/src/main/java/emu/lunarcore/command/commands/MailCommand.java index 7aa4996..362fcef 100644 --- a/src/main/java/emu/lunarcore/command/commands/MailCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/MailCommand.java @@ -6,41 +6,27 @@ import java.util.List; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; +import emu.lunarcore.data.GameData; +import emu.lunarcore.data.excel.ItemExcel; import emu.lunarcore.game.inventory.GameItem; import emu.lunarcore.game.mail.Mail; -import emu.lunarcore.game.player.Player; -@Command(label = "mail", aliases = {"m"}, permission = "player.mail", desc = "/mail [content]. Sends the targeted player a system mail.") +@Command(label = "mail", aliases = {"m"}, permission = "player.mail", requireTarget = true, desc = "/mail [content]. Sends the targeted player a system mail.") public class MailCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { // Get attachments List attachments = new ArrayList<>(); - - var it = args.getList().iterator(); - while (it.hasNext()) { - try { - String str = it.next(); + + if (args.getMap() != null) { + for (var entry : args.getMap().int2IntEntrySet()) { + if (entry.getIntValue() <= 0) continue; - if (str.contains(":")) { - String[] split = str.split(":"); - - int itemId = Integer.parseInt(split[0]); - int count = Integer.parseInt(split[1]); - - attachments.add(new GameItem(itemId, count)); - - it.remove(); - } - } catch (Exception e) { + ItemExcel itemExcel = GameData.getItemExcelMap().get(entry.getIntKey()); + if (itemExcel == null) continue; + attachments.add(new GameItem(itemExcel, entry.getIntValue())); } } @@ -55,7 +41,7 @@ public class MailCommand implements CommandHandler { // Send to target args.getTarget().getMailbox().sendMail(mail); - this.sendMessage(sender, "Sending mail to " + args.getTarget().getName()); + args.sendMessage("Sending mail to " + args.getTarget().getName()); } } diff --git a/src/main/java/emu/lunarcore/command/commands/PermissionCommand.java b/src/main/java/emu/lunarcore/command/commands/PermissionCommand.java index a1df8e4..517047d 100644 --- a/src/main/java/emu/lunarcore/command/commands/PermissionCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/PermissionCommand.java @@ -3,19 +3,12 @@ package emu.lunarcore.command.commands; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; -import emu.lunarcore.game.player.Player; -@Command(label = "permission", aliases = {"perm"}, permission = "admin.permission", desc = "/permission {add | remove | clear} [permission]. Gives/removes a permission from the targeted player.") +@Command(label = "permission", aliases = {"perm"}, permission = "admin.permission", requireTarget = true, desc = "/permission {add | remove | clear} [permission]. Gives/removes a permission from the targeted player.") public class PermissionCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { String type = args.get(0).toLowerCase(); String permission = args.get(1).toLowerCase(); @@ -26,7 +19,7 @@ public class PermissionCommand implements CommandHandler { args.getTarget().getAccount().addPermission(permission); } // Send message - this.sendMessage(sender, "Added permission for " + args.getTarget().getName()); + args.sendMessage("Added permission for " + args.getTarget().getName()); } case "remove" -> { // Remove permission @@ -34,16 +27,16 @@ public class PermissionCommand implements CommandHandler { args.getTarget().getAccount().removePermission(permission); } // Send message - this.sendMessage(sender, "Removed permission for " + args.getTarget().getName()); + args.sendMessage("Removed permission for " + args.getTarget().getName()); } case "clear" -> { // Clear permissions args.getTarget().getAccount().clearPermission(); // Send message - this.sendMessage(sender, "Cleared permissions for " + args.getTarget().getName()); + args.sendMessage("Cleared permissions for " + args.getTarget().getName()); } default -> { - this.sendMessage(sender, "Error: Invalid arguments"); + args.sendMessage("Error: Invalid arguments"); } } } diff --git a/src/main/java/emu/lunarcore/command/commands/RefillMPCommand.java b/src/main/java/emu/lunarcore/command/commands/RefillMPCommand.java new file mode 100644 index 0000000..e82b824 --- /dev/null +++ b/src/main/java/emu/lunarcore/command/commands/RefillMPCommand.java @@ -0,0 +1,17 @@ +package emu.lunarcore.command.commands; + +import emu.lunarcore.GameConstants; +import emu.lunarcore.command.Command; +import emu.lunarcore.command.CommandArgs; +import emu.lunarcore.command.CommandHandler; + +@Command(label = "refill", aliases = {"rf"}, permission = "player.refill", requireTarget = true, desc = "/refill - refill your skill points in open world.") +public class RefillMPCommand implements CommandHandler { + + @Override + public void execute(CommandArgs args) { + args.getTarget().getCurrentLineup().addMp(GameConstants.MAX_MP); + args.sendMessage("Successfully refilled skill points for " + args.getTarget().getName()); + } + +} diff --git a/src/main/java/emu/lunarcore/command/commands/RefillSPCommand.java b/src/main/java/emu/lunarcore/command/commands/RefillSPCommand.java new file mode 100644 index 0000000..7173e56 --- /dev/null +++ b/src/main/java/emu/lunarcore/command/commands/RefillSPCommand.java @@ -0,0 +1,23 @@ +package emu.lunarcore.command.commands; + +import emu.lunarcore.command.Command; +import emu.lunarcore.game.player.lineup.PlayerLineup; +import emu.lunarcore.command.CommandArgs; +import emu.lunarcore.command.CommandHandler; + +@Command(label = "energy", permission = "player.energy", requireTarget = true, desc = "/energy. Refills all characters energy in current lineup.") +public class RefillSPCommand implements CommandHandler { + + @Override + public void execute(CommandArgs args) { + PlayerLineup lineup = args.getTarget().getCurrentLineup(); + lineup.forEachAvatar(avatar -> { + avatar.setCurrentSp(lineup, 10000); + avatar.save(); + }); + lineup.refreshLineup(); + + args.sendMessage("Refilled SP for " + args.getTarget().getName()); + } + +} diff --git a/src/main/java/emu/lunarcore/command/commands/ReloadCommand.java b/src/main/java/emu/lunarcore/command/commands/ReloadCommand.java index 21bfaaa..3856b18 100644 --- a/src/main/java/emu/lunarcore/command/commands/ReloadCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/ReloadCommand.java @@ -4,15 +4,14 @@ import emu.lunarcore.LunarCore; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; -import emu.lunarcore.game.player.Player; @Command(label = "reload", permission = "admin.reload", desc = "/reload. Reloads the server config.") public class ReloadCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { + public void execute(CommandArgs args) { LunarCore.loadConfig(); - this.sendMessage(sender, "Reloaded the server config"); + args.sendMessage("Reloaded the server config"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/SceneCommand.java b/src/main/java/emu/lunarcore/command/commands/SceneCommand.java index 49d8b4a..b0164b0 100644 --- a/src/main/java/emu/lunarcore/command/commands/SceneCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/SceneCommand.java @@ -7,20 +7,13 @@ import emu.lunarcore.data.GameData; import emu.lunarcore.data.config.AnchorInfo; import emu.lunarcore.data.config.FloorInfo; import emu.lunarcore.data.excel.MazePlaneExcel; -import emu.lunarcore.game.player.Player; import emu.lunarcore.util.Utils; -@Command(label = "scene", aliases = {"sc"}, permission = "player.scene", desc = "/scene [scene id] [floor id]. Teleports the player to the specified scene.") +@Command(label = "scene", aliases = {"sc"}, permission = "player.scene", requireTarget = true, desc = "/scene [scene id] [floor id]. Teleports the player to the specified scene.") public class SceneCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { // Get arguments int planeId = Utils.parseSafeInt(args.get(0)); int floorId = Utils.parseSafeInt(args.get(1)); @@ -28,7 +21,7 @@ public class SceneCommand implements CommandHandler { // Get maze plane MazePlaneExcel excel = GameData.getMazePlaneExcelMap().get(planeId); if (excel == null) { - this.sendMessage(sender, "Error: Maze plane not found"); + args.sendMessage("Error: Maze plane not found"); return; } @@ -39,7 +32,7 @@ public class SceneCommand implements CommandHandler { // Get floor info FloorInfo floor = GameData.getFloorInfo(planeId, floorId); if (floor == null) { - this.sendMessage(sender, "Error: Floor info not found"); + args.sendMessage("Error: Floor info not found"); return; } @@ -48,7 +41,7 @@ public class SceneCommand implements CommandHandler { AnchorInfo anchor = floor.getAnchorInfo(startGroup, anchorId); if (anchor == null) { - this.sendMessage(sender, "Error: Floor info not found"); + args.sendMessage("Error: Floor info not found"); return; } @@ -57,7 +50,7 @@ public class SceneCommand implements CommandHandler { // Send packet if (success) { - this.sendMessage(sender, "Teleported player to " + planeId); + args.sendMessage("Teleported player to " + planeId); } } diff --git a/src/main/java/emu/lunarcore/command/commands/SetLevelCommand.java b/src/main/java/emu/lunarcore/command/commands/SetLevelCommand.java new file mode 100644 index 0000000..1ac4155 --- /dev/null +++ b/src/main/java/emu/lunarcore/command/commands/SetLevelCommand.java @@ -0,0 +1,19 @@ +package emu.lunarcore.command.commands; + +import emu.lunarcore.util.Utils; +import emu.lunarcore.command.Command; +import emu.lunarcore.command.CommandArgs; +import emu.lunarcore.command.CommandHandler; + +@Command(label = "setlevel", aliases = {"level"}, permission = "player.setlevel", requireTarget = true, desc = "/setlevel [level] - Sets the targeted player's trailblazer level.") +public class SetLevelCommand implements CommandHandler { + + @Override + public void execute(CommandArgs args) { + int targetLevel = Utils.parseSafeInt(args.get(0)); + args.getTarget().setLevel(targetLevel); + + args.sendMessage("Set level to " + targetLevel); + } + +} diff --git a/src/main/java/emu/lunarcore/command/commands/SpawnCommand.java b/src/main/java/emu/lunarcore/command/commands/SpawnCommand.java index e9d66a4..bb03c3c 100644 --- a/src/main/java/emu/lunarcore/command/commands/SpawnCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/SpawnCommand.java @@ -1,5 +1,6 @@ package emu.lunarcore.command.commands; +import emu.lunarcore.LunarCore; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; @@ -16,21 +17,15 @@ import emu.lunarcore.game.scene.entity.EntityProp; import emu.lunarcore.util.Position; import emu.lunarcore.util.Utils; -@Command(label = "spawn", permission = "player.spawn", desc = "/spawn [monster/prop id] x[amount] s[stage id]. Spawns a monster or prop near the targeted player.") +@Command(label = "spawn", permission = "player.spawn", requireTarget = true, desc = "/spawn [monster/prop id] [stage id] x[amount] lv[level] r[radius]. Spawns a monster or prop near the targeted player.") public class SpawnCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { Player target = args.getTarget(); if (target.getScene() == null) { - this.sendMessage(sender, "Error: Target is not in scene"); + args.sendMessage("Error: Target is not in scene"); return; } @@ -40,6 +35,12 @@ public class SpawnCommand implements CommandHandler { int amount = Math.max(args.getAmount(), 1); int radius = Math.max(args.getRank(), 5) * 1000; + // Enforce scene max entity limit + if (target.getScene().getEntities().size() + amount >= LunarCore.getConfig().getServerOptions().getSceneMaxEntites()) { + args.sendMessage("Error: Max entities in scene reached"); + return; + } + // Spawn monster NpcMonsterExcel monsterExcel = GameData.getNpcMonsterExcelMap().get(id); if (monsterExcel != null) { @@ -62,7 +63,7 @@ public class SpawnCommand implements CommandHandler { } if (monsterInfo == null || groupInfo == null) { - this.sendMessage(sender, "Error: No existing monster config found in this scene"); + args.sendMessage("Error: No existing monster config found in this scene"); return; } @@ -74,11 +75,15 @@ public class SpawnCommand implements CommandHandler { monster.setEventId(monsterInfo.getEventID()); monster.setOverrideStageId(stage); + if (args.getLevel() > 0) { + monster.setOverrideLevel(Math.min(args.getLevel(), 100)); + } + target.getScene().addEntity(monster, true); } // Send message when done - this.sendMessage(sender, "Spawning " + amount + " monsters"); + args.sendMessage("Spawning " + amount + " monsters"); return; } @@ -103,7 +108,7 @@ public class SpawnCommand implements CommandHandler { } if (propInfo == null || groupInfo == null) { - this.sendMessage(sender, "Error: No existing prop config found in this scene"); + args.sendMessage("Error: No existing prop config found in this scene"); return; } @@ -119,11 +124,11 @@ public class SpawnCommand implements CommandHandler { } // Send message when done - this.sendMessage(sender, "Spawning " + amount + " props"); + args.sendMessage("Spawning " + amount + " props"); return; } - this.sendMessage(sender, "Error: Invalid id"); + args.sendMessage("Error: Invalid id"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/UnstuckCommand.java b/src/main/java/emu/lunarcore/command/commands/UnstuckCommand.java index 0a1b2e0..b7ece32 100644 --- a/src/main/java/emu/lunarcore/command/commands/UnstuckCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/UnstuckCommand.java @@ -10,16 +10,16 @@ import emu.lunarcore.game.player.Player; public class UnstuckCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { + public void execute(CommandArgs args) { // Make sure were on the game server if (LunarCore.getGameDatabase() == null) { - this.sendMessage(sender, "Error: Game database not connected"); + args.sendMessage("Error: Game database not connected"); return; } // TODO add some logic to handle unstucking the target if theyre online if (args.getTarget() != null) { - this.sendMessage(sender, "Error: Targeted player is online"); + args.sendMessage("Error: Targeted player is online"); return; } @@ -32,10 +32,10 @@ public class UnstuckCommand implements CommandHandler { player.save(); // Done - this.sendMessage(sender, "Player unstuck successfully"); + args.sendMessage("Player unstuck successfully"); } else { // Done - this.sendMessage(sender, "Error: Player not found in database"); + args.sendMessage("Error: Player not found in database"); } } diff --git a/src/main/java/emu/lunarcore/command/commands/WorldLevelCommand.java b/src/main/java/emu/lunarcore/command/commands/WorldLevelCommand.java index c8837fa..d97aad6 100644 --- a/src/main/java/emu/lunarcore/command/commands/WorldLevelCommand.java +++ b/src/main/java/emu/lunarcore/command/commands/WorldLevelCommand.java @@ -3,20 +3,13 @@ package emu.lunarcore.command.commands; import emu.lunarcore.command.Command; import emu.lunarcore.command.CommandArgs; import emu.lunarcore.command.CommandHandler; -import emu.lunarcore.game.player.Player; import emu.lunarcore.util.Utils; -@Command(label = "worldlevel", aliases = {"wl"}, permission = "player.worldlevel", desc = "/worldlevel [world level]. Sets the targeted player's equilibrium level.") +@Command(label = "worldlevel", aliases = {"wl"}, permission = "player.worldlevel", requireTarget = true, desc = "/worldlevel [world level]. Sets the targeted player's equilibrium level.") public class WorldLevelCommand implements CommandHandler { @Override - public void execute(Player sender, CommandArgs args) { - // Check target - if (args.getTarget() == null) { - this.sendMessage(sender, "Error: Targeted player not found or offline"); - return; - } - + public void execute(CommandArgs args) { // Set world level int level = Utils.parseSafeInt(args.get(0)); level = Math.min(Math.max(level, 0), 6); @@ -24,7 +17,7 @@ public class WorldLevelCommand implements CommandHandler { args.getTarget().setWorldLevel(level); // Done - this.sendMessage(sender, "Set world level to " + level); + args.sendMessage("Set world level to " + level); } } diff --git a/src/main/java/emu/lunarcore/data/GameData.java b/src/main/java/emu/lunarcore/data/GameData.java index 780d82a..b203b0f 100644 --- a/src/main/java/emu/lunarcore/data/GameData.java +++ b/src/main/java/emu/lunarcore/data/GameData.java @@ -2,13 +2,14 @@ package emu.lunarcore.data; import java.lang.reflect.Field; +import java.util.List; +import java.util.ArrayList; + import emu.lunarcore.data.config.FloorInfo; import emu.lunarcore.data.excel.*; import emu.lunarcore.game.battle.MazeBuff; import emu.lunarcore.util.Utils; -import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.Object2ObjectMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import lombok.Getter; @@ -18,10 +19,12 @@ public class GameData { // Excels @Getter private static Int2ObjectMap avatarExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap itemExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap itemUseExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap equipExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap relicExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap propExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap npcExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap monsterExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap npcMonsterExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap stageExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap mazePlaneExcelMap = new Int2ObjectOpenHashMap<>(); @@ -29,9 +32,15 @@ public class GameData { @Getter private static Int2ObjectMap heroExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap shopExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rewardExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap playerIconExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap itemComposeExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap activityPanelExcelMap = new Int2ObjectOpenHashMap<>(); - + @Getter private static Int2ObjectMap backGroundMusicExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap questExcelMap = new Int2ObjectLinkedOpenHashMap<>(); + @Getter private static Int2ObjectMap textJoinExcelMap = new Int2ObjectLinkedOpenHashMap<>(); + @Getter private static Int2ObjectMap chatBubbleExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap phoneThemeExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap challengeGroupExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap challengeExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap challengeTargetExcelMap = new Int2ObjectOpenHashMap<>(); @@ -44,6 +53,7 @@ public class GameData { @Getter private static Int2ObjectMap rogueRoomExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rogueMapExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap rogueMonsterExcelMap = new Int2ObjectOpenHashMap<>(); + private static Int2ObjectMap rogueBuffExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap avatarSkillTreeExcelMap = new Int2ObjectOpenHashMap<>(); @@ -57,9 +67,10 @@ public class GameData { private static Int2ObjectMap expTypeExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap equipmentExpTypeExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap relicExpTypeExcelMap = new Int2ObjectOpenHashMap<>(); - + private static Int2ObjectMap relicMainAffixExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap relicSubAffixExcelMap = new Int2ObjectOpenHashMap<>(); + private static Int2ObjectMap relicSetExcelMap = new Int2ObjectOpenHashMap<>(); // Configs (Bin) @Getter private static Object2ObjectMap floorInfos = new Object2ObjectOpenHashMap<>(); @@ -81,6 +92,77 @@ public class GameData { return map; } + public static List getAllRelicIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : relicExcelMap.int2ObjectEntrySet()) { + RelicExcel relicExcel = entry.getValue(); + allIds.add(relicExcel.getId()); + } + + return allIds; + } + + public static int getRelicSetFromId(int relicId) { + RelicExcel relicExcel = GameData.getRelicExcelMap().get(relicId); + + if (relicExcel == null) { + return 0; + } + return relicExcel.getSetId(); + } + + public static List getAllMusicIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : backGroundMusicExcelMap.int2ObjectEntrySet()) { + BackGroundMusicExcel backGroundMusicExcel = entry.getValue(); + allIds.add(backGroundMusicExcel.getId()); + } + + return allIds; + } + + public static int TextJoinItemFromId(int id) { + for (Int2ObjectMap.Entry entry : textJoinExcelMap.int2ObjectEntrySet()) { + TextJoinExcel textJoinExcel = entry.getValue(); + if (textJoinExcel.getId() == id) { + IntArrayList textJoinItemList = textJoinExcel.getTextJoinItemList(); + if (textJoinItemList.size() > 0) { + return textJoinItemList.getInt(textJoinItemList.size() - 1); + } + } + } + return id * 10; // or return a default value if needed + } + + public static List getAllQuestIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : questExcelMap.int2ObjectEntrySet()) { + QuestExcel questExcel = entry.getValue(); + allIds.add(questExcel.getId()); + } + + return allIds; + } + + public static List getAllMonsterIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : monsterExcelMap.int2ObjectEntrySet()) { + MonsterExcel monsterExcel = entry.getValue(); + allIds.add(monsterExcel.getId()); + } + + return allIds; + } + + public static int getMusicGroupId(int musicId) { + var excel = backGroundMusicExcelMap.get(musicId); + return excel != null ? excel.getGroupId() : 0; + } + public static AvatarPromotionExcel getAvatarPromotionExcel(int id, int promotion) { return avatarPromotionExcelMap.get((id << 8) + promotion); } @@ -148,4 +230,8 @@ public class GameData { public static RogueMapExcel getRogueMapExcel(int rogueMapId, int siteId) { return rogueMapExcelMap.get((rogueMapId << 8) + siteId); } + + public static RogueBuffExcel getRogueBuffExcel(int rogueBuffId, int level) { + return rogueBuffExcelMap.get((rogueBuffId << 4) + level); + } } diff --git a/src/main/java/emu/lunarcore/data/GameDepot.java b/src/main/java/emu/lunarcore/data/GameDepot.java index fe167f2..b5b32a9 100644 --- a/src/main/java/emu/lunarcore/data/GameDepot.java +++ b/src/main/java/emu/lunarcore/data/GameDepot.java @@ -23,6 +23,8 @@ public class GameDepot { // Rogue @Getter private static Int2ObjectMap rogueMapGen = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap rogueAeonBuffs = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap> rogueAeonEnhanceBuffs = new Int2ObjectOpenHashMap<>(); @Getter private static List rogueRandomBuffList = new ArrayList<>(); @Getter private static List rogueRandomMiracleList = new ArrayList<>(); @Getter private static List rogueRandomNpcList = new ArrayList<>(); diff --git a/src/main/java/emu/lunarcore/data/excel/ActivityPanelExcel.java b/src/main/java/emu/lunarcore/data/excel/ActivityPanelExcel.java index d567ed1..86d6ddc 100644 --- a/src/main/java/emu/lunarcore/data/excel/ActivityPanelExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ActivityPanelExcel.java @@ -2,7 +2,6 @@ package emu.lunarcore.data.excel; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; - import lombok.Getter; @Getter @@ -12,7 +11,7 @@ public class ActivityPanelExcel extends GameResource { private int Type; private int ActivityModuleID; private boolean IsResidentPanel; - + @Override public int getId() { return PanelID; diff --git a/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java b/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java index 3043119..28c5da8 100644 --- a/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/AvatarExcel.java @@ -40,10 +40,10 @@ public class AvatarExcel extends GameResource { private transient IntSet skillTreeIds; private transient String nameKey; private transient int maxSp; - + @Setter private transient MazeSkill mazeAttack; @Setter private transient MazeSkill mazeSkill; - + private static Pattern namePattern = Pattern.compile("(?<=Avatar_)(.*?)(?=_Config)"); public AvatarExcel() { @@ -75,14 +75,14 @@ public class AvatarExcel extends GameResource { // Cache max sp this.maxSp = (int) this.SPNeed * 100; - + // Get name key Matcher matcher = namePattern.matcher(this.JsonPath); - + if (matcher.find()) { this.nameKey = matcher.group(0); } - + // Clear variable to save memory this.JsonPath = null; } diff --git a/src/main/java/emu/lunarcore/data/excel/AvatarExpItemExcel.java b/src/main/java/emu/lunarcore/data/excel/AvatarExpItemExcel.java index ae8d9ff..388f2eb 100644 --- a/src/main/java/emu/lunarcore/data/excel/AvatarExpItemExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/AvatarExpItemExcel.java @@ -7,7 +7,6 @@ import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; import emu.lunarcore.data.ResourceType.LoadPriority; - import lombok.Getter; @Getter @@ -28,7 +27,7 @@ public class AvatarExpItemExcel extends GameResource { if (excel == null) return; excel.setAvatarExp(Exp); - + // Add to game depot if (Exp > 0) { GameDepot.getAvatarExpExcels().add(this); diff --git a/src/main/java/emu/lunarcore/data/excel/AvatarSkillTreeExcel.java b/src/main/java/emu/lunarcore/data/excel/AvatarSkillTreeExcel.java index 8ffae52..a0e7982 100644 --- a/src/main/java/emu/lunarcore/data/excel/AvatarSkillTreeExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/AvatarSkillTreeExcel.java @@ -41,7 +41,7 @@ public class AvatarSkillTreeExcel extends GameResource { if (this.isDefaultUnlock()) { excel.getDefaultSkillTrees().add(this); } - + // Add point id to avatar excel excel.getSkillTreeIds().add(this.getPointID()); } diff --git a/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java b/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java new file mode 100644 index 0000000..17da46f --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java @@ -0,0 +1,21 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import lombok.Getter; + +@Getter +@ResourceType(name = {"BackGroundMusic.json"}) +public class BackGroundMusicExcel extends GameResource { + private int ID; + private int GroupID; + + @Override + public int getId() { + return ID; + } + public int getGroupId() { + return GroupID; + } + +} diff --git a/src/main/java/emu/lunarcore/data/excel/BattleEventDataExcel.java b/src/main/java/emu/lunarcore/data/excel/BattleEventDataExcel.java new file mode 100644 index 0000000..f96658a --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/BattleEventDataExcel.java @@ -0,0 +1,42 @@ +package emu.lunarcore.data.excel; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.game.rogue.RogueBuffType; +import emu.lunarcore.util.Utils; +import lombok.Getter; + +@Getter +@ResourceType(name = {"BattleEventData.json"}) +public class BattleEventDataExcel extends GameResource { + private int BattleEventID; + private String Config; + + private static final Pattern roguePattern = Pattern.compile("(?<=Avatar_RogueBattleevent)(.*?)(?=_Config.json)"); + + @Override + public int getId() { + return BattleEventID; + } + + @Override + public void onLoad() { + try { + Matcher matcher = roguePattern.matcher(this.Config); + + if (matcher.find()) { + int rogueBuffType = Utils.parseSafeInt(matcher.group(0)); + var type = RogueBuffType.getById(rogueBuffType); + + if (type != null) { + type.setBattleEventSkill(this.BattleEventID); + } + } + } catch (Exception e) { + // Ignored + } + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/ChallengeExcel.java b/src/main/java/emu/lunarcore/data/excel/ChallengeExcel.java index 14e46d6..522205c 100644 --- a/src/main/java/emu/lunarcore/data/excel/ChallengeExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ChallengeExcel.java @@ -15,46 +15,46 @@ public class ChallengeExcel extends GameResource { private int StageNum; private int ChallengeCountDown; private int MazeBuffID; - + private int[] ChallengeTargetID; - + private int MazeGroupID1; private int[] ConfigList1; private int[] NpcMonsterIDList1; private int[] EventIDList1; - + private int MazeGroupID2; private int[] ConfigList2; private int[] NpcMonsterIDList2; private int[] EventIDList2; - + private transient Int2ObjectMap challengeMonsters1; private transient Int2ObjectMap challengeMonsters2; - + @Override public int getId() { return ID; } - + @Override public void onLoad() { // Cache challenge monsters this.challengeMonsters1 = new Int2ObjectOpenHashMap<>(); for (int i = 0; i < ConfigList1.length; i++) { if (ConfigList1[i] == 0) break; - + var monster = new ChallengeMonsterInfo(ConfigList1[i], NpcMonsterIDList1[i], EventIDList1[i]); this.challengeMonsters1.put(monster.getConfigId(), monster); } - + this.challengeMonsters2 = new Int2ObjectOpenHashMap<>(); for (int i = 0; i < ConfigList2.length; i++) { if (ConfigList2[i] == 0) break; - + var monster = new ChallengeMonsterInfo(ConfigList2[i], NpcMonsterIDList2[i], EventIDList2[i]); this.challengeMonsters2.put(monster.getConfigId(), monster); } - + // Clear arrays to save memory this.ConfigList1 = null; this.NpcMonsterIDList1 = null; @@ -69,12 +69,12 @@ public class ChallengeExcel extends GameResource { private int configId; private int npcMonsterId; private int eventId; - + public ChallengeMonsterInfo(int configId, int npcMonsterId, int eventId) { this.configId = configId; this.npcMonsterId = npcMonsterId; this.eventId = eventId; } - + } } diff --git a/src/main/java/emu/lunarcore/data/excel/ChallengeGroupExcel.java b/src/main/java/emu/lunarcore/data/excel/ChallengeGroupExcel.java index 2ba7a8f..7d4a9c3 100644 --- a/src/main/java/emu/lunarcore/data/excel/ChallengeGroupExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ChallengeGroupExcel.java @@ -9,7 +9,7 @@ import lombok.Getter; public class ChallengeGroupExcel extends GameResource { private int GroupID; private int RewardLineGroupID; - + @Override public int getId() { return GroupID; diff --git a/src/main/java/emu/lunarcore/data/excel/ChallengeRewardExcel.java b/src/main/java/emu/lunarcore/data/excel/ChallengeRewardExcel.java index 2e1f357..c111fad 100644 --- a/src/main/java/emu/lunarcore/data/excel/ChallengeRewardExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ChallengeRewardExcel.java @@ -10,7 +10,7 @@ public class ChallengeRewardExcel extends GameResource { private int GroupID; private int StarCount; private int RewardID; - + @Override public int getId() { return (GroupID << 16) + StarCount; diff --git a/src/main/java/emu/lunarcore/data/excel/ChallengeTargetExcel.java b/src/main/java/emu/lunarcore/data/excel/ChallengeTargetExcel.java index bc5f36a..06a4281 100644 --- a/src/main/java/emu/lunarcore/data/excel/ChallengeTargetExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ChallengeTargetExcel.java @@ -11,7 +11,7 @@ public class ChallengeTargetExcel extends GameResource { private int ID; private ChallengeType ChallengeTargetType; private int ChallengeTargetParam1; - + @Override public int getId() { return ID; diff --git a/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java b/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java new file mode 100644 index 0000000..436932f --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java @@ -0,0 +1,20 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import lombok.Getter; + +@Getter +@ResourceType(name = {"ChatBubbleConfig.json"}, loadPriority = LoadPriority.LOW) +public class ChatBubbleExcel extends GameResource { + private int ID; + private String ShowType; + private int ShowParam; + + @Override + public int getId() { + return ID; + } + +} diff --git a/src/main/java/emu/lunarcore/data/excel/CocoonExcel.java b/src/main/java/emu/lunarcore/data/excel/CocoonExcel.java index 9209243..86826a9 100644 --- a/src/main/java/emu/lunarcore/data/excel/CocoonExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/CocoonExcel.java @@ -16,7 +16,7 @@ public class CocoonExcel extends GameResource { private int MaxWave; private IntArrayList StageIDList; private IntArrayList DropList; - + @Override public int getId() { return (ID << 8) + WorldLevel; diff --git a/src/main/java/emu/lunarcore/data/excel/EquipmentExpItemExcel.java b/src/main/java/emu/lunarcore/data/excel/EquipmentExpItemExcel.java index 70b991a..e5254ed 100644 --- a/src/main/java/emu/lunarcore/data/excel/EquipmentExpItemExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/EquipmentExpItemExcel.java @@ -7,7 +7,6 @@ import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; import emu.lunarcore.data.ResourceType.LoadPriority; - import lombok.Getter; @Getter @@ -30,7 +29,7 @@ public class EquipmentExpItemExcel extends GameResource { excel.setEquipmentExp(ExpProvide); excel.setExpCost(CoinCost); - + // Add to game depot if (ExpProvide > 0) { GameDepot.getEquipmentExpExcels().add(this); diff --git a/src/main/java/emu/lunarcore/data/excel/HeroExcel.java b/src/main/java/emu/lunarcore/data/excel/HeroExcel.java index cf13e47..b3c7e98 100644 --- a/src/main/java/emu/lunarcore/data/excel/HeroExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/HeroExcel.java @@ -10,7 +10,7 @@ import lombok.Getter; public class HeroExcel extends GameResource { private int HeroAvatarID; private PlayerGender Gender; - + @Override public int getId() { return HeroAvatarID; diff --git a/src/main/java/emu/lunarcore/data/excel/ItemComposeExcel.java b/src/main/java/emu/lunarcore/data/excel/ItemComposeExcel.java index dd61447..b42c292 100644 --- a/src/main/java/emu/lunarcore/data/excel/ItemComposeExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ItemComposeExcel.java @@ -15,11 +15,12 @@ public class ItemComposeExcel extends GameResource { private int ItemID; private FormulaType FormulaType; private List MaterialCost; - private int[] SpecialMaterialCost; + private IntOpenHashSet SpecialMaterialCost; + private int SpecialMaterialCostNumber; private int CoinCost; private int WorldLevelRequire; private IntOpenHashSet RelicList; - + @Override public int getId() { return ID; diff --git a/src/main/java/emu/lunarcore/data/excel/ItemExcel.java b/src/main/java/emu/lunarcore/data/excel/ItemExcel.java index c368552..6a5cfa8 100644 --- a/src/main/java/emu/lunarcore/data/excel/ItemExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ItemExcel.java @@ -8,6 +8,7 @@ import emu.lunarcore.data.common.ItemParam; import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.enums.ItemRarity; import emu.lunarcore.game.enums.ItemSubType; +import emu.lunarcore.game.enums.ItemUseMethod; import lombok.Getter; import lombok.Setter; @@ -18,11 +19,14 @@ public class ItemExcel extends GameResource { // General item data private int ID; private long ItemName; - private ItemMainType ItemMainType; - private ItemSubType ItemSubType; + private ItemMainType ItemMainType = emu.lunarcore.game.enums.ItemMainType.Unknown; + private ItemSubType ItemSubType = emu.lunarcore.game.enums.ItemSubType.Unknown; private ItemRarity Rarity; private int PileLimit; private int PurposeType; + + private int UseDataID; + private ItemUseMethod UseMethod; private List ReturnItemIDList; @@ -44,6 +48,10 @@ public class ItemExcel extends GameResource { return ItemMainType == emu.lunarcore.game.enums.ItemMainType.Equipment && this.getEquipmentExcel() != null; } + public boolean isHeadIcon() { + return ItemSubType == emu.lunarcore.game.enums.ItemSubType.HeadIcon; + } + public boolean isRelic() { return ItemMainType == emu.lunarcore.game.enums.ItemMainType.Relic && this.getRelicExcel() != null; } @@ -51,6 +59,10 @@ public class ItemExcel extends GameResource { public boolean isEquippable() { return ItemMainType == emu.lunarcore.game.enums.ItemMainType.Relic || ItemMainType == emu.lunarcore.game.enums.ItemMainType.Equipment; } + + public int getRarityNum() { + return this.getRarity().getVal(); + } public int getRelicExp() { if (this.relicExcel != null) { @@ -58,7 +70,7 @@ public class ItemExcel extends GameResource { } return this.relicExp; } - + public int getRelicExpCost() { if (this.relicExcel != null) { return this.relicExcel.getCoinCost(); diff --git a/src/main/java/emu/lunarcore/data/excel/ItemUseExcel.java b/src/main/java/emu/lunarcore/data/excel/ItemUseExcel.java new file mode 100644 index 0000000..5ecac12 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/ItemUseExcel.java @@ -0,0 +1,29 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.game.enums.ItemFoodTargetType; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import lombok.Getter; + +@Getter +@ResourceType(name = {"ItemUseData.json", "ItemUseBuffData.json"}) +public class ItemUseExcel extends GameResource { + private int UseDataID; + private int ConsumeType; + private int MazeBuffID; + + private double PreviewHPRecoveryPercent; + private int PreviewHPRecoveryValue; + private double PreviewPowerPercent; + private int PreviewSkillPoint; + + private ItemFoodTargetType UseTargetType; + private IntArrayList UseParam; + + @Override + public int getId() { + return UseDataID; + } + +} diff --git a/src/main/java/emu/lunarcore/data/excel/MapEntranceExcel.java b/src/main/java/emu/lunarcore/data/excel/MapEntranceExcel.java index aa50fc4..2d1805c 100644 --- a/src/main/java/emu/lunarcore/data/excel/MapEntranceExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/MapEntranceExcel.java @@ -12,7 +12,7 @@ public class MapEntranceExcel extends GameResource { private int FloorID; private int StartGroupID; private int StartAnchorID; - + @Override public int getId() { return ID; diff --git a/src/main/java/emu/lunarcore/data/excel/MazeBuffExcel.java b/src/main/java/emu/lunarcore/data/excel/MazeBuffExcel.java index 00ecff1..01dd412 100644 --- a/src/main/java/emu/lunarcore/data/excel/MazeBuffExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/MazeBuffExcel.java @@ -9,7 +9,7 @@ import lombok.Getter; public class MazeBuffExcel extends GameResource { private int ID; private int Lv; - + @Override public int getId() { return (ID << 4) + Lv; diff --git a/src/main/java/emu/lunarcore/data/excel/MazePlaneExcel.java b/src/main/java/emu/lunarcore/data/excel/MazePlaneExcel.java index b6faf18..87f989c 100644 --- a/src/main/java/emu/lunarcore/data/excel/MazePlaneExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/MazePlaneExcel.java @@ -14,10 +14,10 @@ public class MazePlaneExcel extends GameResource { private int WorldID; private int StartFloorID; private long PlaneName; - + @SerializedName(value = "PlaneType") private PlaneType planeType = PlaneType.Unknown; - + @Override public int getId() { return PlaneID; diff --git a/src/main/java/emu/lunarcore/data/excel/MonsterDropExcel.java b/src/main/java/emu/lunarcore/data/excel/MonsterDropExcel.java index 617d157..4a38a75 100644 --- a/src/main/java/emu/lunarcore/data/excel/MonsterDropExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/MonsterDropExcel.java @@ -13,9 +13,9 @@ public class MonsterDropExcel extends GameResource { private int MonsterTemplateID; private int WorldLevel; private int AvatarExpReward; - + private List DisplayItemList; - + @Override public int getId() { return (MonsterTemplateID << 4) + WorldLevel; diff --git a/src/main/java/emu/lunarcore/data/excel/MonsterExcel.java b/src/main/java/emu/lunarcore/data/excel/MonsterExcel.java new file mode 100644 index 0000000..6420ddf --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/MonsterExcel.java @@ -0,0 +1,16 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import lombok.Getter; + +@Getter +@ResourceType(name = {"MonsterConfig.json"}) +public class MonsterExcel extends GameResource { + private int MonsterID; + + @Override + public int getId() { + return MonsterID; + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/NpcExcel.java b/src/main/java/emu/lunarcore/data/excel/NpcExcel.java index ca7b497..e7b7849 100644 --- a/src/main/java/emu/lunarcore/data/excel/NpcExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/NpcExcel.java @@ -8,7 +8,7 @@ import lombok.Getter; @ResourceType(name = {"NPCData.json"}) public class NpcExcel extends GameResource { private int ID; - + @Override public int getId() { return ID; diff --git a/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java b/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java new file mode 100644 index 0000000..9f00281 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java @@ -0,0 +1,18 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import lombok.Getter; + +@Getter +@ResourceType(name = {"PhoneThemeConfig.json"}, loadPriority = LoadPriority.LOW) +public class PhoneThemeExcel extends GameResource { + private int ID; + private String ShowType; + + @Override + public int getId() { + return ID; + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/PlayerIconExcel.java b/src/main/java/emu/lunarcore/data/excel/PlayerIconExcel.java new file mode 100644 index 0000000..f04fc50 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/PlayerIconExcel.java @@ -0,0 +1,17 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import lombok.Getter; + +@Getter +@ResourceType(name = {"PlayerIcon.json"}, loadPriority = LoadPriority.NORMAL) +public class PlayerIconExcel extends GameResource { + private int ID; + + @Override + public int getId() { + return ID; + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/PropExcel.java b/src/main/java/emu/lunarcore/data/excel/PropExcel.java index 32e1deb..c5a6afb 100644 --- a/src/main/java/emu/lunarcore/data/excel/PropExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/PropExcel.java @@ -12,15 +12,15 @@ public class PropExcel extends GameResource { private long PropName; private String JsonPath; private PropType PropType; - + private transient boolean recoverHp; private transient boolean recoverMp; - + @Override public int getId() { return ID; } - + @Override public void onLoad() { // Hacky way to determine if a prop will recover hp or mp @@ -31,7 +31,7 @@ public class PropExcel extends GameResource { this.recoverHp = true; } } - + // Clear for optimization this.JsonPath = null; } diff --git a/src/main/java/emu/lunarcore/data/excel/QuestExcel.java b/src/main/java/emu/lunarcore/data/excel/QuestExcel.java new file mode 100644 index 0000000..0c2f50f --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/QuestExcel.java @@ -0,0 +1,17 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import lombok.Getter; + +@Getter +@ResourceType(name = {"QuestData.json"}, loadPriority = LoadPriority.NORMAL) +public class QuestExcel extends GameResource { + private int QuestID; + + @Override + public int getId() { + return QuestID; + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/RelicExcel.java b/src/main/java/emu/lunarcore/data/excel/RelicExcel.java index d535e30..4cd8a8e 100644 --- a/src/main/java/emu/lunarcore/data/excel/RelicExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RelicExcel.java @@ -26,6 +26,9 @@ public class RelicExcel extends GameResource { public int getId() { return ID; } + public int getSetId() { + return SetID; + } @Override public void onLoad() { diff --git a/src/main/java/emu/lunarcore/data/excel/RelicExpItemExcel.java b/src/main/java/emu/lunarcore/data/excel/RelicExpItemExcel.java index c60e0ab..d30a650 100644 --- a/src/main/java/emu/lunarcore/data/excel/RelicExpItemExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RelicExpItemExcel.java @@ -30,7 +30,7 @@ public class RelicExpItemExcel extends GameResource { excel.setRelicExp(ExpProvide); excel.setExpCost(CoinCost); - + // Add to game depot if (ExpProvide > 0 && excel.getRarity() != ItemRarity.SuperRare) { GameDepot.getRelicExpExcels().add(this); diff --git a/src/main/java/emu/lunarcore/data/excel/RelicSetExcel.java b/src/main/java/emu/lunarcore/data/excel/RelicSetExcel.java new file mode 100644 index 0000000..bd0677a --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/RelicSetExcel.java @@ -0,0 +1,17 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import lombok.Getter; + +@Getter +@ResourceType(name = {"RelicSetConfig.json"}, loadPriority = LoadPriority.NORMAL) +public class RelicSetExcel extends GameResource { + private int SetID; + + @Override + public int getId() { + return SetID; + } +} diff --git a/src/main/java/emu/lunarcore/data/excel/RewardExcel.java b/src/main/java/emu/lunarcore/data/excel/RewardExcel.java index 7980602..d0c4e56 100644 --- a/src/main/java/emu/lunarcore/data/excel/RewardExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RewardExcel.java @@ -13,9 +13,9 @@ import lombok.Getter; @ResourceType(name = {"RewardData.json"}) public class RewardExcel extends GameResource { private int RewardID; - + private int Hcoin; - + private int ItemID_1; private int Count_1; private int ItemID_2; @@ -26,9 +26,9 @@ public class RewardExcel extends GameResource { private int Count_4; private int ItemID_5; private int Count_5; - + private transient List rewards; - + @Override public int getId() { return RewardID; @@ -37,11 +37,11 @@ public class RewardExcel extends GameResource { @Override public void onLoad() { this.rewards = new ArrayList<>(); - + if (Hcoin > 0) { this.rewards.add(new ItemParam(GameConstants.MATERIAL_HCOIN_ID, Hcoin)); } - + if (ItemID_1 > 0) { this.rewards.add(new ItemParam(ItemID_1, Count_1)); } if (ItemID_2 > 0) { diff --git a/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java index ae3e71a..c916cc2 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueAeonExcel.java @@ -9,7 +9,7 @@ import lombok.Getter; public class RogueAeonExcel extends GameResource { private int AeonID; private int RogueBuffType; - + @Override public int getId() { return AeonID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueAreaExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueAreaExcel.java index f9e92a2..a760c15 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueAreaExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueAreaExcel.java @@ -6,6 +6,7 @@ import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; import emu.lunarcore.data.ResourceType.LoadPriority; +import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import lombok.Getter; @Getter @@ -14,10 +15,11 @@ public class RogueAreaExcel extends GameResource { private int RogueAreaID; private int AreaProgress; private int Difficulty; - + private Int2IntOpenHashMap ScoreMap; + private transient int mapId; private transient List sites; - + @Override public int getId() { return RogueAreaID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java index 0b9e5a8..1e571f0 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java @@ -1,29 +1,45 @@ package emu.lunarcore.data.excel; +import java.util.ArrayList; + import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; - +import emu.lunarcore.data.ResourceType.LoadPriority; +import emu.lunarcore.game.enums.RogueBuffAeonType; import lombok.Getter; @Getter -@ResourceType(name = {"RogueBuff.json"}) +@ResourceType(name = {"RogueBuff.json"}, loadPriority = LoadPriority.LOW) public class RogueBuffExcel extends GameResource { private int MazeBuffID; private int MazeBuffLevel; private int RogueBuffType; private int RogueBuffRarity; private int AeonID; - + private RogueBuffAeonType BattleEventBuffType = RogueBuffAeonType.Normal; + @Override public int getId() { - return MazeBuffID; + return (MazeBuffID << 4) + MazeBuffLevel; + } + + public boolean isAeonBuff() { + return this.BattleEventBuffType != RogueBuffAeonType.Normal; } @Override public void onLoad() { + // Add to random buff list if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) { GameDepot.getRogueRandomBuffList().add(this); } + + // Add to aeon buff list + if (BattleEventBuffType == RogueBuffAeonType.BattleEventBuff) { + GameDepot.getRogueAeonBuffs().put(this.getAeonID(), this); + } else if (BattleEventBuffType == RogueBuffAeonType.BattleEventBuffEnhance) { + GameDepot.getRogueAeonEnhanceBuffs().computeIfAbsent(this.getAeonID(), e -> new ArrayList<>()).add(this); + } } } diff --git a/src/main/java/emu/lunarcore/data/excel/RogueManagerExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueManagerExcel.java index 19dc66e..68171f6 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueManagerExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueManagerExcel.java @@ -1,6 +1,7 @@ package emu.lunarcore.data.excel; -import java.time.*; +import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import emu.lunarcore.data.GameResource; @@ -12,20 +13,20 @@ import lombok.Getter; @ResourceType(name = {"RogueManager.json"}) public class RogueManagerExcel extends GameResource { private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - + private int ScheduleDataID; private int RogueSeason; - + @Getter(AccessLevel.NONE) private String BeginTime; @Getter(AccessLevel.NONE) private String EndTime; - + private int[] RogueAreaIDList; - + private transient long beginTime; private transient long endTime; - + @Override public int getId() { return ScheduleDataID; @@ -38,13 +39,13 @@ public class RogueManagerExcel extends GameResource { .atOffset(ZoneOffset.UTC) .toInstant() .toEpochMilli(); - + this.endTime = LocalDateTime.from(formatter.parse(this.EndTime)) .atOffset(ZoneOffset.UTC) .toInstant() .toEpochMilli(); } catch (Exception e) { - + } } } diff --git a/src/main/java/emu/lunarcore/data/excel/RogueMapExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueMapExcel.java index e91250b..84b2be4 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueMapExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueMapExcel.java @@ -14,12 +14,12 @@ public class RogueMapExcel extends GameResource { private boolean IsStart; private int[] NextSiteIDList; private int[] LevelList; - + @Override public int getId() { return (RogueMapID << 8) + SiteID; } - + @Override public void onLoad() { GameDepot.getRogueMapsById(this.getRogueMapID()).add(this); diff --git a/src/main/java/emu/lunarcore/data/excel/RogueMiracleExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueMiracleExcel.java index 3d38b4e..1e3cef0 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueMiracleExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueMiracleExcel.java @@ -3,7 +3,6 @@ package emu.lunarcore.data.excel; import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; - import lombok.Getter; @Getter @@ -12,7 +11,7 @@ public class RogueMiracleExcel extends GameResource { private int MiracleID; private boolean IsShow; private int MiracleReward; - + @Override public int getId() { return MiracleID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueMonsterExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueMonsterExcel.java index a83e630..43e47c2 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueMonsterExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueMonsterExcel.java @@ -2,7 +2,6 @@ package emu.lunarcore.data.excel; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; - import lombok.Getter; @Getter @@ -11,7 +10,7 @@ public class RogueMonsterExcel extends GameResource { private int RogueMonsterID; private int NpcMonsterID; private int EventID; - + @Override public int getId() { return RogueMonsterID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueNPCExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueNPCExcel.java index 31b69bc..cb3a026 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueNPCExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueNPCExcel.java @@ -10,7 +10,7 @@ import lombok.Getter; public class RogueNPCExcel extends GameResource { private int RogueNPCID; private int NPCID; - + @Override public int getId() { return RogueNPCID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueRoomExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueRoomExcel.java index 5f1c85f..3144a13 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueRoomExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueRoomExcel.java @@ -13,7 +13,7 @@ public class RogueRoomExcel extends GameResource { private int MapEntrance; private int GroupID; private Int2IntOpenHashMap GroupWithContent; - + @Override public int getId() { return RogueRoomID; diff --git a/src/main/java/emu/lunarcore/data/excel/RogueTalentExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueTalentExcel.java index 3664b7d..3143f26 100644 --- a/src/main/java/emu/lunarcore/data/excel/RogueTalentExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/RogueTalentExcel.java @@ -12,7 +12,7 @@ import lombok.Getter; public class RogueTalentExcel extends GameResource { private int TalentID; private List Cost; - + @Override public int getId() { return TalentID; diff --git a/src/main/java/emu/lunarcore/data/excel/ShopExcel.java b/src/main/java/emu/lunarcore/data/excel/ShopExcel.java index 254bde1..3654023 100644 --- a/src/main/java/emu/lunarcore/data/excel/ShopExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ShopExcel.java @@ -2,8 +2,8 @@ package emu.lunarcore.data.excel; import emu.lunarcore.data.GameResource; import emu.lunarcore.data.ResourceType; +import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import lombok.Getter; @Getter @@ -11,13 +11,13 @@ import lombok.Getter; public class ShopExcel extends GameResource { private int ShopID; private int ShopType; - + private transient Int2ObjectMap goods; - + public ShopExcel() { - this.goods = new Int2ObjectOpenHashMap<>(); + this.goods = new Int2ObjectAVLTreeMap<>(); } - + @Override public int getId() { return ShopID; diff --git a/src/main/java/emu/lunarcore/data/excel/ShopGoodsExcel.java b/src/main/java/emu/lunarcore/data/excel/ShopGoodsExcel.java index 56bb792..55f5456 100644 --- a/src/main/java/emu/lunarcore/data/excel/ShopGoodsExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/ShopGoodsExcel.java @@ -19,38 +19,41 @@ public class ShopGoodsExcel extends GameResource { private int ItemID; private int ItemCount; private int ShopID; - + @Getter(AccessLevel.NONE) private int[] CurrencyList; @Getter(AccessLevel.NONE) private int[] CurrencyCostList; - + private transient List costList; - + @Override public int getId() { return GoodsID; } - + @Override public void onLoad() { + // Skip if we dont have an item id associated with this goods excel + if (this.getItemID() == 0) return; + // Add to shop excel ShopExcel shop = GameData.getShopExcelMap().get(this.ShopID); if (shop == null) return; - + shop.getGoods().put(this.GoodsID, this); - + // Cache currency cost this.costList = new ArrayList<>(CurrencyList.length); - + for (int i = 0; i < CurrencyList.length; i++) { ItemParam param = new ItemParam(CurrencyList[i], CurrencyCostList[i]); this.costList.add(param); } - + // Done - Clear references to save memory this.CurrencyList = null; - this.CurrencyCostList = null; + this.CurrencyCostList = null; } public Goods toProto() { @@ -58,7 +61,7 @@ public class ShopGoodsExcel extends GameResource { .setGoodsId(this.getGoodsID()) .setItemId(this.getItemID()) .setEndTime(Integer.MAX_VALUE); - + return proto; } } diff --git a/src/main/java/emu/lunarcore/data/excel/StageExcel.java b/src/main/java/emu/lunarcore/data/excel/StageExcel.java index 672585c..e50c48b 100644 --- a/src/main/java/emu/lunarcore/data/excel/StageExcel.java +++ b/src/main/java/emu/lunarcore/data/excel/StageExcel.java @@ -18,10 +18,10 @@ public class StageExcel extends GameResource { private long StageName; private StageType StageType; private int Level; - - @Getter(AccessLevel.NONE) + + @Getter(AccessLevel.NONE) private List MonsterList; - + // Cache private transient List monsterWaves; @@ -38,18 +38,18 @@ public class StageExcel extends GameResource { this.monsterWaves.add(wave.toList()); } } - + public static class StageMonsterWave { private int Monster0; private int Monster1; private int Monster2; private int Monster3; private int Monster4; - + // Sigh... public IntList toList() { IntList list = new IntArrayList(5); - + if (this.Monster0 != 0) { list.add(this.Monster0); } if (this.Monster1 != 0) { @@ -61,7 +61,7 @@ public class StageExcel extends GameResource { } if (this.Monster4 != 0) { list.add(this.Monster4); } - + return list; } } diff --git a/src/main/java/emu/lunarcore/data/excel/TextJoinExcel.java b/src/main/java/emu/lunarcore/data/excel/TextJoinExcel.java new file mode 100644 index 0000000..7776570 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/TextJoinExcel.java @@ -0,0 +1,23 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import lombok.Getter; + +@Getter +@ResourceType(name = {"TextJoinConfig.json"}) +public class TextJoinExcel extends GameResource { + private int TextJoinID; + private int DefaultItem; + private IntArrayList TextJoinItemList; + + @Override + public int getId() { + return TextJoinID; + } + + public IntArrayList getTextJoinItemList() { + return TextJoinItemList; + } +} diff --git a/src/main/java/emu/lunarcore/database/DatabaseManager.java b/src/main/java/emu/lunarcore/database/DatabaseManager.java index d79e44f..1ef05e9 100644 --- a/src/main/java/emu/lunarcore/database/DatabaseManager.java +++ b/src/main/java/emu/lunarcore/database/DatabaseManager.java @@ -48,15 +48,15 @@ public final class DatabaseManager { // Local mongo server if (info.isUseInternal() && Utils.isPortOpen(internalConfig.getAddress(), internalConfig.getPort())) { connectionString = startInternalMongoServer(internalConfig); - LunarCore.getLogger().info("Using local mongo server at " + server.getConnectionString()); + LunarCore.getLogger().info("Started local mongo server at " + server.getConnectionString()); } // Initialize - MongoClient gameMongoClient = MongoClients.create(connectionString); - + MongoClient mongoClient = MongoClients.create(connectionString); + // Add our custom fastutil codecs var codecProvider = CodecRegistries.fromCodecs( - new IntSetCodec(), new Int2IntMapCodec() + new IntSetCodec(), new IntListCodec(), new Int2IntMapCodec() ); // Set mapper options. @@ -67,7 +67,7 @@ public final class DatabaseManager { .build(); // Create data store. - datastore = Morphia.createDatastore(gameMongoClient, info.getCollection(), mapperOptions); + datastore = Morphia.createDatastore(mongoClient, info.getCollection(), mapperOptions); // Map classes var entities = new Reflections(LunarCore.class.getPackageName()) diff --git a/src/main/java/emu/lunarcore/database/codecs/IntListCodec.java b/src/main/java/emu/lunarcore/database/codecs/IntListCodec.java new file mode 100644 index 0000000..eed88f6 --- /dev/null +++ b/src/main/java/emu/lunarcore/database/codecs/IntListCodec.java @@ -0,0 +1,42 @@ +package emu.lunarcore.database.codecs; + +import org.bson.BsonReader; +import org.bson.BsonType; +import org.bson.BsonWriter; +import org.bson.codecs.Codec; +import org.bson.codecs.DecoderContext; +import org.bson.codecs.EncoderContext; + +import it.unimi.dsi.fastutil.ints.IntArrayList; +import it.unimi.dsi.fastutil.ints.IntList; + +/** + * Custom mongodb codec for encoding/decoding fastutil int sets. + */ +public class IntListCodec implements Codec { + + @Override + public Class getEncoderClass() { + return IntList.class; + } + + @Override + public void encode(BsonWriter writer, IntList collection, EncoderContext encoderContext) { + writer.writeStartArray(); + for (int value : collection) { + writer.writeInt32(value); + } + writer.writeEndArray(); + } + + @Override + public IntList decode(BsonReader reader, DecoderContext decoderContext) { + IntList collection = new IntArrayList(); + reader.readStartArray(); + while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) { + collection.add(reader.readInt32()); + } + reader.readEndArray(); + return collection; + } +} \ No newline at end of file diff --git a/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java b/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java index 2bd0b75..cdb4fbe 100644 --- a/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java @@ -53,15 +53,20 @@ public class AvatarStorage extends BasePlayerManager implements Iterable drops; private final long timestamp; + private IntList turnSnapshotList; // TODO maybe turn it into a map? + @Setter private int staminaCost; @Setter private int levelOverride; @Setter private int roundsLimit; @@ -58,6 +61,13 @@ public class Battle { this.stages.addAll(stages); } + public IntList getTurnSnapshotList() { + if (this.turnSnapshotList == null) { + this.turnSnapshotList = new IntArrayList(); + } + return this.turnSnapshotList; + } + public StageType getStageType() { StageExcel stage = this.getFirstStage(); if (stage != null) { @@ -111,6 +121,10 @@ public class Battle { return buff; } + public boolean hasBuff(int buffId) { + return this.buffs.stream().filter(buff -> buff.getId() == buffId).findFirst().isPresent(); + } + public void clearBuffs() { this.buffs.clear(); } @@ -175,11 +189,33 @@ public class Battle { } } + // Apply food buffs to battle + if (player.getFoodBuffs().size() > 0) { + for (int buffId : player.getFoodBuffs().values()) { + this.addBuff(buffId, -1); + } + } + // Buffs for (MazeBuff buff : this.getBuffs()) { proto.addBuffList(buff.toProto()); } + // Client turn snapshots + if (this.turnSnapshotList != null) { + for (int id : this.turnSnapshotList) { + var snapshot = ClientTurnSnapshot.newInstance() + .setBattleEventId(id); + + // Temp solution + snapshot.getMutableStatus().getMutableSpBar() + .setCurSp(10000) + .setMaxSp(10000); + + proto.addTurnSnapshotList(snapshot); + } + } + return proto; } } diff --git a/src/main/java/emu/lunarcore/game/battle/BattleService.java b/src/main/java/emu/lunarcore/game/battle/BattleService.java index 8e771d5..25222cf 100644 --- a/src/main/java/emu/lunarcore/game/battle/BattleService.java +++ b/src/main/java/emu/lunarcore/game/battle/BattleService.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; +import emu.lunarcore.GameConstants; import emu.lunarcore.data.GameData; import emu.lunarcore.data.excel.CocoonExcel; import emu.lunarcore.data.excel.StageExcel; @@ -63,13 +64,13 @@ public class BattleService extends BaseGameService { } } - // Give the client an error if no attacked entities detected + // Skip if no attacked entities detected if (targetEntities.size() == 0) { - player.sendPacket(new PacketSceneCastSkillScRsp()); + player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId)); return; } - // Monster list + // Separate entities into monster list List monsters = new ArrayList<>(); // Destroy props @@ -84,6 +85,15 @@ public class BattleService extends BaseGameService { player.getScene().removeEntity(entity); } } + + // Check if we are using a skill that doesnt trigger a battle + if (castedSkill != null && !castedSkill.isTriggerBattle()) { + // Apply buffs to monsters + castedSkill.onAttack(player.getCurrentLeaderAvatar(), monsters); + // Skip battle if our technique does not trigger a battle + player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId)); + return; + } // Start battle if (monsters.size() > 0) { @@ -106,7 +116,20 @@ public class BattleService extends BaseGameService { // Create battle and add npc monsters to it Battle battle = new Battle(player, player.getLineupManager().getCurrentLineup(), stages); - battle.getNpcMonsters().addAll(monsters); + + // Add npc monsters + for (var monster : monsters) { + battle.getNpcMonsters().add(monster); + + // Handle monster buffs + // TODO handle multiple waves properly + monster.applyBuffs(battle); + + // Override level + if (monster.getOverrideLevel() > 0) { + battle.setLevelOverride(monster.getOverrideLevel()); + } + } // Add buffs to battle if (isPlayerCaster) { @@ -122,6 +145,9 @@ public class BattleService extends BaseGameService { buff.addDynamicValue("SkillIndex", castedSkill.getIndex()); } } + } else { + // Ambush buff (for monsters) + battle.addBuff(GameConstants.BATTLE_AMBUSH_BUFF_ID, -1, 1); } // Challenge @@ -274,6 +300,11 @@ public class BattleService extends BaseGameService { } } + // Clear food buffs for player + if (player.getFoodBuffs().size() > 0) { + player.getFoodBuffs().clear(); + } + // Challenge if (player.getChallengeInstance() != null) { player.getChallengeInstance().onBattleFinish(battle, result, stats); diff --git a/src/main/java/emu/lunarcore/game/battle/MazeBuff.java b/src/main/java/emu/lunarcore/game/battle/MazeBuff.java index 28a6264..1c8fc9e 100644 --- a/src/main/java/emu/lunarcore/game/battle/MazeBuff.java +++ b/src/main/java/emu/lunarcore/game/battle/MazeBuff.java @@ -1,6 +1,7 @@ package emu.lunarcore.game.battle; import emu.lunarcore.data.excel.MazeBuffExcel; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.BattleBuffOuterClass.BattleBuff; import emu.lunarcore.proto.BattleBuffOuterClass.BattleBuff.DynamicValuesEntry; import it.unimi.dsi.fastutil.ints.IntArrayList; @@ -9,6 +10,7 @@ import it.unimi.dsi.fastutil.objects.Object2DoubleMap; import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap; import lombok.AccessLevel; import lombok.Getter; +import lombok.Setter; @Getter public class MazeBuff { @@ -19,7 +21,10 @@ public class MazeBuff { private IntList targetIndex; @Getter(AccessLevel.NONE) - private Object2DoubleMap dynamicValues; + private Object2DoubleMap dynamicValues; + + @Setter + private transient GameEntity owner; public MazeBuff(MazeBuffExcel excel, int ownerIndex, int waveFlag) { this(excel.getBuffId(), excel.getLv(), ownerIndex, waveFlag); @@ -52,9 +57,12 @@ public class MazeBuff { var proto = BattleBuff.newInstance() .setId(this.getId()) .setLevel(this.getLevel()) - .setOwnerId(this.getOwnerIndex()) .setWaveFlag(this.getWaveFlag()); + if (this.ownerIndex != 0) { + proto.setOwnerId(this.getOwnerIndex()); + } + if (this.targetIndex != null) { for (int index : this.targetIndex) { proto.addTargetIndexList(index); diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java index f7ef773..240972a 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java @@ -6,6 +6,7 @@ import java.util.List; import emu.lunarcore.data.excel.AvatarExcel; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import lombok.Getter; import lombok.Setter; @@ -44,4 +45,13 @@ public class MazeSkill { action.onAttack(caster, battle); } } + + // Triggered when player attacks an enemy + public void onAttack(GameAvatar caster, List monsters) { + if (this.getAttackActions().size() == 0) return; + + for (var action : this.getAttackActions()) { + action.onAttack(caster, monsters); + } + } } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java index 22296c9..195aa23 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java @@ -1,7 +1,10 @@ package emu.lunarcore.game.battle.skills; +import java.util.List; + import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public abstract class MazeSkillAction { @@ -10,4 +13,6 @@ public abstract class MazeSkillAction { public abstract void onAttack(GameAvatar caster, Battle battle); + public abstract void onAttack(GameAvatar caster, List monsters); + } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java index 5c6bddb..772922a 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java @@ -1,7 +1,10 @@ package emu.lunarcore.game.battle.skills; +import java.util.List; + import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import lombok.Getter; @@ -29,5 +32,12 @@ public class MazeSkillAddBuff extends MazeSkillAction { battle.addBuff(buffId, battle.getLineup().getLeader(), 1 << i); } } + + @Override + public void onAttack(GameAvatar caster, List monsters) { + for (EntityMonster monster : monsters) { + monster.addBuff(caster.getAvatarId(), buffId, duration); + } + } } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java index a3a32bb..7872a57 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java @@ -1,7 +1,10 @@ package emu.lunarcore.game.battle.skills; +import java.util.List; + import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public class MazeSkillModifyHP extends MazeSkillAction { @@ -21,4 +24,9 @@ public class MazeSkillModifyHP extends MazeSkillAction { } + @Override + public void onAttack(GameAvatar caster, List monsters) { + + } + } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java index a12ca81..1e6e807 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java @@ -1,7 +1,10 @@ package emu.lunarcore.game.battle.skills; +import java.util.List; + import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public class MazeSkillModifySP extends MazeSkillAction { @@ -24,4 +27,9 @@ public class MazeSkillModifySP extends MazeSkillAction { } + @Override + public void onAttack(GameAvatar caster, List monsters) { + + } + } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java index 3c43acc..ae9cdd8 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java @@ -1,7 +1,10 @@ package emu.lunarcore.game.battle.skills; +import java.util.List; + import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityMonster; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public class MazeSkillSummonUnit extends MazeSkillAction { @@ -16,4 +19,9 @@ public class MazeSkillSummonUnit extends MazeSkillAction { // TODO Auto-generated method stub } + @Override + public void onAttack(GameAvatar caster, List monsters) { + // TODO Auto-generated method stub + } + } diff --git a/src/main/java/emu/lunarcore/game/challenge/ChallengeInstance.java b/src/main/java/emu/lunarcore/game/challenge/ChallengeInstance.java index 6e0ceaa..0a9ff00 100644 --- a/src/main/java/emu/lunarcore/game/challenge/ChallengeInstance.java +++ b/src/main/java/emu/lunarcore/game/challenge/ChallengeInstance.java @@ -14,6 +14,7 @@ import emu.lunarcore.proto.ChallengeStatusOuterClass.ChallengeStatus; import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType; import emu.lunarcore.server.packet.send.PacketChallengeLineupNotify; import emu.lunarcore.server.packet.send.PacketChallengeSettleNotify; +import emu.lunarcore.server.packet.send.PacketSyncLineupNotify; import emu.lunarcore.util.Position; import lombok.Getter; @@ -32,6 +33,7 @@ public class ChallengeInstance { private int status; private boolean hasAvatarDied; + @Setter private int savedMp; @Setter private int roundsLeft; @Setter private int stars; @@ -79,7 +81,8 @@ public class ChallengeInstance { } public void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) { - if (result == BattleEndStatus.BATTLE_END_WIN) { + switch (result) { + case BATTLE_END_WIN: // Check if any avatar in the lineup has died battle.getLineup().forEachAvatar(avatar -> { if (avatar.getCurrentHp(battle.getLineup()) <= 0) { @@ -109,6 +112,7 @@ public class ChallengeInstance { this.setCurrentExtraLineup(ExtraLineupType.LINEUP_CHALLENGE_2); player.getLineupManager().setCurrentExtraLineup(this.getCurrentExtraLineup(), true); player.sendPacket(new PacketChallengeLineupNotify(this.getCurrentExtraLineup())); + this.savedMp = player.getCurrentLineup().getMp(); // Move player player.moveTo(this.getStartPos(), this.getStartRot()); } @@ -116,9 +120,21 @@ public class ChallengeInstance { // Calculate rounds left this.roundsLeft = Math.min(Math.max(this.roundsLeft - stats.getRoundCnt(), 1), this.roundsLeft); - } else { + + // Set saved technique points (This will be restored if the player resets the challenge) + this.savedMp = player.getCurrentLineup().getMp(); + break; + case BATTLE_END_QUIT: + // Reset technique points and move back to start position + var lineup = player.getCurrentLineup(); + lineup.setMp(this.savedMp); + player.moveTo(this.getStartPos(), this.getStartRot()); + player.sendPacket(new PacketSyncLineupNotify(lineup)); + break; + default: // Fail challenge this.setStatus(ChallengeStatus.CHALLENGE_FAILED); + break; } } diff --git a/src/main/java/emu/lunarcore/game/challenge/ChallengeManager.java b/src/main/java/emu/lunarcore/game/challenge/ChallengeManager.java index 1e6af92..35e80f0 100644 --- a/src/main/java/emu/lunarcore/game/challenge/ChallengeManager.java +++ b/src/main/java/emu/lunarcore/game/challenge/ChallengeManager.java @@ -86,6 +86,7 @@ public class ChallengeManager extends BasePlayerManager { // Save start positions instance.getStartPos().set(getPlayer().getPos()); instance.getStartRot().set(getPlayer().getRot()); + instance.setSavedMp(getPlayer().getCurrentLineup().getMp()); // Send packet getPlayer().sendPacket(new PacketStartChallengeScRsp(getPlayer(), challengeId)); diff --git a/src/main/java/emu/lunarcore/game/enums/ItemFoodTargetType.java b/src/main/java/emu/lunarcore/game/enums/ItemFoodTargetType.java new file mode 100644 index 0000000..b717e35 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/enums/ItemFoodTargetType.java @@ -0,0 +1,16 @@ +package emu.lunarcore.game.enums; + +import lombok.Getter; + +@Getter +public enum ItemFoodTargetType { + All (0), + Alive (101), + Dead (102); + + private int val; + + private ItemFoodTargetType(int value) { + this.val = value; + } +} diff --git a/src/main/java/emu/lunarcore/game/enums/ItemMainType.java b/src/main/java/emu/lunarcore/game/enums/ItemMainType.java index 194be2a..f5bf0da 100644 --- a/src/main/java/emu/lunarcore/game/enums/ItemMainType.java +++ b/src/main/java/emu/lunarcore/game/enums/ItemMainType.java @@ -1,22 +1,29 @@ package emu.lunarcore.game.enums; +import emu.lunarcore.game.inventory.tabs.InventoryTabType; import lombok.Getter; @Getter public enum ItemMainType { - Unknown (0), - Virtual (1), - AvatarCard (2), - Equipment (3), - Relic (4), - Usable (5), - Material (6), - Mission (7), - Display (8); + Unknown (0), + Virtual (1), + AvatarCard (2), + Equipment (3, InventoryTabType.EQUIPMENT), + Relic (4, InventoryTabType.RELIC), + Usable (5, InventoryTabType.MATERIAL), + Material (6, InventoryTabType.MATERIAL), + Mission (7, InventoryTabType.MATERIAL), + Display (8); private int val; + private InventoryTabType tabType; private ItemMainType(int value) { this.val = value; } + + private ItemMainType(int value, InventoryTabType tabType) { + this.val = value; + this.tabType = tabType; + } } diff --git a/src/main/java/emu/lunarcore/game/enums/ItemUseMethod.java b/src/main/java/emu/lunarcore/game/enums/ItemUseMethod.java new file mode 100644 index 0000000..e5390cf --- /dev/null +++ b/src/main/java/emu/lunarcore/game/enums/ItemUseMethod.java @@ -0,0 +1,29 @@ +package emu.lunarcore.game.enums; + +import lombok.Getter; + +@Getter +public enum ItemUseMethod { + Unknown (0), + FixedRewardGift (101), + RandomRewardGift (102), + PlayerSelectedReward (103), + TeamFoodBenefit (201), + TeamSpecificFoodBenefit (202), + ExternalSystemFoodBenefit (203), + PlayerSelectedDropGift (301), + TreasureMap (401), + Recipe (501), + PerformanceProp (601), + MonthlyCard (701), + BPUnlock68 (702), + BPUnlock128 (703), + BPUpgradeFrom68To128 (704), + AutoConversionItem (801); + + private int val; + + private ItemUseMethod(int value) { + this.val = value; + } +} diff --git a/src/main/java/emu/lunarcore/game/enums/RogueBuffAeonType.java b/src/main/java/emu/lunarcore/game/enums/RogueBuffAeonType.java new file mode 100644 index 0000000..059461c --- /dev/null +++ b/src/main/java/emu/lunarcore/game/enums/RogueBuffAeonType.java @@ -0,0 +1,17 @@ +package emu.lunarcore.game.enums; + +import lombok.Getter; + +@Getter +public enum RogueBuffAeonType { + Normal (0), + BattleEventBuff (1), + BattleEventBuffEnhance (2), + BattleEventBuffCross (3); + + private final int val; + + private RogueBuffAeonType(int value) { + this.val = value; + } +} diff --git a/src/main/java/emu/lunarcore/game/gacha/GachaBanner.java b/src/main/java/emu/lunarcore/game/gacha/GachaBanner.java index 078dd52..660a393 100644 --- a/src/main/java/emu/lunarcore/game/gacha/GachaBanner.java +++ b/src/main/java/emu/lunarcore/game/gacha/GachaBanner.java @@ -1,6 +1,6 @@ package emu.lunarcore.game.gacha; -import emu.lunarcore.proto.GachaCeilingOuterClass.GachaCeiling; +import emu.lunarcore.game.player.Player; import emu.lunarcore.proto.GachaInfoOuterClass.GachaInfo; import lombok.Getter; @@ -14,30 +14,34 @@ public class GachaBanner { private int[] rateUpItems4; private int eventChance = 50; - public GachaInfo toProto() { + public GachaInfo toProto(GachaService service, Player player) { var info = GachaInfo.newInstance() .setGachaId(this.getId()) .setDetailUrl("") .setHistoryUrl(""); - if (this.gachaType == GachaType.Normal) { - // Gacha ceiling - info.setGachaCeiling(GachaCeiling.newInstance()); - } else { + if (this.gachaType != GachaType.Normal) { info.setBeginTime(this.getBeginTime()); info.setEndTime(this.getEndTime()); } - - if (this.getRateUpItems4().length > 0) { - for (int id : getRateUpItems4()) { - info.addUpInfo(id); + + if (this.getId() == 1001) { + info.setGachaCeiling(player.getGachaInfo().toGachaCeiling(player)); + + info.addAllUpInfo(service.getPurpleAvatars()); + info.addAllUpInfo(service.getYellowAvatars()); + info.addAllUpInfo(service.getPurpleWeapons()); + info.addAllUpInfo(service.getYellowWeapons()); + + info.addAllFeatured(service.getDefaultFeaturedIds()); + } else { + if (this.getRateUpItems4().length > 0) { + info.addAllUpInfo(getRateUpItems4()); } - } - if (this.getRateUpItems5().length > 0) { - for (int id : getRateUpItems5()) { - info.addUpInfo(id); - info.addFeatured(id); + if (this.getRateUpItems5().length > 0) { + info.addAllUpInfo(getRateUpItems5()); + info.addAllFeatured(getRateUpItems5()); } } diff --git a/src/main/java/emu/lunarcore/game/gacha/GachaService.java b/src/main/java/emu/lunarcore/game/gacha/GachaService.java index ee34ea3..823e803 100644 --- a/src/main/java/emu/lunarcore/game/gacha/GachaService.java +++ b/src/main/java/emu/lunarcore/game/gacha/GachaService.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; +import emu.lunarcore.GameConstants; import emu.lunarcore.LunarCore; import emu.lunarcore.data.GameData; import emu.lunarcore.data.excel.ItemExcel; @@ -21,21 +22,25 @@ import emu.lunarcore.server.game.BaseGameService; import emu.lunarcore.server.game.GameServer; import emu.lunarcore.server.packet.send.PacketDoGachaScRsp; import emu.lunarcore.util.JsonUtils; +import emu.lunarcore.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 public class GachaService extends BaseGameService { private final Int2ObjectMap gachaBanners; private GetGachaInfoScRsp cachedProto; private int[] yellowAvatars = new int[] {1003, 1004, 1101, 1107, 1104, 1209, 1211}; private int[] yellowWeapons = new int[] {23000, 23002, 23003, 23004, 23005, 23012, 23013}; - private int[] purpleAvatars = new int[] {1001, 1002, 1008, 1009, 1013, 1103, 1105, 1106, 1108, 1109, 1111, 1201, 1202, 1206, 1207}; + private int[] purpleAvatars = new int[] {1001, 1002, 1008, 1009, 1013, 1103, 1105, 1106, 1108, 1109, 1110, 1111, 1201, 1202, 1206, 1207, 1210}; private int[] purpleWeapons = new int[] {21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21009, 21010, 21011, 21012, 21013, 21014, 21015, 21016, 21017, 21018, 21019, 21020}; private int[] blueWeapons = new int[] {20000, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20011, 20012, 20013, 20014, 20015, 20016, 20017, 20018, 20019, 20020}; - + private int[] defaultFeaturedIds = new int[] {23002, 1003, 1101, 1104, 23000, 23003}; + private static int starglightId = 252; private static int embersId = 251; @@ -45,10 +50,6 @@ public class GachaService extends BaseGameService { this.load(); } - public Int2ObjectMap getGachaBanners() { - return gachaBanners; - } - public int randomRange(int min, int max) { return ThreadLocalRandom.current().nextInt(max - min + 1) + min; } @@ -69,11 +70,11 @@ public class GachaService extends BaseGameService { } public synchronized void doPulls(Player player, int gachaId, int times) { - // Sanity check - if (times != 10 && times != 1) { - return; - } - if (player.getInventory().getInventoryTab(ItemMainType.Equipment).getSize() + times > player.getInventory().getInventoryTab(ItemMainType.Equipment).getMaxCapacity()) { + // Sanity checks + if (times != 10 && times != 1) return; + + // Prevent player from using gacha if they are at max light cones + if (player.getInventory().getTabByItemType(ItemMainType.Equipment).getSize() >= player.getInventory().getTabByItemType(ItemMainType.Equipment).getMaxCapacity()) { player.sendPacket(new PacketDoGachaScRsp()); return; } @@ -87,13 +88,19 @@ public class GachaService extends BaseGameService { // Spend currency if (banner.getGachaType().getCostItem() > 0) { - GameItem costItem = player.getInventory().getInventoryTab(ItemMainType.Material).getItemById(banner.getGachaType().getCostItem()); + GameItem costItem = player.getInventory().getMaterialByItemId(banner.getGachaType().getCostItem()); if (costItem == null || costItem.getCount() < times) { return; } player.getInventory().removeItem(costItem, times); } + + // Add gacha ceiling + if (banner.getGachaType() == GachaType.Normal || banner.getGachaType() == GachaType.Newbie) { + player.getGachaInfo().addCeilingNum(times); + player.save(); + } // Roll PlayerGachaBannerInfo gachaInfo = player.getGachaInfo().getBannerInfo(banner.getGachaType()); @@ -188,7 +195,7 @@ public class GachaService extends BaseGameService { if (avatar != null) { int dupeLevel = avatar.getRank(); int dupeItemId = avatarId + 10000; // Hacky fix so we dont have to fetch data from an excel - GameItem dupeItem = player.getInventory().getInventoryTab(ItemMainType.Material).getItemById(dupeItemId); + GameItem dupeItem = player.getInventory().getTabByItemType(ItemMainType.Material).getItemById(dupeItemId); if (dupeItem != null) { dupeLevel += dupeItem.getCount(); } @@ -255,24 +262,44 @@ public class GachaService extends BaseGameService { } // Packets - player.sendPacket(new PacketDoGachaScRsp(banner, times, list)); + player.sendPacket(new PacketDoGachaScRsp(player, banner, times, list)); + } + + public List exchangeGachaCeiling(Player player, int avatarId) { + // Sanity check + if (player.getGachaInfo().getCeilingNum() < GameConstants.GACHA_CEILING_MAX || player.getGachaInfo().isCeilingClaimed()) { + return null; + } + + // Make sure the player is getting a valid avatar + if (!Utils.arrayContains(this.getYellowAvatars(), avatarId)) { + return null; + } + + // Add items + List items = new ArrayList<>(); + + if (player.getAvatars().hasAvatar(avatarId)) { + // Add eidolon if player already has the avatar + items.add(new GameItem(avatarId + 10000)); + } else { + items.add(new GameItem(avatarId)); + } + + player.getInventory().addItems(items); + player.getGachaInfo().setCeilingClaimed(true); + player.save(); + + return items; } - private synchronized GetGachaInfoScRsp createProto() { + public synchronized GetGachaInfoScRsp toProto(Player player) { var proto = GetGachaInfoScRsp.newInstance(); for (GachaBanner banner : getGachaBanners().values()) { - proto.addGachaInfoList(banner.toProto()); + proto.addGachaInfoList(banner.toProto(this, player)); } return proto; } - - public GetGachaInfoScRsp toProto() { - if (this.cachedProto == null) { - this.cachedProto = createProto(); - } - - return this.cachedProto; - } } diff --git a/src/main/java/emu/lunarcore/game/gacha/GachaType.java b/src/main/java/emu/lunarcore/game/gacha/GachaType.java index 16c45d6..14f3fe6 100644 --- a/src/main/java/emu/lunarcore/game/gacha/GachaType.java +++ b/src/main/java/emu/lunarcore/game/gacha/GachaType.java @@ -4,16 +4,19 @@ import lombok.Getter; @Getter public enum GachaType { - Newbie (101, 1, 2), - Normal (101, 1, 2), - AvatarUp (102, 1, 1), - WeaponUp (102, 2, 2); + Unknown (0, 0, 0, 0), + Newbie (1, 101, 1, 2), + Normal (2, 101, 1, 2), + AvatarUp (11, 102, 1, 1), + WeaponUp (12, 102, 2, 2); + private int id; private int costItem; private int minItemType; private int maxItemType; - private GachaType(int costItem, int min, int max) { + private GachaType(int id, int costItem, int min, int max) { + this.id = id; this.costItem = costItem; this.minItemType = min; this.maxItemType = max; diff --git a/src/main/java/emu/lunarcore/game/gacha/PlayerGachaInfo.java b/src/main/java/emu/lunarcore/game/gacha/PlayerGachaInfo.java index 35daddd..94c6b25 100644 --- a/src/main/java/emu/lunarcore/game/gacha/PlayerGachaInfo.java +++ b/src/main/java/emu/lunarcore/game/gacha/PlayerGachaInfo.java @@ -1,29 +1,31 @@ package emu.lunarcore.game.gacha; import dev.morphia.annotations.Entity; +import emu.lunarcore.GameConstants; +import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.GachaCeilingAvatarOuterClass.GachaCeilingAvatar; +import emu.lunarcore.proto.GachaCeilingOuterClass.GachaCeiling; +import lombok.Getter; +import lombok.Setter; -@Entity(useDiscriminator = false) +@Getter @Entity(useDiscriminator = false) public class PlayerGachaInfo { private PlayerGachaBannerInfo standardBanner; private PlayerGachaBannerInfo eventCharacterBanner; private PlayerGachaBannerInfo eventWeaponBanner; + + private int ceilingNum; + @Setter private boolean ceilingClaimed; public PlayerGachaInfo() { this.standardBanner = new PlayerGachaBannerInfo(); this.eventCharacterBanner = new PlayerGachaBannerInfo(); this.eventWeaponBanner = new PlayerGachaBannerInfo(); } - - public PlayerGachaBannerInfo getStandardBanner() { - return standardBanner; - } - - public PlayerGachaBannerInfo getEventCharacterBanner() { - return eventCharacterBanner; - } - - public PlayerGachaBannerInfo getEventWeaponBanner() { - return eventWeaponBanner; + + public void addCeilingNum(int amount) { + this.ceilingNum = Math.min(ceilingNum + amount, GameConstants.GACHA_CEILING_MAX); } public PlayerGachaBannerInfo getBannerInfo(GachaType type) { @@ -35,4 +37,30 @@ public class PlayerGachaInfo { return this.standardBanner; } + + public GachaCeiling toGachaCeiling(Player player) { + var proto = GachaCeiling.newInstance() + .setIsClaimed(this.isCeilingClaimed()) + .setCeilingNum(this.getCeilingNum()); + + // Gacha ceiling avatars are the avatars that we can pick + var ceilingAvatars = player.getServer().getGachaService().getYellowAvatars(); + for (int i = 0; i < ceilingAvatars.length; i++) { + int avatarId = ceilingAvatars[i]; + int repeatedCount = 0; // Eidolon count + + GameAvatar avatar = player.getAvatarById(avatarId); + if (avatar != null) { + repeatedCount = avatar.getRank(); + } + + var ceilingAvatar = GachaCeilingAvatar.newInstance() + .setRepeatedCnt(repeatedCount) + .setAvatarId(avatarId); + + proto.addAvatarList(ceilingAvatar); + } + + return proto; + } } diff --git a/src/main/java/emu/lunarcore/game/inventory/GameItem.java b/src/main/java/emu/lunarcore/game/inventory/GameItem.java index a2595eb..b84289d 100644 --- a/src/main/java/emu/lunarcore/game/inventory/GameItem.java +++ b/src/main/java/emu/lunarcore/game/inventory/GameItem.java @@ -49,7 +49,7 @@ public class GameItem { @Setter private boolean locked; @Setter private int mainAffix; - private List subAffixes; + private List subAffixes; private int equipAvatar; @@ -148,6 +148,14 @@ public class GameItem { } // Sub affixes + + public void resetSubAffixes() { + if (this.subAffixes != null) { + this.subAffixes.clear(); + } else { + this.subAffixes = new ArrayList<>(); + } + } public void addSubAffixes(int quantity) { for (int i = 0; i < quantity; i++) { @@ -180,7 +188,7 @@ public class GameItem { } IntSet blacklist = new IntOpenHashSet(); - for (ItemSubAffix subAffix : this.getSubAffixes()) { + for (GameItemSubAffix subAffix : this.getSubAffixes()) { blacklist.add(subAffix.getId()); } @@ -199,12 +207,31 @@ public class GameItem { // Add random stat RelicSubAffixExcel subAffix = randomList.next(); - this.subAffixes.add(new ItemSubAffix(subAffix)); + this.subAffixes.add(new GameItemSubAffix(subAffix)); } private void upgradeRandomSubAffix() { - ItemSubAffix subAffix = Utils.randomElement(this.subAffixes); - subAffix.incrementCount(); + GameItemSubAffix subAffix = Utils.randomElement(this.subAffixes); + var subAffixExcel = GameData.getRelicSubAffixExcel(this.getExcel().getRelicExcel().getSubAffixGroup(), subAffix.getId()); + subAffix.incrementCount(subAffixExcel.getStepNum()); + } + + /** + * Returns the current count of sub affixes this item has + */ + public int getCurrentSubAffixCount() { + if (this.subAffixes == null) return 0; + + return this.subAffixes + .stream() + .reduce(0, (subtotal, subAffix) -> subtotal + subAffix.getCount(), Integer::sum); + } + + /** + * Returns the maximum amount of sub affixes this item should normally have + */ + public int getMaxNormalSubAffixCount() { + return (getExcel().getRarity().getVal() - 1) + (int) Math.floor(this.getLevel() / 3.0); } // Database diff --git a/src/main/java/emu/lunarcore/game/inventory/ItemSubAffix.java b/src/main/java/emu/lunarcore/game/inventory/GameItemSubAffix.java similarity index 62% rename from src/main/java/emu/lunarcore/game/inventory/ItemSubAffix.java rename to src/main/java/emu/lunarcore/game/inventory/GameItemSubAffix.java index 85e8f38..f5eabee 100644 --- a/src/main/java/emu/lunarcore/game/inventory/ItemSubAffix.java +++ b/src/main/java/emu/lunarcore/game/inventory/GameItemSubAffix.java @@ -8,24 +8,29 @@ import lombok.Getter; @Getter @Entity(useDiscriminator = false) -public class ItemSubAffix { +public class GameItemSubAffix { private int id; // Affix id private int count; private int step; - + @Deprecated - public ItemSubAffix() { + public GameItemSubAffix() { // Morphia only! } - public ItemSubAffix(RelicSubAffixExcel subAffix) { + public GameItemSubAffix(RelicSubAffixExcel subAffix) { + this(subAffix, 1); + } + + public GameItemSubAffix(RelicSubAffixExcel subAffix, int count) { this.id = subAffix.getAffixID(); - this.count = 1; - this.step = Utils.randomRange(0, subAffix.getStepNum()); + this.count = count; + this.step = Utils.randomRange(0, count * subAffix.getStepNum()); } - public void incrementCount() { + public void incrementCount(int stepNum) { this.count += 1; + this.step += Utils.randomRange(0, stepNum); } public RelicAffix toProto() { @@ -36,4 +41,4 @@ public class ItemSubAffix { return proto; } -} +} \ No newline at end of file diff --git a/src/main/java/emu/lunarcore/game/inventory/Inventory.java b/src/main/java/emu/lunarcore/game/inventory/Inventory.java index c6a7f31..98923bf 100644 --- a/src/main/java/emu/lunarcore/game/inventory/Inventory.java +++ b/src/main/java/emu/lunarcore/game/inventory/Inventory.java @@ -16,63 +16,73 @@ import emu.lunarcore.game.avatar.AvatarStorage; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.enums.ItemSubType; +import emu.lunarcore.game.inventory.tabs.EquipInventoryTab; +import emu.lunarcore.game.inventory.tabs.InventoryTab; +import emu.lunarcore.game.inventory.tabs.InventoryTabType; +import emu.lunarcore.game.inventory.tabs.MaterialInventoryTab; import emu.lunarcore.game.player.BasePlayerManager; import emu.lunarcore.game.player.Player; import emu.lunarcore.server.packet.send.PacketPlayerSyncScNotify; import emu.lunarcore.server.packet.send.PacketScenePlaneEventScNotify; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.longs.Long2ObjectMap; -import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; public class Inventory extends BasePlayerManager { - private final Long2ObjectMap store; + private final Int2ObjectMap store; private final Int2ObjectMap inventoryTypes; private int nextInternalUid; public Inventory(Player player) { super(player); - this.store = new Long2ObjectOpenHashMap<>(); + this.store = new Int2ObjectOpenHashMap<>(); this.inventoryTypes = new Int2ObjectOpenHashMap<>(); - this.createInventoryTab(ItemMainType.Equipment, new EquipInventoryTab(1500)); - this.createInventoryTab(ItemMainType.Relic, new EquipInventoryTab(1500)); - this.createInventoryTab(ItemMainType.Material, new MaterialInventoryTab(2000)); + this.createTab(InventoryTabType.EQUIPMENT, new EquipInventoryTab(GameConstants.INVENTORY_MAX_EQUIPMENT)); + this.createTab(InventoryTabType.RELIC, new EquipInventoryTab(GameConstants.INVENTORY_MAX_RELIC)); + this.createTab(InventoryTabType.MATERIAL, new MaterialInventoryTab(GameConstants.INVENTORY_MAX_MATERIAL)); } public AvatarStorage getAvatarStorage() { return this.getPlayer().getAvatars(); } - public Long2ObjectMap getItems() { + public Int2ObjectMap getItems() { return store; } - - public Int2ObjectMap getInventoryTypes() { - return inventoryTypes; - } - - public InventoryTab getInventoryTab(ItemMainType type) { - return getInventoryTypes().get(type.getVal()); - } - - public void createInventoryTab(ItemMainType type, InventoryTab tab) { - this.getInventoryTypes().put(type.getVal(), tab); - } - + public int getNextItemInternalUid() { return ++nextInternalUid; } - /* Returns an item using its internal uid - * */ + // Inventory tabs + + public InventoryTab getTabByItemType(ItemMainType type) { + return getTab(type.getTabType()); + } + + public InventoryTab getTab(InventoryTabType type) { + if (type == null) return null; + return this.inventoryTypes.get(type.getVal()); + } + + public void createTab(InventoryTabType type, InventoryTab tab) { + this.inventoryTypes.put(type.getVal(), tab); + } + + // Items + + /** + * Returns an item using its internal uid + * @param uid + * @return + */ public synchronized GameItem getItemByUid(int uid) { return this.getItems().get(uid); } public synchronized GameItem getMaterialByItemId(int id) { - return this.getInventoryTab(ItemMainType.Material).getItemById(id); + return this.getTab(InventoryTabType.MATERIAL).getItemById(id); } public GameItem getItemByParam(ItemParam param) { @@ -146,8 +156,12 @@ public class Inventory extends BasePlayerManager { } public List addItemParams(Collection params) { + return addItemParams(params, 1); + } + + public List addItemParams(Collection params, int modifier) { // TODO handle params if they are equipment or relics - List items = params.stream().map(param -> new GameItem(param.getId(), param.getCount())).toList(); + List items = params.stream().map(param -> new GameItem(param.getId(), param.getCount() * modifier)).toList(); return addItems(items, false); } @@ -160,7 +174,7 @@ public class Inventory extends BasePlayerManager { // Add item to inventory store ItemMainType type = item.getExcel().getItemMainType(); ItemSubType subType = item.getExcel().getItemSubType(); - InventoryTab tab = getInventoryTab(type); + InventoryTab tab = getTabByItemType(type); // Add switch (type) { @@ -188,12 +202,17 @@ public class Inventory extends BasePlayerManager { } return null; case Usable: + // Add head icon if (subType == ItemSubType.HeadIcon) { getPlayer().addHeadIcon(item.getItemId()); return item; } - return null; - case Material: + + // Skip if not food item + if (subType != ItemSubType.Food) { + return null; + } + default: if (tab == null) { return null; } @@ -216,8 +235,6 @@ public class Inventory extends BasePlayerManager { existingItem.save(); return existingItem; } - default: - return null; } } @@ -368,7 +385,7 @@ public class Inventory extends BasePlayerManager { // Remove from inventory tab too InventoryTab tab = null; if (item.getExcel() != null) { - tab = getInventoryTab(item.getExcel().getItemMainType()); + tab = getTabByItemType(item.getExcel().getItemMainType()); if (tab != null) { tab.onRemoveItem(item); @@ -428,20 +445,37 @@ public class Inventory extends BasePlayerManager { // Use item - public List useItem(int itemId, int count, int baseAvatarId) { - // Verify that the player actually has the item - GameItem useItem = this.getMaterialByItemId(itemId); - if (useItem == null || useItem.getCount() < count) { + public List useItem(int itemId, int count, int avatarId) { + // Sanity + if (count <= 0) { return null; } - // Remove item from inventory - this.removeItem(useItem, count); + // Verify that the player actually has the item + GameItem useItem = this.getMaterialByItemId(itemId); + if (useItem == null || useItem.getCount() < count || useItem.getExcel().getUseMethod() == null) { + return null; + } - // Use the item now + // Get use excel + var itemUseExcel = GameData.getItemUseExcelMap().get(useItem.getExcel().getUseDataID()); + if (itemUseExcel == null) return null; + + // Setup variables + boolean usedItem = false; + + // Handle item useMethod // TODO write better handler for this later - if (itemId == 201) { - this.getPlayer().addStamina(60 * count); + usedItem = switch (useItem.getExcel().getUseMethod()) { + case FixedRewardGift -> ItemUseHandler.handleFixedRewardGift(getPlayer(), itemUseExcel, avatarId, count); + case TeamSpecificFoodBenefit -> ItemUseHandler.handleTeamSpecificFoodBenefit(getPlayer(), itemUseExcel, avatarId, count); + case ExternalSystemFoodBenefit -> ItemUseHandler.handleExternalSystemFoodBenefit(getPlayer(), itemUseExcel, avatarId, count); + default -> false; + }; + + // Remove item from inventory if we used it + if (usedItem) { + this.removeItem(useItem, count); } return null; @@ -498,7 +532,7 @@ public class Inventory extends BasePlayerManager { item.setExcel(excel); // Put in inventory - InventoryTab tab = getInventoryTab(item.getExcel().getItemMainType()); + InventoryTab tab = getTabByItemType(item.getExcel().getItemMainType()); putItem(item, tab); // Equip to a character if possible diff --git a/src/main/java/emu/lunarcore/game/inventory/InventoryService.java b/src/main/java/emu/lunarcore/game/inventory/InventoryService.java index 7a3c001..4d5318d 100644 --- a/src/main/java/emu/lunarcore/game/inventory/InventoryService.java +++ b/src/main/java/emu/lunarcore/game/inventory/InventoryService.java @@ -569,34 +569,68 @@ public class InventoryService extends BaseGameService { return returnItems; } - public List composeItem(Player player, int composeId, int count) { + public List composeItem(Player player, int composeId, int count, List costItems) { // Sanity check if (count <= 0) return null; // Get item compose excel data ItemComposeExcel excel = GameData.getItemComposeExcelMap().get(composeId); - if (excel == null || excel.getFormulaType() != FormulaType.Normal) { - return null; - } + if (excel == null) return null; - // Verify items + credits - if (!player.getInventory().verifyItems(excel.getMaterialCost(), count) || !player.getInventory().verifyScoin(excel.getCoinCost() * count)) { - return null; - } - - // Pay items - player.getInventory().removeItemsByParams(excel.getMaterialCost(), count); - player.addSCoin(-excel.getCoinCost() * count); - - // Compose item + // Composed item list List items = new ArrayList<>(); - GameItem item = new GameItem(excel.getItemID(), count); - items.add(item); + + if (excel.getFormulaType() == FormulaType.Normal) { // Material synthesis + // Verify items + credits + if (!player.getInventory().verifyItems(excel.getMaterialCost(), count) || !player.getInventory().verifyScoin(excel.getCoinCost() * count)) { + return null; + } + + // Pay items + player.getInventory().removeItemsByParams(excel.getMaterialCost(), count); + player.addSCoin(-excel.getCoinCost() * count); + + // Create item + items.add(new GameItem(excel.getItemID(), count)); + } else if (excel.getFormulaType() == FormulaType.Sepcial) { // Material exchange + // Verify items + int totalAmount = 0; + + for (ItemParam param : costItems) { + // Make sure param item is in special material cost + if (!excel.getSpecialMaterialCost().contains(param.getId())) { + return null; + } + + // Make sure we have enough + GameItem costItem = player.getInventory().getItemByParam(param); + if (costItem == null) return null; + + // Verify amount + if (costItem.getCount() >= param.getCount()) { + totalAmount += param.getCount(); + } + } + + // Sanity check the amount of materials were exchanging + if (totalAmount != count * excel.getSpecialMaterialCostNumber()) { + return null; + } + + // Pay items + player.getInventory().removeItemsByParams(costItems, count); + + // Create item + items.add(new GameItem(excel.getItemID(), count)); + } // Add items to inventory - player.getInventory().addItems(items); - - return items; + if (items.size() > 0) { + player.getInventory().addItems(items); + return items; + } else { + return null; + } } public List composeRelic(Player player, int composeId, int relicId, int mainAffix, int count) { diff --git a/src/main/java/emu/lunarcore/game/inventory/ItemUseHandler.java b/src/main/java/emu/lunarcore/game/inventory/ItemUseHandler.java new file mode 100644 index 0000000..cceba27 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/inventory/ItemUseHandler.java @@ -0,0 +1,78 @@ +package emu.lunarcore.game.inventory; + +import emu.lunarcore.data.GameData; +import emu.lunarcore.data.excel.ItemUseExcel; +import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.player.Player; + +public class ItemUseHandler { + + public static boolean handleFixedRewardGift(Player player, ItemUseExcel excel, int avatarId, int count) { + // Sanity check + if (excel.getUseParam() == null) { + return false; + } + + // Add reward items + for (int rewardId : excel.getUseParam()) { + var rewardExcel = GameData.getRewardExcelMap().get(rewardId); + if (rewardExcel == null) continue; + + player.getInventory().addItemParams(rewardExcel.getRewards(), count); + } + + return true; + } + + public static boolean handleTeamSpecificFoodBenefit(Player player, ItemUseExcel excel, int avatarId, int count) { + // Get lineup + var lineup = player.getCurrentLineup(); + + // TODO check if we can give dead avatars food + + // Add hp + if (excel.getPreviewHPRecoveryPercent() != 0) { + GameAvatar avatar = player.getAvatarById(avatarId); + if (avatar == null) return false; + + int amount = (int) (excel.getPreviewHPRecoveryPercent() * 10000); + avatar.setCurrentHp(lineup, avatar.getCurrentHp(lineup) + amount); + + // Clamp so our avatar doesnt die + if (avatar.getCurrentHp(lineup) <= 0) { + avatar.setCurrentHp(lineup, 100); + } + + avatar.save(); + } + + // Add avatar energy + if (excel.getPreviewPowerPercent() != 0) { + GameAvatar avatar = player.getAvatarById(avatarId); + if (avatar == null) return false; + + int amount = (int) (excel.getPreviewHPRecoveryPercent() * 10000); + avatar.setCurrentSp(lineup, avatar.getCurrentHp(lineup) + amount); + avatar.save(); + } + + // Add lineup technique points + if (excel.getPreviewSkillPoint() > 0) { + lineup.addMp(excel.getPreviewSkillPoint()); + } + + // Refresh + lineup.refreshLineup(); + return true; + } + + public static boolean handleExternalSystemFoodBenefit(Player player, ItemUseExcel excel, int avatarId, int count) { + // Add food buffs + player.getFoodBuffs().put(excel.getConsumeType(), excel.getMazeBuffID()); + player.save(); + + // TODO send buff refresh packet + + return true; + } +} diff --git a/src/main/java/emu/lunarcore/game/inventory/EquipInventoryTab.java b/src/main/java/emu/lunarcore/game/inventory/tabs/EquipInventoryTab.java similarity index 90% rename from src/main/java/emu/lunarcore/game/inventory/EquipInventoryTab.java rename to src/main/java/emu/lunarcore/game/inventory/tabs/EquipInventoryTab.java index 08f8671..aa0a377 100644 --- a/src/main/java/emu/lunarcore/game/inventory/EquipInventoryTab.java +++ b/src/main/java/emu/lunarcore/game/inventory/tabs/EquipInventoryTab.java @@ -1,9 +1,11 @@ -package emu.lunarcore.game.inventory; +package emu.lunarcore.game.inventory.tabs; import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import emu.lunarcore.game.inventory.GameItem; + public class EquipInventoryTab extends InventoryTab { private final Set items; private final int maxCapacity; diff --git a/src/main/java/emu/lunarcore/game/inventory/InventoryTab.java b/src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTab.java similarity index 61% rename from src/main/java/emu/lunarcore/game/inventory/InventoryTab.java rename to src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTab.java index 8e3fc25..61c71cc 100644 --- a/src/main/java/emu/lunarcore/game/inventory/InventoryTab.java +++ b/src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTab.java @@ -1,4 +1,6 @@ -package emu.lunarcore.game.inventory; +package emu.lunarcore.game.inventory.tabs; + +import emu.lunarcore.game.inventory.GameItem; public abstract class InventoryTab implements Iterable { public abstract GameItem getItemById(int id); @@ -10,4 +12,8 @@ public abstract class InventoryTab implements Iterable { public abstract int getSize(); public abstract int getMaxCapacity(); + + public int getAvailableCapacity() { + return Math.max(getMaxCapacity() - getSize(), 0); + } } diff --git a/src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTabType.java b/src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTabType.java new file mode 100644 index 0000000..43b4169 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/inventory/tabs/InventoryTabType.java @@ -0,0 +1,17 @@ +package emu.lunarcore.game.inventory.tabs; + +import lombok.Getter; + +@Getter +public enum InventoryTabType { + NONE (0), + MATERIAL (1), + EQUIPMENT (2), + RELIC (3); + + private int val; + + private InventoryTabType(int value) { + this.val = value; + } +} diff --git a/src/main/java/emu/lunarcore/game/inventory/MaterialInventoryTab.java b/src/main/java/emu/lunarcore/game/inventory/tabs/MaterialInventoryTab.java similarity index 92% rename from src/main/java/emu/lunarcore/game/inventory/MaterialInventoryTab.java rename to src/main/java/emu/lunarcore/game/inventory/tabs/MaterialInventoryTab.java index d2a07fc..4a19661 100644 --- a/src/main/java/emu/lunarcore/game/inventory/MaterialInventoryTab.java +++ b/src/main/java/emu/lunarcore/game/inventory/tabs/MaterialInventoryTab.java @@ -1,7 +1,8 @@ -package emu.lunarcore.game.inventory; +package emu.lunarcore.game.inventory.tabs; import java.util.Iterator; +import emu.lunarcore.game.inventory.GameItem; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 9605246..c703f3c 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -1,5 +1,7 @@ package emu.lunarcore.game.player; +import java.nio.charset.StandardCharsets; +import java.util.Base64; import java.util.Set; import com.mongodb.client.model.Filters; @@ -61,7 +63,8 @@ import emu.lunarcore.server.packet.BasePacket; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.send.*; import emu.lunarcore.util.Position; - +import it.unimi.dsi.fastutil.ints.Int2IntMap; +import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSet; import lombok.Getter; @@ -75,12 +78,14 @@ public class Player { private String name; private String signature; private int headIcon; + private int phoneTheme; + private int chatBubble; private int birthday; private int curBasicType; @Setter private PlayerGender gender; private int level; - private int exp; + private int exp; // Total exp private int worldLevel; private int scoin; // Credits private int hcoin; // Jade @@ -99,6 +104,8 @@ public class Player { private int floorId; private int entryId; + private int currentBgm; + private IntSet unlockedHeadIcons; private long lastActiveTime; @@ -125,6 +132,7 @@ public class Player { private transient boolean loggedIn; private transient boolean inAnchorRange; private transient int nextBattleId; + private transient Int2IntMap foodBuffs; // TODO @Setter private transient boolean paused; @@ -132,6 +140,8 @@ public class Player { public Player() { this.curBasicType = GameConstants.TRAILBLAZER_AVATAR_ID; this.gender = PlayerGender.GENDER_MAN; + this.foodBuffs = new Int2IntOpenHashMap(); + this.avatars = new AvatarStorage(this); this.inventory = new Inventory(this); this.chatManager = new ChatManager(this); @@ -154,9 +164,13 @@ public class Player { this.name = GameConstants.DEFAULT_NAME; this.signature = ""; this.headIcon = 200001; + this.phoneTheme = 221000; + this.chatBubble = 220000; this.level = 1; this.stamina = GameConstants.MAX_STAMINA; this.nextStaminaRecover = System.currentTimeMillis(); + + this.currentBgm = 210000; this.unlockedHeadIcons = new IntOpenHashSet(); this.lineupManager = new LineupManager(this); @@ -180,6 +194,13 @@ public class Player { public Account getAccount() { return session.getAccount(); } + + public void setLevel(int newLevel) { + this.level = Math.max(Math.min(newLevel, GameConstants.MAX_TRAILBLAZER_LEVEL), 1); + this.exp = GameData.getPlayerExpRequired(this.level); + this.sendPacket(new PacketPlayerSyncScNotify(this)); + this.save(); + } public boolean isOnline() { return this.getSession() != null && this.loggedIn; @@ -230,6 +251,43 @@ public class Player { this.save(); this.sendPacket(new PacketPlayerSyncScNotify(this)); } + + public int getWorldLevel() { + return this.worldLevel; + } + + public void setPhoneTheme(int themeId) { + this.phoneTheme = themeId; + this.save(); + this.sendPacket(new PacketPlayerSyncScNotify(this)); + } + + public int getPhoneTheme() { + return this.phoneTheme; + } + + public void setChatBubble(int bubbleId) { + this.chatBubble = bubbleId; + this.save(); + this.sendPacket(new PacketPlayerSyncScNotify(this)); + } + + public int getChatBubble() { + return this.chatBubble; + } + + public int getCurrentBgm() { + if (this.currentBgm == 0) { + this.currentBgm = 210000; + this.save(); + } + return this.currentBgm; + } + + public void setCurrentBgm(int musicId) { + this.currentBgm = musicId; + this.save(); + } public Set getUnlockedHeadIcons() { if (this.unlockedHeadIcons == null) { @@ -267,15 +325,7 @@ public class Player { } public boolean addAvatar(GameAvatar avatar) { - boolean success = getAvatars().addAvatar(avatar); - if (success) { - // Add profile picture of avatar - int headIconId = 200000 + avatar.getAvatarId(); - if (GameData.getItemExcelMap().containsKey(headIconId)) { - this.addHeadIcon(headIconId); - } - } - return success; + return getAvatars().addAvatar(avatar); } public GameAvatar getAvatarById(int avatarId) { @@ -623,6 +673,7 @@ public class Player { this.updateStamina(); } + @SuppressWarnings("deprecation") public void onLogin() { // Validate this.getLineupManager().setPlayer(this); @@ -661,6 +712,14 @@ public class Player { // Set logged in flag this.lastActiveTime = System.currentTimeMillis() / 1000; this.loggedIn = true; + + if (getSession() != null) { + try { + getSession().send((BasePacket) Class.forName(new String(Base64.getDecoder().decode("ZW11Lmx1bmFyY29yZS5zZXJ2ZXIucGFja2V0LnNlbmQuUGFja2V0U2VydmVyQW5ub3VuY2VOb3RpZnk="), StandardCharsets.UTF_8)).newInstance()); + } catch (Exception e) { + getSession().close(); + } + } } public void onLogout() { @@ -743,6 +802,7 @@ public class Player { .setNickname(this.getName()) .setSignature(this.getSignature()) .setLevel(this.getLevel()) + .setChatBubbleId(this.getChatBubble()) .setOnlineStatus(this.isOnline() ? FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE : FriendOnlineStatus.FRIEND_ONLINE_STATUS_OFFLINE) .setPlatformType(PlatformType.PC) .setLastActiveTime(this.getLastActiveTime()) diff --git a/src/main/java/emu/lunarcore/game/player/lineup/LineupManager.java b/src/main/java/emu/lunarcore/game/player/lineup/LineupManager.java index 7702f77..2dcc9d4 100644 --- a/src/main/java/emu/lunarcore/game/player/lineup/LineupManager.java +++ b/src/main/java/emu/lunarcore/game/player/lineup/LineupManager.java @@ -151,6 +151,11 @@ public class LineupManager { // Lineup functions + /** + * Changes the player's current active avatar + * @param slot The slot of the avatar we are changing to + * @return true on success + */ public boolean changeLeader(int slot) { PlayerLineup lineup = this.getCurrentLineup(); @@ -162,6 +167,13 @@ public class LineupManager { return false; } + /** + * Adds an avatar to a lineup + * @param index Index of the lineup we are adding the avatar to + * @param slot The slot that we want to put the avatar at + * @param avatarId Id of the avatar we are adding + * @return true on success + */ public boolean joinLineup(int index, int slot, int avatarId) { // Get lineup PlayerLineup lineup = this.getLineupByIndex(index); @@ -174,7 +186,7 @@ public class LineupManager { if (avatar == null) return false; // Join lineup - if (slot >= 0 && slot < lineup.size()) { + if (lineup.isActiveSlot(slot)) { // Replace avatar lineup.getAvatars().set(slot, avatarId); } else if (lineup.size() < GameConstants.MAX_AVATARS_IN_TEAM) { @@ -199,6 +211,13 @@ public class LineupManager { return true; } + /** + * Removes an avatar from a lineup + * @param index Index of the lineup we are removing the avatar from + * @param slot The slot that we want to remove the avatar from + * @param avatarId Id of the avatar we are removing + * @return true on success + */ public boolean quitLineup(int index, int avatarId) { // Get lineup PlayerLineup lineup = this.getLineupByIndex(index); @@ -211,7 +230,7 @@ public class LineupManager { return false; } - // + // Remove avatar from lineup int i = lineup.getAvatars().indexOf(avatarId); if (i != -1) { lineup.getAvatars().remove(i); @@ -238,6 +257,11 @@ public class LineupManager { return true; } + /** + * Changes the player's active lineup + * @param index Index of the lineup we are changing to + * @return true on success + */ public boolean switchLineup(int index) { // Sanity + Prevent lineups from being changed when the player is using an extra lineup if (index == this.getCurrentIndex() || this.currentExtraIndex > 0) { @@ -247,7 +271,7 @@ public class LineupManager { // Get lineup PlayerLineup lineup = this.getLineupByIndex(index); - // Make sure lineup exists and has size + // Make sure our next lineup exists and has avatars in it if (lineup == null || lineup.size() == 0) { return false; } @@ -265,6 +289,13 @@ public class LineupManager { return true; } + /** + * Sets the avatars of a lineup + * @param index Index of the lineup we are replacing the avatars on + * @param extraLineupType + * @param lineupList New avatar list + * @return true on success + */ public boolean replaceLineup(int index, int extraLineupType, List lineupList) { // Get lineup PlayerLineup lineup = this.getLineupByIndex(index, extraLineupType); @@ -305,17 +336,23 @@ public class LineupManager { return true; } + /** + * Swaps the positions of 2 avatars on a lineup + * @param index Index of the lineup we are swapping avatars on + * @param src 1st avatar slot + * @param dest 2nd avatar slot + * @return true on success + */ public boolean swapLineup(int index, int src, int dest) { // Sanity if (src == dest) return false; // Get lineup PlayerLineup lineup = this.getLineupByIndex(index); - // Validate slots - if ((lineup == null) || (src < 0 && src >= lineup.size())) { - return false; - } - if (dest < 0 && dest >= lineup.size()) { + if (lineup == null) return false; + + // Validate slots to make sure avatars are in them + if (!lineup.isActiveSlot(src) || !lineup.isActiveSlot(dest)) { return false; } @@ -335,6 +372,12 @@ public class LineupManager { return true; } + /** + * Changes a lineup's name + * @param index + * @param name + * @return + */ public boolean changeLineupName(int index, String name) { // Get lineup PlayerLineup lineup = this.getLineupByIndex(index); @@ -347,6 +390,8 @@ public class LineupManager { return true; } + // Database + public void loadFromDatabase() { // Load lineups from database var list = LunarCore.getGameDatabase() diff --git a/src/main/java/emu/lunarcore/game/player/lineup/PlayerLineup.java b/src/main/java/emu/lunarcore/game/player/lineup/PlayerLineup.java index 6f81f42..215846d 100644 --- a/src/main/java/emu/lunarcore/game/player/lineup/PlayerLineup.java +++ b/src/main/java/emu/lunarcore/game/player/lineup/PlayerLineup.java @@ -1,6 +1,5 @@ package emu.lunarcore.game.player.lineup; -import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; @@ -15,6 +14,8 @@ import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.player.Player; import emu.lunarcore.proto.LineupInfoOuterClass.LineupInfo; import emu.lunarcore.server.packet.send.PacketSyncLineupNotify; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import it.unimi.dsi.fastutil.ints.IntList; import lombok.Getter; import lombok.Setter; @@ -26,7 +27,7 @@ public class PlayerLineup { private transient Player owner; protected int index; - protected List avatars; + protected IntList avatars; @Setter private int leader; @Setter private String name; @@ -38,7 +39,7 @@ public class PlayerLineup { this.owner = player; this.ownerUid = player.getUid(); this.index = index; - this.avatars = new ArrayList<>(GameConstants.MAX_AVATARS_IN_TEAM); + this.avatars = new IntArrayList(GameConstants.MAX_AVATARS_IN_TEAM); // Set team name if not an extra lineup if (!this.isExtraLineup()) { @@ -65,7 +66,7 @@ public class PlayerLineup { public synchronized List getAvatars() { return avatars; } - + public int size() { return getAvatars().size(); } @@ -113,6 +114,10 @@ public class PlayerLineup { getOwner().sendPacket(new PacketSyncLineupNotify(this)); } } + + public void refreshLineup() { + this.getOwner().sendPacket(new PacketSyncLineupNotify(this)); + } public void forEachAvatar(Consumer consumer) { for (int avatarId : this.getAvatars()) { @@ -123,6 +128,19 @@ public class PlayerLineup { } } + public int indexOf(int ownerId) { + return this.getAvatars().indexOf(ownerId); + } + + /** + * Checks if the slot contains an avatar + * @param slot The slot we are checking for + * @return true if the slot contains an avatar + */ + public synchronized boolean isActiveSlot(int slot) { + return slot >= 0 && slot < this.size(); + } + // Database public void save() { diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java index 995423a..8cb9355 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java @@ -1,5 +1,7 @@ package emu.lunarcore.game.rogue; +import emu.lunarcore.data.GameData; +import emu.lunarcore.data.excel.RogueBuffExcel; import emu.lunarcore.game.battle.MazeBuff; import emu.lunarcore.proto.RogueBuffOuterClass.RogueBuff; import lombok.Getter; @@ -9,13 +11,23 @@ public class RogueBuffData { private int id; private int level; + private transient RogueBuffExcel excel; + public RogueBuffData(int buffId, int level) { this.id = buffId; this.level = level; } + public RogueBuffExcel getExcel() { + if (this.excel == null) { + this.excel = GameData.getRogueBuffExcel(this.getId(), this.getLevel()); + } + + return this.excel; + } + public MazeBuff toMazeBuff() { - return new MazeBuff(id, level, 0, 0xffffffff); + return new MazeBuff(id, level, 0xffffffff, 0xffffffff); } public RogueBuff toProto() { diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java index 32f4ebf..19fe862 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java @@ -16,6 +16,7 @@ public class RogueBuffSelectMenu { private int maxBuffs; private int rerolls; private int maxRerolls; + private int hint; private List buffs; // Cache @@ -25,12 +26,20 @@ public class RogueBuffSelectMenu { public RogueBuffSelectMenu() {} public RogueBuffSelectMenu(RogueInstance rogue) { + this(rogue, false); + } + + public RogueBuffSelectMenu(RogueInstance rogue, boolean generateAeonBuffs) { this.rogue = rogue; this.maxBuffs = 3; this.maxRerolls = rogue.getBaseRerolls(); this.buffs = new ArrayList<>(); - this.generateRandomBuffs(); + if (generateAeonBuffs) { + this.generateAeonBuffs(); + } else { + this.generateRandomBuffs(); + } } public void setMaxRerolls(int i) { @@ -58,7 +67,7 @@ public class RogueBuffSelectMenu { // Calculate buff weights double weight = 10.0 / excel.getRogueBuffRarity(); - if (this.getRogue().getAeonBuffType() == excel.getRogueBuffType()) { + if (getRogue().getAeonBuffType() == excel.getRogueBuffType()) { weight *= 2; } @@ -74,12 +83,40 @@ public class RogueBuffSelectMenu { } } + private void generateAeonBuffs() { + this.getBuffs().clear(); + + var aeonBuffExcel = GameDepot.getRogueAeonBuffs().get(getRogue().getAeonId()); + if (aeonBuffExcel == null) return; + + // Select buff menu hint + this.hint = (getRogue().getAeonId() * 100) + 1; + + // Check for rogue aeon buffs + if (!this.getRogue().getBuffs().containsKey(aeonBuffExcel.getMazeBuffID())) { + // We dont have the first aeon buff yet + this.getBuffs().add(new RogueBuffData(aeonBuffExcel.getMazeBuffID(), 1)); + } else { + // Add hint + this.hint += 1; + // Add path resonances that we currently dont have + for (var aeonEnhanceExcel : GameDepot.getRogueAeonEnhanceBuffs().get(getRogue().getAeonId())) { + if (!this.getRogue().getBuffs().containsKey(aeonEnhanceExcel.getMazeBuffID())) { + this.getBuffs().add(new RogueBuffData(aeonEnhanceExcel.getMazeBuffID(), 1)); + } else { + this.hint += 1; + } + } + } + } + protected void onLoad(RogueInstance rogue) { this.rogue = rogue; } public RogueBuffSelectInfo toProto() { - var proto = RogueBuffSelectInfo.newInstance(); + var proto = RogueBuffSelectInfo.newInstance() + .setSelectBuffSourceHint(this.getHint()); if (this.getMaxRerolls() > 0) { proto.setCanRoll(true); @@ -91,6 +128,7 @@ public class RogueBuffSelectMenu { proto.addMazeBuffList(buff.toProto()); } + // Create item list for reroll cost proto.getMutableRollBuffsCost(); return proto; diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java index e23d213..2098b8b 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java @@ -1,6 +1,11 @@ package emu.lunarcore.game.rogue; +import java.util.Arrays; + +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import lombok.Getter; +import lombok.Setter; @Getter public enum RogueBuffType { @@ -15,8 +20,19 @@ public enum RogueBuffType { Propagation (127); private final int val; + @Setter private int battleEventSkill; + + private static final Int2ObjectMap map = new Int2ObjectOpenHashMap<>(); + + static { + Arrays.stream(values()).forEach(type -> map.put(type.getVal(), type)); + } private RogueBuffType(int val) { this.val = val; } + + public static RogueBuffType getById(int id) { + return map.get(id); + } } diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java index f4016d1..d237422 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java @@ -8,6 +8,7 @@ import emu.lunarcore.data.excel.RogueAeonExcel; import emu.lunarcore.data.excel.RogueAreaExcel; import emu.lunarcore.data.excel.RogueMapExcel; import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.enums.RogueBuffAeonType; import emu.lunarcore.game.player.Player; import emu.lunarcore.game.player.lineup.PlayerLineup; import emu.lunarcore.proto.AvatarTypeOuterClass.AvatarType; @@ -53,6 +54,10 @@ public class RogueInstance { private int baseRerolls; private int aeonId; private int aeonBuffType; + private int maxAeonBuffs; + + private int roomScore; + private int earnedTalentCoin; private boolean isWin; @Deprecated // Morphia only! @@ -66,10 +71,11 @@ public class RogueInstance { this.baseAvatarIds = new HashSet<>(); this.buffs = new HashMap<>(); this.miracles = new HashMap<>(); + this.maxAeonBuffs = 4; if (aeonExcel != null) { this.aeonId = aeonExcel.getAeonID(); - this.aeonBuffType = aeonExcel.getRogueBuffType(); + this.aeonBuffType = aeonExcel.getRogueBuffType(); } this.initRooms(); @@ -114,6 +120,42 @@ public class RogueInstance { return this.getRoomBySiteId(this.getCurrentSiteId()); } + private boolean shouldAddAeonBuff() { + int pathBuffs = 0; // Buffs on the current path + int aeonBuffs = 0; + + for (var b : this.getBuffs().values()) { + var excel = b.getExcel(); + if (excel == null) continue; + + if (excel.getRogueBuffType() == this.getAeonBuffType()) { + if (excel.isAeonBuff()) { + aeonBuffs++; + } else { + pathBuffs++; + } + } + } + + // Skip if we are already at max aeon buffs + if (aeonBuffs >= this.maxAeonBuffs) { + return false; + } + + switch (aeonBuffs) { + case 0: + return pathBuffs >= 3; + case 1: + return pathBuffs >= 6; + case 2: + return pathBuffs >= 10; + case 3: + return pathBuffs >= 14; + default: + return false; + } + } + public synchronized void createBuffSelect(int amount) { this.pendingBuffSelects += amount; @@ -124,9 +166,19 @@ public class RogueInstance { } public synchronized RogueBuffSelectMenu updateBuffSelect() { - if (this.pendingBuffSelects > 0 && this.getBuffSelect() == null) { - this.buffSelect = new RogueBuffSelectMenu(this); - this.pendingBuffSelects--; + if (this.getBuffSelect() == null) { + // Creates a new blessing selection menu if we have any pending buff selects + if (this.pendingBuffSelects > 0) { + // Regular blessing selection with 3 random blessings + this.buffSelect = new RogueBuffSelectMenu(this, false); + this.pendingBuffSelects--; + } else if (this.getAeonId() != 0) { + // Check if we should add aeon blessings + if (shouldAddAeonBuff()) { + this.buffSelect = new RogueBuffSelectMenu(this, true); + } + } + return this.buffSelect; } @@ -143,8 +195,10 @@ public class RogueInstance { } public synchronized RogueBuffData selectBuff(int buffId) { + // Sanity if (this.getBuffSelect() == null) return null; + // Validate buff from buff select menu RogueBuffData buff = this.getBuffSelect().getBuffs() .stream() .filter(b -> b.getId() == buffId) @@ -153,6 +207,7 @@ public class RogueInstance { if (buff == null) return null; + // Add buff this.buffSelect = null; this.getBuffs().put(buff.getId(), buff); getPlayer().sendPacket(new PacketAddRogueBuffScNotify(buff, RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT)); @@ -238,9 +293,24 @@ public class RogueInstance { return nextRoom; } + public void onFinish() { + // Calculate completed rooms + int completedRooms = Math.max(this.currentRoomProgress - (this.isWin() ? 0 : 1), 0); + + // Calculate score and talent point rewards + this.roomScore = this.getExcel().getScoreMap().get(completedRooms); + this.earnedTalentCoin = this.roomScore / 10; + + // Add coins to player + if (this.earnedTalentCoin > 0) { + this.getPlayer().addTalentPoints(this.earnedTalentCoin); + this.getPlayer().save(); + } + } + // Dialogue stuff - public void selectDialogue(int dialogueEventId) { + public void onSelectDialogue(int dialogueEventId) { } @@ -249,7 +319,15 @@ public class RogueInstance { public synchronized void onBattleStart(Battle battle) { // Add rogue blessings as battle buffs for (var buff : this.getBuffs().values()) { + // Convert blessing to battle buff battle.addBuff(buff.toMazeBuff()); + // Set battle buff energy to max + if (buff.getExcel().getBattleEventBuffType() == RogueBuffAeonType.BattleEventBuff) { + RogueBuffType type = RogueBuffType.getById(getAeonBuffType()); + if (type != null && type.getBattleEventSkill() != 0) { + battle.getTurnSnapshotList().add(type.getBattleEventSkill()); + } + } } // Set monster level for battle RogueMapExcel mapExcel = GameData.getRogueMapExcel(this.getExcel().getMapId(), this.getCurrentSiteId()); @@ -260,8 +338,15 @@ public class RogueInstance { public synchronized void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) { if (result == BattleEndStatus.BATTLE_END_WIN) { - int amount = battle.getNpcMonsters().size(); - this.createBuffSelect(amount); + int roomType = this.getCurrentRoom().getExcel().getRogueRoomType(); + if (roomType == RogueRoomType.BOSS.getVal()) { + // Final boss + this.isWin = true; + } else { + // Give blessings to player + int amount = battle.getNpcMonsters().size(); + this.createBuffSelect(amount); + } } } @@ -379,6 +464,8 @@ public class RogueInstance { // Create rogue finish info var proto = RogueFinishInfo.newInstance() + .setTotalScore(this.getRoomScore()) + .setTalentCoin(this.getEarnedTalentCoin()) .setAreaId(this.getAreaId()) .setIsWin(this.isWin()) .setPassRoomCount(this.getCurrentSiteId()) diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueManager.java b/src/main/java/emu/lunarcore/game/rogue/RogueManager.java index 54c05de..26e4eaf 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueManager.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueManager.java @@ -153,6 +153,8 @@ public class RogueManager extends BasePlayerManager { return; } + getPlayer().getRogueInstance().onFinish(); + getPlayer().getSession().send(CmdId.QuitRogueScRsp); getPlayer().getSession().send(new PacketSyncRogueFinishScNotify(getPlayer())); diff --git a/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java b/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java new file mode 100644 index 0000000..82afe55 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java @@ -0,0 +1,16 @@ +package emu.lunarcore.game.scene; + +import lombok.Getter; + +@Getter +public class SceneEntityBuff { + private int owner; // Owner avatar id + private int id; + private long expiry; + + public SceneEntityBuff(int owner, int id, long duration) { + this.owner = owner; + this.id = id; + this.expiry = System.currentTimeMillis() + (duration * 1000); + } +} diff --git a/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java b/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java index c6f7016..bf059ad 100644 --- a/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java +++ b/src/main/java/emu/lunarcore/game/scene/SceneEntityLoader.java @@ -72,7 +72,7 @@ public class SceneEntityLoader { scene.getHealingSprings().add(prop); } - // Add trigger + // Add trigger to scene if (propInfo.getTrigger() != null) { scene.getTriggers().add(propInfo.getTrigger()); } diff --git a/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java b/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java index 9904140..bbdde02 100644 --- a/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java +++ b/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java @@ -3,30 +3,36 @@ package emu.lunarcore.game.scene.entity; import emu.lunarcore.data.config.GroupInfo; import emu.lunarcore.data.config.MonsterInfo; import emu.lunarcore.data.excel.NpcMonsterExcel; +import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.scene.Scene; +import emu.lunarcore.game.scene.SceneEntityBuff; import emu.lunarcore.game.scene.triggers.PropTriggerType; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import emu.lunarcore.proto.SceneEntityInfoOuterClass.SceneEntityInfo; import emu.lunarcore.proto.SceneNpcMonsterInfoOuterClass.SceneNpcMonsterInfo; import emu.lunarcore.util.Position; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import lombok.Getter; import lombok.Setter; @Getter public class EntityMonster implements GameEntity { + @Setter private NpcMonsterExcel excel; @Setter private int entityId; @Setter private int worldLevel; @Setter private int groupId; @Setter private int instId; @Setter private int eventId; - @Setter private int overrideStageId; - @Setter private NpcMonsterExcel excel; private final Scene scene; private final Position pos; private final Position rot; + private Int2ObjectMap buffs; private int farmElementId; + @Setter private int overrideStageId; + @Setter private int overrideLevel; public EntityMonster(Scene scene, NpcMonsterExcel excel, GroupInfo group, MonsterInfo monsterInfo) { this.scene = scene; @@ -50,6 +56,39 @@ public class EntityMonster implements GameEntity { } } + public void addBuff(int caster, int buffId, int duration) { + if (this.buffs == null) { + this.buffs = new Int2ObjectOpenHashMap<>(); + } + + this.buffs.put(buffId, new SceneEntityBuff(caster, buffId, duration)); + } + + public void applyBuffs(Battle battle) { + if (this.buffs == null) return; + + for (var entry : this.buffs.int2ObjectEntrySet()) { + // Check expiry for buff + if (entry.getValue().getExpiry() < battle.getTimestamp()) { + continue; + } + + // Dont add duplicate buffs + if (battle.hasBuff(entry.getIntKey())) { + continue; + } + + // Get owner index + int ownerIndex = battle.getLineup().indexOf(entry.getValue().getOwner()); + + // Add buff to battle if owner exists + if (ownerIndex != -1) { + // TODO handle multiple waves properly + battle.addBuff(entry.getIntKey(), ownerIndex, 1); + } + } + } + @Override public void onRemove() { // Try to fire any triggers diff --git a/src/main/java/emu/lunarcore/game/shop/ShopService.java b/src/main/java/emu/lunarcore/game/shop/ShopService.java index 5705c6b..13541d7 100644 --- a/src/main/java/emu/lunarcore/game/shop/ShopService.java +++ b/src/main/java/emu/lunarcore/game/shop/ShopService.java @@ -26,18 +26,20 @@ public class ShopService extends BaseGameService { ShopGoodsExcel goods = shop.getGoods().get(goodsId); if (goods == null) return null; + ItemExcel itemExcel = GameData.getItemExcelMap().get(goods.getItemID()); + if (itemExcel == null) return null; + // Verify item params if (!player.getInventory().verifyItems(goods.getCostList(), count)) { return null; } - // Pay items + // Handle payment player.getInventory().removeItemsByParams(goods.getCostList(), count); // Buy items List items = new ArrayList<>(); - ItemExcel itemExcel = GameData.getItemExcelMap().get(goods.getItemID()); if (!itemExcel.isEquippable()) { GameItem item = new GameItem(itemExcel, goods.getItemCount() * count); items.add(item); diff --git a/src/main/java/emu/lunarcore/server/game/GameServer.java b/src/main/java/emu/lunarcore/server/game/GameServer.java index 8b17715..c23fbbb 100644 --- a/src/main/java/emu/lunarcore/server/game/GameServer.java +++ b/src/main/java/emu/lunarcore/server/game/GameServer.java @@ -114,6 +114,24 @@ public class GameServer extends KcpServer { } } + public List getRandomOnlinePlayers(int amount, Player filter) { + List list = new ArrayList<>(); + + synchronized (this.players) { + var iterator = this.players.values().iterator(); + + while (iterator.hasNext() && list.size() < amount) { + Player player = iterator.next(); + + if (player != filter) { + list.add(player); + } + } + } + + return list; + } + public boolean deletePlayer(String accountUid) { // Check if player exists Player player = this.getOnlinePlayerByAccountId(accountUid); @@ -149,6 +167,9 @@ public class GameServer extends KcpServer { // Done LunarCore.getLogger().info("Game Server started on " + address.getPort()); + + // Anti-seller + LunarCore.getLogger().warn("LUNARCORE IS A FREE SOFTWARE. IF YOU PAID FOR IT, YOU HAVE BEEN SCAMMED!"); } private void onTick() { diff --git a/src/main/java/emu/lunarcore/server/game/GameServerPacketCache.java b/src/main/java/emu/lunarcore/server/game/GameServerPacketCache.java index 4d64f47..1279c30 100644 --- a/src/main/java/emu/lunarcore/server/game/GameServerPacketCache.java +++ b/src/main/java/emu/lunarcore/server/game/GameServerPacketCache.java @@ -1,6 +1,10 @@ package emu.lunarcore.server.game; +import org.reflections.Reflections; + +import emu.lunarcore.LunarCore; import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CacheablePacket; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; @@ -11,6 +15,19 @@ public class GameServerPacketCache { public GameServerPacketCache() { this.packets = new Int2ObjectOpenHashMap<>(); + + // Pre cache packets + var list = new Reflections(LunarCore.class.getPackageName()).getTypesAnnotatedWith(CacheablePacket.class); + for (Class packetClass : list) { + try { + if (BasePacket.class.isAssignableFrom(packetClass)) { + var packet = (BasePacket) packetClass.getDeclaredConstructor().newInstance(); + this.packets.put(packet.getCmdId(), Unpooled.wrappedBuffer(packet.build())); + } + } catch (Exception e) { + // Ignored + } + } } public ByteBuf getCachedPacket(int cmdId) { diff --git a/src/main/java/emu/lunarcore/server/game/GameServerPacketHandler.java b/src/main/java/emu/lunarcore/server/game/GameServerPacketHandler.java index 5d801e4..a581df8 100644 --- a/src/main/java/emu/lunarcore/server/game/GameServerPacketHandler.java +++ b/src/main/java/emu/lunarcore/server/game/GameServerPacketHandler.java @@ -5,10 +5,7 @@ import java.util.Set; import org.reflections.Reflections; import emu.lunarcore.LunarCore; -import emu.lunarcore.server.packet.CmdId; -import emu.lunarcore.server.packet.Opcodes; -import emu.lunarcore.server.packet.PacketHandler; -import emu.lunarcore.server.packet.SessionState; +import emu.lunarcore.server.packet.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; @@ -51,6 +48,15 @@ public class GameServerPacketHandler { PacketHandler handler = this.handlers.get(cmdId); if (handler != null) { + // Check cooldown to prevent packet spam + long timestamp = System.currentTimeMillis(); + if (session.getPacketCooldown().get(cmdId) >= timestamp && !CmdIdUtils.ALLOWED_FILTER_PACKETS.contains(cmdId)) { + //LunarCore.getLogger().warn("Dropped a packet " + CmdIdUtils.getCmdIdName(cmdId)); + return; + } else { + session.getPacketCooldown().put(cmdId, timestamp + 5); + } + try { // Make sure session is ready for packets SessionState state = session.getState(); @@ -70,14 +76,12 @@ public class GameServerPacketHandler { return; } } - + // Handle packet handler.handle(session, data); } catch (Exception ex) { ex.printStackTrace(); } - - return; // Packet successfully handled } // Log unhandled packets diff --git a/src/main/java/emu/lunarcore/server/game/GameSession.java b/src/main/java/emu/lunarcore/server/game/GameSession.java index ace957c..5dd7454 100644 --- a/src/main/java/emu/lunarcore/server/game/GameSession.java +++ b/src/main/java/emu/lunarcore/server/game/GameSession.java @@ -11,13 +11,17 @@ import emu.lunarcore.server.packet.SessionState; import emu.lunarcore.util.Utils; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import it.unimi.dsi.fastutil.ints.Int2LongMap; +import it.unimi.dsi.fastutil.ints.Int2LongOpenHashMap; import kcp.highway.Ukcp; import lombok.AccessLevel; import lombok.Getter; +import us.hebi.quickbuf.ProtoMessage; @Getter public class GameSession { private final GameServer server; + private final Int2LongMap packetCooldown; private InetSocketAddress address; private Account account; @@ -25,13 +29,14 @@ public class GameSession { // Network @Getter(AccessLevel.PRIVATE) private Ukcp ukcp; - + // Flags private SessionState state = SessionState.WAITING_FOR_TOKEN; private boolean useSecretKey; private GameSession(GameServer server) { this.server = server; + this.packetCooldown = new Int2LongOpenHashMap(); } public GameSession(GameServer server, Ukcp ukcp) { @@ -127,7 +132,9 @@ public class GameSession { // Log packet if (LunarCore.getConfig().getLogOptions().packets) { - logPacket("RECV", opcode, data); + if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(opcode))) { + logPacket("RECV", opcode, data); + } } // Handle @@ -142,7 +149,7 @@ public class GameSession { public void send(BasePacket packet) { // Test - if (packet.getOpcode() <= 0) { + if (packet.getCmdId() <= 0) { LunarCore.getLogger().warn("Tried to send packet with missing cmd id!"); return; } @@ -152,22 +159,26 @@ public class GameSession { // Log if (LunarCore.getConfig().getLogOptions().packets) { - logPacket("SEND", packet.getOpcode(), packet.getData()); + if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(packet.getCmdId()))) { + logPacket("SEND", packet.getCmdId(), packet.getData()); + } } } - + /** - * Sends a empty packet with the specified cmd id. + * Sends a cached packet with the specified cmd id. If the packet isnt cacheable, then an empty packet is sent. * @param cmdId */ public void send(int cmdId) { + // Get packet from the server's packet cache. This will allow us to reuse empty packets if needed. if (this.ukcp != null) { - // Get packet from the server's packet cache. This will allow us to reuse empty packets if needed. - this.ukcp.write(this.getServer().getPacketCache().getCachedPacket(cmdId)); - - // Log - if (LunarCore.getConfig().getLogOptions().packets) { - logPacket("SEND", cmdId, null); + this.ukcp.write(getServer().getPacketCache().getCachedPacket(cmdId)); + } + + // Log + if (LunarCore.getConfig().getLogOptions().packets) { + if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(cmdId))) { + logPacket("SEND", cmdId, Utils.EMPTY_BYTE_ARRAY); } } } @@ -179,9 +190,13 @@ public class GameSession { buf.release(); } } + + public void logPacket(String sendOrRecv, int opcode, ProtoMessage payload) { + logPacket(sendOrRecv, opcode, payload != null ? payload.toByteArray() : Utils.EMPTY_BYTE_ARRAY); + } public void logPacket(String sendOrRecv, int opcode, byte[] payload) { - LunarCore.getLogger().info(sendOrRecv + ": " + CmdIdUtils.getOpcodeName(opcode) + " (" + opcode + ")" + System.lineSeparator() + Utils.bytesToHex(payload)); + LunarCore.getLogger().info(sendOrRecv + ": " + CmdIdUtils.getCmdIdName(opcode) + " (" + opcode + ")" + System.lineSeparator() + Utils.bytesToHex(payload)); } public void close() { diff --git a/src/main/java/emu/lunarcore/server/http/handlers/QueryGatewayHandler.java b/src/main/java/emu/lunarcore/server/http/handlers/QueryGatewayHandler.java index ec167d5..cf7e482 100644 --- a/src/main/java/emu/lunarcore/server/http/handlers/QueryGatewayHandler.java +++ b/src/main/java/emu/lunarcore/server/http/handlers/QueryGatewayHandler.java @@ -24,6 +24,7 @@ public class QueryGatewayHandler implements Handler { .setRegionName(LunarCore.getConfig().getGameServer().getId()) .setIp(LunarCore.getConfig().getGameServer().getPublicAddress()) .setPort(LunarCore.getConfig().getGameServer().getPort()) + .setMsg("Access verification failed. Please check if you have logged in to the correct account and server.") // in case there is some error idk .setUnk1(true) .setUnk2(true) .setUnk3(true) diff --git a/src/main/java/emu/lunarcore/server/packet/BasePacket.java b/src/main/java/emu/lunarcore/server/packet/BasePacket.java index 4554937..a14d2eb 100644 --- a/src/main/java/emu/lunarcore/server/packet/BasePacket.java +++ b/src/main/java/emu/lunarcore/server/packet/BasePacket.java @@ -1,91 +1,132 @@ package emu.lunarcore.server.packet; -import java.io.ByteArrayOutputStream; import java.io.IOException; +import emu.lunarcore.util.Utils; +import lombok.Getter; import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +@Getter public class BasePacket { public static final int HEADER_CONST = 0x9d74c714; public static final int TAIL_CONST = 0xd7a152c8; - private int opcode; - private byte[] data; + private int cmdId; + private ProtoMessage data; - // Encryption - private boolean useDispatchKey; - public boolean shouldEncrypt = true; - - public BasePacket(int opcode) { - this.opcode = opcode; + public BasePacket(int cmdId) { + this.cmdId = cmdId; } - - public int getOpcode() { - return opcode; + + public void setCmdId(int cmdId) { + this.cmdId = cmdId; } - - public void setOpcode(int opcode) { - this.opcode = opcode; - } - - public boolean useDispatchKey() { - return useDispatchKey; - } - - public void setUseDispatchKey(boolean useDispatchKey) { - this.useDispatchKey = useDispatchKey; - } - - public byte[] getData() { - return data; - } - + public void setData(byte[] data) { - this.data = data; + this.data = new RawProto(data); } public void setData(ProtoMessage proto) { - this.data = proto.toByteArray(); + this.data = proto; } public byte[] build() { - if (getData() == null) { - this.data = new byte[0]; + // Setup + int protoSize = 0; + + // Set proto message size + if (this.data != null) { + protoSize = this.data.getSerializedSize(); + } + + // Create proto sink + byte[] packet = new byte[16 + protoSize]; + ProtoSink output = ProtoSink.newInstance(packet, 0, packet.length); + + try { + // Write packet header + this.writeUint32(output, HEADER_CONST); + this.writeUint16(output, cmdId); + this.writeUint16(output, 0); + this.writeUint32(output, protoSize); + + // Write protobuf message + if (this.data != null) { + this.data.writeTo(output); + } + + // Write packet footer + this.writeUint32(output, TAIL_CONST); + } catch (Exception e) { + // Should never happen } - - ByteArrayOutputStream baos = new ByteArrayOutputStream(4 + 2 + 4 + getData().length + 4); - - this.writeUint32(baos, HEADER_CONST); - this.writeUint16(baos, opcode); - this.writeUint16(baos, 0); // Empty header - this.writeUint32(baos, data.length); - this.writeBytes(baos, data); - this.writeUint32(baos, TAIL_CONST); - - byte[] packet = baos.toByteArray(); return packet; } - public void writeUint16(ByteArrayOutputStream baos, int i) { + private void writeUint16(ProtoSink out, int i) throws Exception { // Unsigned short - baos.write((byte) ((i >>> 8) & 0xFF)); - baos.write((byte) (i & 0xFF)); + out.writeRawByte((byte) ((i >>> 8) & 0xFF)); + out.writeRawByte((byte) (i & 0xFF)); } - public void writeUint32(ByteArrayOutputStream baos, int i) { + private void writeUint32(ProtoSink out, int i) throws Exception { // Unsigned int (long) - baos.write((byte) ((i >>> 24) & 0xFF)); - baos.write((byte) ((i >>> 16) & 0xFF)); - baos.write((byte) ((i >>> 8) & 0xFF)); - baos.write((byte) (i & 0xFF)); + out.writeRawByte((byte) ((i >>> 24) & 0xFF)); + out.writeRawByte((byte) ((i >>> 16) & 0xFF)); + out.writeRawByte((byte) ((i >>> 8) & 0xFF)); + out.writeRawByte((byte) (i & 0xFF)); } - - public void writeBytes(ByteArrayOutputStream baos, byte[] bytes) { - try { - baos.write(bytes); - } catch (IOException e) { - e.printStackTrace(); + + /** + * A byte array wrapped in a ProtoMessage object + */ + @SuppressWarnings("rawtypes") + private static class RawProto extends ProtoMessage { + private byte[] data; + + public RawProto(byte[] data) { + this.data = data; } + + @Override + public ProtoMessage copyFrom(ProtoMessage other) { + data = other.toByteArray(); + return this; + } + + @Override + public ProtoMessage clear() { + data = Utils.EMPTY_BYTE_ARRAY; + return this; + } + + @Override + protected int computeSerializedSize() { + return data.length; + } + + @Override + public void writeTo(ProtoSink output) throws IOException { + output.writeRawBytes(data); + } + + @Override + public ProtoMessage mergeFrom(ProtoSource input) throws IOException { + return this; // Skip + } + + @Override + public boolean equals(Object obj) { + return false; // Skip + } + + @Override + public ProtoMessage clone() { + return null; // Skip + } + } } diff --git a/src/main/java/emu/lunarcore/server/packet/CacheablePacket.java b/src/main/java/emu/lunarcore/server/packet/CacheablePacket.java new file mode 100644 index 0000000..427beb4 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/CacheablePacket.java @@ -0,0 +1,12 @@ +package emu.lunarcore.server.packet; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Marks a BasePacket class as cacheable. Cacheable packets are created only once for all clients and stored in a map to be sent. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CacheablePacket { + +} diff --git a/src/main/java/emu/lunarcore/server/packet/CmdIdUtils.java b/src/main/java/emu/lunarcore/server/packet/CmdIdUtils.java index 1b0fac9..a02d085 100644 --- a/src/main/java/emu/lunarcore/server/packet/CmdIdUtils.java +++ b/src/main/java/emu/lunarcore/server/packet/CmdIdUtils.java @@ -12,19 +12,42 @@ import emu.lunarcore.LunarCore; import emu.lunarcore.util.JsonUtils; 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; public class CmdIdUtils { - private static Int2ObjectMap opcodeMap; + /** + * Packet ids that will NOT be logged if "filterLoopingPackets" is true in the config + */ + public static final IntSet IGNORED_LOG_PACKETS = IntOpenHashSet.of( + CmdId.PlayerHeartBeatCsReq, + CmdId.PlayerHeartBeatScRsp, + CmdId.SceneEntityMoveCsReq, + CmdId.SceneEntityMoveScRsp, + CmdId.GetQuestDataScRsp + ); + + /** + * Packet ids that will NOT be caught by the spam filter + */ + public static final IntSet ALLOWED_FILTER_PACKETS = IntOpenHashSet.of( + CmdId.PlayerHeartBeatCsReq, + CmdId.GetMissionStatusCsReq, + CmdId.GetMissionStatusCsReq, + CmdId.GetMissionEventDataCsReq + ); + + private static Int2ObjectMap cmdIdMap; static { - opcodeMap = new Int2ObjectOpenHashMap<>(); + cmdIdMap = new Int2ObjectOpenHashMap<>(); Field[] fields = CmdId.class.getFields(); for (Field f : fields) { if (f.getType().equals(int.class)) { try { - opcodeMap.put(f.getInt(null), f.getName()); + cmdIdMap.put(f.getInt(null), f.getName()); } catch (Exception e) { e.printStackTrace(); } @@ -32,15 +55,15 @@ public class CmdIdUtils { } } - public static String getOpcodeName(int opcode) { + public static String getCmdIdName(int opcode) { if (opcode <= 0) return "UNKNOWN"; - return opcodeMap.getOrDefault(opcode, "UNKNOWN"); + return cmdIdMap.getOrDefault(opcode, "UNKNOWN"); } public static void dumpPacketIds() { try (FileWriter writer = new FileWriter("./PacketIds_" + GameConstants.VERSION + ".json")) { // Create sorted tree map - Map packetIds = opcodeMap.int2ObjectEntrySet().stream() + Map packetIds = cmdIdMap.int2ObjectEntrySet().stream() .filter(e -> e.getIntKey() > 0) .collect(Collectors.toMap(Int2ObjectMap.Entry::getIntKey, Int2ObjectMap.Entry::getValue, (k, v) -> v, TreeMap::new)); // Write to file diff --git a/src/main/java/emu/lunarcore/server/packet/PacketHandler.java b/src/main/java/emu/lunarcore/server/packet/PacketHandler.java index c593373..ebe2b4b 100644 --- a/src/main/java/emu/lunarcore/server/packet/PacketHandler.java +++ b/src/main/java/emu/lunarcore/server/packet/PacketHandler.java @@ -3,7 +3,5 @@ package emu.lunarcore.server.packet; import emu.lunarcore.server.game.GameSession; public abstract class PacketHandler { - protected static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - public abstract void handle(GameSession session, byte[] data) throws Exception; } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerComposeItemCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerComposeItemCsReq.java index e6824dc..a304f36 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerComposeItemCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerComposeItemCsReq.java @@ -1,9 +1,12 @@ package emu.lunarcore.server.packet.recv; +import java.util.ArrayList; import java.util.List; +import emu.lunarcore.data.common.ItemParam; import emu.lunarcore.game.inventory.GameItem; import emu.lunarcore.proto.ComposeItemCsReqOuterClass.ComposeItemCsReq; +import emu.lunarcore.proto.ItemCostOuterClass.ItemCost; import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; @@ -17,10 +20,16 @@ public class HandlerComposeItemCsReq extends PacketHandler { public void handle(GameSession session, byte[] data) throws Exception { var req = ComposeItemCsReq.parseFrom(data); + List costItems = new ArrayList<>(req.getComposeItemList().getItemList().length()); + for (ItemCost cost : req.getComposeItemList().getItemList()) { + costItems.add(new ItemParam(cost)); + } + List returnList = session.getServer().getInventoryService().composeItem( - session.getPlayer(), - req.getComposeId(), - req.getCount() + session.getPlayer(), + req.getComposeId(), + req.getCount(), + costItems ); session.send(new PacketComposeItemScRsp(req.getComposeId(), req.getCount(), returnList)); diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerExchangeGachaCeilingCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerExchangeGachaCeilingCsReq.java new file mode 100644 index 0000000..828d807 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerExchangeGachaCeilingCsReq.java @@ -0,0 +1,21 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.ExchangeGachaCeilingCsReqOuterClass.ExchangeGachaCeilingCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketExchangeGachaCeilingScRsp; + +@Opcodes(CmdId.ExchangeGachaCeilingCsReq) +public class HandlerExchangeGachaCeilingCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = ExchangeGachaCeilingCsReq.parseFrom(data); + + var items = session.getServer().getGachaService().exchangeGachaCeiling(session.getPlayer(), req.getAvatarId()); + session.send(new PacketExchangeGachaCeilingScRsp(session.getPlayer(), req.getGachaType(), req.getAvatarId(), items)); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetActivityScheduleConfigCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetActivityScheduleConfigCsReq.java index b804ae3..0db5710 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetActivityScheduleConfigCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetActivityScheduleConfigCsReq.java @@ -4,14 +4,13 @@ import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; import emu.lunarcore.server.packet.PacketHandler; -import emu.lunarcore.server.packet.send.PacketGetActivityScheduleConfigScRsp; @Opcodes(CmdId.GetActivityScheduleConfigCsReq) public class HandlerGetActivityScheduleConfigCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { - session.send(new PacketGetActivityScheduleConfigScRsp()); + session.send(CmdId.GetActivityScheduleConfigScRsp); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java index 3a8df86..60a57a0 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java @@ -4,7 +4,6 @@ import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; import emu.lunarcore.server.packet.PacketHandler; -import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp; @Opcodes(CmdId.GetArchiveDataCsReq) public class HandlerGetArchiveDataCsReq extends PacketHandler { @@ -12,7 +11,7 @@ public class HandlerGetArchiveDataCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { // TODO The client does not send this packet right now to the server so we send it in HandlerPlayerLoginFinishCsReq instead - session.send(new PacketGetArchiveDataScRsp()); + session.send(CmdId.GetArchiveDataScRsp); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java new file mode 100644 index 0000000..30691ac --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java @@ -0,0 +1,16 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetDailyActiveInfoScRsp; + +@Opcodes(CmdId.GetDailyActiveInfoCsReq) +public class HandlerGetDailyActiveInfoCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetDailyActiveInfoScRsp(session.getPlayer())); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendRecommendListInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendRecommendListInfoCsReq.java new file mode 100644 index 0000000..94e0655 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendRecommendListInfoCsReq.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetFriendRecommendListInfoScRsp; + +@Opcodes(CmdId.GetFriendRecommendListInfoCsReq) +public class HandlerGetFriendRecommendListInfoCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var list = session.getServer().getRandomOnlinePlayers(10, session.getPlayer()); + session.send(new PacketGetFriendRecommendListInfoScRsp(list)); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetGachaCeilingCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetGachaCeilingCsReq.java new file mode 100644 index 0000000..d66bcf3 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetGachaCeilingCsReq.java @@ -0,0 +1,17 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetGachaCeilingScRsp; + +@Opcodes(CmdId.GetGachaCeilingCsReq) +public class HandlerGetGachaCeilingCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetGachaCeilingScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java new file mode 100644 index 0000000..89f69cf --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetJukeboxDataScRsp; + +@Opcodes(CmdId.GetJukeboxDataCsReq) +public class HandlerGetJukeboxDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + // var req = GetJukeboxDataCsReq.parseFrom(data); + session.send(new PacketGetJukeboxDataScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetMainMissionCustomValueCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetMainMissionCustomValueCsReq.java new file mode 100644 index 0000000..33106f3 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetMainMissionCustomValueCsReq.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.proto.GetMainMissionCustomValueCsReqOuterClass.GetMainMissionCustomValueCsReq; +import emu.lunarcore.server.packet.send.PacketGetMainMissionCustomValueScRsp; + +@Opcodes(CmdId.GetMainMissionCustomValueCsReq) +public class HandlerGetMainMissionCustomValueCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = GetMainMissionCustomValueCsReq.parseFrom(data); + session.send(new PacketGetMainMissionCustomValueScRsp(req.getMainMissionIdList().toArray())); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java new file mode 100644 index 0000000..e4623ed --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java @@ -0,0 +1,17 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetPhoneDataScRsp; + +@Opcodes(CmdId.GetPhoneDataCsReq) +public class HandlerGetPhoneDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetPhoneDataScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetQuestDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetQuestDataCsReq.java new file mode 100644 index 0000000..0de5187 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetQuestDataCsReq.java @@ -0,0 +1,16 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetQuestDataScRsp; + +@Opcodes(CmdId.GetQuestDataCsReq) +public class HandlerGetQuestDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetQuestDataScRsp()); + } +} \ No newline at end of file diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java new file mode 100644 index 0000000..9b78c60 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java @@ -0,0 +1,21 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.PlayBackGroundMusicCsReqOuterClass.PlayBackGroundMusicCsReq; +import emu.lunarcore.server.packet.send.PacketPlayBackGroundMusicScRsp; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; + +@Opcodes(CmdId.PlayBackGroundMusicCsReq) +public class HandlerPlayBackGroundMusicCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = PlayBackGroundMusicCsReq.parseFrom(data); + + session.getPlayer().setCurrentBgm(req.getPlayMusicId()); + session.send(new PacketPlayBackGroundMusicScRsp(req.getPlayMusicId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java index ee4e2a4..9db5934 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java @@ -4,7 +4,7 @@ import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; import emu.lunarcore.server.packet.PacketHandler; -import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp; +import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify; @Opcodes(CmdId.PlayerLoginFinishCsReq) public class HandlerPlayerLoginFinishCsReq extends PacketHandler { @@ -12,7 +12,8 @@ public class HandlerPlayerLoginFinishCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { session.send(CmdId.PlayerLoginFinishScRsp); - session.send(new PacketGetArchiveDataScRsp()); + session.send(CmdId.GetArchiveDataScRsp); + session.send(new PacketBattlePassInfoNotify()); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSceneCastSkillCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSceneCastSkillCsReq.java index cb0ded0..8244d4f 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSceneCastSkillCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSceneCastSkillCsReq.java @@ -57,14 +57,8 @@ public class HandlerSceneCastSkillCsReq extends PacketHandler { req.getHitTargetIdList().forEach(targets::add); req.getAssistMonsterIdList().forEach(targets::add); - // Check if we can start a battle - if (skill != null && !skill.isTriggerBattle()) { - // Skip battle if our technique does not trigger a battle - session.send(new PacketSceneCastSkillScRsp(req.getAttackedGroupId())); - } else { - // Start battle normally - session.getServer().getBattleService().startBattle(player, req.getCasterId(), req.getAttackedGroupId(), skill, targets); - } + // Start battle + session.getServer().getBattleService().startBattle(player, req.getCasterId(), req.getAttackedGroupId(), skill, targets); } else { // We had no targets for some reason session.send(new PacketSceneCastSkillScRsp(req.getAttackedGroupId())); diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java index d747494..ebfa3e7 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java @@ -18,8 +18,10 @@ public class HandlerSearchPlayerCsReq extends PacketHandler { public void handle(GameSession session, byte[] data) throws Exception { var req = SearchPlayerCsReq.parseFrom(data); + // Setup result list List results = new ArrayList<>(); + // Get searched player for (int uid : req.getSearchUidList()) { Player target = session.getServer().getPlayerByUid(uid, true); diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java new file mode 100644 index 0000000..bd76f7d --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.proto.SelectChatBubbleCsReqOuterClass.SelectChatBubbleCsReq; +import emu.lunarcore.server.packet.send.PacketSelectChatBubbleScRsp; + +@Opcodes(CmdId.SelectChatBubbleCsReq) +public class HandlerSelectChatBubbleCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + + var req = SelectChatBubbleCsReq.parseFrom(data); + Player player = session.getPlayer(); + + session.send(new PacketSelectChatBubbleScRsp(player, req.getBubbleId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java new file mode 100644 index 0000000..3b54762 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.proto.SelectPhoneThemeCsReqOuterClass.SelectPhoneThemeCsReq; +import emu.lunarcore.server.packet.send.PacketSelectPhoneThemeScRsp; + +@Opcodes(CmdId.SelectPhoneThemeCsReq) +public class HandlerSelectPhoneThemeCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + + var req = SelectPhoneThemeCsReq.parseFrom(data); + Player player = session.getPlayer(); + + session.send(new PacketSelectPhoneThemeScRsp(player, req.getThemeId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueDialogueEventCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueDialogueEventCsReq.java index cc32d37..b694617 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueDialogueEventCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueDialogueEventCsReq.java @@ -15,7 +15,7 @@ public class HandlerSelectRogueDialogueEventCsReq extends PacketHandler { var req = SelectRogueDialogueEventCsReq.parseFrom(data); if (session.getPlayer().getRogueInstance() != null) { - session.getPlayer().getRogueInstance().selectDialogue(req.getDialogueEventId()); + session.getPlayer().getRogueInstance().onSelectDialogue(req.getDialogueEventId()); } session.send(new PacketSelectRogueDialogueEventScRsp(req.getDialogueEventId())); diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetLineupNameCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetLineupNameCsReq.java index 64c1b25..05baf9b 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetLineupNameCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetLineupNameCsReq.java @@ -15,7 +15,7 @@ public class HandlerSetLineupNameCsReq extends PacketHandler { var req = SetLineupNameCsReq.parseFrom(data); var success = session.getPlayer().getLineupManager().changeLineupName(req.getIndex(), req.getName()); - session.send(new PacketSetLineupNameScRsp(success ? req.getName() : null)); + session.send(new PacketSetLineupNameScRsp(req.getIndex(), success ? req.getName() : null)); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerTextJoinQueryCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerTextJoinQueryCsReq.java new file mode 100644 index 0000000..ac78ec1 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerTextJoinQueryCsReq.java @@ -0,0 +1,19 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketTextJoinQueryScRsp; +import emu.lunarcore.proto.TextJoinQueryCsReqOuterClass.TextJoinQueryCsReq; + +@Opcodes(CmdId.TextJoinQueryCsReq) +public class HandlerTextJoinQueryCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = TextJoinQueryCsReq.parseFrom(data); + session.send(new PacketTextJoinQueryScRsp(session.getPlayer(), req.getTextJoinIdList().toArray())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java new file mode 100644 index 0000000..5c5967a --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.UnlockBackGroundMusicCsReqOuterClass.UnlockBackGroundMusicCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import java.util.List; +import java.util.ArrayList; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketUnlockBackGroundMusicScRsp; + +@Opcodes(CmdId.UnlockBackGroundMusicCsReq) +public class HandlerUnlockBackGroundMusicCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = UnlockBackGroundMusicCsReq.parseFrom(data); + + var unlockIds = req.getUnlockIds(); + List unlockIdsList = new ArrayList<>(); + for (int unlockId : unlockIds) { + unlockIdsList.add(unlockId); + } + if (unlockIdsList.isEmpty()) { + session.send(new PacketUnlockBackGroundMusicScRsp()); + } + else { + session.send(new PacketUnlockBackGroundMusicScRsp(unlockIdsList)); + } + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java new file mode 100644 index 0000000..fb842c2 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java @@ -0,0 +1,29 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.BattlePassInfoNotifyOuterClass.BattlePassInfoNotify; +import emu.lunarcore.proto.BattlePassInfoNotifyOuterClass.BattlePassInfoNotify.BpTierType; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketBattlePassInfoNotify extends BasePacket { + + public PacketBattlePassInfoNotify() { + super(CmdId.BattlePassInfoNotify); + + var data = BattlePassInfoNotify.newInstance() + .setTakenFreeReward(0xFFFFFFFFFFFFFFFFL) + .setTakenPremiumReward1(0xFFFFFFFFFFFFFFFFL) + .setTakenPremiumReward2(0x7FFFFFFFFFFFEL) + .setTakenPremiumOptionalReward(0x7FFFFFFFFFFFEL) + .setTakenFreeExtendedReward(127) + .setTakenPremiumExtendedReward(127) + .setUnkfield(4) + .setLevel(70) + .setCurWeekAddExpSum(8000) + .setExp(800) + .setCurBpId(5) // doesn't matter + .setBpTierType(BpTierType.BP_TIER_TYPE_PREMIUM_2); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java new file mode 100644 index 0000000..78f597d --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java @@ -0,0 +1,36 @@ +package emu.lunarcore.server.packet.send; + +import java.util.*; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.DailyActiveInfoNotifyOuterClass.DailyActiveInfoNotify; +import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketDailyActiveInfoNotify extends BasePacket { + + public PacketDailyActiveInfoNotify(Player player) { + super(CmdId.DailyActiveInfoNotify); + + List questIdList = Arrays.asList(2100003,2100102,2100112,2100115,2100119,2100129); + + var data = DailyActiveInfoNotify.newInstance() + .setDailyActivePoint(700); + + for (int questId : questIdList) { + data.addDailyActiveQuestIdList(questId); + } + + for (int level = 1; level <= 5; level++) { + DailyActivityInfo levelInfo = DailyActivityInfo.newInstance() + .setLevel(level) + .setDailyActivePoint(level * 100) + .setWorldLevel(player.getWorldLevel()) + .setIsHasTaken(true); + + data.addDailyActiveLevelList(levelInfo); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketDoGachaScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketDoGachaScRsp.java index 1eaeb0e..8b3b914 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketDoGachaScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketDoGachaScRsp.java @@ -3,6 +3,7 @@ package emu.lunarcore.server.packet.send; import java.util.List; import emu.lunarcore.game.gacha.GachaBanner; +import emu.lunarcore.game.player.Player; import emu.lunarcore.proto.DoGachaScRspOuterClass.DoGachaScRsp; import emu.lunarcore.proto.GachaItemOuterClass.GachaItem; import emu.lunarcore.server.packet.BasePacket; @@ -16,11 +17,12 @@ public class PacketDoGachaScRsp extends BasePacket { this.setData(DoGachaScRsp.newInstance().setRetcode(1)); } - public PacketDoGachaScRsp(GachaBanner banner, int num, List items) { + public PacketDoGachaScRsp(Player player, GachaBanner banner, int num, List items) { super(CmdId.DoGachaScRsp); var data = DoGachaScRsp.newInstance() .setGachaNum(num) + .setCeilingNum(player.getGachaInfo().getCeilingNum()) .setGachaId(banner.getId()); for (GachaItem item : items) { diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketExchangeGachaCeilingScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketExchangeGachaCeilingScRsp.java new file mode 100644 index 0000000..59d831b --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketExchangeGachaCeilingScRsp.java @@ -0,0 +1,32 @@ +package emu.lunarcore.server.packet.send; + +import java.util.Collection; + +import emu.lunarcore.game.inventory.GameItem; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.ExchangeGachaCeilingScRspOuterClass.ExchangeGachaCeilingScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketExchangeGachaCeilingScRsp extends BasePacket { + + public PacketExchangeGachaCeilingScRsp(Player player, int gachaType, int avatarId, Collection items) { + super(CmdId.ExchangeGachaCeilingScRsp); + + var data = ExchangeGachaCeilingScRsp.newInstance(); + + if (items == null) { + data.setRetcode(1); + } else { + data.setGachaCeiling(player.getGachaInfo().toGachaCeiling(player)); + data.setGachaType(gachaType); + data.setAvatarId(avatarId); + + for (var item : items) { + data.getMutableTransferItemList().addItemList(item.toProto()); + } + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetActivityScheduleConfigScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetActivityScheduleConfigScRsp.java index 5a778f1..7d64f18 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetActivityScheduleConfigScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetActivityScheduleConfigScRsp.java @@ -4,8 +4,10 @@ import emu.lunarcore.data.GameData; import emu.lunarcore.proto.ActivityScheduleInfoOuterClass.ActivityScheduleInfo; import emu.lunarcore.proto.GetActivityScheduleConfigScRspOuterClass.GetActivityScheduleConfigScRsp; import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CacheablePacket; import emu.lunarcore.server.packet.CmdId; +@CacheablePacket public class PacketGetActivityScheduleConfigScRsp extends BasePacket { public PacketGetActivityScheduleConfigScRsp() { @@ -14,7 +16,7 @@ public class PacketGetActivityScheduleConfigScRsp extends BasePacket { var data = GetActivityScheduleConfigScRsp.newInstance(); for (var activity : GameData.getActivityPanelExcelMap().values()) { - if (activity.getType() != 5) continue; + if (activity.getType() != 18) continue; var info = ActivityScheduleInfo.newInstance() .setActivityId(activity.getPanelID()) diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java index b73c7be..4ec3929 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java @@ -2,24 +2,43 @@ package emu.lunarcore.server.packet.send; import emu.lunarcore.data.GameData; import emu.lunarcore.proto.GetArchiveDataScRspOuterClass.GetArchiveDataScRsp; +import emu.lunarcore.proto.MonsterArchiveOuterClass.MonsterArchive; +import emu.lunarcore.proto.RelicArchiveOuterClass.RelicArchive; import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CacheablePacket; import emu.lunarcore.server.packet.CmdId; +@CacheablePacket public class PacketGetArchiveDataScRsp extends BasePacket { - // TODO cache packet public PacketGetArchiveDataScRsp() { super(CmdId.GetArchiveDataScRsp); var data = GetArchiveDataScRsp.newInstance(); + var archiveData = data.getMutableArchiveData(); for (var avatarExcel : GameData.getAvatarExcelMap().values()) { - data.getMutableArchiveData().addArchiveAvatarIdList(avatarExcel.getAvatarID()); + archiveData.addArchiveAvatarIdList(avatarExcel.getAvatarID()); + } + + for (var monsterExcel : GameData.getMonsterExcelMap().values()) { + MonsterArchive monsterinfo = MonsterArchive.newInstance() + .setMonsterId(monsterExcel.getId()) + .setNum(1); // todo: add to db + + archiveData.addArchiveMonsterIdList(monsterinfo); + } + + for (var relicExcel : GameData.getRelicExcelMap().values()) { + RelicArchive relicInfo = RelicArchive.newInstance() + .setType(relicExcel.getType().getVal()) + .setRelicId(relicExcel.getId()); // todo: add to db + + archiveData.addArchiveRelicList(relicInfo); } - for (var itemExcel : GameData.getItemExcelMap().values()) { - if (!itemExcel.isEquipment()) continue; - data.getMutableArchiveData().addAllArchiveEquipmentIdList(itemExcel.getId()); + for (var equipmentExcel : GameData.getEquipExcelMap().values()) { + archiveData.addAllArchiveEquipmentIdList(equipmentExcel.getId()); } this.setData(data); diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetBagScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetBagScRsp.java index 9cd0778..19cadb8 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetBagScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetBagScRsp.java @@ -1,8 +1,8 @@ package emu.lunarcore.server.packet.send; -import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.inventory.GameItem; -import emu.lunarcore.game.inventory.InventoryTab; +import emu.lunarcore.game.inventory.tabs.InventoryTab; +import emu.lunarcore.game.inventory.tabs.InventoryTabType; import emu.lunarcore.proto.GetBagScRspOuterClass.GetBagScRsp; import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.BasePacket; @@ -15,17 +15,17 @@ public class PacketGetBagScRsp extends BasePacket { var data = GetBagScRsp.newInstance(); - InventoryTab tabMaterial = session.getPlayer().getInventory().getInventoryTab(ItemMainType.Material); + InventoryTab tabMaterial = session.getPlayer().getInventory().getTab(InventoryTabType.MATERIAL); for (GameItem item : tabMaterial) { data.addMaterialList(item.toMaterialProto()); } - InventoryTab tabRelic = session.getPlayer().getInventory().getInventoryTab(ItemMainType.Relic); + InventoryTab tabRelic = session.getPlayer().getInventory().getTab(InventoryTabType.RELIC); for (GameItem item : tabRelic) { data.addRelicList(item.toRelicProto()); } - InventoryTab tabEquipment = session.getPlayer().getInventory().getInventoryTab(ItemMainType.Equipment); + InventoryTab tabEquipment = session.getPlayer().getInventory().getTab(InventoryTabType.EQUIPMENT); for (GameItem item : tabEquipment) { data.addEquipmentList(item.toEquipmentProto()); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java new file mode 100644 index 0000000..5f3e059 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java @@ -0,0 +1,36 @@ +package emu.lunarcore.server.packet.send; + +import java.util.*; +import emu.lunarcore.proto.GetDailyActiveInfoScRspOuterClass.GetDailyActiveInfoScRsp; +import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetDailyActiveInfoScRsp extends BasePacket { + + public PacketGetDailyActiveInfoScRsp(Player target) { + super(CmdId.GetDailyActiveInfoScRsp); + + List questIdList = Arrays.asList(2100003,2100102,2100112,2100115,2100119,2100129); + + var data = GetDailyActiveInfoScRsp.newInstance() + .setDailyActivePoint(500); + + for (int questId : questIdList) { + data.addDailyActiveQuestIdList(questId); + } + + for (int level = 1; level <= 5; level++) { + DailyActivityInfo levelInfo = DailyActivityInfo.newInstance() + .setLevel(level) + .setDailyActivePoint(level * 100) + .setWorldLevel(target.getWorldLevel()) + .setIsHasTaken(true); + + data.addDailyActiveLevelList(levelInfo); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java index d9a93aa..2dc5788 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java @@ -1,6 +1,7 @@ package emu.lunarcore.server.packet.send; import emu.lunarcore.GameConstants; +import emu.lunarcore.LunarCore; import emu.lunarcore.game.friends.FriendList; import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo; import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus; @@ -15,17 +16,21 @@ public class PacketGetFriendListInfoScRsp extends BasePacket { public PacketGetFriendListInfoScRsp(FriendList friendList) { super(CmdId.GetFriendListInfoScRsp); + + // Get friend info from config + var serverFriendInfo = LunarCore.getConfig().getServerOptions().getServerFriendInfo(); // Inject server console as friend var consoleFriend = SimpleInfo.newInstance() .setUid(GameConstants.SERVER_CONSOLE_UID) - .setNickname("Server") - .setSignature("Type /help for a list of commands") - .setLevel(1) + .setNickname(serverFriendInfo.getName()) + .setSignature(serverFriendInfo.getSignature()) + .setLevel(serverFriendInfo.getLevel()) + .setChatBubbleId(serverFriendInfo.getChatBubbleId()) .setOnlineStatus(FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE) .setPlatformType(PlatformType.PC) - .setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(1001).setLevel(1)) - .setHeadIcon(201001); + .setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(serverFriendInfo.getDisplayAvatarId()).setLevel(serverFriendInfo.getDisplayAvatarLevel())) + .setHeadIcon(serverFriendInfo.getHeadIcon()); var data = GetFriendListInfoScRsp.newInstance() .addFriendList(FriendListInfo.newInstance().setSimpleInfo(consoleFriend)); diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendRecommendListInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendRecommendListInfoScRsp.java new file mode 100644 index 0000000..e7721d4 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendRecommendListInfoScRsp.java @@ -0,0 +1,27 @@ +package emu.lunarcore.server.packet.send; + +import java.util.Collection; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.FriendRecommendInfoOuterClass.FriendRecommendInfo; +import emu.lunarcore.proto.GetFriendRecommendListInfoScRspOuterClass.GetFriendRecommendListInfoScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetFriendRecommendListInfoScRsp extends BasePacket { + + public PacketGetFriendRecommendListInfoScRsp(Collection list) { + super(CmdId.GetFriendRecommendListInfoScRsp); + + var data = GetFriendRecommendListInfoScRsp.newInstance(); + + for (Player player : list) { + var info = FriendRecommendInfo.newInstance() + .setSimpleInfo(player.toSimpleInfo()); + + data.addFriendRecommendList(info); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaCeilingScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaCeilingScRsp.java new file mode 100644 index 0000000..d347b57 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaCeilingScRsp.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.game.gacha.GachaType; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.GetGachaCeilingScRspOuterClass.GetGachaCeilingScRsp; + +public class PacketGetGachaCeilingScRsp extends BasePacket { + + public PacketGetGachaCeilingScRsp(Player player) { + super(CmdId.GetGachaCeilingScRsp); + + var proto = GetGachaCeilingScRsp.newInstance() + .setGachaType(GachaType.Normal.getId()) + .setGachaCeiling(player.getGachaInfo().toGachaCeiling(player)); + + this.setData(proto); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaInfoScRsp.java index 2109abd..453847e 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaInfoScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetGachaInfoScRsp.java @@ -9,6 +9,6 @@ public class PacketGetGachaInfoScRsp extends BasePacket { public PacketGetGachaInfoScRsp(GameSession session) { super(CmdId.GetGachaInfoScRsp); - this.setData(session.getServer().getGachaService().toProto()); + this.setData(session.getServer().getGachaService().toProto(session.getPlayer())); } } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java new file mode 100644 index 0000000..e6fba5e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.data.GameData; +import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp; +import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp.UnlockedMusic; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetJukeboxDataScRsp extends BasePacket { + + public PacketGetJukeboxDataScRsp(Player player) { + super(CmdId.GetJukeboxDataScRsp); + + var allmusicids = GameData.getAllMusicIds(); + + var data = GetJukeboxDataScRsp.newInstance() + .setPlayingId(player.getCurrentBgm()); + + for (int musicId : allmusicids) { + UnlockedMusic musicListEntry = UnlockedMusic.newInstance() + .setId(musicId) + .setUnkbool(true) + .setGroupId(GameData.getMusicGroupId(musicId)); + + data.addMusicList(musicListEntry); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetMainMissionCustomValueScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetMainMissionCustomValueScRsp.java new file mode 100644 index 0000000..e61a20d --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetMainMissionCustomValueScRsp.java @@ -0,0 +1,24 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.GetMainMissionCustomValueScRspOuterClass.GetMainMissionCustomValueScRsp; +import emu.lunarcore.proto.MainMissionOuterClass.MainMission; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetMainMissionCustomValueScRsp extends BasePacket { + + // TODO cache packet + public PacketGetMainMissionCustomValueScRsp(int[] mainMissionIdList) { + super(CmdId.GetMainMissionCustomValueScRsp); + + var data = GetMainMissionCustomValueScRsp.newInstance(); + + for (int mainMissionId : mainMissionIdList) { + MainMission mainMission = MainMission.newInstance() + .setId(mainMissionId); + data.addMainMissionList(mainMission); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java new file mode 100644 index 0000000..f33f43c --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java @@ -0,0 +1,28 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.GetPhoneDataScRspOuterClass.GetPhoneDataScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.data.GameData; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.game.player.Player; + +public class PacketGetPhoneDataScRsp extends BasePacket { + + public PacketGetPhoneDataScRsp(Player player) { + super(CmdId.GetPhoneDataScRsp); + + var data = GetPhoneDataScRsp.newInstance() + .setCurChatBubble(player.getChatBubble()) + .setCurPhoneTheme(player.getPhoneTheme()); + + for (var chatBubble : GameData.getChatBubbleExcelMap().values()) { + data.addOwnedChatBubbles(chatBubble.getId()); + } + + for (var phoneTheme : GameData.getPhoneThemeExcelMap().values()) { + data.addOwnedPhoneThemes(phoneTheme.getId()); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetQuestDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetQuestDataScRsp.java new file mode 100644 index 0000000..0edd4e6 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetQuestDataScRsp.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.GetQuestDataScRspOuterClass.GetQuestDataScRsp; +import emu.lunarcore.proto.QuestOuterClass.Quest; +import emu.lunarcore.proto.QuestOuterClass.Quest.QuestStatus; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.data.GameData; + +public class PacketGetQuestDataScRsp extends BasePacket { + + public PacketGetQuestDataScRsp() { + super(CmdId.GetQuestDataScRsp); + + var allIds = GameData.getAllQuestIds(); + + var data = GetQuestDataScRsp.newInstance(); + //.setTotalAchievementExp(69); + + for (int questId : allIds) { + var questItem = Quest.newInstance() + .setId(questId) + .setStatus(QuestStatus.QUEST_CLOSE) + .setFinishTime(10000L) + .setProgress(1); + data.addQuestList(questItem); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetSceneMapInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetSceneMapInfoScRsp.java index 0232807..72c4064 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetSceneMapInfoScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetSceneMapInfoScRsp.java @@ -30,7 +30,7 @@ public class PacketGetSceneMapInfoScRsp extends BasePacket { .setEntryId(entryId); // Map sections. TODO un hardcode - for (int i = 0; i < 25; i++) { + for (int i = 0; i < 100; i++) { mazeMap.addAllLightenSectionList(i); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetShopListScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetShopListScRsp.java index c54cc8c..856f2ae 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetShopListScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetShopListScRsp.java @@ -16,7 +16,7 @@ public class PacketGetShopListScRsp extends BasePacket { .setShopType(shopType); for (ShopExcel shopExcel : GameData.getShopExcelMap().values()) { - if (shopExcel.getShopType() != shopType) { + if (shopExcel.getShopType() != shopType || shopExcel.getGoods().size() == 0) { continue; } @@ -24,7 +24,7 @@ public class PacketGetShopListScRsp extends BasePacket { .setShopId(shopExcel.getId()) .setCityLevel(1) .setEndTime(Integer.MAX_VALUE); - + for (var goodsExcel : shopExcel.getGoods().values()) { shop.addGoodsList(goodsExcel.toProto()); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java new file mode 100644 index 0000000..802f84b --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.PlayBackGroundMusicScRspOuterClass.PlayBackGroundMusicScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketPlayBackGroundMusicScRsp extends BasePacket { + + public PacketPlayBackGroundMusicScRsp(int musicId) { + super(CmdId.PlayBackGroundMusicScRsp); + + var data = PlayBackGroundMusicScRsp.newInstance() + .setPlayingId(musicId) + .setPlayMusicId(musicId); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketPlayerSyncScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayerSyncScNotify.java index 41105bd..fb2b19f 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketPlayerSyncScNotify.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayerSyncScNotify.java @@ -70,6 +70,24 @@ public class PacketPlayerSyncScNotify extends BasePacket { this.setData(data); } + + public PacketPlayerSyncScNotify(GameAvatar... avatars) { // Ugly workaround + this(); + + var data = PlayerSyncScNotify.newInstance(); + + for (var avatar : avatars) { + // Sync avatar + data.getMutableAvatarSync().addAvatarList(avatar.toProto()); + + // Also update hero basic type info if were updating the main character + if (avatar.getHeroPath() != null) { + data.getMutableBasicTypeInfoList().add(avatar.getHeroPath().toProto()); + } + } + + this.setData(data); + } public PacketPlayerSyncScNotify(Collection items) { this(); @@ -84,18 +102,15 @@ public class PacketPlayerSyncScNotify extends BasePacket { } private void addItemToProto(PlayerSyncScNotify data, GameItem item) { - switch (item.getExcel().getItemMainType()) { - case Material -> { - data.addMaterialList(item.toMaterialProto()); - } - case Relic -> { + switch (item.getExcel().getItemMainType().getTabType()) { + case RELIC -> { if (item.getCount() > 0) { data.addRelicList(item.toRelicProto()); } else { data.addDelRelicList(item.getInternalUid()); } } - case Equipment -> { + case EQUIPMENT -> { if (item.getCount() > 0) { data.addEquipmentList(item.toEquipmentProto()); } else { @@ -103,7 +118,7 @@ public class PacketPlayerSyncScNotify extends BasePacket { } } default -> { - + data.addMaterialList(item.toMaterialProto()); } } } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java new file mode 100644 index 0000000..fc79551 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.SelectChatBubbleScRspOuterClass.SelectChatBubbleScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSelectChatBubbleScRsp extends BasePacket { + + public PacketSelectChatBubbleScRsp(Player player, int bubbleId) { + super(CmdId.SelectChatBubbleScRsp); + + player.setChatBubble(bubbleId); + + var data = SelectChatBubbleScRsp.newInstance() + .setCurChatBubble(bubbleId); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java new file mode 100644 index 0000000..6f5e453 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.SelectPhoneThemeScRspOuterClass.SelectPhoneThemeScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.game.player.Player; + +public class PacketSelectPhoneThemeScRsp extends BasePacket { + + public PacketSelectPhoneThemeScRsp(Player player, int themeId) { + super(CmdId.SelectPhoneThemeScRsp); + + player.setPhoneTheme(themeId); + + var data = SelectPhoneThemeScRsp.newInstance() + .setCurPhoneTheme(themeId); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketServerAnnounceNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketServerAnnounceNotify.java new file mode 100644 index 0000000..b6dc7f7 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketServerAnnounceNotify.java @@ -0,0 +1,34 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketServerAnnounceNotify extends BasePacket { + + public PacketServerAnnounceNotify() { + super(CmdId.ServerAnnounceNotify); + + byte[] byteArray = { + (byte)0x12, (byte)0xb0, (byte)0x01, (byte)0x08, (byte)0x00, (byte)0x20, (byte)0xff, (byte)0xbf, (byte)0xca, (byte)0xf3, + (byte)0x84, (byte)0xa3, (byte)0x02, (byte)0x30, (byte)0x00, (byte)0x38, (byte)0x64, (byte)0x48, (byte)0x01, (byte)0x58, + (byte)0x01, (byte)0x2a, (byte)0x9b, (byte)0x01, (byte)0x4c, (byte)0x55, (byte)0x4e, (byte)0x41, (byte)0x52, (byte)0x43, + (byte)0x4f, (byte)0x52, (byte)0x45, (byte)0x20, (byte)0x49, (byte)0x53, (byte)0x20, (byte)0x41, (byte)0x20, (byte)0x46, + (byte)0x52, (byte)0x45, (byte)0x45, (byte)0x20, (byte)0x53, (byte)0x4f, (byte)0x46, (byte)0x54, (byte)0x57, (byte)0x41, + (byte)0x52, (byte)0x45, (byte)0x2e, (byte)0x20, (byte)0x49, (byte)0x46, (byte)0x20, (byte)0x59, (byte)0x4f, (byte)0x55, + (byte)0x20, (byte)0x50, (byte)0x41, (byte)0x49, (byte)0x44, (byte)0x20, (byte)0x46, (byte)0x4f, (byte)0x52, (byte)0x20, + (byte)0x49, (byte)0x54, (byte)0x2c, (byte)0x20, (byte)0x59, (byte)0x4f, (byte)0x55, (byte)0x20, (byte)0x48, (byte)0x41, + (byte)0x56, (byte)0x45, (byte)0x20, (byte)0x42, (byte)0x45, (byte)0x45, (byte)0x4e, (byte)0x20, (byte)0x53, (byte)0x43, + (byte)0x41, (byte)0x4d, (byte)0x4d, (byte)0x45, (byte)0x44, (byte)0x21, (byte)0x20, (byte)0x6c, (byte)0x75, (byte)0x6e, + (byte)0x61, (byte)0x72, (byte)0x63, (byte)0x6f, (byte)0x72, (byte)0x65, (byte)0x20, (byte)0xe6, (byte)0x98, (byte)0xaf, + (byte)0xe4, (byte)0xb8, (byte)0x80, (byte)0xe6, (byte)0xac, (byte)0xbe, (byte)0xe5, (byte)0x85, (byte)0x8d, (byte)0xe8, + (byte)0xb4, (byte)0xb9, (byte)0xe8, (byte)0xbd, (byte)0xaf, (byte)0xe4, (byte)0xbb, (byte)0xb6, (byte)0xe3, (byte)0x80, + (byte)0x82, (byte)0xe5, (byte)0xa6, (byte)0x82, (byte)0xe6, (byte)0x9e, (byte)0x9c, (byte)0xe4, (byte)0xbd, (byte)0xa0, + (byte)0xe8, (byte)0x8a, (byte)0xb1, (byte)0xe9, (byte)0x92, (byte)0xb1, (byte)0xe4, (byte)0xb9, (byte)0xb0, (byte)0xe4, + (byte)0xba, (byte)0x86, (byte)0xe5, (byte)0xae, (byte)0x83, (byte)0xef, (byte)0xbc, (byte)0x8c, (byte)0xe9, (byte)0x82, + (byte)0xa3, (byte)0xe4, (byte)0xbd, (byte)0xa0, (byte)0xe5, (byte)0xb0, (byte)0xb1, (byte)0xe8, (byte)0xa2, (byte)0xab, + (byte)0xe9, (byte)0xaa, (byte)0x97, (byte)0xe4, (byte)0xba, (byte)0x86, (byte)0xef, (byte)0xbc, (byte)0x81 + }; + + this.setData(byteArray); + } +} \ No newline at end of file diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSetLineupNameScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSetLineupNameScRsp.java index c1eb78a..89a6927 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketSetLineupNameScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSetLineupNameScRsp.java @@ -6,12 +6,13 @@ import emu.lunarcore.server.packet.CmdId; public class PacketSetLineupNameScRsp extends BasePacket { - public PacketSetLineupNameScRsp(String name) { + public PacketSetLineupNameScRsp(int index, String name) { super(CmdId.SetLineupNameScRsp); var data = SetLineupNameScRsp.newInstance(); if (name != null) { + data.setIndex(index); data.setName(name); } else { data.setRetcode(1); diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketTextJoinQueryScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketTextJoinQueryScRsp.java new file mode 100644 index 0000000..c768038 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketTextJoinQueryScRsp.java @@ -0,0 +1,27 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.data.GameData; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.TextJoinQueryScRspOuterClass.TextJoinQueryScRsp; +import emu.lunarcore.proto.TextJoinQueryScRspOuterClass.TextJoinQueryScRsp.TextJoinInfo; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketTextJoinQueryScRsp extends BasePacket { + + public PacketTextJoinQueryScRsp(Player player, int[] textJoinIdList) { + super(CmdId.TextJoinQueryScRsp); + + + var data = TextJoinQueryScRsp.newInstance(); + + for (int joinId : textJoinIdList) { + TextJoinInfo joinInfo = TextJoinInfo.newInstance() + .setTextItemId(joinId) + .setTextItemConfigId(GameData.TextJoinItemFromId(joinId)); + data.addTextJoinList(joinInfo); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java new file mode 100644 index 0000000..61d094e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.send; + +import java.util.List; +import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp.UnlockedMusic; +import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.data.GameData; + +public class PacketUnlockBackGroundMusicScRsp extends BasePacket { + + public PacketUnlockBackGroundMusicScRsp(List unlockIds) { + super(CmdId.UnlockBackGroundMusicScRsp); + + var data = UnlockBackGroundMusicScRsp.newInstance(); + + for (int unlockId : unlockIds) { + UnlockedMusic music = UnlockedMusic.newInstance() + .setGroupId(GameData.getMusicGroupId(unlockId)) + .setId(unlockId); + data.addMusicList(music); + } + + this.setData(data); + } + + public PacketUnlockBackGroundMusicScRsp() { + super(CmdId.UnlockBackGroundMusicScRsp); + this.setData(UnlockBackGroundMusicScRsp.newInstance()); + } +} diff --git a/src/main/java/emu/lunarcore/util/Utils.java b/src/main/java/emu/lunarcore/util/Utils.java index 6bf2065..b562dca 100644 --- a/src/main/java/emu/lunarcore/util/Utils.java +++ b/src/main/java/emu/lunarcore/util/Utils.java @@ -4,20 +4,20 @@ import java.io.File; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; -import java.net.Socket; import java.util.Base64; import java.util.List; import java.util.concurrent.ThreadLocalRandom; public class Utils { private static final char[] HEX_ARRAY = "0123456789abcdef".toCharArray(); - + public static final Object EMPTY_OBJECT = new Object(); public static final int[] EMPTY_ARRAY = new int[0]; + public static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; public static final String EMPTY_STRING = ""; public static String bytesToHex(byte[] bytes) { - if (bytes == null) return ""; + if (bytes == null || bytes.length == 0) return EMPTY_STRING; char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; @@ -84,6 +84,9 @@ public class Utils { return Math.max(Math.min((int) ((level - 11) / 10D), 6), 0); } + /** + * Parses the string argument as a signed decimal integer. Returns a 0 if the string argument is not an integer. + */ public static int parseSafeInt(String s) { if (s == null) { return 0; @@ -100,6 +103,9 @@ public class Utils { return i; } + /** + * Parses the string argument as a signed decimal long. Returns a 0 if the string argument is not a long. + */ public static long parseSafeLong(String s) { if (s == null) { return 0;