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
b505b082
Commit
b505b082
authored
Jul 21, 2022
by
Melledy
Browse files
Fix host team size not changing when a player joins their world for the first time
parent
62e54010
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/world/World.java
View file @
b505b082
...
...
@@ -148,7 +148,7 @@ public class World implements Iterable<Player> {
player
.
setPeerId
(
this
.
getNextPeerId
());
player
.
getTeamManager
().
setEntityId
(
getNextEntityId
(
EntityIdType
.
TEAM
));
// Copy main team to m
p
team
// Copy main team to m
ultiplayer
team
if
(
this
.
isMultiplayer
())
{
player
.
getTeamManager
().
getMpTeam
().
copyFrom
(
player
.
getTeamManager
().
getCurrentSinglePlayerTeamInfo
(),
player
.
getTeamManager
().
getMaxTeamSize
());
player
.
getTeamManager
().
setCurrentCharacterIndex
(
0
);
...
...
@@ -282,8 +282,8 @@ public class World implements Iterable<Player> {
private
void
updatePlayerInfos
(
Player
paramPlayer
)
{
for
(
Player
player
:
getPlayers
())
{
// Dont send packets if player is lo
ad
ing in and filter out joining player
if
(!
player
.
hasSentAvatarDataNotify
()
||
player
.
getSceneLoadState
().
getValue
()
<
SceneLoadState
.
INIT
.
getValue
()
||
player
==
paramPlayer
)
{
// Dont send packets if player is lo
gg
ing in and filter out joining player
if
(!
player
.
hasSentAvatarDataNotify
()
||
player
==
paramPlayer
)
{
continue
;
}
...
...
@@ -293,6 +293,8 @@ public class World implements Iterable<Player> {
player
.
getTeamManager
().
updateTeamEntities
(
null
);
}
// Dont send packets if player is loading into the scene
if
(
player
.
getSceneLoadState
().
getValue
()
<
SceneLoadState
.
INIT
.
getValue
()
)
{
// World player info packets
player
.
getSession
().
send
(
new
PacketWorldPlayerInfoNotify
(
this
));
player
.
getSession
().
send
(
new
PacketScenePlayerInfoNotify
(
this
));
...
...
@@ -303,6 +305,7 @@ public class World implements Iterable<Player> {
player
.
getSession
().
send
(
new
PacketSyncScenePlayTeamEntityNotify
(
player
));
}
}
}
public
void
broadcastPacket
(
BasePacket
packet
)
{
// Send to all players - might have to check if player has been sent data packets
...
...
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