mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 10:55:56 +00:00
Merge branch 'development' of https://github.com/Melledy/Grasscutter into development
This commit is contained in:
commit
e97e124460
@ -19,7 +19,7 @@
|
||||
"bannerType": "EVENT",
|
||||
"prefabPath": "GachaShowPanel_A079",
|
||||
"previewPrefabPath": "UI_Tab_GachaShowPanel_A079",
|
||||
"titlePath": "UI_GACHA_SHOW_PANEL_A079_TITLE",
|
||||
"titlePath": "UI_GACHA_SHOW_PANEL_A048_TITLE",
|
||||
"costItem": 223,
|
||||
"beginTime": 0,
|
||||
"endTime": 1924992000,
|
||||
@ -34,7 +34,7 @@
|
||||
"bannerType": "WEAPON",
|
||||
"prefabPath": "GachaShowPanel_A080",
|
||||
"previewPrefabPath": "UI_Tab_GachaShowPanel_A080",
|
||||
"titlePath": "UI_GACHA_SHOW_PANEL_A080_TITLE",
|
||||
"titlePath": "UI_GACHA_SHOW_PANEL_A021_TITLE",
|
||||
"costItem": 223,
|
||||
"beginTime": 0,
|
||||
"endTime": 1924992000,
|
||||
|
@ -27,6 +27,7 @@ public final class Config {
|
||||
public String Ip = "127.0.0.1";
|
||||
public String PublicIp = "";
|
||||
public int Port = 443;
|
||||
public int OverseaLogPort = 8888;
|
||||
public int UploadLogPort = 80;
|
||||
public String KeystorePath = "./keystore.p12";
|
||||
public String KeystorePassword = "";
|
||||
|
@ -46,7 +46,7 @@ public final class AccountCommand implements CommandHandler {
|
||||
CommandHandler.sendMessage(null, "Account already exists.");
|
||||
return;
|
||||
} else {
|
||||
CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerId() + ".");
|
||||
CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerUid() + ".");
|
||||
account.addPermission("*"); // Grant the player superuser permissions.
|
||||
account.save(); // Save account to database.
|
||||
}
|
||||
|
@ -23,11 +23,17 @@ public final class ChangeSceneCommand implements CommandHandler {
|
||||
|
||||
try {
|
||||
int sceneId = Integer.parseInt(args.get(0));
|
||||
|
||||
if (sceneId == sender.getSceneId()) {
|
||||
CommandHandler.sendMessage(sender, "You are already in that scene");
|
||||
return;
|
||||
}
|
||||
|
||||
boolean result = sender.getWorld().transferPlayerToScene(sender, sceneId, sender.getPos());
|
||||
|
||||
CommandHandler.sendMessage(sender, "Changed to scene " + sceneId);
|
||||
|
||||
if (!result) {
|
||||
CommandHandler.sendMessage(sender, "Scene does not exist or you are already in it");
|
||||
CommandHandler.sendMessage(sender, "Scene does not exist");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommandHandler.sendMessage(sender, "Usage: changescene <scene id>");
|
||||
|
@ -22,7 +22,7 @@ public final class KickCommand implements CommandHandler {
|
||||
}
|
||||
|
||||
if (sender != null) {
|
||||
CommandHandler.sendMessage(sender, String.format("Player [%s:%s] has kicked player [%s:%s]", sender.getAccount().getPlayerId(), sender.getAccount().getUsername(), target, targetPlayer.getAccount().getUsername()));
|
||||
CommandHandler.sendMessage(sender, String.format("Player [%s:%s] has kicked player [%s:%s]", sender.getAccount().getPlayerUid(), sender.getAccount().getUsername(), target, targetPlayer.getAccount().getUsername()));
|
||||
}
|
||||
CommandHandler.sendMessage(sender, String.format("Kicking player [%s:%s]", target, targetPlayer.getAccount().getUsername()));
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package emu.grasscutter.game;
|
||||
|
||||
import dev.morphia.annotations.AlsoLoad;
|
||||
import dev.morphia.annotations.Collation;
|
||||
import dev.morphia.annotations.Entity;
|
||||
import dev.morphia.annotations.Id;
|
||||
@ -24,7 +25,7 @@ public class Account {
|
||||
private String username;
|
||||
private String password; // Unused for now
|
||||
|
||||
private int playerId;
|
||||
@AlsoLoad("playerUid") private int playerId;
|
||||
private String email;
|
||||
|
||||
private String token;
|
||||
@ -68,7 +69,7 @@ public class Account {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public int getPlayerId() {
|
||||
public int getPlayerUid() {
|
||||
return this.playerId;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ import emu.grasscutter.net.proto.OnlinePlayerInfoOuterClass.OnlinePlayerInfo;
|
||||
import emu.grasscutter.net.proto.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason;
|
||||
import emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo;
|
||||
import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail;
|
||||
import emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo;
|
||||
import emu.grasscutter.server.game.GameServer;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.packet.send.PacketAbilityInvocationsNotify;
|
||||
@ -49,9 +50,11 @@ import emu.grasscutter.server.packet.send.PacketPlayerEnterSceneNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketPlayerPropNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketPlayerStoreNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketPrivateChatNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketScenePlayerLocationNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketSetNameCardRsp;
|
||||
import emu.grasscutter.server.packet.send.PacketStoreWeightLimitNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketUnlockNameCardNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketWorldPlayerLocationNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketWorldPlayerRTTNotify;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
@ -101,6 +104,7 @@ public class GenshinPlayer {
|
||||
@Transient private int enterSceneToken;
|
||||
@Transient private SceneLoadState sceneState;
|
||||
@Transient private boolean hasSentAvatarDataNotify;
|
||||
@Transient private long nextSendPlayerLocTime = 0;
|
||||
|
||||
@Transient private final Int2ObjectMap<CoopRequest> coopRequests;
|
||||
@Transient private final InvokeHandler<CombatInvokeEntry> combatInvokeHandler;
|
||||
@ -121,6 +125,12 @@ public class GenshinPlayer {
|
||||
}
|
||||
this.properties.put(prop.getId(), 0);
|
||||
}
|
||||
|
||||
this.gachaInfo = new PlayerGachaInfo();
|
||||
this.nameCardList = new HashSet<>();
|
||||
this.flyCloakList = new HashSet<>();
|
||||
this.costumeList = new HashSet<>();
|
||||
|
||||
this.setSceneId(3);
|
||||
this.setRegionId(1);
|
||||
this.sceneState = SceneLoadState.NONE;
|
||||
@ -140,11 +150,6 @@ public class GenshinPlayer {
|
||||
this.nickname = "Traveler";
|
||||
this.signature = "";
|
||||
this.teamManager = new TeamManager(this);
|
||||
this.gachaInfo = new PlayerGachaInfo();
|
||||
this.playerProfile = new PlayerProfile(this);
|
||||
this.nameCardList = new HashSet<>();
|
||||
this.flyCloakList = new HashSet<>();
|
||||
this.costumeList = new HashSet<>();
|
||||
this.setProperty(PlayerProperty.PROP_PLAYER_LEVEL, 1);
|
||||
this.setProperty(PlayerProperty.PROP_IS_SPRING_AUTO_USE, 1);
|
||||
this.setProperty(PlayerProperty.PROP_SPRING_AUTO_USE_PERCENT, 50);
|
||||
@ -165,6 +170,7 @@ public class GenshinPlayer {
|
||||
|
||||
public void setUid(int id) {
|
||||
this.id = id;
|
||||
this.getProfile().syncWithCharacter(this);
|
||||
}
|
||||
|
||||
public long getNextGenshinGuid() {
|
||||
@ -654,6 +660,13 @@ public class GenshinPlayer {
|
||||
return social;
|
||||
}
|
||||
|
||||
public WorldPlayerLocationInfo getWorldPlayerLocationInfo() {
|
||||
return WorldPlayerLocationInfo.newBuilder()
|
||||
.setSceneId(this.getSceneId())
|
||||
.setPlayerLoc(this.getPlayerLocationInfo())
|
||||
.build();
|
||||
}
|
||||
|
||||
public PlayerLocationInfo getPlayerLocationInfo() {
|
||||
return PlayerLocationInfo.newBuilder()
|
||||
.setUid(this.getUid())
|
||||
@ -679,9 +692,22 @@ public class GenshinPlayer {
|
||||
}
|
||||
// Ping
|
||||
if (this.getWorld() != null) {
|
||||
this.sendPacket(new PacketWorldPlayerRTTNotify(this.getWorld())); // Player ping
|
||||
// RTT notify - very important to send this often
|
||||
this.sendPacket(new PacketWorldPlayerRTTNotify(this.getWorld()));
|
||||
|
||||
// Update player locations if in multiplayer every 5 seconds
|
||||
long time = System.currentTimeMillis();
|
||||
if (this.getWorld().isMultiplayer() && this.getScene() != null && time > nextSendPlayerLocTime) {
|
||||
this.sendPacket(new PacketWorldPlayerLocationNotify(this.getWorld()));
|
||||
this.sendPacket(new PacketScenePlayerLocationNotify(this.getScene()));
|
||||
this.resetSendPlayerLocTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetSendPlayerLocTime() {
|
||||
this.nextSendPlayerLocTime = System.currentTimeMillis() + 5000;
|
||||
}
|
||||
|
||||
@PostLoad
|
||||
private void onLoad() {
|
||||
@ -696,12 +722,8 @@ public class GenshinPlayer {
|
||||
// Make sure these exist
|
||||
if (this.getTeamManager() == null) {
|
||||
this.teamManager = new TeamManager(this);
|
||||
} if (this.getGachaInfo() == null) {
|
||||
this.gachaInfo = new PlayerGachaInfo();
|
||||
} if (this.nameCardList == null) {
|
||||
this.nameCardList = new HashSet<>();
|
||||
} if (this.costumeList == null) {
|
||||
this.costumeList = new HashSet<>();
|
||||
} if (this.getProfile().getUid() == 0) {
|
||||
this.getProfile().syncWithCharacter(this);
|
||||
}
|
||||
|
||||
// Check if player object exists in server
|
||||
|
@ -206,28 +206,9 @@ public class World implements Iterable<GenshinPlayer> {
|
||||
public void deregisterScene(GenshinScene scene) {
|
||||
this.getScenes().remove(scene.getId());
|
||||
}
|
||||
|
||||
public boolean forceTransferPlayerToScene(GenshinPlayer player, int sceneId, Position pos) {
|
||||
// Forces the client to reload the scene map to prevent the player from falling off the map.
|
||||
if (GenshinData.getSceneDataMap().get(sceneId) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.getScene() != null) {
|
||||
player.getScene().removePlayer(player);
|
||||
}
|
||||
|
||||
GenshinScene scene = this.getSceneById(sceneId);
|
||||
scene.addPlayer(player);
|
||||
player.getPos().set(pos);
|
||||
|
||||
// Teleport packet
|
||||
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.EnterSelf, EnterReason.TransPoint, sceneId, pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean transferPlayerToScene(GenshinPlayer player, int sceneId, Position pos) {
|
||||
if (player.getScene().getId() == sceneId || GenshinData.getSceneDataMap().get(sceneId) == null) {
|
||||
if (GenshinData.getSceneDataMap().get(sceneId) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import dev.morphia.annotations.Indexed;
|
||||
import dev.morphia.annotations.PostLoad;
|
||||
import dev.morphia.annotations.PrePersist;
|
||||
import dev.morphia.annotations.Transient;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GenshinData;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.custom.OpenConfigEntry;
|
||||
@ -42,6 +43,7 @@ import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.PlayerProperty;
|
||||
import emu.grasscutter.net.proto.AvatarFetterInfoOuterClass.AvatarFetterInfo;
|
||||
import emu.grasscutter.net.proto.AvatarInfoOuterClass.AvatarInfo;
|
||||
import emu.grasscutter.server.packet.send.PacketAbilityChangeNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarEquipChangeNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarFightPropNotify;
|
||||
import emu.grasscutter.utils.ProtoHelper;
|
||||
@ -69,7 +71,7 @@ public class GenshinAvatar {
|
||||
|
||||
@Transient private final Int2ObjectMap<GenshinItem> equips;
|
||||
@Transient private final Int2FloatOpenHashMap fightProp;
|
||||
@Transient private final Set<String> bonusAbilityList;
|
||||
@Transient private Set<String> extraAbilityEmbryos;
|
||||
|
||||
private Map<Integer, Integer> skillLevelMap; // Talent levels
|
||||
private Map<Integer, Integer> proudSkillBonusMap; // Talent bonus levels (from const)
|
||||
@ -86,7 +88,7 @@ public class GenshinAvatar {
|
||||
// Morhpia only!
|
||||
this.equips = new Int2ObjectOpenHashMap<>();
|
||||
this.fightProp = new Int2FloatOpenHashMap();
|
||||
this.bonusAbilityList = new HashSet<>();
|
||||
this.extraAbilityEmbryos = new HashSet<>();
|
||||
this.proudSkillBonusMap = new HashMap<>(); // TODO Move to genshin avatar
|
||||
}
|
||||
|
||||
@ -260,8 +262,8 @@ public class GenshinAvatar {
|
||||
return proudSkillBonusMap;
|
||||
}
|
||||
|
||||
public Set<String> getBonusAbilityList() {
|
||||
return bonusAbilityList;
|
||||
public Set<String> getExtraAbilityEmbryos() {
|
||||
return extraAbilityEmbryos;
|
||||
}
|
||||
|
||||
public float getCurrentHp() {
|
||||
@ -347,14 +349,14 @@ public class GenshinAvatar {
|
||||
item.setEquipCharacter(this.getAvatarId());
|
||||
item.save();
|
||||
|
||||
if (this.getPlayer().hasSentAvatarDataNotify()) {
|
||||
this.getPlayer().sendPacket(new PacketAvatarEquipChangeNotify(this, item));
|
||||
}
|
||||
|
||||
if (shouldRecalc) {
|
||||
this.recalcStats();
|
||||
}
|
||||
|
||||
if (this.getPlayer().hasSentAvatarDataNotify()) {
|
||||
this.getPlayer().sendPacket(new PacketAvatarEquipChangeNotify(this, item));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -371,11 +373,18 @@ public class GenshinAvatar {
|
||||
}
|
||||
|
||||
public void recalcStats() {
|
||||
recalcStats(false);
|
||||
}
|
||||
|
||||
public void recalcStats(boolean forceSendAbilityChange) {
|
||||
// Setup
|
||||
AvatarData data = this.getAvatarData();
|
||||
AvatarPromoteData promoteData = GenshinData.getAvatarPromoteData(data.getAvatarPromoteId(), this.getPromoteLevel());
|
||||
Int2IntOpenHashMap setMap = new Int2IntOpenHashMap();
|
||||
this.getBonusAbilityList().clear();
|
||||
|
||||
// Extra ability embryos
|
||||
Set<String> prevExtraAbilityEmbryos = this.getExtraAbilityEmbryos();
|
||||
this.extraAbilityEmbryos = new HashSet<>();
|
||||
|
||||
// Get hp percent, set to 100% if none
|
||||
float hpPercent = this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) <= 0 ? 1f : this.getFightProperty(FightProperty.FIGHT_PROP_CUR_HP) / this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP);
|
||||
@ -458,7 +467,7 @@ public class GenshinAvatar {
|
||||
}
|
||||
|
||||
// Add any skill strings from this affix
|
||||
this.addToAbilityList(affix.getOpenConfig(), true);
|
||||
this.addToExtraAbilityEmbryos(affix.getOpenConfig(), true);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@ -505,7 +514,7 @@ public class GenshinAvatar {
|
||||
}
|
||||
|
||||
// Add any skill strings from this affix
|
||||
this.addToAbilityList(affix.getOpenConfig(), true);
|
||||
this.addToExtraAbilityEmbryos(affix.getOpenConfig(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -538,7 +547,7 @@ public class GenshinAvatar {
|
||||
}
|
||||
|
||||
// Add any skill strings from this proud skill
|
||||
this.addToAbilityList(proudSkillData.getOpenConfig(), true);
|
||||
this.addToExtraAbilityEmbryos(proudSkillData.getOpenConfig(), true);
|
||||
}
|
||||
|
||||
// Constellations
|
||||
@ -550,7 +559,7 @@ public class GenshinAvatar {
|
||||
}
|
||||
|
||||
// Add any skill strings from this constellation
|
||||
this.addToAbilityList(avatarTalentData.getOpenConfig(), false);
|
||||
this.addToExtraAbilityEmbryos(avatarTalentData.getOpenConfig(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -573,11 +582,17 @@ public class GenshinAvatar {
|
||||
|
||||
// Packet
|
||||
if (getPlayer() != null && getPlayer().hasSentAvatarDataNotify()) {
|
||||
// Update stats for client
|
||||
getPlayer().sendPacket(new PacketAvatarFightPropNotify(this));
|
||||
// Update client abilities
|
||||
EntityAvatar entity = this.getAsEntity();
|
||||
if (entity != null && (!this.getExtraAbilityEmbryos().equals(prevExtraAbilityEmbryos) || forceSendAbilityChange)) {
|
||||
getPlayer().sendPacket(new PacketAbilityChangeNotify(entity));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addToAbilityList(String openConfig, boolean forceAdd) {
|
||||
public void addToExtraAbilityEmbryos(String openConfig, boolean forceAdd) {
|
||||
if (openConfig == null || openConfig.length() == 0) {
|
||||
return;
|
||||
}
|
||||
@ -586,14 +601,14 @@ public class GenshinAvatar {
|
||||
if (entry == null) {
|
||||
if (forceAdd) {
|
||||
// Add config string to ability skill list anyways
|
||||
this.getBonusAbilityList().add(openConfig);
|
||||
this.getExtraAbilityEmbryos().add(openConfig);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (entry.getAddAbilities() != null) {
|
||||
for (String ability : entry.getAddAbilities()) {
|
||||
this.getBonusAbilityList().add(ability);
|
||||
this.getExtraAbilityEmbryos().add(ability);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -223,8 +223,8 @@ public class EntityAvatar extends GenshinEntity {
|
||||
}
|
||||
}
|
||||
// Add equip abilities
|
||||
if (this.getAvatar().getBonusAbilityList().size() > 0) {
|
||||
for (String skill : this.getAvatar().getBonusAbilityList()) {
|
||||
if (this.getAvatar().getExtraAbilityEmbryos().size() > 0) {
|
||||
for (String skill : this.getAvatar().getExtraAbilityEmbryos()) {
|
||||
AbilityEmbryo emb = AbilityEmbryo.newBuilder()
|
||||
.setAbilityId(++embryoId)
|
||||
.setAbilityNameHash(Utils.abilityHash(skill))
|
||||
|
@ -220,7 +220,7 @@ public class FriendsList {
|
||||
friendship.setOwner(getPlayer());
|
||||
|
||||
// Check if friend is online
|
||||
GenshinPlayer friend = getPlayer().getSession().getServer().getPlayerByUid(friendship.getFriendProfile().getId());
|
||||
GenshinPlayer friend = getPlayer().getSession().getServer().getPlayerByUid(friendship.getFriendProfile().getUid());
|
||||
if (friend != null) {
|
||||
// Set friend to online mode
|
||||
friendship.setFriendProfile(friend);
|
||||
|
@ -88,7 +88,7 @@ public class Friendship {
|
||||
|
||||
public FriendBrief toProto() {
|
||||
FriendBrief proto = FriendBrief.newBuilder()
|
||||
.setUid(getFriendProfile().getId())
|
||||
.setUid(getFriendProfile().getUid())
|
||||
.setNickname(getFriendProfile().getName())
|
||||
.setLevel(getFriendProfile().getPlayerLevel())
|
||||
.setAvatar(HeadImage.newBuilder().setAvatarId(getFriendProfile().getAvatarId()))
|
||||
|
@ -7,7 +7,7 @@ import emu.grasscutter.utils.Utils;
|
||||
public class PlayerProfile {
|
||||
@Transient private GenshinPlayer player;
|
||||
|
||||
private int id;
|
||||
@AlsoLoad("id") private int uid;
|
||||
private int nameCard;
|
||||
private int avatarId;
|
||||
private String name;
|
||||
@ -22,12 +22,12 @@ public class PlayerProfile {
|
||||
public PlayerProfile() { }
|
||||
|
||||
public PlayerProfile(GenshinPlayer player) {
|
||||
this.id = player.getUid();
|
||||
this.uid = player.getUid();
|
||||
this.syncWithCharacter(player);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public GenshinPlayer getPlayer() {
|
||||
@ -87,6 +87,7 @@ public class PlayerProfile {
|
||||
return;
|
||||
}
|
||||
|
||||
this.uid = player.getUid();
|
||||
this.name = player.getNickname();
|
||||
this.avatarId = player.getHeadImage();
|
||||
this.signature = player.getSignature();
|
||||
|
@ -589,7 +589,6 @@ public class InventoryManager {
|
||||
|
||||
// Update proud skills
|
||||
AvatarSkillDepotData skillDepot = GenshinData.getAvatarSkillDepotDataMap().get(avatar.getSkillDepotId());
|
||||
boolean hasAddedProudSkill = false;
|
||||
|
||||
if (skillDepot != null && skillDepot.getInherentProudSkillOpens() != null) {
|
||||
for (InherentProudSkillOpens openData : skillDepot.getInherentProudSkillOpens()) {
|
||||
@ -599,7 +598,6 @@ public class InventoryManager {
|
||||
if (openData.getNeedAvatarPromoteLevel() == avatar.getPromoteLevel()) {
|
||||
int proudSkillId = (openData.getProudSkillGroupId() * 100) + 1;
|
||||
if (GenshinData.getProudSkillDataMap().containsKey(proudSkillId)) {
|
||||
hasAddedProudSkill = true;
|
||||
avatar.getProudSkillList().add(proudSkillId);
|
||||
player.sendPacket(new PacketProudSkillChangeNotify(avatar));
|
||||
}
|
||||
@ -607,20 +605,13 @@ public class InventoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Racalc stats and save avatar
|
||||
avatar.recalcStats();
|
||||
avatar.save();
|
||||
|
||||
// Resend ability embryos if proud skill has been added
|
||||
if (hasAddedProudSkill && avatar.getAsEntity() != null) {
|
||||
player.sendPacket(new PacketAbilityChangeNotify(avatar.getAsEntity()));
|
||||
}
|
||||
|
||||
// TODO Send entity prop update packet to world
|
||||
|
||||
// Packets
|
||||
player.sendPacket(new PacketAvatarPropNotify(avatar));
|
||||
player.sendPacket(new PacketAvatarPromoteRsp(avatar));
|
||||
|
||||
// TODO Send entity prop update packet to world
|
||||
avatar.recalcStats(true);
|
||||
avatar.save();
|
||||
}
|
||||
|
||||
public void upgradeAvatar(GenshinPlayer player, long guid, int itemId, int count) {
|
||||
@ -827,25 +818,20 @@ public class InventoryManager {
|
||||
// Apply + recalc
|
||||
avatar.getTalentIdList().add(talentData.getId());
|
||||
avatar.setCoreProudSkillLevel(currentTalentLevel + 1);
|
||||
avatar.recalcStats();
|
||||
|
||||
// Packet
|
||||
player.sendPacket(new PacketAvatarUnlockTalentNotify(avatar, nextTalentId));
|
||||
player.sendPacket(new PacketUnlockAvatarTalentRsp(avatar, nextTalentId));
|
||||
|
||||
// Proud skill bonus map
|
||||
// Proud skill bonus map (Extra skills)
|
||||
OpenConfigEntry entry = GenshinData.getOpenConfigEntries().get(talentData.getOpenConfig());
|
||||
if (entry != null && entry.getExtraTalentIndex() > 0) {
|
||||
avatar.recalcProudSkillBonusMap();
|
||||
player.sendPacket(new PacketProudSkillExtraLevelNotify(avatar, entry.getExtraTalentIndex()));
|
||||
}
|
||||
|
||||
// Resend ability embryos
|
||||
if (avatar.getAsEntity() != null) {
|
||||
player.sendPacket(new PacketAbilityChangeNotify(avatar.getAsEntity()));
|
||||
}
|
||||
|
||||
// Save avatar
|
||||
// Recalc + save avatar
|
||||
avatar.recalcStats(true);
|
||||
avatar.save();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,743 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: WorldPlayerLocationInfo.proto
|
||||
|
||||
package emu.grasscutter.net.proto;
|
||||
|
||||
public final class WorldPlayerLocationInfoOuterClass {
|
||||
private WorldPlayerLocationInfoOuterClass() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
public interface WorldPlayerLocationInfoOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:WorldPlayerLocationInfo)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>uint32 sceneId = 1;</code>
|
||||
* @return The sceneId.
|
||||
*/
|
||||
int getSceneId();
|
||||
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return Whether the playerLoc field is set.
|
||||
*/
|
||||
boolean hasPlayerLoc();
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return The playerLoc.
|
||||
*/
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLoc();
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocOrBuilder();
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code WorldPlayerLocationInfo}
|
||||
*/
|
||||
public static final class WorldPlayerLocationInfo extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:WorldPlayerLocationInfo)
|
||||
WorldPlayerLocationInfoOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use WorldPlayerLocationInfo.newBuilder() to construct.
|
||||
private WorldPlayerLocationInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private WorldPlayerLocationInfo() {
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new WorldPlayerLocationInfo();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private WorldPlayerLocationInfo(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 8: {
|
||||
|
||||
sceneId_ = input.readUInt32();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder subBuilder = null;
|
||||
if (playerLoc_ != null) {
|
||||
subBuilder = playerLoc_.toBuilder();
|
||||
}
|
||||
playerLoc_ = input.readMessage(emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.parser(), extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(playerLoc_);
|
||||
playerLoc_ = subBuilder.buildPartial();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.internal_static_WorldPlayerLocationInfo_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.internal_static_WorldPlayerLocationInfo_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.class, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder.class);
|
||||
}
|
||||
|
||||
public static final int SCENEID_FIELD_NUMBER = 1;
|
||||
private int sceneId_;
|
||||
/**
|
||||
* <code>uint32 sceneId = 1;</code>
|
||||
* @return The sceneId.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public int getSceneId() {
|
||||
return sceneId_;
|
||||
}
|
||||
|
||||
public static final int PLAYERLOC_FIELD_NUMBER = 2;
|
||||
private emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo playerLoc_;
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return Whether the playerLoc field is set.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public boolean hasPlayerLoc() {
|
||||
return playerLoc_ != null;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return The playerLoc.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLoc() {
|
||||
return playerLoc_ == null ? emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.getDefaultInstance() : playerLoc_;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocOrBuilder() {
|
||||
return getPlayerLoc();
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
if (sceneId_ != 0) {
|
||||
output.writeUInt32(1, sceneId_);
|
||||
}
|
||||
if (playerLoc_ != null) {
|
||||
output.writeMessage(2, getPlayerLoc());
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (sceneId_ != 0) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeUInt32Size(1, sceneId_);
|
||||
}
|
||||
if (playerLoc_ != null) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(2, getPlayerLoc());
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo other = (emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo) obj;
|
||||
|
||||
if (getSceneId()
|
||||
!= other.getSceneId()) return false;
|
||||
if (hasPlayerLoc() != other.hasPlayerLoc()) return false;
|
||||
if (hasPlayerLoc()) {
|
||||
if (!getPlayerLoc()
|
||||
.equals(other.getPlayerLoc())) return false;
|
||||
}
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
hash = (37 * hash) + SCENEID_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getSceneId();
|
||||
if (hasPlayerLoc()) {
|
||||
hash = (37 * hash) + PLAYERLOC_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getPlayerLoc().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code WorldPlayerLocationInfo}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:WorldPlayerLocationInfo)
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.internal_static_WorldPlayerLocationInfo_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.internal_static_WorldPlayerLocationInfo_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.class, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
sceneId_ = 0;
|
||||
|
||||
if (playerLocBuilder_ == null) {
|
||||
playerLoc_ = null;
|
||||
} else {
|
||||
playerLoc_ = null;
|
||||
playerLocBuilder_ = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.internal_static_WorldPlayerLocationInfo_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getDefaultInstanceForType() {
|
||||
return emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo build() {
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo buildPartial() {
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo result = new emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo(this);
|
||||
result.sceneId_ = sceneId_;
|
||||
if (playerLocBuilder_ == null) {
|
||||
result.playerLoc_ = playerLoc_;
|
||||
} else {
|
||||
result.playerLoc_ = playerLocBuilder_.build();
|
||||
}
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo) {
|
||||
return mergeFrom((emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo other) {
|
||||
if (other == emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.getDefaultInstance()) return this;
|
||||
if (other.getSceneId() != 0) {
|
||||
setSceneId(other.getSceneId());
|
||||
}
|
||||
if (other.hasPlayerLoc()) {
|
||||
mergePlayerLoc(other.getPlayerLoc());
|
||||
}
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private int sceneId_ ;
|
||||
/**
|
||||
* <code>uint32 sceneId = 1;</code>
|
||||
* @return The sceneId.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public int getSceneId() {
|
||||
return sceneId_;
|
||||
}
|
||||
/**
|
||||
* <code>uint32 sceneId = 1;</code>
|
||||
* @param value The sceneId to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setSceneId(int value) {
|
||||
|
||||
sceneId_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>uint32 sceneId = 1;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearSceneId() {
|
||||
|
||||
sceneId_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo playerLoc_;
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder> playerLocBuilder_;
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return Whether the playerLoc field is set.
|
||||
*/
|
||||
public boolean hasPlayerLoc() {
|
||||
return playerLocBuilder_ != null || playerLoc_ != null;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
* @return The playerLoc.
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLoc() {
|
||||
if (playerLocBuilder_ == null) {
|
||||
return playerLoc_ == null ? emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.getDefaultInstance() : playerLoc_;
|
||||
} else {
|
||||
return playerLocBuilder_.getMessage();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public Builder setPlayerLoc(emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo value) {
|
||||
if (playerLocBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
playerLoc_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
playerLocBuilder_.setMessage(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public Builder setPlayerLoc(
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder builderForValue) {
|
||||
if (playerLocBuilder_ == null) {
|
||||
playerLoc_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
playerLocBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public Builder mergePlayerLoc(emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo value) {
|
||||
if (playerLocBuilder_ == null) {
|
||||
if (playerLoc_ != null) {
|
||||
playerLoc_ =
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.newBuilder(playerLoc_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
playerLoc_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
playerLocBuilder_.mergeFrom(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public Builder clearPlayerLoc() {
|
||||
if (playerLocBuilder_ == null) {
|
||||
playerLoc_ = null;
|
||||
onChanged();
|
||||
} else {
|
||||
playerLoc_ = null;
|
||||
playerLocBuilder_ = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder getPlayerLocBuilder() {
|
||||
|
||||
onChanged();
|
||||
return getPlayerLocFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocOrBuilder() {
|
||||
if (playerLocBuilder_ != null) {
|
||||
return playerLocBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
return playerLoc_ == null ?
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.getDefaultInstance() : playerLoc_;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>.PlayerLocationInfo playerLoc = 2;</code>
|
||||
*/
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>
|
||||
getPlayerLocFieldBuilder() {
|
||||
if (playerLocBuilder_ == null) {
|
||||
playerLocBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>(
|
||||
getPlayerLoc(),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
playerLoc_ = null;
|
||||
}
|
||||
return playerLocBuilder_;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:WorldPlayerLocationInfo)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:WorldPlayerLocationInfo)
|
||||
private static final emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo();
|
||||
}
|
||||
|
||||
public static emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<WorldPlayerLocationInfo>
|
||||
PARSER = new com.google.protobuf.AbstractParser<WorldPlayerLocationInfo>() {
|
||||
@java.lang.Override
|
||||
public WorldPlayerLocationInfo parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new WorldPlayerLocationInfo(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<WorldPlayerLocationInfo> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<WorldPlayerLocationInfo> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_WorldPlayerLocationInfo_descriptor;
|
||||
private static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_WorldPlayerLocationInfo_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\035WorldPlayerLocationInfo.proto\032\030PlayerL" +
|
||||
"ocationInfo.proto\"R\n\027WorldPlayerLocation" +
|
||||
"Info\022\017\n\007sceneId\030\001 \001(\r\022&\n\tplayerLoc\030\002 \001(\013" +
|
||||
"2\023.PlayerLocationInfoB\033\n\031emu.grasscutter" +
|
||||
".net.protob\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.getDescriptor(),
|
||||
});
|
||||
internal_static_WorldPlayerLocationInfo_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_WorldPlayerLocationInfo_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_WorldPlayerLocationInfo_descriptor,
|
||||
new java.lang.String[] { "SceneId", "PlayerLoc", });
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
@ -19,27 +19,27 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo>
|
||||
java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo>
|
||||
getPlayerLocListList();
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLocList(int index);
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getPlayerLocList(int index);
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
int getPlayerLocListCount();
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
java.util.List<? extends emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>
|
||||
java.util.List<? extends emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder>
|
||||
getPlayerLocListOrBuilderList();
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
int index);
|
||||
}
|
||||
/**
|
||||
@ -89,13 +89,13 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
case 18: {
|
||||
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
|
||||
playerLocList_ = new java.util.ArrayList<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo>();
|
||||
playerLocList_ = new java.util.ArrayList<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo>();
|
||||
mutable_bitField0_ |= 0x00000001;
|
||||
}
|
||||
playerLocList_.add(
|
||||
input.readMessage(emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.parser(), extensionRegistry));
|
||||
input.readMessage(emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.parser(), extensionRegistry));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -133,42 +133,42 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify.class, emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify.Builder.class);
|
||||
}
|
||||
|
||||
public static final int PLAYERLOCLIST_FIELD_NUMBER = 1;
|
||||
private java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo> playerLocList_;
|
||||
public static final int PLAYERLOCLIST_FIELD_NUMBER = 2;
|
||||
private java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo> playerLocList_;
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo> getPlayerLocListList() {
|
||||
public java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo> getPlayerLocListList() {
|
||||
return playerLocList_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.util.List<? extends emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>
|
||||
public java.util.List<? extends emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder>
|
||||
getPlayerLocListOrBuilderList() {
|
||||
return playerLocList_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public int getPlayerLocListCount() {
|
||||
return playerLocList_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLocList(int index) {
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getPlayerLocList(int index) {
|
||||
return playerLocList_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
int index) {
|
||||
return playerLocList_.get(index);
|
||||
}
|
||||
@ -188,7 +188,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
for (int i = 0; i < playerLocList_.size(); i++) {
|
||||
output.writeMessage(1, playerLocList_.get(i));
|
||||
output.writeMessage(2, playerLocList_.get(i));
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
@ -201,7 +201,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
size = 0;
|
||||
for (int i = 0; i < playerLocList_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, playerLocList_.get(i));
|
||||
.computeMessageSize(2, playerLocList_.get(i));
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
@ -515,22 +515,22 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo> playerLocList_ =
|
||||
private java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo> playerLocList_ =
|
||||
java.util.Collections.emptyList();
|
||||
private void ensurePlayerLocListIsMutable() {
|
||||
if (!((bitField0_ & 0x00000001) != 0)) {
|
||||
playerLocList_ = new java.util.ArrayList<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo>(playerLocList_);
|
||||
playerLocList_ = new java.util.ArrayList<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo>(playerLocList_);
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
}
|
||||
|
||||
private com.google.protobuf.RepeatedFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder> playerLocListBuilder_;
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder> playerLocListBuilder_;
|
||||
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo> getPlayerLocListList() {
|
||||
public java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo> getPlayerLocListList() {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
return java.util.Collections.unmodifiableList(playerLocList_);
|
||||
} else {
|
||||
@ -538,7 +538,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public int getPlayerLocListCount() {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
@ -548,9 +548,9 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo getPlayerLocList(int index) {
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo getPlayerLocList(int index) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
return playerLocList_.get(index);
|
||||
} else {
|
||||
@ -558,10 +558,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder setPlayerLocList(
|
||||
int index, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo value) {
|
||||
int index, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo value) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
@ -575,10 +575,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder setPlayerLocList(
|
||||
int index, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder builderForValue) {
|
||||
int index, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder builderForValue) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
ensurePlayerLocListIsMutable();
|
||||
playerLocList_.set(index, builderForValue.build());
|
||||
@ -589,9 +589,9 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder addPlayerLocList(emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo value) {
|
||||
public Builder addPlayerLocList(emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo value) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
@ -605,10 +605,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder addPlayerLocList(
|
||||
int index, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo value) {
|
||||
int index, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo value) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
@ -622,10 +622,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder addPlayerLocList(
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder builderForValue) {
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder builderForValue) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
ensurePlayerLocListIsMutable();
|
||||
playerLocList_.add(builderForValue.build());
|
||||
@ -636,10 +636,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder addPlayerLocList(
|
||||
int index, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder builderForValue) {
|
||||
int index, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder builderForValue) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
ensurePlayerLocListIsMutable();
|
||||
playerLocList_.add(index, builderForValue.build());
|
||||
@ -650,10 +650,10 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder addAllPlayerLocList(
|
||||
java.lang.Iterable<? extends emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo> values) {
|
||||
java.lang.Iterable<? extends emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo> values) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
ensurePlayerLocListIsMutable();
|
||||
com.google.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
@ -665,7 +665,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder clearPlayerLocList() {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
@ -678,7 +678,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public Builder removePlayerLocList(int index) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
@ -691,16 +691,16 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder getPlayerLocListBuilder(
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder getPlayerLocListBuilder(
|
||||
int index) {
|
||||
return getPlayerLocListFieldBuilder().getBuilder(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder getPlayerLocListOrBuilder(
|
||||
int index) {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
return playerLocList_.get(index); } else {
|
||||
@ -708,9 +708,9 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public java.util.List<? extends emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>
|
||||
public java.util.List<? extends emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder>
|
||||
getPlayerLocListOrBuilderList() {
|
||||
if (playerLocListBuilder_ != null) {
|
||||
return playerLocListBuilder_.getMessageOrBuilderList();
|
||||
@ -719,33 +719,33 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder addPlayerLocListBuilder() {
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder addPlayerLocListBuilder() {
|
||||
return getPlayerLocListFieldBuilder().addBuilder(
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.getDefaultInstance());
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder addPlayerLocListBuilder(
|
||||
public emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder addPlayerLocListBuilder(
|
||||
int index) {
|
||||
return getPlayerLocListFieldBuilder().addBuilder(
|
||||
index, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.getDefaultInstance());
|
||||
index, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.getDefaultInstance());
|
||||
}
|
||||
/**
|
||||
* <code>repeated .PlayerLocationInfo playerLocList = 1;</code>
|
||||
* <code>repeated .WorldPlayerLocationInfo playerLocList = 2;</code>
|
||||
*/
|
||||
public java.util.List<emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder>
|
||||
public java.util.List<emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder>
|
||||
getPlayerLocListBuilderList() {
|
||||
return getPlayerLocListFieldBuilder().getBuilderList();
|
||||
}
|
||||
private com.google.protobuf.RepeatedFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder>
|
||||
getPlayerLocListFieldBuilder() {
|
||||
if (playerLocListBuilder_ == null) {
|
||||
playerLocListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfo.Builder, emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.PlayerLocationInfoOrBuilder>(
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfo.Builder, emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.WorldPlayerLocationInfoOrBuilder>(
|
||||
playerLocList_,
|
||||
((bitField0_ & 0x00000001) != 0),
|
||||
getParentForChildren(),
|
||||
@ -821,16 +821,16 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\037WorldPlayerLocationNotify.proto\032\030Playe" +
|
||||
"rLocationInfo.proto\"G\n\031WorldPlayerLocati" +
|
||||
"onNotify\022*\n\rplayerLocList\030\001 \003(\0132\023.Player" +
|
||||
"LocationInfoB\033\n\031emu.grasscutter.net.prot" +
|
||||
"ob\006proto3"
|
||||
"\n\037WorldPlayerLocationNotify.proto\032\035World" +
|
||||
"PlayerLocationInfo.proto\"L\n\031WorldPlayerL" +
|
||||
"ocationNotify\022/\n\rplayerLocList\030\002 \003(\0132\030.W" +
|
||||
"orldPlayerLocationInfoB\033\n\031emu.grasscutte" +
|
||||
"r.net.protob\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.getDescriptor(),
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.getDescriptor(),
|
||||
});
|
||||
internal_static_WorldPlayerLocationNotify_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
@ -838,7 +838,7 @@ public final class WorldPlayerLocationNotifyOuterClass {
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_WorldPlayerLocationNotify_descriptor,
|
||||
new java.lang.String[] { "PlayerLocList", });
|
||||
emu.grasscutter.net.proto.PlayerLocationInfoOuterClass.getDescriptor();
|
||||
emu.grasscutter.net.proto.WorldPlayerLocationInfoOuterClass.getDescriptor();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
|
@ -456,7 +456,7 @@ public final class DispatchServer {
|
||||
Grasscutter.getLogger().info("Dispatch server started on port " + getAddress().getPort());
|
||||
|
||||
// Logging servers
|
||||
HttpServer overseaLogServer = HttpServer.create(new InetSocketAddress(Grasscutter.getConfig().getDispatchOptions().Ip, 8888), 0);
|
||||
HttpServer overseaLogServer = HttpServer.create(new InetSocketAddress(Grasscutter.getConfig().getDispatchOptions().Ip, Grasscutter.getConfig().getDispatchOptions().OverseaLogPort), 0);
|
||||
overseaLogServer.createContext( // overseauspider.yuanshen.com
|
||||
"/log",
|
||||
new DispatchHttpJsonHandler("{\"code\":0}")
|
||||
|
@ -31,8 +31,11 @@ public class HandlerEnterSceneDoneReq extends PacketHandler {
|
||||
|
||||
// Locations
|
||||
session.send(new PacketWorldPlayerLocationNotify(session.getPlayer().getWorld()));
|
||||
session.send(new PacketScenePlayerLocationNotify(session.getPlayer()));
|
||||
session.send(new PacketScenePlayerLocationNotify(session.getPlayer().getScene()));
|
||||
session.send(new PacketWorldPlayerRTTNotify(session.getPlayer().getWorld()));
|
||||
|
||||
// Reset timer for sending player locations
|
||||
session.getPlayer().resetSendPlayerLocTime();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,15 +35,15 @@ public class HandlerGetPlayerTokenReq extends PacketHandler {
|
||||
|
||||
// Has character
|
||||
boolean doesPlayerExist = false;
|
||||
if (account.getPlayerId() > 0) {
|
||||
if (account.getPlayerUid() > 0) {
|
||||
// Set flag for player existing
|
||||
doesPlayerExist = DatabaseHelper.checkPlayerExists(account.getPlayerId());
|
||||
doesPlayerExist = DatabaseHelper.checkPlayerExists(account.getPlayerUid());
|
||||
}
|
||||
|
||||
// Set reserve player id if account doesnt exist
|
||||
if (!doesPlayerExist) {
|
||||
int id = DatabaseHelper.getNextPlayerId(session.getAccount().getPlayerId());
|
||||
if (id != session.getAccount().getPlayerId()) {
|
||||
int id = DatabaseHelper.getNextPlayerId(session.getAccount().getPlayerUid());
|
||||
if (id != session.getAccount().getPlayerUid()) {
|
||||
session.getAccount().setPlayerId(id);
|
||||
session.getAccount().save();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class HandlerPlayerLoginReq extends PacketHandler {
|
||||
}
|
||||
|
||||
// Load character from db
|
||||
GenshinPlayer player = DatabaseHelper.getPlayerById(session.getAccount().getPlayerId());
|
||||
GenshinPlayer player = DatabaseHelper.getPlayerById(session.getAccount().getPlayerUid());
|
||||
|
||||
if (player == null) {
|
||||
// Send packets
|
||||
|
@ -1,11 +1,15 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.data.GenshinData;
|
||||
import emu.grasscutter.data.custom.ScenePointEntry;
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq;
|
||||
import emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp;
|
||||
import emu.grasscutter.net.packet.PacketHandler;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.packet.send.PacketSceneTransToPointRsp;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
@Opcodes(PacketOpcodes.SceneTransToPointReq)
|
||||
public class HandlerSceneTransToPointReq extends PacketHandler {
|
||||
@ -13,7 +17,20 @@ public class HandlerSceneTransToPointReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload);
|
||||
session.send(new PacketSceneTransToPointRsp(session.getPlayer(), req.getPointId(), req.getSceneId()));
|
||||
|
||||
String code = req.getSceneId() + "_" + req.getPointId();
|
||||
ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code);
|
||||
|
||||
if (scenePointEntry != null) {
|
||||
float x = scenePointEntry.getPointData().getTranPos().getX();
|
||||
float y = scenePointEntry.getPointData().getTranPos().getY();
|
||||
float z = scenePointEntry.getPointData().getTranPos().getZ();
|
||||
|
||||
session.getPlayer().getWorld().transferPlayerToScene(session.getPlayer(), req.getSceneId(), new Position(x, y, z));
|
||||
session.send(new PacketSceneTransToPointRsp(session.getPlayer(), req.getPointId(), req.getSceneId()));
|
||||
} else {
|
||||
session.send(new PacketSceneTransToPointRsp());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.recv;
|
||||
import emu.grasscutter.net.packet.GenshinPacket;
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify;
|
||||
import emu.grasscutter.net.packet.PacketHandler;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
|
||||
@ -16,8 +17,11 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure packet is a valid proto before replaying it to the other players
|
||||
SetEntityClientDataNotify notif = SetEntityClientDataNotify.parseFrom(payload);
|
||||
|
||||
GenshinPacket packet = new GenshinPacket(PacketOpcodes.SetEntityClientDataNotify, true);
|
||||
packet.setData(payload);
|
||||
packet.setData(notif);
|
||||
|
||||
session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), packet);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
|
||||
|
||||
try {
|
||||
// Save to db
|
||||
DatabaseHelper.createPlayer(player, session.getAccount().getPlayerId());
|
||||
DatabaseHelper.createPlayer(player, session.getAccount().getPlayerUid());
|
||||
|
||||
// Create avatar
|
||||
if (player.getAvatars().getAvatarCount() == 0) {
|
||||
|
@ -8,8 +8,8 @@ import emu.grasscutter.net.proto.AbilityChangeNotifyOuterClass.AbilityChangeNoti
|
||||
public class PacketAbilityChangeNotify extends GenshinPacket {
|
||||
|
||||
public PacketAbilityChangeNotify(EntityAvatar entity) {
|
||||
super(PacketOpcodes.AbilityChangeNotify);
|
||||
|
||||
super(PacketOpcodes.AbilityChangeNotify, true);
|
||||
|
||||
AbilityChangeNotify proto = AbilityChangeNotify.newBuilder()
|
||||
.setEntityId(entity.getId())
|
||||
.setAbilityControlBlock(entity.getAbilityControlBlock())
|
||||
|
@ -23,7 +23,6 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket {
|
||||
.setWorldLevel(0)
|
||||
.setSignature("")
|
||||
.setLastActiveTime((int) (System.currentTimeMillis() / 1000f))
|
||||
.setIsMpModeAvailable(true)
|
||||
.setNameCardId(210001)
|
||||
.setOnlineState(FriendOnlineState.FRIEND_ONLINE)
|
||||
.setParam(1)
|
||||
|
@ -16,7 +16,7 @@ public class PacketGetPlayerTokenRsp extends GenshinPacket {
|
||||
this.setUseDispatchKey(true);
|
||||
|
||||
GetPlayerTokenRsp p = GetPlayerTokenRsp.newBuilder()
|
||||
.setPlayerUid(session.getAccount().getPlayerId())
|
||||
.setPlayerUid(session.getAccount().getPlayerUid())
|
||||
.setAccountToken(session.getAccount().getToken())
|
||||
.setAccountType(1)
|
||||
.setIsProficientPlayer(doesPlayerExist) // Not sure where this goes
|
||||
|
@ -1,19 +1,20 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.GenshinPlayer;
|
||||
import emu.grasscutter.game.GenshinScene;
|
||||
import emu.grasscutter.net.packet.GenshinPacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.ScenePlayerLocationNotifyOuterClass.ScenePlayerLocationNotify;
|
||||
|
||||
public class PacketScenePlayerLocationNotify extends GenshinPacket {
|
||||
|
||||
public PacketScenePlayerLocationNotify(GenshinPlayer player) {
|
||||
public PacketScenePlayerLocationNotify(GenshinScene scene) {
|
||||
super(PacketOpcodes.ScenePlayerLocationNotify);
|
||||
|
||||
ScenePlayerLocationNotify.Builder proto = ScenePlayerLocationNotify.newBuilder()
|
||||
.setSceneId(player.getSceneId());
|
||||
.setSceneId(scene.getId());
|
||||
|
||||
for (GenshinPlayer p : player.getWorld().getPlayers()) {
|
||||
for (GenshinPlayer p : scene.getPlayers()) {
|
||||
proto.addPlayerLocList(p.getPlayerLocationInfo());
|
||||
}
|
||||
|
||||
|
@ -13,23 +13,22 @@ public class PacketSceneTransToPointRsp extends GenshinPacket {
|
||||
public PacketSceneTransToPointRsp(GenshinPlayer player, int pointId, int sceneId) {
|
||||
super(PacketOpcodes.SceneTransToPointRsp);
|
||||
|
||||
String code = sceneId + "_" + pointId;
|
||||
ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code);
|
||||
|
||||
float x = scenePointEntry.getPointData().getTranPos().getX();
|
||||
float y = scenePointEntry.getPointData().getTranPos().getY();
|
||||
float z = scenePointEntry.getPointData().getTranPos().getZ();
|
||||
|
||||
player.getPos().set(new Position(x, y, z));
|
||||
|
||||
player.getWorld().forceTransferPlayerToScene(player, sceneId, player.getPos());
|
||||
|
||||
SceneTransToPointRsp proto = SceneTransToPointRsp.newBuilder()
|
||||
.setRetcode(0)
|
||||
.setPointId(pointId)
|
||||
.setSceneId(sceneId)
|
||||
.build();
|
||||
.setRetcode(0)
|
||||
.setPointId(pointId)
|
||||
.setSceneId(sceneId)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSceneTransToPointRsp() {
|
||||
super(PacketOpcodes.SceneTransToPointRsp);
|
||||
|
||||
SceneTransToPointRsp proto = SceneTransToPointRsp.newBuilder()
|
||||
.setRetcode(1) // Internal server error
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ public class PacketSceneUnlockInfoNotify extends GenshinPacket {
|
||||
SceneUnlockInfoNotify proto = SceneUnlockInfoNotify.newBuilder()
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(1))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(3))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(4))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(4).addSceneTagIdList(106).addSceneTagIdList(109))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(5))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(6))
|
||||
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(7))
|
||||
|
@ -14,7 +14,7 @@ public class PacketWorldPlayerLocationNotify extends GenshinPacket {
|
||||
WorldPlayerLocationNotify.Builder proto = WorldPlayerLocationNotify.newBuilder();
|
||||
|
||||
for (GenshinPlayer p : world.getPlayers()) {
|
||||
proto.addPlayerLocList(p.getPlayerLocationInfo());
|
||||
proto.addPlayerLocList(p.getWorldPlayerLocationInfo());
|
||||
}
|
||||
|
||||
this.setData(proto);
|
||||
|
Loading…
Reference in New Issue
Block a user