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
9fc8cc1c
Commit
9fc8cc1c
authored
Apr 27, 2022
by
Kengxxiao
Committed by
GitHub
Apr 27, 2022
Browse files
Merge pull request #1 from Grasscutters/development
merge
parents
627a2f1e
d1fc8c1f
Changes
297
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneEntityDrownReq.java
0 → 100644
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityMonster
;
import
emu.grasscutter.game.entity.GameEntity
;
import
emu.grasscutter.game.props.FightProperty
;
import
emu.grasscutter.game.props.LifeState
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SceneEntityDrownReqOuterClass.SceneEntityDrownReq
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketSceneEntityDrownRsp
;
@Opcodes
(
PacketOpcodes
.
SceneEntityDrownReq
)
public
class
HandlerSceneEntityDrownReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
SceneEntityDrownReq
req
=
SceneEntityDrownReq
.
parseFrom
(
payload
);
GameEntity
entity
=
session
.
getPlayer
().
getScene
().
getEntityById
(
req
.
getEntityId
());
if
(
entity
==
null
||
!(
entity
instanceof
EntityMonster
||
entity
instanceof
EntityAvatar
))
{
return
;
}
entity
.
setFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
,
0
);
//TODO: make a list somewhere of all entities to remove per tick rather than one by one
session
.
getPlayer
().
getScene
().
killEntity
(
entity
,
0
);
session
.
getPlayer
().
getScene
().
broadcastPacket
(
new
PacketSceneEntityDrownRsp
(
req
.
getEntityId
()));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneInitFinishReq.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.
Genshin
Player.SceneLoadState
;
import
emu.grasscutter.game.
player.
Player.SceneLoadState
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketHandler
;
...
@@ -31,7 +31,7 @@ public class HandlerSceneInitFinishReq extends PacketHandler {
...
@@ -31,7 +31,7 @@ public class HandlerSceneInitFinishReq extends PacketHandler {
session
.
send
(
new
PacketWorldPlayerInfoNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketWorldPlayerInfoNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketWorldDataNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketWorldDataNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketSceneUnlockInfoNotify
());
session
.
send
(
new
PacketSceneUnlockInfoNotify
());
session
.
send
(
new
Genshin
Packet
(
PacketOpcodes
.
SceneForceUnlockNotify
));
session
.
send
(
new
Base
Packet
(
PacketOpcodes
.
SceneForceUnlockNotify
));
session
.
send
(
new
PacketHostPlayerNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketHostPlayerNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketSceneTimeNotify
(
session
.
getPlayer
()));
session
.
send
(
new
PacketSceneTimeNotify
(
session
.
getPlayer
()));
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneTransToPointReq.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.custom.ScenePointEntry
;
import
emu.grasscutter.data.custom.ScenePointEntry
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
...
@@ -19,7 +19,7 @@ public class HandlerSceneTransToPointReq extends PacketHandler {
...
@@ -19,7 +19,7 @@ public class HandlerSceneTransToPointReq extends PacketHandler {
SceneTransToPointReq
req
=
SceneTransToPointReq
.
parseFrom
(
payload
);
SceneTransToPointReq
req
=
SceneTransToPointReq
.
parseFrom
(
payload
);
String
code
=
req
.
getSceneId
()
+
"_"
+
req
.
getPointId
();
String
code
=
req
.
getSceneId
()
+
"_"
+
req
.
getPointId
();
ScenePointEntry
scenePointEntry
=
G
enshin
Data
.
getScenePointEntries
().
get
(
code
);
ScenePointEntry
scenePointEntry
=
G
ame
Data
.
getScenePointEntries
().
get
(
code
);
if
(
scenePointEntry
!=
null
)
{
if
(
scenePointEntry
!=
null
)
{
float
x
=
scenePointEntry
.
getPointData
().
getTranPos
().
getX
();
float
x
=
scenePointEntry
.
getPointData
().
getTranPos
().
getX
();
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerSetEntityClientDataNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify
;
import
emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify
;
...
@@ -20,7 +20,7 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
...
@@ -20,7 +20,7 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
// Make sure packet is a valid proto before replaying it to the other players
// Make sure packet is a valid proto before replaying it to the other players
SetEntityClientDataNotify
notif
=
SetEntityClientDataNotify
.
parseFrom
(
payload
);
SetEntityClientDataNotify
notif
=
SetEntityClientDataNotify
.
parseFrom
(
payload
);
Genshin
Packet
packet
=
new
Genshin
Packet
(
PacketOpcodes
.
SetEntityClientDataNotify
,
true
);
Base
Packet
packet
=
new
Base
Packet
(
PacketOpcodes
.
SetEntityClientDataNotify
,
true
);
packet
.
setData
(
notif
);
packet
.
setData
(
notif
);
session
.
getPlayer
().
getScene
().
broadcastPacketToOthers
(
session
.
getPlayer
(),
packet
);
session
.
getPlayer
().
getScene
().
broadcastPacketToOthers
(
session
.
getPlayer
(),
packet
);
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.G
enshin
Constants
;
import
emu.grasscutter.G
ame
Constants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.database.DatabaseHelper
;
import
emu.grasscutter.game.
GenshinPlaye
r
;
import
emu.grasscutter.game.
avatar.Avata
r
;
import
emu.grasscutter.game.
avatar.GenshinAvata
r
;
import
emu.grasscutter.game.
player.Playe
r
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass.SetPlayerBornDataReq
;
import
emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass.SetPlayerBornDataReq
;
...
@@ -24,9 +24,9 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
...
@@ -24,9 +24,9 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
// Sanity checks
// Sanity checks
int
avatarId
=
req
.
getAvatarId
();
int
avatarId
=
req
.
getAvatarId
();
int
startingSkillDepot
=
0
;
int
startingSkillDepot
=
0
;
if
(
avatarId
==
G
enshin
Constants
.
MAIN_CHARACTER_MALE
)
{
if
(
avatarId
==
G
ame
Constants
.
MAIN_CHARACTER_MALE
)
{
startingSkillDepot
=
504
;
startingSkillDepot
=
504
;
}
else
if
(
avatarId
==
G
enshin
Constants
.
MAIN_CHARACTER_FEMALE
)
{
}
else
if
(
avatarId
==
G
ame
Constants
.
MAIN_CHARACTER_FEMALE
)
{
startingSkillDepot
=
704
;
startingSkillDepot
=
704
;
}
else
{
}
else
{
return
;
return
;
...
@@ -38,7 +38,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
...
@@ -38,7 +38,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
}
}
// Create character
// Create character
Genshin
Player
player
=
new
Genshin
Player
(
session
);
Player
player
=
new
Player
(
session
);
player
.
setNickname
(
nickname
);
player
.
setNickname
(
nickname
);
try
{
try
{
...
@@ -47,8 +47,8 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
...
@@ -47,8 +47,8 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
// Create avatar
// Create avatar
if
(
player
.
getAvatars
().
getAvatarCount
()
==
0
)
{
if
(
player
.
getAvatars
().
getAvatarCount
()
==
0
)
{
Genshin
Avatar
mainCharacter
=
new
Genshin
Avatar
(
avatarId
);
Avatar
mainCharacter
=
new
Avatar
(
avatarId
);
mainCharacter
.
setSkillDepot
(
G
enshin
Data
.
getAvatarSkillDepotDataMap
().
get
(
startingSkillDepot
));
mainCharacter
.
setSkillDepot
(
G
ame
Data
.
getAvatarSkillDepotDataMap
().
get
(
startingSkillDepot
));
player
.
addAvatar
(
mainCharacter
);
player
.
addAvatar
(
mainCharacter
);
player
.
setMainCharacterId
(
avatarId
);
player
.
setMainCharacterId
(
avatarId
);
player
.
setHeadImage
(
avatarId
);
player
.
setHeadImage
(
avatarId
);
...
@@ -68,7 +68,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
...
@@ -68,7 +68,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
session
.
setState
(
SessionState
.
ACTIVE
);
session
.
setState
(
SessionState
.
ACTIVE
);
// Born resp packet
// Born resp packet
session
.
send
(
new
Genshin
Packet
(
PacketOpcodes
.
SetPlayerBornDataRsp
));
session
.
send
(
new
Base
Packet
(
PacketOpcodes
.
SetPlayerBornDataRsp
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Grasscutter
.
getLogger
().
error
(
"Error creating player object: "
,
e
);
Grasscutter
.
getLogger
().
error
(
"Error creating player object: "
,
e
);
session
.
close
();
session
.
close
();
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerTakePlayerLevelRewardReq.java
View file @
9fc8cc1c
...
@@ -5,9 +5,9 @@ import java.util.List;
...
@@ -5,9 +5,9 @@ import java.util.List;
import
java.util.Set
;
import
java.util.Set
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.common.RewardItemData
;
import
emu.grasscutter.data.common.RewardItemData
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.game.props.ActionReason
;
import
emu.grasscutter.game.props.ActionReason
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketHandler
;
...
@@ -24,15 +24,15 @@ public class HandlerTakePlayerLevelRewardReq extends PacketHandler {
...
@@ -24,15 +24,15 @@ public class HandlerTakePlayerLevelRewardReq extends PacketHandler {
TakePlayerLevelRewardReq
req
=
TakePlayerLevelRewardReq
.
parseFrom
(
payload
);
TakePlayerLevelRewardReq
req
=
TakePlayerLevelRewardReq
.
parseFrom
(
payload
);
int
level
=
req
.
getLevel
();
int
level
=
req
.
getLevel
();
int
rewardId
=
G
enshin
Data
.
getPlayerLevelDataMap
().
get
(
level
).
getRewardId
();
int
rewardId
=
G
ame
Data
.
getPlayerLevelDataMap
().
get
(
level
).
getRewardId
();
if
(
rewardId
!=
0
)
{
if
(
rewardId
!=
0
)
{
List
<
RewardItemData
>
rewardItems
=
G
enshin
Data
.
getRewardDataMap
().
get
(
rewardId
).
getRewardItemList
();
List
<
RewardItemData
>
rewardItems
=
G
ame
Data
.
getRewardDataMap
().
get
(
rewardId
).
getRewardItemList
();
List
<
G
enshin
Item
>
items
=
new
LinkedList
<>();
List
<
G
ame
Item
>
items
=
new
LinkedList
<>();
for
(
RewardItemData
rewardItem
:
rewardItems
)
{
for
(
RewardItemData
rewardItem
:
rewardItems
)
{
if
(
rewardItem
!=
null
)
{
if
(
rewardItem
!=
null
)
{
if
(
rewardItem
.
getItemId
()
!=
0
)
{
if
(
rewardItem
.
getItemId
()
!=
0
)
{
items
.
add
(
new
G
enshin
Item
(
rewardItem
.
getItemId
(),
rewardItem
.
getItemCount
()));
items
.
add
(
new
G
ame
Item
(
rewardItem
.
getItemId
(),
rewardItem
.
getItemCount
()));
}
}
}
}
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerUseItemReq.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.recv
;
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UseItemReqOuterClass.UseItemReq
;
import
emu.grasscutter.net.proto.UseItemReqOuterClass.UseItemReq
;
...
@@ -15,7 +15,7 @@ public class HandlerUseItemReq extends PacketHandler {
...
@@ -15,7 +15,7 @@ public class HandlerUseItemReq extends PacketHandler {
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
UseItemReq
req
=
UseItemReq
.
parseFrom
(
payload
);
UseItemReq
req
=
UseItemReq
.
parseFrom
(
payload
);
G
enshin
Item
useItem
=
session
.
getServer
().
getInventoryManager
().
useItem
(
session
.
getPlayer
(),
req
.
getTargetGuid
(),
req
.
getGuid
(),
req
.
getCount
());
G
ame
Item
useItem
=
session
.
getServer
().
getInventoryManager
().
useItem
(
session
.
getPlayer
(),
req
.
getTargetGuid
(),
req
.
getGuid
(),
req
.
getCount
());
if
(
useItem
!=
null
)
{
if
(
useItem
!=
null
)
{
session
.
send
(
new
PacketUseItemRsp
(
req
.
getTargetGuid
(),
useItem
));
session
.
send
(
new
PacketUseItemRsp
(
req
.
getTargetGuid
(),
useItem
));
}
else
{
}
else
{
...
...
src/main/java/emu/grasscutter/server/packet/send/Packet.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
public
class
Packet
extends
Genshin
Packet
{
public
class
Packet
extends
Base
Packet
{
public
Packet
()
{
public
Packet
()
{
super
(
PacketOpcodes
.
NONE
);
super
(
PacketOpcodes
.
NONE
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAbilityChangeNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AbilityChangeNotifyOuterClass.AbilityChangeNotify
;
import
emu.grasscutter.net.proto.AbilityChangeNotifyOuterClass.AbilityChangeNotify
;
public
class
PacketAbilityChangeNotify
extends
Genshin
Packet
{
public
class
PacketAbilityChangeNotify
extends
Base
Packet
{
public
PacketAbilityChangeNotify
(
EntityAvatar
entity
)
{
public
PacketAbilityChangeNotify
(
EntityAvatar
entity
)
{
super
(
PacketOpcodes
.
AbilityChangeNotify
,
true
);
super
(
PacketOpcodes
.
AbilityChangeNotify
,
true
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java
View file @
9fc8cc1c
...
@@ -2,12 +2,12 @@ package emu.grasscutter.server.packet.send;
...
@@ -2,12 +2,12 @@ package emu.grasscutter.server.packet.send;
import
java.util.List
;
import
java.util.List
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify
;
import
emu.grasscutter.net.proto.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
public
class
PacketAbilityInvocationsNotify
extends
Genshin
Packet
{
public
class
PacketAbilityInvocationsNotify
extends
Base
Packet
{
public
PacketAbilityInvocationsNotify
(
AbilityInvokeEntry
entry
)
{
public
PacketAbilityInvocationsNotify
(
AbilityInvokeEntry
entry
)
{
super
(
PacketOpcodes
.
AbilityInvocationsNotify
,
true
);
super
(
PacketOpcodes
.
AbilityInvocationsNotify
,
true
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAskAddFriendNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.friends.Friendship
;
import
emu.grasscutter.game.friends.Friendship
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AskAddFriendNotifyOuterClass.AskAddFriendNotify
;
import
emu.grasscutter.net.proto.AskAddFriendNotifyOuterClass.AskAddFriendNotify
;
public
class
PacketAskAddFriendNotify
extends
Genshin
Packet
{
public
class
PacketAskAddFriendNotify
extends
Base
Packet
{
public
PacketAskAddFriendNotify
(
Friendship
friendship
)
{
public
PacketAskAddFriendNotify
(
Friendship
friendship
)
{
super
(
PacketOpcodes
.
AskAddFriendNotify
);
super
(
PacketOpcodes
.
AskAddFriendNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAskAddFriendRsp.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AskAddFriendRspOuterClass.AskAddFriendRsp
;
import
emu.grasscutter.net.proto.AskAddFriendRspOuterClass.AskAddFriendRsp
;
public
class
PacketAskAddFriendRsp
extends
Genshin
Packet
{
public
class
PacketAskAddFriendRsp
extends
Base
Packet
{
public
PacketAskAddFriendRsp
(
int
targetUid
)
{
public
PacketAskAddFriendRsp
(
int
targetUid
)
{
super
(
PacketOpcodes
.
AskAddFriendRsp
);
super
(
PacketOpcodes
.
AskAddFriendRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarAddNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarAddNotifyOuterClass.AvatarAddNotify
;
import
emu.grasscutter.net.proto.AvatarAddNotifyOuterClass.AvatarAddNotify
;
public
class
PacketAvatarAddNotify
extends
Genshin
Packet
{
public
class
PacketAvatarAddNotify
extends
Base
Packet
{
public
PacketAvatarAddNotify
(
Genshin
Avatar
avatar
,
boolean
addedToTeam
)
{
public
PacketAvatarAddNotify
(
Avatar
avatar
,
boolean
addedToTeam
)
{
super
(
PacketOpcodes
.
AvatarAddNotify
);
super
(
PacketOpcodes
.
AvatarAddNotify
);
AvatarAddNotify
proto
=
AvatarAddNotify
.
newBuilder
()
AvatarAddNotify
proto
=
AvatarAddNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarChangeCostumeNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarChangeCostumeNotifyOuterClass.AvatarChangeCostumeNotify
;
import
emu.grasscutter.net.proto.AvatarChangeCostumeNotifyOuterClass.AvatarChangeCostumeNotify
;
public
class
PacketAvatarChangeCostumeNotify
extends
Genshin
Packet
{
public
class
PacketAvatarChangeCostumeNotify
extends
Base
Packet
{
public
PacketAvatarChangeCostumeNotify
(
EntityAvatar
entity
)
{
public
PacketAvatarChangeCostumeNotify
(
EntityAvatar
entity
)
{
super
(
PacketOpcodes
.
AvatarChangeCostumeNotify
);
super
(
PacketOpcodes
.
AvatarChangeCostumeNotify
);
AvatarChangeCostumeNotify
proto
=
AvatarChangeCostumeNotify
.
newBuilder
()
AvatarChangeCostumeNotify
proto
=
AvatarChangeCostumeNotify
.
newBuilder
()
.
setEntity
(
entity
.
toProto
())
.
setEntity
Info
(
entity
.
toProto
())
.
build
();
.
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarChangeCostumeRsp.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp
;
import
emu.grasscutter.net.proto.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketAvatarChangeCostumeRsp
extends
Genshin
Packet
{
public
class
PacketAvatarChangeCostumeRsp
extends
Base
Packet
{
public
PacketAvatarChangeCostumeRsp
(
long
avatarGuid
,
int
costumeId
)
{
public
PacketAvatarChangeCostumeRsp
(
long
avatarGuid
,
int
costumeId
)
{
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
...
@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
...
@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
AvatarChangeCostumeRsp
proto
=
AvatarChangeCostumeRsp
.
newBuilder
()
AvatarChangeCostumeRsp
proto
=
AvatarChangeCostumeRsp
.
newBuilder
()
.
setRetcode
(
1
)
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
)
.
build
();
.
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDataNotify.java
View file @
9fc8cc1c
...
@@ -2,17 +2,17 @@ package emu.grasscutter.server.packet.send;
...
@@ -2,17 +2,17 @@ package emu.grasscutter.server.packet.send;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
emu.grasscutter.game.
GenshinPlaye
r
;
import
emu.grasscutter.game.
avatar.Avata
r
;
import
emu.grasscutter.game.
TeamInfo
;
import
emu.grasscutter.game.
player.Player
;
import
emu.grasscutter.game.
avatar.GenshinAvatar
;
import
emu.grasscutter.game.
player.TeamInfo
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarDataNotifyOuterClass.AvatarDataNotify
;
import
emu.grasscutter.net.proto.AvatarDataNotifyOuterClass.AvatarDataNotify
;
import
emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam
;
import
emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam
;
public
class
PacketAvatarDataNotify
extends
Genshin
Packet
{
public
class
PacketAvatarDataNotify
extends
Base
Packet
{
public
PacketAvatarDataNotify
(
Genshin
Player
player
)
{
public
PacketAvatarDataNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarDataNotify
,
2
);
super
(
PacketOpcodes
.
AvatarDataNotify
,
2
);
AvatarDataNotify
.
Builder
proto
=
AvatarDataNotify
.
newBuilder
()
AvatarDataNotify
.
Builder
proto
=
AvatarDataNotify
.
newBuilder
()
...
@@ -21,7 +21,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
...
@@ -21,7 +21,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.
addAllOwnedFlycloakList
(
player
.
getFlyCloakList
())
.
addAllOwnedFlycloakList
(
player
.
getFlyCloakList
())
.
addAllOwnedCostumeList
(
player
.
getCostumeList
());
.
addAllOwnedCostumeList
(
player
.
getCostumeList
());
for
(
Genshin
Avatar
avatar
:
player
.
getAvatars
())
{
for
(
Avatar
avatar
:
player
.
getAvatars
())
{
proto
.
addAvatarList
(
avatar
.
toProto
());
proto
.
addAvatarList
(
avatar
.
toProto
());
}
}
...
@@ -31,7 +31,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
...
@@ -31,7 +31,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.
setTeamName
(
teamInfo
.
getName
());
.
setTeamName
(
teamInfo
.
getName
());
for
(
int
i
=
0
;
i
<
teamInfo
.
getAvatars
().
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
teamInfo
.
getAvatars
().
size
();
i
++)
{
Genshin
Avatar
avatar
=
player
.
getAvatars
().
getAvatarById
(
teamInfo
.
getAvatars
().
get
(
i
));
Avatar
avatar
=
player
.
getAvatars
().
getAvatarById
(
teamInfo
.
getAvatars
().
get
(
i
));
avatarTeam
.
addAvatarGuidList
(
avatar
.
getGuid
());
avatarTeam
.
addAvatarGuidList
(
avatar
.
getGuid
());
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDieAnimationEndRsp.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarDieAnimationEndRspOuterClass.AvatarDieAnimationEndRsp
;
import
emu.grasscutter.net.proto.AvatarDieAnimationEndRspOuterClass.AvatarDieAnimationEndRsp
;
public
class
PacketAvatarDieAnimationEndRsp
extends
Genshin
Packet
{
public
class
PacketAvatarDieAnimationEndRsp
extends
Base
Packet
{
public
PacketAvatarDieAnimationEndRsp
(
long
dieGuid
,
int
skillId
)
{
public
PacketAvatarDieAnimationEndRsp
(
long
dieGuid
,
int
skillId
)
{
super
(
PacketOpcodes
.
AvatarDieAnimationEndRsp
);
super
(
PacketOpcodes
.
AvatarDieAnimationEndRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarEquipChangeNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.inventory.EquipType
;
import
emu.grasscutter.game.inventory.EquipType
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarEquipChangeNotifyOuterClass.AvatarEquipChangeNotify
;
import
emu.grasscutter.net.proto.AvatarEquipChangeNotifyOuterClass.AvatarEquipChangeNotify
;
public
class
PacketAvatarEquipChangeNotify
extends
Genshin
Packet
{
public
class
PacketAvatarEquipChangeNotify
extends
Base
Packet
{
public
PacketAvatarEquipChangeNotify
(
Genshin
Avatar
avatar
,
G
enshin
Item
item
)
{
public
PacketAvatarEquipChangeNotify
(
Avatar
avatar
,
G
ame
Item
item
)
{
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
...
@@ -27,7 +27,7 @@ public class PacketAvatarEquipChangeNotify extends GenshinPacket {
...
@@ -27,7 +27,7 @@ public class PacketAvatarEquipChangeNotify extends GenshinPacket {
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
public
PacketAvatarEquipChangeNotify
(
Genshin
Avatar
avatar
,
EquipType
slot
)
{
public
PacketAvatarEquipChangeNotify
(
Avatar
avatar
,
EquipType
slot
)
{
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFetterDataNotify.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.props.FetterState
;
import
emu.grasscutter.game.props.FetterState
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarFetterDataNotifyOuterClass.AvatarFetterDataNotify
;
import
emu.grasscutter.net.proto.AvatarFetterDataNotifyOuterClass.AvatarFetterDataNotify
;
import
emu.grasscutter.net.proto.AvatarFetterInfoOuterClass.AvatarFetterInfo
;
import
emu.grasscutter.net.proto.AvatarFetterInfoOuterClass.AvatarFetterInfo
;
import
emu.grasscutter.net.proto.FetterDataOuterClass.FetterData
;
import
emu.grasscutter.net.proto.FetterDataOuterClass.FetterData
;
public
class
PacketAvatarFetterDataNotify
extends
Genshin
Packet
{
public
class
PacketAvatarFetterDataNotify
extends
Base
Packet
{
public
PacketAvatarFetterDataNotify
(
Genshin
Avatar
avatar
)
{
public
PacketAvatarFetterDataNotify
(
Avatar
avatar
)
{
super
(
PacketOpcodes
.
AvatarFetterDataNotify
);
super
(
PacketOpcodes
.
AvatarFetterDataNotify
);
int
fetterLevel
=
avatar
.
getFetterLevel
();
int
fetterLevel
=
avatar
.
getFetterLevel
();
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFetterLevelRewardRsp.java
View file @
9fc8cc1c
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarFetterLevelRewardRspOuterClass.AvatarFetterLevelRewardRsp
;
import
emu.grasscutter.net.proto.AvatarFetterLevelRewardRspOuterClass.AvatarFetterLevelRewardRsp
;
public
class
PacketAvatarFetterLevelRewardRsp
extends
Genshin
Packet
{
public
class
PacketAvatarFetterLevelRewardRsp
extends
Base
Packet
{
public
PacketAvatarFetterLevelRewardRsp
(
long
guid
,
int
fetterLevel
,
int
rewardId
)
{
public
PacketAvatarFetterLevelRewardRsp
(
long
guid
,
int
fetterLevel
,
int
rewardId
)
{
super
(
PacketOpcodes
.
AvatarFetterLevelRewardRsp
);
super
(
PacketOpcodes
.
AvatarFetterLevelRewardRsp
);
...
...
Prev
1
…
4
5
6
7
8
9
10
11
12
…
15
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