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
01b190bc
Commit
01b190bc
authored
May 07, 2022
by
Magix
Committed by
GitHub
May 07, 2022
Browse files
UPGRADE TO 1.1.0 POG
Merge `development` into `stable`
parents
6b81b888
1beddf16
Changes
497
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterMpNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.PlayerApplyEnterMpNotifyOuterClass.PlayerApplyEnterMpNotify
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpNotifyOuterClass.PlayerApplyEnterMpNotify
;
public
class
PacketPlayerApplyEnterMpNotify
extends
Genshin
Packet
{
public
class
PacketPlayerApplyEnterMpNotify
extends
Base
Packet
{
public
PacketPlayerApplyEnterMpNotify
(
Genshin
Player
srcPlayer
)
{
public
PacketPlayerApplyEnterMpNotify
(
Player
srcPlayer
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpNotify
);
super
(
PacketOpcodes
.
PlayerApplyEnterMpNotify
);
PlayerApplyEnterMpNotify
proto
=
PlayerApplyEnterMpNotify
.
newBuilder
()
PlayerApplyEnterMpNotify
proto
=
PlayerApplyEnterMpNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterMpResultNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify
;
public
class
PacketPlayerApplyEnterMpResultNotify
extends
Genshin
Packet
{
public
class
PacketPlayerApplyEnterMpResultNotify
extends
Base
Packet
{
public
PacketPlayerApplyEnterMpResultNotify
(
Genshin
Player
target
,
boolean
isAgreed
,
PlayerApplyEnterMpReason
reason
)
{
public
PacketPlayerApplyEnterMpResultNotify
(
Player
target
,
boolean
isAgreed
,
PlayerApplyEnterMp
ResultNotifyOuterClass
.
PlayerApplyEnterMpResultNotify
.
Reason
reason
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultNotify
);
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultNotify
);
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
...
@@ -21,7 +22,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
...
@@ -21,7 +22,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
this
.
setData
(
proto
);
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
);
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultNotify
);
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
PlayerApplyEnterMpResultNotify
proto
=
PlayerApplyEnterMpResultNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterMpResultRsp.java
View file @
01b190bc
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.PlayerApplyEnterMpResultRspOuterClass.PlayerApplyEnterMpResultRsp
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpResultRspOuterClass.PlayerApplyEnterMpResultRsp
;
public
class
PacketPlayerApplyEnterMpResultRsp
extends
Genshin
Packet
{
public
class
PacketPlayerApplyEnterMpResultRsp
extends
Base
Packet
{
public
PacketPlayerApplyEnterMpResultRsp
(
int
applyUid
,
boolean
isAgreed
)
{
public
PacketPlayerApplyEnterMpResultRsp
(
int
applyUid
,
boolean
isAgreed
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultRsp
);
super
(
PacketOpcodes
.
PlayerApplyEnterMpResultRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterMpRsp.java
View file @
01b190bc
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.PlayerApplyEnterMpRspOuterClass.PlayerApplyEnterMpRsp
;
import
emu.grasscutter.net.proto.PlayerApplyEnterMpRspOuterClass.PlayerApplyEnterMpRsp
;
public
class
PacketPlayerApplyEnterMpRsp
extends
Genshin
Packet
{
public
class
PacketPlayerApplyEnterMpRsp
extends
Base
Packet
{
public
PacketPlayerApplyEnterMpRsp
(
int
targetUid
)
{
public
PacketPlayerApplyEnterMpRsp
(
int
targetUid
)
{
super
(
PacketOpcodes
.
PlayerApplyEnterMpRsp
);
super
(
PacketOpcodes
.
PlayerApplyEnterMpRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerChatNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.ChatInfoOuterClass.ChatInfo
;
import
emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo
;
import
emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify
;
import
emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify
;
import
emu.grasscutter.net.proto.SystemHintOuterClass.SystemHint
;
import
emu.grasscutter.net.proto.SystemHintOuterClass.SystemHint
;
public
class
PacketPlayerChatNotify
extends
Genshin
Packet
{
public
class
PacketPlayerChatNotify
extends
Base
Packet
{
public
PacketPlayerChatNotify
(
Genshin
Player
sender
,
int
channelId
,
String
message
)
{
public
PacketPlayerChatNotify
(
Player
sender
,
int
channelId
,
String
message
)
{
super
(
PacketOpcodes
.
PlayerChatNotify
);
super
(
PacketOpcodes
.
PlayerChatNotify
);
ChatInfo
info
=
ChatInfo
.
newBuilder
()
ChatInfo
info
=
ChatInfo
.
newBuilder
()
...
@@ -26,7 +26,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
...
@@ -26,7 +26,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
public
PacketPlayerChatNotify
(
Genshin
Player
sender
,
int
channelId
,
int
emote
)
{
public
PacketPlayerChatNotify
(
Player
sender
,
int
channelId
,
int
emote
)
{
super
(
PacketOpcodes
.
PlayerChatNotify
);
super
(
PacketOpcodes
.
PlayerChatNotify
);
ChatInfo
info
=
ChatInfo
.
newBuilder
()
ChatInfo
info
=
ChatInfo
.
newBuilder
()
...
@@ -43,7 +43,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
...
@@ -43,7 +43,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
public
PacketPlayerChatNotify
(
Genshin
Player
sender
,
int
channelId
,
SystemHint
systemHint
)
{
public
PacketPlayerChatNotify
(
Player
sender
,
int
channelId
,
ChatInfo
.
SystemHint
systemHint
)
{
super
(
PacketOpcodes
.
PlayerChatNotify
);
super
(
PacketOpcodes
.
PlayerChatNotify
);
ChatInfo
info
=
ChatInfo
.
newBuilder
()
ChatInfo
info
=
ChatInfo
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerChatRsp.java
View file @
01b190bc
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.PlayerChatRspOuterClass.PlayerChatRsp
;
import
emu.grasscutter.net.proto.PlayerChatRspOuterClass.PlayerChatRsp
;
public
class
PacketPlayerChatRsp
extends
Genshin
Packet
{
public
class
PacketPlayerChatRsp
extends
Base
Packet
{
public
PacketPlayerChatRsp
()
{
public
PacketPlayerChatRsp
()
{
super
(
PacketOpcodes
.
PlayerChatRsp
);
super
(
PacketOpcodes
.
PlayerChatRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerDataNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.PlayerDataNotifyOuterClass.PlayerDataNotify
;
import
emu.grasscutter.net.proto.PlayerDataNotifyOuterClass.PlayerDataNotify
;
import
emu.grasscutter.net.proto.PropValueOuterClass.PropValue
;
import
emu.grasscutter.net.proto.PropValueOuterClass.PropValue
;
public
class
PacketPlayerDataNotify
extends
Genshin
Packet
{
public
class
PacketPlayerDataNotify
extends
Base
Packet
{
public
PacketPlayerDataNotify
(
Genshin
Player
player
)
{
public
PacketPlayerDataNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerDataNotify
,
2
);
super
(
PacketOpcodes
.
PlayerDataNotify
,
2
);
PlayerDataNotify
.
Builder
p
=
PlayerDataNotify
.
newBuilder
()
PlayerDataNotify
.
Builder
p
=
PlayerDataNotify
.
newBuilder
()
.
setNickName
(
player
.
getNickname
())
.
setNickName
(
player
.
getNickname
())
.
set
Client
Time
(
System
.
currentTimeMillis
())
.
set
Server
Time
(
System
.
currentTimeMillis
())
.
setIsFirstLoginToday
(
true
)
.
setIsFirstLoginToday
(
true
)
.
setRegionId
(
player
.
getRegionId
());
.
setRegionId
(
player
.
getRegionId
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterDungeonRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerEnterDungeonRspOuterClass.PlayerEnterDungeonRsp
;
public
class
PacketPlayerEnterDungeonRsp
extends
BasePacket
{
public
PacketPlayerEnterDungeonRsp
(
int
pointId
,
int
dungeonId
)
{
super
(
PacketOpcodes
.
PlayerEnterDungeonRsp
);
PlayerEnterDungeonRsp
proto
=
PlayerEnterDungeonRsp
.
newBuilder
()
.
setPointId
(
pointId
)
.
setDungeonId
(
dungeonId
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneInfoNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AbilityControlBlockOuterClass
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
import
emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo
;
import
emu.grasscutter.net.proto.AvatarEnterSceneInfoOuterClass.AvatarEnterSceneInfo
;
import
emu.grasscutter.net.proto.AvatarEnterSceneInfoOuterClass.AvatarEnterSceneInfo
;
import
emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo
;
import
emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo
;
import
emu.grasscutter.net.proto.PlayerEnterSceneInfoNotifyOuterClass.PlayerEnterSceneInfoNotify
;
import
emu.grasscutter.net.proto.PlayerEnterSceneInfoNotifyOuterClass.PlayerEnterSceneInfoNotify
;
import
emu.grasscutter.net.proto.TeamEnterSceneInfoOuterClass.TeamEnterSceneInfo
;
import
emu.grasscutter.net.proto.TeamEnterSceneInfoOuterClass.TeamEnterSceneInfo
;
public
class
PacketPlayerEnterSceneInfoNotify
extends
Genshin
Packet
{
public
class
PacketPlayerEnterSceneInfoNotify
extends
Base
Packet
{
public
PacketPlayerEnterSceneInfoNotify
(
Genshin
Player
player
)
{
public
PacketPlayerEnterSceneInfoNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerEnterSceneInfoNotify
);
super
(
PacketOpcodes
.
PlayerEnterSceneInfoNotify
);
AbilitySyncStateInfo
empty
=
AbilitySyncStateInfo
.
newBuilder
().
build
();
AbilitySyncStateInfo
empty
=
AbilitySyncStateInfo
.
newBuilder
().
build
();
...
@@ -26,7 +27,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
...
@@ -26,7 +27,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
TeamEnterSceneInfo
.
newBuilder
()
TeamEnterSceneInfo
.
newBuilder
()
.
setTeamEntityId
(
player
.
getTeamManager
().
getEntityId
())
// 150995833
.
setTeamEntityId
(
player
.
getTeamManager
().
getEntityId
())
// 150995833
.
setTeamAbilityInfo
(
empty
)
.
setTeamAbilityInfo
(
empty
)
.
set
Unk
(
empty
)
.
set
AbilityControlBlock
(
AbilityControlBlockOuterClass
.
AbilityControlBlock
.
newBuilder
().
build
()
)
);
);
proto
.
setMpLevelEntityInfo
(
proto
.
setMpLevelEntityInfo
(
MPLevelEntityInfo
.
newBuilder
()
MPLevelEntityInfo
.
newBuilder
()
...
@@ -36,7 +37,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
...
@@ -36,7 +37,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
);
);
for
(
EntityAvatar
avatarEntity
:
player
.
getTeamManager
().
getActiveTeam
())
{
for
(
EntityAvatar
avatarEntity
:
player
.
getTeamManager
().
getActiveTeam
())
{
G
enshin
Item
weapon
=
avatarEntity
.
getAvatar
().
getWeapon
();
G
ame
Item
weapon
=
avatarEntity
.
getAvatar
().
getWeapon
();
long
weaponGuid
=
weapon
!=
null
?
weapon
.
getGuid
()
:
0
;
long
weaponGuid
=
weapon
!=
null
?
weapon
.
getGuid
()
:
0
;
AvatarEnterSceneInfo
avatarInfo
=
AvatarEnterSceneInfo
.
newBuilder
()
AvatarEnterSceneInfo
avatarInfo
=
AvatarEnterSceneInfo
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.
Genshin
Player.SceneLoadState
;
import
emu.grasscutter.game.
player.
Player.SceneLoadState
;
import
emu.grasscutter.game.props.EnterReason
;
import
emu.grasscutter.game.props.EnterReason
;
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.EnterTypeOuterClass.EnterType
;
import
emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType
;
import
emu.grasscutter.net.proto.PlayerEnterSceneNotifyOuterClass.PlayerEnterSceneNotify
;
import
emu.grasscutter.net.proto.PlayerEnterSceneNotifyOuterClass.PlayerEnterSceneNotify
;
import
emu.grasscutter.utils.Position
;
import
emu.grasscutter.utils.Position
;
import
emu.grasscutter.utils.Utils
;
import
emu.grasscutter.utils.Utils
;
public
class
PacketPlayerEnterSceneNotify
extends
Genshin
Packet
{
public
class
PacketPlayerEnterSceneNotify
extends
Base
Packet
{
// Login
// Login
public
PacketPlayerEnterSceneNotify
(
Genshin
Player
player
)
{
public
PacketPlayerEnterSceneNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerEnterSceneNotify
);
super
(
PacketOpcodes
.
PlayerEnterSceneNotify
);
player
.
setSceneLoadState
(
SceneLoadState
.
LOADING
);
player
.
setSceneLoadState
(
SceneLoadState
.
LOADING
);
...
@@ -23,25 +23,25 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
...
@@ -23,25 +23,25 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
setSceneId
(
player
.
getSceneId
())
.
setSceneId
(
player
.
getSceneId
())
.
setPos
(
player
.
getPos
().
toProto
())
.
setPos
(
player
.
getPos
().
toProto
())
.
setSceneBeginTime
(
System
.
currentTimeMillis
())
.
setSceneBeginTime
(
System
.
currentTimeMillis
())
.
setType
(
EnterType
.
E
nterSelf
)
.
setType
(
EnterType
.
E
NTER_SELF
)
.
setTargetUid
(
player
.
getUid
())
.
setTargetUid
(
player
.
getUid
())
.
setEnterSceneToken
(
player
.
getEnterSceneToken
())
.
setEnterSceneToken
(
player
.
getEnterSceneToken
())
.
setWorldLevel
(
player
.
getWorldLevel
())
.
setWorldLevel
(
player
.
getWorldLevel
())
.
setEnterReason
(
EnterReason
.
Login
.
getValue
())
.
setEnterReason
(
EnterReason
.
Login
.
getValue
())
.
setIsFirstLoginEnterScene
(
player
.
isFirstLoginEnterScene
())
.
setIsFirstLoginEnterScene
(
player
.
isFirstLoginEnterScene
())
.
set
Unk1
(
1
)
.
set
WorldType
(
1
)
.
set
Unk2
(
"3-"
+
player
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
set
SceneTransaction
(
"3-"
+
player
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
build
();
.
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
public
PacketPlayerEnterSceneNotify
(
Genshin
Player
player
,
EnterType
type
,
EnterReason
reason
,
int
newScene
,
Position
newPos
)
{
public
PacketPlayerEnterSceneNotify
(
Player
player
,
EnterType
type
,
EnterReason
reason
,
int
newScene
,
Position
newPos
)
{
this
(
player
,
player
,
type
,
reason
,
newScene
,
newPos
);
this
(
player
,
player
,
type
,
reason
,
newScene
,
newPos
);
}
}
// Teleport or go somewhere
// Teleport or go somewhere
public
PacketPlayerEnterSceneNotify
(
Genshin
Player
player
,
Genshin
Player
target
,
EnterType
type
,
EnterReason
reason
,
int
newScene
,
Position
newPos
)
{
public
PacketPlayerEnterSceneNotify
(
Player
player
,
Player
target
,
EnterType
type
,
EnterReason
reason
,
int
newScene
,
Position
newPos
)
{
super
(
PacketOpcodes
.
PlayerEnterSceneNotify
);
super
(
PacketOpcodes
.
PlayerEnterSceneNotify
);
player
.
setEnterSceneToken
(
Utils
.
randomRange
(
1000
,
99999
));
player
.
setEnterSceneToken
(
Utils
.
randomRange
(
1000
,
99999
));
...
@@ -62,8 +62,8 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
...
@@ -62,8 +62,8 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
addSceneTagIdList
(
109
)
.
addSceneTagIdList
(
109
)
.
addSceneTagIdList
(
113
)
.
addSceneTagIdList
(
113
)
.
addSceneTagIdList
(
117
)
.
addSceneTagIdList
(
117
)
.
set
Unk1
(
1
)
.
set
WorldType
(
1
)
.
set
Unk2
(
newScene
+
"-"
+
target
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
set
SceneTransaction
(
newScene
+
"-"
+
target
.
getUid
()
+
"-"
+
(
int
)
(
System
.
currentTimeMillis
()
/
1000
)
+
"-"
+
18402
)
.
build
();
.
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerGameTimeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
World
;
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.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNotify
;
import
emu.grasscutter.net.proto.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNotify
;
public
class
PacketPlayerGameTimeNotify
extends
Genshin
Packet
{
public
class
PacketPlayerGameTimeNotify
extends
Base
Packet
{
public
PacketPlayerGameTimeNotify
(
Genshin
Player
player
)
{
public
PacketPlayerGameTimeNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerGameTimeNotify
);
super
(
PacketOpcodes
.
PlayerGameTimeNotify
);
PlayerGameTimeNotify
proto
=
PlayerGameTimeNotify
.
newBuilder
()
PlayerGameTimeNotify
proto
=
PlayerGameTimeNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerGetForceQuitBanInfoRsp.java
View file @
01b190bc
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.PlayerGetForceQuitBanInfoRspOuterClass.PlayerGetForceQuitBanInfoRsp
;
import
emu.grasscutter.net.proto.PlayerGetForceQuitBanInfoRspOuterClass.PlayerGetForceQuitBanInfoRsp
;
public
class
PacketPlayerGetForceQuitBanInfoRsp
extends
Genshin
Packet
{
public
class
PacketPlayerGetForceQuitBanInfoRsp
extends
Base
Packet
{
public
PacketPlayerGetForceQuitBanInfoRsp
(
int
retcode
)
{
public
PacketPlayerGetForceQuitBanInfoRsp
(
int
retcode
)
{
super
(
PacketOpcodes
.
PlayerGetForceQuitBanInfoRsp
);
super
(
PacketOpcodes
.
PlayerGetForceQuitBanInfoRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLevelRewardUpdateNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
java.util.Set
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerLevelRewardUpdateNotifyOuterClass.PlayerLevelRewardUpdateNotify
;
public
class
PacketPlayerLevelRewardUpdateNotify
extends
BasePacket
{
public
PacketPlayerLevelRewardUpdateNotify
(
Set
<
Integer
>
rewardedLevels
)
{
super
(
PacketOpcodes
.
PlayerLevelRewardUpdateNotify
);
PlayerLevelRewardUpdateNotify
.
Builder
proto
=
PlayerLevelRewardUpdateNotify
.
newBuilder
();
for
(
Integer
level
:
rewardedLevels
)
{
proto
.
addLevelList
(
level
);
}
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java
View file @
01b190bc
...
@@ -2,7 +2,9 @@ package emu.grasscutter.server.packet.send;
...
@@ -2,7 +2,9 @@ package emu.grasscutter.server.packet.send;
import
com.google.protobuf.ByteString
;
import
com.google.protobuf.ByteString
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.Grasscutter.ServerDebugMode
;
import
emu.grasscutter.Grasscutter.ServerRunMode
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerLoginRspOuterClass.PlayerLoginRsp
;
import
emu.grasscutter.net.proto.PlayerLoginRspOuterClass.PlayerLoginRsp
;
import
emu.grasscutter.net.proto.QueryCurrRegionHttpRspOuterClass
;
import
emu.grasscutter.net.proto.QueryCurrRegionHttpRspOuterClass
;
...
@@ -14,7 +16,7 @@ import java.io.File;
...
@@ -14,7 +16,7 @@ import java.io.File;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.Base64
;
import
java.util.Base64
;
public
class
PacketPlayerLoginRsp
extends
Genshin
Packet
{
public
class
PacketPlayerLoginRsp
extends
Base
Packet
{
private
static
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
regionCache
;
private
static
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
regionCache
;
...
@@ -25,7 +27,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
...
@@ -25,7 +27,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
RegionInfo
info
;
RegionInfo
info
;
if
(
Grasscutter
.
getConfig
().
RunMode
.
equalsIgnoreCase
(
"
GAME_ONLY
"
)
)
{
if
(
Grasscutter
.
getConfig
().
RunMode
==
ServerRunMode
.
GAME_ONLY
)
{
if
(
regionCache
==
null
)
{
if
(
regionCache
==
null
)
{
try
{
try
{
File
file
=
new
File
(
Grasscutter
.
getConfig
().
DATA_FOLDER
+
"query_cur_region.txt"
);
File
file
=
new
File
(
Grasscutter
.
getConfig
().
DATA_FOLDER
+
"query_cur_region.txt"
);
...
@@ -40,8 +42,8 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
...
@@ -40,8 +42,8 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
regionQuery
=
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
.
parseFrom
(
decodedCurRegion
);
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
regionQuery
=
QueryCurrRegionHttpRspOuterClass
.
QueryCurrRegionHttpRsp
.
parseFrom
(
decodedCurRegion
);
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
set
Gateserver
Ip
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
set
Port
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
set
GateserverPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
.
build
();
...
@@ -64,7 +66,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
...
@@ -64,7 +66,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
.
setClientSilenceDataVersion
(
info
.
getClientSilenceDataVersion
())
.
setClientSilenceDataVersion
(
info
.
getClientSilenceDataVersion
())
.
setClientMd5
(
info
.
getClientDataMd5
())
.
setClientMd5
(
info
.
getClientDataMd5
())
.
setClientSilenceMd5
(
info
.
getClientSilenceDataMd5
())
.
setClientSilenceMd5
(
info
.
getClientSilenceDataMd5
())
.
setResVersionConfig
(
info
.
getConfig
())
.
setResVersionConfig
(
info
.
get
ResVersion
Config
())
.
setClientVersionSuffix
(
info
.
getClientVersionSuffix
())
.
setClientVersionSuffix
(
info
.
getClientVersionSuffix
())
.
setClientSilenceVersionSuffix
(
info
.
getClientSilenceVersionSuffix
())
.
setClientSilenceVersionSuffix
(
info
.
getClientSilenceVersionSuffix
())
.
setIsScOpen
(
false
)
.
setIsScOpen
(
false
)
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerPropNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.props.PlayerProperty
;
import
emu.grasscutter.game.props.PlayerProperty
;
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.PlayerPropNotifyOuterClass.PlayerPropNotify
;
import
emu.grasscutter.net.proto.PlayerPropNotifyOuterClass.PlayerPropNotify
;
import
emu.grasscutter.utils.ProtoHelper
;
import
emu.grasscutter.utils.ProtoHelper
;
public
class
PacketPlayerPropNotify
extends
Genshin
Packet
{
public
class
PacketPlayerPropNotify
extends
Base
Packet
{
public
PacketPlayerPropNotify
(
Genshin
Player
player
,
PlayerProperty
prop
)
{
public
PacketPlayerPropNotify
(
Player
player
,
PlayerProperty
prop
)
{
super
(
PacketOpcodes
.
PlayerPropNotify
);
super
(
PacketOpcodes
.
PlayerPropNotify
);
this
.
buildHeader
(
0
);
this
.
buildHeader
(
0
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerSetPauseRsp.java
View file @
01b190bc
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
PacketPlayerSetPauseRsp
extends
Genshin
Packet
{
public
class
PacketPlayerSetPauseRsp
extends
Base
Packet
{
public
PacketPlayerSetPauseRsp
(
int
clientSequence
)
{
public
PacketPlayerSetPauseRsp
(
int
clientSequence
)
{
super
(
PacketOpcodes
.
PlayerSetPauseRsp
);
super
(
PacketOpcodes
.
PlayerSetPauseRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.G
enshin
Constants
;
import
emu.grasscutter.G
ame
Constants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.
GenshinPlayer
;
import
emu.grasscutter.game.
inventory.GameItem
;
import
emu.grasscutter.game.
inventory.GenshinItem
;
import
emu.grasscutter.game.
player.Player
;
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.ItemOuterClass.Item
;
import
emu.grasscutter.net.proto.ItemOuterClass.Item
;
import
emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify
;
import
emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify
;
import
emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType
;
import
emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType
;
public
class
PacketPlayerStoreNotify
extends
Genshin
Packet
{
public
class
PacketPlayerStoreNotify
extends
Base
Packet
{
public
PacketPlayerStoreNotify
(
Genshin
Player
player
)
{
public
PacketPlayerStoreNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerStoreNotify
);
super
(
PacketOpcodes
.
PlayerStoreNotify
);
this
.
buildHeader
(
2
);
this
.
buildHeader
(
2
);
PlayerStoreNotify
.
Builder
p
=
PlayerStoreNotify
.
newBuilder
()
PlayerStoreNotify
.
Builder
p
=
PlayerStoreNotify
.
newBuilder
()
.
setStoreType
(
StoreType
.
S
torePack
)
.
setStoreType
(
StoreType
.
S
TORE_PACK
)
.
setWeightLimit
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
InventoryLimitAll
);
.
setWeightLimit
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
InventoryLimitAll
);
for
(
G
enshin
Item
item
:
player
.
getInventory
())
{
for
(
G
ame
Item
item
:
player
.
getInventory
())
{
Item
itemProto
=
item
.
toProto
();
Item
itemProto
=
item
.
toProto
();
p
.
addItemList
(
itemProto
);
p
.
addItemList
(
itemProto
);
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerTimeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.PlayerTimeNotifyOuterClass.PlayerTimeNotify
;
import
emu.grasscutter.net.proto.PlayerTimeNotifyOuterClass.PlayerTimeNotify
;
public
class
PacketPlayerTimeNotify
extends
Genshin
Packet
{
public
class
PacketPlayerTimeNotify
extends
Base
Packet
{
public
PacketPlayerTimeNotify
(
Genshin
Player
player
)
{
public
PacketPlayerTimeNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
PlayerTimeNotify
);
super
(
PacketOpcodes
.
PlayerTimeNotify
);
PlayerTimeNotify
proto
=
PlayerTimeNotify
.
newBuilder
()
PlayerTimeNotify
proto
=
PlayerTimeNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPostEnterSceneRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
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.PostEnterSceneRspOuterClass.PostEnterSceneRsp
;
import
emu.grasscutter.net.proto.PostEnterSceneRspOuterClass.PostEnterSceneRsp
;
public
class
PacketPostEnterSceneRsp
extends
Genshin
Packet
{
public
class
PacketPostEnterSceneRsp
extends
Base
Packet
{
public
PacketPostEnterSceneRsp
(
Genshin
Player
player
)
{
public
PacketPostEnterSceneRsp
(
Player
player
)
{
super
(
PacketOpcodes
.
PostEnterSceneRsp
);
super
(
PacketOpcodes
.
PostEnterSceneRsp
);
PostEnterSceneRsp
p
=
PostEnterSceneRsp
.
newBuilder
()
PostEnterSceneRsp
p
=
PostEnterSceneRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPrivateChatNotify.java
View file @
01b190bc
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.ChatInfoOuterClass.ChatInfo
;
import
emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo
;
import
emu.grasscutter.net.proto.PrivateChatNotifyOuterClass.PrivateChatNotify
;
import
emu.grasscutter.net.proto.PrivateChatNotifyOuterClass.PrivateChatNotify
;
public
class
PacketPrivateChatNotify
extends
Genshin
Packet
{
public
class
PacketPrivateChatNotify
extends
Base
Packet
{
public
PacketPrivateChatNotify
(
int
senderId
,
int
recvId
,
String
message
)
{
public
PacketPrivateChatNotify
(
int
senderId
,
int
recvId
,
String
message
)
{
super
(
PacketOpcodes
.
PrivateChatNotify
);
super
(
PacketOpcodes
.
PrivateChatNotify
);
...
...
Prev
1
…
17
18
19
20
21
22
23
24
25
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