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
b9f7c657
Commit
b9f7c657
authored
Apr 27, 2022
by
Benjamin Elsdon
Browse files
Merge remote-tracking branch 'upstream/development' into dev-mail
parents
eb495807
782618cd
Changes
86
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketGadgetInteractRsp.java
View file @
b9f7c657
...
...
@@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.GenshinPacket;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp
;
import
emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketGadgetInteractRsp
extends
GenshinPacket
{
public
PacketGadgetInteractRsp
(
EntityGadget
gadget
,
InteractType
interact
)
{
...
...
@@ -23,7 +24,7 @@ public class PacketGadgetInteractRsp extends GenshinPacket {
super
(
PacketOpcodes
.
GadgetInteractRsp
);
GadgetInteractRsp
proto
=
GadgetInteractRsp
.
newBuilder
()
.
setRetcode
(
1
)
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
)
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetAuthkeyRsp.java
View file @
b9f7c657
...
...
@@ -3,13 +3,14 @@ package emu.grasscutter.server.packet.send;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetAuthkeyRspOuterClass.GetAuthkeyRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketGetAuthkeyRsp
extends
GenshinPacket
{
public
PacketGetAuthkeyRsp
()
{
super
(
PacketOpcodes
.
GetAuthkeyRsp
);
GetAuthkeyRsp
proto
=
GetAuthkeyRsp
.
newBuilder
().
setRetcode
(
1
).
build
();
GetAuthkeyRsp
proto
=
GetAuthkeyRsp
.
newBuilder
().
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
).
build
();
this
.
setData
(
proto
);
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java
View file @
b9f7c657
...
...
@@ -9,6 +9,7 @@ import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief;
import
emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState
;
import
emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFriendListRsp
;
import
emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage
;
import
emu.grasscutter.net.proto.PlatformTypeOuterClass
;
public
class
PacketGetPlayerFriendListRsp
extends
GenshinPacket
{
...
...
@@ -19,15 +20,15 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket {
.
setUid
(
GenshinConstants
.
SERVER_CONSOLE_UID
)
.
setNickname
(
"Server"
)
.
setLevel
(
1
)
.
setAvatar
(
HeadImage
.
newBuilder
().
setAvatarId
(
GenshinConstants
.
MAIN_CHARACTER_FEMALE
))
.
setAvatar
Id
(
HeadImage
.
newBuilder
().
setAvatarId
(
GenshinConstants
.
MAIN_CHARACTER_FEMALE
)
.
getAvatarId
()
)
.
setWorldLevel
(
0
)
.
setSignature
(
""
)
.
setLastActiveTime
((
int
)
(
System
.
currentTimeMillis
()
/
1000
f
))
.
setNameCardId
(
210001
)
.
setOnlineState
(
FriendOnlineState
.
FRIEND_ONLINE
)
.
setParam
(
1
)
.
set
Unk1
(
1
)
.
set
Unk2
(
3
)
.
set
IsGameSource
(
true
)
.
set
PlatformType
(
PlatformTypeOuterClass
.
PlatformType
.
PC
)
.
build
();
GetPlayerFriendListRsp
.
Builder
proto
=
GetPlayerFriendListRsp
.
newBuilder
().
addFriendList
(
serverFriend
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerSocialDetailRsp.java
View file @
b9f7c657
...
...
@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetPlayerSocialDetailRspOuterClass.GetPlayerSocialDetailRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail
;
public
class
PacketGetPlayerSocialDetailRsp
extends
GenshinPacket
{
...
...
@@ -15,7 +16,7 @@ public class PacketGetPlayerSocialDetailRsp extends GenshinPacket {
if
(
detail
!=
null
)
{
proto
.
setDetailData
(
detail
);
}
else
{
proto
.
setRetcode
(
1
);
proto
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
);
}
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerTokenRsp.java
View file @
b9f7c657
...
...
@@ -16,18 +16,18 @@ public class PacketGetPlayerTokenRsp extends GenshinPacket {
this
.
setUseDispatchKey
(
true
);
GetPlayerTokenRsp
p
=
GetPlayerTokenRsp
.
newBuilder
()
.
set
Player
Uid
(
session
.
getAccount
().
getPlayerUid
())
.
set
Account
Token
(
session
.
getAccount
().
getToken
())
.
setUid
(
session
.
getAccount
().
getPlayerUid
())
.
setToken
(
session
.
getAccount
().
getToken
())
.
setAccountType
(
1
)
.
setIsProficientPlayer
(
doesPlayerExist
)
// Not sure where this goes
.
setSecretKey
(
Crypto
.
ENCRYPT_SEED
)
.
setSec
retKey
Buffer
(
ByteString
.
copyFrom
(
Crypto
.
ENCRYPT_SEED_BUFFER
))
.
setSecretKey
Seed
(
Crypto
.
ENCRYPT_SEED
)
.
setSec
urityCmd
Buffer
(
ByteString
.
copyFrom
(
Crypto
.
ENCRYPT_SEED_BUFFER
))
.
setPlatformType
(
3
)
.
setChannelId
(
1
)
.
setCountryCode
(
"US"
)
.
set
Unk1
(
"c25-314dd05b0b5f"
)
.
set
Unk3
(
3
)
.
setClientIp
(
session
.
getAddress
().
getAddress
().
getHostAddress
())
.
set
ClientVersionRandomKey
(
"c25-314dd05b0b5f"
)
.
set
RegPlatform
(
3
)
.
setClientIp
Str
(
session
.
getAddress
().
getAddress
().
getHostAddress
())
.
build
();
this
.
setData
(
p
.
toByteArray
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterMpResultNotify.java
View file @
b9f7c657
...
...
@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.Player
public
class
PacketPlayerApplyEnterMpResultNotify
extends
GenshinPacket
{
public
PacketPlayerApplyEnterMpResultNotify
(
GenshinPlayer
target
,
boolean
isAgreed
,
PlayerApplyEnterMpReason
reason
)
{
public
PacketPlayerApplyEnterMpResultNotify
(
GenshinPlayer
target
,
boolean
isAgreed
,
PlayerApplyEnterMp
ResultNotify
.
Reason
reason
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultNotify
);
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
...
...
@@ -21,7 +21,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
this
.
setData
(
proto
);
}
public
PacketPlayerApplyEnterMpResultNotify
(
int
targetId
,
String
targetName
,
boolean
isAgreed
,
PlayerApplyEnterMpReason
reason
)
{
public
PacketPlayerApplyEnterMpResultNotify
(
int
targetId
,
String
targetName
,
boolean
isAgreed
,
PlayerApplyEnterMp
ResultNotify
.
Reason
reason
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultNotify
);
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerChatNotify.java
View file @
b9f7c657
...
...
@@ -43,7 +43,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
this
.
setData
(
proto
);
}
public
PacketPlayerChatNotify
(
GenshinPlayer
sender
,
int
channelId
,
SystemHint
systemHint
)
{
public
PacketPlayerChatNotify
(
GenshinPlayer
sender
,
int
channelId
,
ChatInfo
.
SystemHint
systemHint
)
{
super
(
PacketOpcodes
.
PlayerChatNotify
);
ChatInfo
info
=
ChatInfo
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerDataNotify.java
View file @
b9f7c657
...
...
@@ -13,7 +13,7 @@ public class PacketPlayerDataNotify extends GenshinPacket {
PlayerDataNotify
.
Builder
p
=
PlayerDataNotify
.
newBuilder
()
.
setNickName
(
player
.
getNickname
())
.
set
Client
Time
(
System
.
currentTimeMillis
())
.
set
Server
Time
(
System
.
currentTimeMillis
())
.
setIsFirstLoginToday
(
true
)
.
setRegionId
(
player
.
getRegionId
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneInfoNotify.java
View file @
b9f7c657
...
...
@@ -5,6 +5,7 @@ import emu.grasscutter.game.entity.EntityAvatar;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AbilityControlBlockOuterClass
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
import
emu.grasscutter.net.proto.AvatarEnterSceneInfoOuterClass.AvatarEnterSceneInfo
;
import
emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo
;
...
...
@@ -26,7 +27,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
TeamEnterSceneInfo
.
newBuilder
()
.
setTeamEntityId
(
player
.
getTeamManager
().
getEntityId
())
// 150995833
.
setTeamAbilityInfo
(
empty
)
.
set
Unk
(
empty
)
.
set
AbilityControlBlock
(
AbilityControlBlockOuterClass
.
AbilityControlBlock
.
newBuilder
().
build
()
)
);
proto
.
setMpLevelEntityInfo
(
MPLevelEntityInfo
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java
View file @
b9f7c657
...
...
@@ -23,14 +23,14 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
setSceneId
(
player
.
getSceneId
())
.
setPos
(
player
.
getPos
().
toProto
())
.
setSceneBeginTime
(
System
.
currentTimeMillis
())
.
setType
(
EnterType
.
E
nterSelf
)
.
setType
(
EnterType
.
E
NTER_SELF
)
.
setTargetUid
(
player
.
getUid
())
.
setEnterSceneToken
(
player
.
getEnterSceneToken
())
.
setWorldLevel
(
player
.
getWorldLevel
())
.
setEnterReason
(
EnterReason
.
Login
.
getValue
())
.
setIsFirstLoginEnterScene
(
player
.
isFirstLoginEnterScene
())
.
set
Unk1
(
1
)
.
set
Unk2
(
"3-"
+
player
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
set
WorldType
(
1
)
.
set
SceneTransaction
(
"3-"
+
player
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
build
();
this
.
setData
(
proto
);
...
...
@@ -62,8 +62,8 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
addSceneTagIdList
(
109
)
.
addSceneTagIdList
(
113
)
.
addSceneTagIdList
(
117
)
.
set
Unk1
(
1
)
.
set
Unk2
(
newScene
+
"-"
+
target
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
set
WorldType
(
1
)
.
set
SceneTransaction
(
newScene
+
"-"
+
target
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java
View file @
b9f7c657
...
...
@@ -40,8 +40,8 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
regionQuery
=
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
.
parseFrom
(
decodedCurRegion
);
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
set
Gateserver
Ip
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
set
Gateserver
Port
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
...
...
@@ -64,7 +64,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
.
setClientSilenceDataVersion
(
info
.
getClientSilenceDataVersion
())
.
setClientMd5
(
info
.
getClientDataMd5
())
.
setClientSilenceMd5
(
info
.
getClientSilenceDataMd5
())
.
setResVersionConfig
(
info
.
getConfig
())
.
setResVersionConfig
(
info
.
get
ResVersion
Config
())
.
setClientVersionSuffix
(
info
.
getClientVersionSuffix
())
.
setClientSilenceVersionSuffix
(
info
.
getClientSilenceVersionSuffix
())
.
setIsScOpen
(
false
)
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java
View file @
b9f7c657
...
...
@@ -18,7 +18,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket {
this
.
buildHeader
(
2
);
PlayerStoreNotify
.
Builder
p
=
PlayerStoreNotify
.
newBuilder
()
.
setStoreType
(
StoreType
.
S
torePack
)
.
setStoreType
(
StoreType
.
S
TORE_PACK
)
.
setWeightLimit
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
InventoryLimitAll
);
for
(
GenshinItem
item
:
player
.
getInventory
())
{
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java
View file @
b9f7c657
...
...
@@ -15,7 +15,7 @@ public class PacketSceneEntityAppearNotify extends GenshinPacket {
super
(
PacketOpcodes
.
SceneEntityAppearNotify
,
true
);
SceneEntityAppearNotify
.
Builder
proto
=
SceneEntityAppearNotify
.
newBuilder
()
.
setAppearType
(
VisionType
.
V
isionBorn
)
.
setAppearType
(
VisionType
.
V
ISION_BORN
)
.
addEntityList
(
entity
.
toProto
());
this
.
setData
(
proto
.
build
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDrownRsp.java
0 → 100644
View file @
b9f7c657
src/main/java/emu/grasscutter/server/packet/send/PacketSceneKickPlayerRsp.java
View file @
b9f7c657
...
...
@@ -2,6 +2,7 @@ package emu.grasscutter.server.packet.send;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.SceneKickPlayerRspOuterClass.SceneKickPlayerRsp
;
public
class
PacketSceneKickPlayerRsp
extends
GenshinPacket
{
...
...
@@ -20,7 +21,7 @@ public class PacketSceneKickPlayerRsp extends GenshinPacket {
super
(
PacketOpcodes
.
SceneKickPlayerRsp
);
SceneKickPlayerRsp
proto
=
SceneKickPlayerRsp
.
newBuilder
()
.
setRetcode
(
1
)
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
)
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSceneTeamUpdateNotify.java
View file @
b9f7c657
...
...
@@ -19,7 +19,7 @@ public class PacketSceneTeamUpdateNotify extends GenshinPacket {
for
(
GenshinPlayer
p
:
player
.
getWorld
().
getPlayers
())
{
for
(
EntityAvatar
entityAvatar
:
p
.
getTeamManager
().
getActiveTeam
())
{
SceneTeamAvatar
.
Builder
avatarProto
=
SceneTeamAvatar
.
newBuilder
()
.
setPlayer
I
d
(
p
.
getUid
())
.
setPlayer
Ui
d
(
p
.
getUid
())
.
setAvatarGuid
(
entityAvatar
.
getAvatar
().
getGuid
())
.
setSceneId
(
p
.
getSceneId
())
.
setEntityId
(
entityAvatar
.
getId
())
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSceneTransToPointRsp.java
View file @
b9f7c657
...
...
@@ -5,6 +5,7 @@ import emu.grasscutter.data.custom.ScenePointEntry;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp
;
import
emu.grasscutter.utils.Position
;
...
...
@@ -26,7 +27,7 @@ public class PacketSceneTransToPointRsp extends GenshinPacket {
super
(
PacketOpcodes
.
SceneTransToPointRsp
);
SceneTransToPointRsp
proto
=
SceneTransToPointRsp
.
newBuilder
()
.
setRetcode
(
1
)
// Internal server error
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
)
// Internal server error
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerBirthdayRsp.java
View file @
b9f7c657
...
...
@@ -4,6 +4,7 @@ import emu.grasscutter.game.GenshinPlayer;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SetPlayerBirthdayRspOuterClass.SetPlayerBirthdayRsp
;
import
emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass
;
public
class
PacketSetPlayerBirthdayRsp
extends
GenshinPacket
{
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSetPlayerHeadImageRsp.java
View file @
b9f7c657
...
...
@@ -12,7 +12,7 @@ public class PacketSetPlayerHeadImageRsp extends GenshinPacket {
super
(
PacketOpcodes
.
SetPlayerHeadImageRsp
);
SetPlayerHeadImageRsp
proto
=
SetPlayerHeadImageRsp
.
newBuilder
()
.
setAvatar
(
HeadImage
.
newBuilder
().
setAvatarId
(
player
.
getHeadImage
()))
.
setAvatar
Id
(
HeadImage
.
newBuilder
().
setAvatarId
(
player
.
getHeadImage
())
.
getAvatarId
()
)
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSitRsp.java
deleted
100644 → 0
View file @
eb495807
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SitRspOuterClass.SitRsp
;
import
emu.grasscutter.utils.Position
;
public
class
PacketSitRsp
extends
GenshinPacket
{
public
PacketSitRsp
(
long
chairId
,
Position
pos
,
int
EntityId
)
{
super
(
PacketOpcodes
.
SitRsp
);
SitRsp
proto
=
SitRsp
.
newBuilder
()
.
setEntityId
(
EntityId
)
.
setPosition
(
pos
.
toProto
())
.
setChairId
(
chairId
)
.
build
();
this
.
setData
(
proto
);
}
}
Prev
1
2
3
4
5
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