Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
8651cdd1
Commit
8651cdd1
authored
Jul 21, 2022
by
Melledy
Browse files
Rename `hasSentAvatarDataNotify()` to `hasSentLoginPackets()`
parent
b505b082
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/avatar/Avatar.java
View file @
8651cdd1
...
...
@@ -496,7 +496,7 @@ public class Avatar {
item
.
setEquipCharacter
(
this
.
getAvatarId
());
item
.
save
();
if
(
this
.
getPlayer
().
hasSent
AvatarDataNotify
())
{
if
(
this
.
getPlayer
().
hasSent
LoginPackets
())
{
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
);
// Packet
if
(
getPlayer
()
!=
null
&&
getPlayer
().
hasSent
AvatarDataNotify
())
{
if
(
getPlayer
()
!=
null
&&
getPlayer
().
hasSent
LoginPackets
())
{
// Update stats for client
getPlayer
().
sendPacket
(
new
PacketAvatarFightPropNotify
(
this
));
// Update client abilities
...
...
src/main/java/emu/grasscutter/game/player/Player.java
View file @
8651cdd1
...
...
@@ -170,7 +170,7 @@ public class Player {
@Transient
private
boolean
paused
;
@Transient
private
int
enterSceneToken
;
@Transient
private
SceneLoadState
sceneState
;
@Transient
private
boolean
hasSent
AvatarDataNotify
;
@Transient
private
boolean
hasSent
LoginPackets
;
@Transient
private
long
nextSendPlayerLocTime
=
0
;
private
transient
final
Int2ObjectMap
<
CoopRequest
>
coopRequests
;
...
...
@@ -562,7 +562,7 @@ public class Player {
}
public
boolean
isFirstLoginEnterScene
()
{
return
!
this
.
hasSent
AvatarDataNotify
;
return
!
this
.
hasSent
LoginPackets
;
}
public
TeamManager
getTeamManager
()
{
...
...
@@ -884,14 +884,10 @@ public class Player {
this
.
godmode
=
godmode
;
}
public
boolean
hasSent
AvatarDataNotify
()
{
return
hasSent
AvatarDataNotify
;
public
boolean
hasSent
LoginPackets
()
{
return
hasSent
LoginPackets
;
}
public
void
setHasSentAvatarDataNotify
(
boolean
hasSentAvatarDataNotify
)
{
this
.
hasSentAvatarDataNotify
=
hasSentAvatarDataNotify
;
}
public
void
addAvatar
(
Avatar
avatar
,
boolean
addToCurrentTeam
)
{
boolean
result
=
getAvatars
().
addAvatar
(
avatar
);
...
...
@@ -900,7 +896,7 @@ public class Player {
getAvatars
().
addStartingWeapon
(
avatar
);
// Done
if
(
hasSent
AvatarDataNotify
())
{
if
(
hasSent
LoginPackets
())
{
// Recalc stats
avatar
.
recalcStats
();
// 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
this
.
setH
asSent
AvatarDataNotify
(
true
)
;
this
.
h
asSent
LoginPackets
=
true
;
// Send server welcome chat.
this
.
getServer
().
getChatManager
().
sendServerWelcomeMessages
(
this
);
...
...
src/main/java/emu/grasscutter/game/world/World.java
View file @
8651cdd1
...
...
@@ -283,7 +283,7 @@ public class World implements Iterable<Player> {
private
void
updatePlayerInfos
(
Player
paramPlayer
)
{
for
(
Player
player
:
getPlayers
())
{
// Dont send packets if player is logging in and filter out joining player
if
(!
player
.
hasSent
AvatarDataNotify
()
||
player
==
paramPlayer
)
{
if
(!
player
.
hasSent
LoginPackets
()
||
player
==
paramPlayer
)
{
continue
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment