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
c4de0304
Commit
c4de0304
authored
Apr 25, 2022
by
Benjamin Elsdon
Browse files
Added ChangeMailStarNotify (change importance level)
parent
8d427f23
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMailStarNotify.java
0 → 100644
View file @
c4de0304
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.Mail
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ChangeMailStarNotifyOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketMailChangeNotify
;
import
java.util.ArrayList
;
import
java.util.List
;
@Opcodes
(
PacketOpcodes
.
ChangeMailStarNotify
)
public
class
HandlerChangeMailStarNotify
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
ChangeMailStarNotifyOuterClass
.
ChangeMailStarNotify
req
=
ChangeMailStarNotifyOuterClass
.
ChangeMailStarNotify
.
parseFrom
(
payload
);
List
<
Mail
>
updatedMail
=
new
ArrayList
<>();
for
(
int
mailId
:
req
.
getMailIdListList
())
{
Mail
message
=
session
.
getPlayer
().
getMailById
(
mailId
);
int
messageIndex
=
session
.
getPlayer
().
getMailIndex
(
message
);
message
.
importance
=
req
.
getIsStar
()
==
true
?
1
:
0
;
session
.
getPlayer
().
replaceMailByIndex
(
messageIndex
,
message
);
updatedMail
.
add
(
message
);
}
session
.
send
(
new
PacketMailChangeNotify
(
session
.
getPlayer
(),
updatedMail
));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerGetAllMailReq.java
View file @
c4de0304
...
...
@@ -18,5 +18,4 @@ public class HandlerGetAllMailReq extends PacketHandler {
GetAllMailReqOuterClass
.
GetAllMailReq
req
=
GetAllMailReqOuterClass
.
GetAllMailReq
.
parseFrom
(
payload
);
session
.
send
(
new
PacketGetAllMailRsp
(
session
.
getPlayer
(),
req
.
getIsGiftMail
()));
}
}
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