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
7925d1cd
Commit
7925d1cd
authored
Apr 17, 2022
by
Melledy
Browse files
Initial commit
parents
Changes
354
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarChangeCostumeReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarChangeCostumeReqOuterClass.AvatarChangeCostumeReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketAvatarChangeCostumeRsp
;
@Opcodes
(
PacketOpcodes
.
AvatarChangeCostumeReq
)
public
class
HandlerAvatarChangeCostumeReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarChangeCostumeReq
req
=
AvatarChangeCostumeReq
.
parseFrom
(
payload
);
boolean
success
=
session
.
getPlayer
().
getAvatars
().
changeCostume
(
req
.
getAvatarGuid
(),
req
.
getCostumeId
());
if
(
success
)
{
session
.
getPlayer
().
sendPacket
(
new
PacketAvatarChangeCostumeRsp
(
req
.
getAvatarGuid
(),
req
.
getCostumeId
()));
}
else
{
session
.
getPlayer
().
sendPacket
(
new
PacketAvatarChangeCostumeRsp
());
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarDieAnimationEndReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarDieAnimationEndReqOuterClass.AvatarDieAnimationEndReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
AvatarDieAnimationEndReq
)
public
class
HandlerAvatarDieAnimationEndReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarDieAnimationEndReq
req
=
AvatarDieAnimationEndReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getTeamManager
().
onAvatarDie
(
req
.
getDieGuid
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarPromoteReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarPromoteReqOuterClass.AvatarPromoteReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
AvatarPromoteReq
)
public
class
HandlerAvatarPromoteReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarPromoteReq
req
=
AvatarPromoteReq
.
parseFrom
(
payload
);
// Ascend avatar
session
.
getServer
().
getInventoryManager
().
promoteAvatar
(
session
.
getPlayer
(),
req
.
getGuid
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarSkillUpgradeReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarSkillUpgradeReqOuterClass.AvatarSkillUpgradeReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
AvatarSkillUpgradeReq
)
public
class
HandlerAvatarSkillUpgradeReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarSkillUpgradeReq
req
=
AvatarSkillUpgradeReq
.
parseFrom
(
payload
);
// Level up avatar talent
session
.
getServer
().
getInventoryManager
().
upgradeAvatarSkill
(
session
.
getPlayer
(),
req
.
getAvatarGuid
(),
req
.
getAvatarSkillId
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarUpgradeReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarUpgradeReqOuterClass.AvatarUpgradeReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
AvatarUpgradeReq
)
public
class
HandlerAvatarUpgradeReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarUpgradeReq
req
=
AvatarUpgradeReq
.
parseFrom
(
payload
);
// Level up avatar
session
.
getServer
().
getInventoryManager
().
upgradeAvatar
(
session
.
getPlayer
(),
req
.
getAvatarGuid
(),
req
.
getItemId
(),
req
.
getCount
()
);
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarWearFlycloakReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarWearFlycloakReqOuterClass.AvatarWearFlycloakReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketAvatarWearFlycloakRsp
;
@Opcodes
(
PacketOpcodes
.
AvatarWearFlycloakReq
)
public
class
HandlerAvatarWearFlycloakReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
AvatarWearFlycloakReq
req
=
AvatarWearFlycloakReq
.
parseFrom
(
payload
);
boolean
success
=
session
.
getPlayer
().
getAvatars
().
wearFlycloak
(
req
.
getAvatarGuid
(),
req
.
getFlycloakId
());
if
(
success
)
{
session
.
getPlayer
().
sendPacket
(
new
PacketAvatarWearFlycloakRsp
(
req
.
getAvatarGuid
(),
req
.
getFlycloakId
()));
}
else
{
session
.
getPlayer
().
sendPacket
(
new
PacketAvatarWearFlycloakRsp
());
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerCalcWeaponUpgradeReturnItemsReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
java.util.List
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.CalcWeaponUpgradeReturnItemsReqOuterClass.CalcWeaponUpgradeReturnItemsReq
;
import
emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketCalcWeaponUpgradeReturnItemsRsp
;
@Opcodes
(
PacketOpcodes
.
CalcWeaponUpgradeReturnItemsReq
)
public
class
HandlerCalcWeaponUpgradeReturnItemsReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
CalcWeaponUpgradeReturnItemsReq
req
=
CalcWeaponUpgradeReturnItemsReq
.
parseFrom
(
payload
);
List
<
ItemParam
>
returnOres
=
session
.
getServer
().
getInventoryManager
().
calcWeaponUpgradeReturnItems
(
session
.
getPlayer
(),
req
.
getTargetWeaponGuid
(),
req
.
getFoodWeaponGuidListList
(),
req
.
getItemParamListList
()
);
if
(
returnOres
!=
null
)
{
session
.
send
(
new
PacketCalcWeaponUpgradeReturnItemsRsp
(
req
.
getTargetWeaponGuid
(),
returnOres
));
}
else
{
session
.
send
(
new
PacketCalcWeaponUpgradeReturnItemsRsp
());
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeAvatarReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChangeAvatarReqOuterClass.ChangeAvatarReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
ChangeAvatarReq
)
public
class
HandlerChangeAvatarReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChangeAvatarReq
req
=
ChangeAvatarReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getTeamManager
().
changeAvatar
(
req
.
getGuid
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeGameTimeReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChangeGameTimeReqOuterClass.ChangeGameTimeReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketChangeGameTimeRsp
;
@Opcodes
(
PacketOpcodes
.
ChangeGameTimeReq
)
public
class
HandlerChangeGameTimeReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChangeGameTimeReq
req
=
ChangeGameTimeReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getWorld
().
changeTime
(
req
.
getGameTime
());
session
.
getPlayer
().
sendPacket
(
new
PacketChangeGameTimeRsp
(
session
.
getPlayer
().
getWorld
()));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMpTeamAvatarReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChangeMpTeamAvatarReqOuterClass.ChangeMpTeamAvatarReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
ChangeMpTeamAvatarReq
)
public
class
HandlerChangeMpTeamAvatarReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChangeMpTeamAvatarReq
req
=
ChangeMpTeamAvatarReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getTeamManager
().
setupMpTeam
(
req
.
getAvatarGuidListList
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeTeamNameReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChangeTeamNameReqOuterClass.ChangeTeamNameReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
ChangeTeamNameReq
)
public
class
HandlerChangeTeamNameReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChangeTeamNameReq
req
=
ChangeTeamNameReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getTeamManager
().
setTeamName
(
req
.
getTeamId
(),
req
.
getTeamName
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerChooseCurAvatarTeamReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChooseCurAvatarTeamReqOuterClass.ChooseCurAvatarTeamReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
ChooseCurAvatarTeamReq
)
public
class
HandlerChooseCurAvatarTeamReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChooseCurAvatarTeamReq
req
=
ChooseCurAvatarTeamReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getTeamManager
().
setCurrentTeam
(
req
.
getTeamId
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.entity.GenshinEntity
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.CombatInvocationsNotifyOuterClass.CombatInvocationsNotify
;
import
emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry
;
import
emu.grasscutter.net.proto.EntityMoveInfoOuterClass.EntityMoveInfo
;
import
emu.grasscutter.net.proto.EvtBeingHitInfoOuterClass.EvtBeingHitInfo
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
CombatInvocationsNotify
)
public
class
HandlerCombatInvocationsNotify
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
CombatInvocationsNotify
notif
=
CombatInvocationsNotify
.
parseFrom
(
payload
);
for
(
CombatInvokeEntry
entry
:
notif
.
getInvokeListList
())
{
switch
(
entry
.
getArgumentType
())
{
case
CombatEvtBeingHit:
// Handle damage
EvtBeingHitInfo
hitInfo
=
EvtBeingHitInfo
.
parseFrom
(
entry
.
getCombatData
());
session
.
getPlayer
().
getWorld
().
handleAttack
(
hitInfo
.
getAttackResult
());
break
;
case
EntityMove:
// Handle movement
EntityMoveInfo
moveInfo
=
EntityMoveInfo
.
parseFrom
(
entry
.
getCombatData
());
GenshinEntity
entity
=
session
.
getPlayer
().
getWorld
().
getEntityById
(
moveInfo
.
getEntityId
());
if
(
entity
!=
null
)
{
entity
.
getPosition
().
set
(
moveInfo
.
getMotionInfo
().
getPos
());
entity
.
getRotation
().
set
(
moveInfo
.
getMotionInfo
().
getRot
());
entity
.
setLastMoveSceneTimeMs
(
moveInfo
.
getSceneTime
());
entity
.
setLastMoveReliableSeq
(
moveInfo
.
getReliableSeq
());
entity
.
setMotionState
(
moveInfo
.
getMotionInfo
().
getState
());
}
break
;
default
:
break
;
}
session
.
getPlayer
().
getCombatInvokeHandler
().
addEntry
(
entry
.
getForwardType
(),
entry
);
}
if
(
notif
.
getInvokeListList
().
size
()
>
0
)
{
session
.
getPlayer
().
getCombatInvokeHandler
().
update
(
session
.
getPlayer
());
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerDealAddFriendReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.DealAddFriendReqOuterClass.DealAddFriendReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
DealAddFriendReq
)
public
class
HandlerDealAddFriendReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
DealAddFriendReq
req
=
DealAddFriendReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getFriendsList
().
handleFriendRequest
(
req
.
getTargetUid
(),
req
.
getDealAddFriendResult
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerDeleteFriendReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.DeleteFriendReqOuterClass.DeleteFriendReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
DeleteFriendReq
)
public
class
HandlerDeleteFriendReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
DeleteFriendReq
req
=
DeleteFriendReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
getFriendsList
().
deleteFriend
(
req
.
getTargetUid
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerDestroyMaterialReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.DestroyMaterialReqOuterClass.DestroyMaterialReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
DestroyMaterialReq
)
public
class
HandlerDestroyMaterialReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
DestroyMaterialReq
req
=
DestroyMaterialReq
.
parseFrom
(
payload
);
// Delete items
session
.
getServer
().
getInventoryManager
().
destroyMaterial
(
session
.
getPlayer
(),
req
.
getMaterialListList
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerDoGachaReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.DoGachaReqOuterClass.DoGachaReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
DoGachaReq
)
public
class
HandlerDoGachaReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
DoGachaReq
req
=
DoGachaReq
.
parseFrom
(
payload
);
session
.
getServer
().
getGachaManager
().
doPulls
(
session
.
getPlayer
(),
req
.
getGachaType
(),
req
.
getGachaTimes
());
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerDungeonEntryInfoReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
@Opcodes
(
PacketOpcodes
.
DungeonEntryInfoReq
)
public
class
HandlerDungeonEntryInfoReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerEnterSceneDoneReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.GenshinPlayer.SceneLoadState
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEnterSceneDoneRsp
;
import
emu.grasscutter.server.packet.send.PacketPlayerTimeNotify
;
import
emu.grasscutter.server.packet.send.PacketScenePlayerLocationNotify
;
import
emu.grasscutter.server.packet.send.PacketWorldPlayerLocationNotify
;
import
emu.grasscutter.server.packet.send.PacketWorldPlayerRTTNotify
;
@Opcodes
(
PacketOpcodes
.
EnterSceneDoneReq
)
public
class
HandlerEnterSceneDoneReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
// Finished loading
session
.
getPlayer
().
setSceneLoadState
(
SceneLoadState
.
LOADED
);
// Done
session
.
send
(
new
PacketEnterSceneDoneRsp
(
session
.
getPlayer
()));
session
.
send
(
new
PacketPlayerTimeNotify
(
session
.
getPlayer
()));
// Probably not the right place
// Spawn player in world
session
.
getPlayer
().
getWorld
().
spawnPlayer
(
session
.
getPlayer
());
// Spawn other entites already in world
session
.
getPlayer
().
getWorld
().
showOtherEntities
(
session
.
getPlayer
());
// Locations
session
.
send
(
new
PacketWorldPlayerLocationNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketScenePlayerLocationNotify
(
session
.
getPlayer
()));
session
.
send
(
new
PacketWorldPlayerRTTNotify
(
session
.
getPlayer
().
getWorld
()));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerEnterSceneReadyReq.java
0 → 100644
View file @
7925d1cd
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEnterScenePeerNotify
;
import
emu.grasscutter.server.packet.send.PacketEnterSceneReadyRsp
;
@Opcodes
(
PacketOpcodes
.
EnterSceneReadyReq
)
public
class
HandlerEnterSceneReadyReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
{
session
.
send
(
new
PacketEnterScenePeerNotify
(
session
.
getPlayer
()));
session
.
send
(
new
PacketEnterSceneReadyRsp
(
session
.
getPlayer
()));
}
}
Prev
1
…
4
5
6
7
8
9
10
11
12
…
18
Next
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