Commit fa9d703d authored by BaiSugar's avatar BaiSugar Committed by GitHub
Browse files

Merge branch 'Grasscutters:development' into development

parents 6a5d97a3 d1fc8c1f
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TakePlayerLevelRewardRspOuterClass.TakePlayerLevelRewardRsp;
public class PacketTakePlayerLevelRewardRsp extends GenshinPacket {
public class PacketTakePlayerLevelRewardRsp extends BasePacket {
public PacketTakePlayerLevelRewardRsp(int level, int rewardId) {
super(PacketOpcodes.TakePlayerLevelRewardRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TakeoffEquipRspOuterClass.TakeoffEquipRsp;
public class PacketTakeoffEquipRsp extends GenshinPacket {
public class PacketTakeoffEquipRsp extends BasePacket {
public PacketTakeoffEquipRsp(long avatarGuid, int slot) {
super(PacketOpcodes.TakeoffEquipRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerAllDataRspOuterClass.TowerAllDataRsp;
import emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelRecord;
import emu.grasscutter.net.proto.TowerFloorRecordOuterClass.TowerFloorRecord;
public class PacketTowerAllDataRsp extends GenshinPacket {
public class PacketTowerAllDataRsp extends BasePacket {
public PacketTowerAllDataRsp() {
super(PacketOpcodes.TowerAllDataRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.UnlockAvatarTalentRspOuterClass.UnlockAvatarTalentRsp;
public class PacketUnlockAvatarTalentRsp extends GenshinPacket {
public class PacketUnlockAvatarTalentRsp extends BasePacket {
public PacketUnlockAvatarTalentRsp(GenshinAvatar avatar, int talentId) {
public PacketUnlockAvatarTalentRsp(Avatar avatar, int talentId) {
super(PacketOpcodes.UnlockAvatarTalentRsp);
UnlockAvatarTalentRsp proto = UnlockAvatarTalentRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.UnlockNameCardNotifyOuterClass.UnlockNameCardNotify;
public class PacketUnlockNameCardNotify extends GenshinPacket {
public class PacketUnlockNameCardNotify extends BasePacket {
public PacketUnlockNameCardNotify(int nameCard) {
super(PacketOpcodes.UnlockNameCardNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import emu.grasscutter.net.proto.UseItemRspOuterClass.UseItemRsp;
public class PacketUseItemRsp extends GenshinPacket {
public class PacketUseItemRsp extends BasePacket {
public PacketUseItemRsp(long targetGuid, GenshinItem useItem) {
public PacketUseItemRsp(long targetGuid, GameItem useItem) {
super(PacketOpcodes.UseItemRsp);
UseItemRsp proto = UseItemRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WeaponAwakenRspOuterClass.WeaponAwakenRsp;
public class PacketWeaponAwakenRsp extends GenshinPacket {
public class PacketWeaponAwakenRsp extends BasePacket {
public PacketWeaponAwakenRsp(GenshinAvatar avatar, GenshinItem item, GenshinItem feedWeapon, int oldRefineLevel) {
public PacketWeaponAwakenRsp(Avatar avatar, GameItem item, GameItem feedWeapon, int oldRefineLevel) {
super(PacketOpcodes.WeaponAwakenRsp);
WeaponAwakenRsp.Builder proto = WeaponAwakenRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WeaponPromoteRspOuterClass.WeaponPromoteRsp;
public class PacketWeaponPromoteRsp extends GenshinPacket {
public class PacketWeaponPromoteRsp extends BasePacket {
public PacketWeaponPromoteRsp(GenshinItem item, int oldPromoteLevel) {
public PacketWeaponPromoteRsp(GameItem item, int oldPromoteLevel) {
super(PacketOpcodes.WeaponPromoteRsp);
WeaponPromoteRsp proto = WeaponPromoteRsp.newBuilder()
......
......@@ -2,15 +2,15 @@ package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam;
import emu.grasscutter.net.proto.WeaponUpgradeRspOuterClass.WeaponUpgradeRsp;
public class PacketWeaponUpgradeRsp extends GenshinPacket {
public class PacketWeaponUpgradeRsp extends BasePacket {
public PacketWeaponUpgradeRsp(GenshinItem item, int oldLevel, List<ItemParam> leftoverOres) {
public PacketWeaponUpgradeRsp(GameItem item, int oldLevel, List<ItemParam> leftoverOres) {
super(PacketOpcodes.WeaponUpgradeRsp);
WeaponUpgradeRsp proto = WeaponUpgradeRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WearEquipRspOuterClass.WearEquipRsp;
public class PacketWearEquipRsp extends GenshinPacket {
public class PacketWearEquipRsp extends BasePacket {
public PacketWearEquipRsp(long avatarGuid, long equipGuid) {
super(PacketOpcodes.WearEquipRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PropValueOuterClass.PropValue;
import emu.grasscutter.net.proto.WorldDataNotifyOuterClass.WorldDataNotify;
public class PacketWorldDataNotify extends GenshinPacket {
public class PacketWorldDataNotify extends BasePacket {
public PacketWorldDataNotify(World world) {
super(PacketOpcodes.WorldDataNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType;
import emu.grasscutter.net.proto.WorldPlayerDieNotifyOuterClass.WorldPlayerDieNotify;
public class PacketWorldPlayerDieNotify extends GenshinPacket {
public class PacketWorldPlayerDieNotify extends BasePacket {
public PacketWorldPlayerDieNotify(PlayerDieType playerDieType, int killerId) {
super(PacketOpcodes.WorldPlayerDieNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify;
public class PacketWorldPlayerInfoNotify extends GenshinPacket {
public class PacketWorldPlayerInfoNotify extends BasePacket {
public PacketWorldPlayerInfoNotify(World world) {
super(PacketOpcodes.WorldPlayerInfoNotify);
......@@ -14,7 +14,7 @@ public class PacketWorldPlayerInfoNotify extends GenshinPacket {
WorldPlayerInfoNotify.Builder proto = WorldPlayerInfoNotify.newBuilder();
for (int i = 0; i < world.getPlayers().size(); i++) {
GenshinPlayer p = world.getPlayers().get(i);
Player p = world.getPlayers().get(i);
proto.addPlayerInfoList(p.getOnlinePlayerInfo());
proto.addPlayerUidList(p.getUid());
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify;
public class PacketWorldPlayerLocationNotify extends GenshinPacket {
public class PacketWorldPlayerLocationNotify extends BasePacket {
public PacketWorldPlayerLocationNotify(World world) {
super(PacketOpcodes.WorldPlayerLocationNotify);
WorldPlayerLocationNotify.Builder proto = WorldPlayerLocationNotify.newBuilder();
for (GenshinPlayer p : world.getPlayers()) {
for (Player p : world.getPlayers()) {
proto.addPlayerWorldLocList(p.getWorldPlayerLocationInfo());
}
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerRTTInfoOuterClass.PlayerRTTInfo;
import emu.grasscutter.net.proto.WorldPlayerRTTNotifyOuterClass.WorldPlayerRTTNotify;
public class PacketWorldPlayerRTTNotify extends GenshinPacket {
public class PacketWorldPlayerRTTNotify extends BasePacket {
public PacketWorldPlayerRTTNotify(World world) {
super(PacketOpcodes.WorldPlayerRTTNotify);
WorldPlayerRTTNotify.Builder proto = WorldPlayerRTTNotify.newBuilder();
for (GenshinPlayer player : world.getPlayers()) {
for (Player player : world.getPlayers()) {
proto.addPlayerRttList(
PlayerRTTInfo.newBuilder()
.setUid(player.getUid())
......
......@@ -2,7 +2,7 @@ package emu.grasscutter.task;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.Account;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.player.Player;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
......
package emu.grasscutter.task.tasks;
import emu.grasscutter.database.DatabaseManager;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.task.Task;
import emu.grasscutter.task.TaskHandler;
......@@ -15,8 +15,8 @@ import org.quartz.JobExecutionException;
public final class MoonCard implements TaskHandler {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
List<GenshinPlayer> players = DatabaseManager.getDatastore().find(GenshinPlayer.class).stream().toList();
for (GenshinPlayer player : players) {
List<Player> players = DatabaseManager.getDatastore().find(Player.class).stream().toList();
for (Player player : players) {
if (player.isOnline()) {
if (player.inMoonCard()) {
player.getTodayMoonCard();
......
......@@ -18,9 +18,9 @@ import java.util.stream.Collectors;
import com.google.gson.reflect.TypeToken;
import emu.grasscutter.GenshinConstants;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GenshinData;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.ResourceLoader;
import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.def.ItemData;
......@@ -45,48 +45,48 @@ public final class Tools {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
writer.println("// Genshin Impact " + GenshinConstants.VERSION + " GM Handbook");
writer.println("// Grasscutter " + GameConstants.VERSION + " GM Handbook");
writer.println("// Created " + dtf.format(now) + System.lineSeparator() + System.lineSeparator());
list = new ArrayList<>(GenshinData.getAvatarDataMap().keySet());
list = new ArrayList<>(GameData.getAvatarDataMap().keySet());
Collections.sort(list);
writer.println("// Avatars");
for (Integer id : list) {
AvatarData data = GenshinData.getAvatarDataMap().get(id);
AvatarData data = GameData.getAvatarDataMap().get(id);
writer.println(data.getId() + " : " + map.get(data.getNameTextMapHash()));
}
writer.println();
list = new ArrayList<>(GenshinData.getItemDataMap().keySet());
list = new ArrayList<>(GameData.getItemDataMap().keySet());
Collections.sort(list);
writer.println("// Items");
for (Integer id : list) {
ItemData data = GenshinData.getItemDataMap().get(id);
ItemData data = GameData.getItemDataMap().get(id);
writer.println(data.getId() + " : " + map.get(data.getNameTextMapHash()));
}
writer.println();
writer.println("// Scenes");
list = new ArrayList<>(GenshinData.getSceneDataMap().keySet());
list = new ArrayList<>(GameData.getSceneDataMap().keySet());
Collections.sort(list);
for (Integer id : list) {
SceneData data = GenshinData.getSceneDataMap().get(id);
SceneData data = GameData.getSceneDataMap().get(id);
writer.println(data.getId() + " : " + data.getScriptData());
}
writer.println();
writer.println("// Monsters");
list = new ArrayList<>(GenshinData.getMonsterDataMap().keySet());
list = new ArrayList<>(GameData.getMonsterDataMap().keySet());
Collections.sort(list);
for (Integer id : list) {
MonsterData data = GenshinData.getMonsterDataMap().get(id);
MonsterData data = GameData.getMonsterDataMap().get(id);
writer.println(data.getId() + " : " + map.get(data.getNameTextMapHash()));
}
}
......
......@@ -174,11 +174,11 @@ public final class Utils {
// Check for resources folder.
if(!fileExists(resourcesFolder)) {
logger.info("Creating resources folder...");
logger.info("Place a copy of 'GenshinData' in the resources folder.");
logger.info("Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder.");
createFolder(resourcesFolder); exit = true;
}
// Check for GenshinData.
// Check for BinOutput + ExcelBinOuput.
if(!fileExists(resourcesFolder + "BinOutput") ||
!fileExists(resourcesFolder + "ExcelBinOutput")) {
logger.info("Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment