mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-05-08 21:15:54 +08:00
Rename hasSentAvatarDataNotify()
to hasSentLoginPackets()
This commit is contained in:
parent
b505b0825a
commit
8651cdd12b
@ -496,7 +496,7 @@ public class Avatar {
|
|||||||
item.setEquipCharacter(this.getAvatarId());
|
item.setEquipCharacter(this.getAvatarId());
|
||||||
item.save();
|
item.save();
|
||||||
|
|
||||||
if (this.getPlayer().hasSentAvatarDataNotify()) {
|
if (this.getPlayer().hasSentLoginPackets()) {
|
||||||
this.getPlayer().sendPacket(new PacketAvatarEquipChangeNotify(this, item));
|
this.getPlayer().sendPacket(new PacketAvatarEquipChangeNotify(this, item));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,7 +732,7 @@ public class Avatar {
|
|||||||
this.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * hpPercent);
|
this.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * hpPercent);
|
||||||
|
|
||||||
// Packet
|
// Packet
|
||||||
if (getPlayer() != null && getPlayer().hasSentAvatarDataNotify()) {
|
if (getPlayer() != null && getPlayer().hasSentLoginPackets()) {
|
||||||
// Update stats for client
|
// Update stats for client
|
||||||
getPlayer().sendPacket(new PacketAvatarFightPropNotify(this));
|
getPlayer().sendPacket(new PacketAvatarFightPropNotify(this));
|
||||||
// Update client abilities
|
// Update client abilities
|
||||||
|
@ -170,7 +170,7 @@ public class Player {
|
|||||||
@Transient private boolean paused;
|
@Transient private boolean paused;
|
||||||
@Transient private int enterSceneToken;
|
@Transient private int enterSceneToken;
|
||||||
@Transient private SceneLoadState sceneState;
|
@Transient private SceneLoadState sceneState;
|
||||||
@Transient private boolean hasSentAvatarDataNotify;
|
@Transient private boolean hasSentLoginPackets;
|
||||||
@Transient private long nextSendPlayerLocTime = 0;
|
@Transient private long nextSendPlayerLocTime = 0;
|
||||||
|
|
||||||
private transient final Int2ObjectMap<CoopRequest> coopRequests;
|
private transient final Int2ObjectMap<CoopRequest> coopRequests;
|
||||||
@ -562,7 +562,7 @@ public class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFirstLoginEnterScene() {
|
public boolean isFirstLoginEnterScene() {
|
||||||
return !this.hasSentAvatarDataNotify;
|
return !this.hasSentLoginPackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TeamManager getTeamManager() {
|
public TeamManager getTeamManager() {
|
||||||
@ -884,12 +884,8 @@ public class Player {
|
|||||||
this.godmode = godmode;
|
this.godmode = godmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSentAvatarDataNotify() {
|
public boolean hasSentLoginPackets() {
|
||||||
return hasSentAvatarDataNotify;
|
return hasSentLoginPackets;
|
||||||
}
|
|
||||||
|
|
||||||
public void setHasSentAvatarDataNotify(boolean hasSentAvatarDataNotify) {
|
|
||||||
this.hasSentAvatarDataNotify = hasSentAvatarDataNotify;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAvatar(Avatar avatar, boolean addToCurrentTeam) {
|
public void addAvatar(Avatar avatar, boolean addToCurrentTeam) {
|
||||||
@ -900,7 +896,7 @@ public class Player {
|
|||||||
getAvatars().addStartingWeapon(avatar);
|
getAvatars().addStartingWeapon(avatar);
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
if (hasSentAvatarDataNotify()) {
|
if (hasSentLoginPackets()) {
|
||||||
// Recalc stats
|
// Recalc stats
|
||||||
avatar.recalcStats();
|
avatar.recalcStats();
|
||||||
// Packet, show notice on left if the avatar will be added to the team
|
// Packet, show notice on left if the avatar will be added to the team
|
||||||
@ -1361,7 +1357,7 @@ public class Player {
|
|||||||
|
|
||||||
|
|
||||||
// First notify packets sent
|
// First notify packets sent
|
||||||
this.setHasSentAvatarDataNotify(true);
|
this.hasSentLoginPackets = true;
|
||||||
|
|
||||||
// Send server welcome chat.
|
// Send server welcome chat.
|
||||||
this.getServer().getChatManager().sendServerWelcomeMessages(this);
|
this.getServer().getChatManager().sendServerWelcomeMessages(this);
|
||||||
|
@ -283,7 +283,7 @@ public class World implements Iterable<Player> {
|
|||||||
private void updatePlayerInfos(Player paramPlayer) {
|
private void updatePlayerInfos(Player paramPlayer) {
|
||||||
for (Player player : getPlayers()) {
|
for (Player player : getPlayers()) {
|
||||||
// Dont send packets if player is logging in and filter out joining player
|
// Dont send packets if player is logging in and filter out joining player
|
||||||
if (!player.hasSentAvatarDataNotify() || player == paramPlayer) {
|
if (!player.hasSentLoginPackets() || player == paramPlayer) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user