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
97779fd3
Commit
97779fd3
authored
Aug 16, 2022
by
AnimeGitB
Committed by
Luke H-W
Aug 16, 2022
Browse files
Fix deprecated chat references
parent
c115fe1a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/player/Player.java
View file @
97779fd3
...
@@ -798,7 +798,7 @@ public class Player {
...
@@ -798,7 +798,7 @@ public class Player {
return
;
return
;
}
}
this
.
getServer
().
getChat
Manager
().
sendPrivateMessageFromServer
(
getUid
(),
message
.
toString
());
this
.
getServer
().
getChat
System
().
sendPrivateMessageFromServer
(
getUid
(),
message
.
toString
());
// this.sendPacket(new PacketPrivateChatNotify(GameConstants.SERVER_CONSOLE_UID, getUid(), message.toString()));
// this.sendPacket(new PacketPrivateChatNotify(GameConstants.SERVER_CONSOLE_UID, getUid(), message.toString()));
}
}
...
@@ -810,7 +810,7 @@ public class Player {
...
@@ -810,7 +810,7 @@ public class Player {
*/
*/
public
void
sendMessage
(
Player
sender
,
Object
message
)
{
public
void
sendMessage
(
Player
sender
,
Object
message
)
{
// this.sendPacket(new PacketPrivateChatNotify(sender.getUid(), this.getUid(), message.toString()));
// this.sendPacket(new PacketPrivateChatNotify(sender.getUid(), this.getUid(), message.toString()));
this
.
getServer
().
getChat
Manager
().
sendPrivateMessage
(
sender
,
this
.
getUid
(),
message
.
toString
());
this
.
getServer
().
getChat
System
().
sendPrivateMessage
(
sender
,
this
.
getUid
(),
message
.
toString
());
}
}
// ---------------------MAIL------------------------
// ---------------------MAIL------------------------
...
@@ -1199,7 +1199,7 @@ public class Player {
...
@@ -1199,7 +1199,7 @@ public class Player {
this
.
hasSentLoginPackets
=
true
;
this
.
hasSentLoginPackets
=
true
;
// Send server welcome chat.
// Send server welcome chat.
this
.
getServer
().
getChat
Manager
().
sendServerWelcomeMessages
(
this
);
this
.
getServer
().
getChat
System
().
sendServerWelcomeMessages
(
this
);
// Set session state
// Set session state
session
.
setState
(
SessionState
.
ACTIVE
);
session
.
setState
(
SessionState
.
ACTIVE
);
...
@@ -1219,7 +1219,7 @@ public class Player {
...
@@ -1219,7 +1219,7 @@ public class Player {
public
void
onLogout
()
{
public
void
onLogout
()
{
try
{
try
{
// Clear chat history.
// Clear chat history.
this
.
getServer
().
getChat
Manager
().
clearHistoryOnLogout
(
this
);
this
.
getServer
().
getChat
System
().
clearHistoryOnLogout
(
this
);
// stop stamina calculation
// stop stamina calculation
getStaminaManager
().
stopSustainedStaminaHandler
();
getStaminaManager
().
stopSustainedStaminaHandler
();
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerChatReq.java
View file @
97779fd3
...
@@ -17,9 +17,9 @@ public class HandlerPlayerChatReq extends PacketHandler {
...
@@ -17,9 +17,9 @@ public class HandlerPlayerChatReq extends PacketHandler {
ChatInfo
.
ContentCase
content
=
req
.
getChatInfo
().
getContentCase
();
ChatInfo
.
ContentCase
content
=
req
.
getChatInfo
().
getContentCase
();
if
(
content
==
ChatInfo
.
ContentCase
.
TEXT
)
{
if
(
content
==
ChatInfo
.
ContentCase
.
TEXT
)
{
session
.
getServer
().
getChat
Manager
().
sendTeamMessage
(
session
.
getPlayer
(),
req
.
getChannelId
(),
req
.
getChatInfo
().
getText
());
session
.
getServer
().
getChat
System
().
sendTeamMessage
(
session
.
getPlayer
(),
req
.
getChannelId
(),
req
.
getChatInfo
().
getText
());
}
else
if
(
content
==
ChatInfo
.
ContentCase
.
ICON
)
{
}
else
if
(
content
==
ChatInfo
.
ContentCase
.
ICON
)
{
session
.
getServer
().
getChat
Manager
().
sendTeamMessage
(
session
.
getPlayer
(),
req
.
getChannelId
(),
req
.
getChatInfo
().
getIcon
());
session
.
getServer
().
getChat
System
().
sendTeamMessage
(
session
.
getPlayer
(),
req
.
getChannelId
(),
req
.
getChatInfo
().
getIcon
());
}
}
session
.
send
(
new
PacketPlayerChatRsp
());
session
.
send
(
new
PacketPlayerChatRsp
());
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerPrivateChatReq.java
View file @
97779fd3
...
@@ -15,9 +15,9 @@ public class HandlerPrivateChatReq extends PacketHandler {
...
@@ -15,9 +15,9 @@ public class HandlerPrivateChatReq extends PacketHandler {
PrivateChatReq
.
ContentCase
content
=
req
.
getContentCase
();
PrivateChatReq
.
ContentCase
content
=
req
.
getContentCase
();
if
(
content
==
PrivateChatReq
.
ContentCase
.
TEXT
)
{
if
(
content
==
PrivateChatReq
.
ContentCase
.
TEXT
)
{
session
.
getServer
().
getChat
Manager
().
sendPrivateMessage
(
session
.
getPlayer
(),
req
.
getTargetUid
(),
req
.
getText
());
session
.
getServer
().
getChat
System
().
sendPrivateMessage
(
session
.
getPlayer
(),
req
.
getTargetUid
(),
req
.
getText
());
}
else
if
(
content
==
PrivateChatReq
.
ContentCase
.
ICON
)
{
}
else
if
(
content
==
PrivateChatReq
.
ContentCase
.
ICON
)
{
session
.
getServer
().
getChat
Manager
().
sendPrivateMessage
(
session
.
getPlayer
(),
req
.
getTargetUid
(),
req
.
getIcon
());
session
.
getServer
().
getChat
System
().
sendPrivateMessage
(
session
.
getPlayer
(),
req
.
getTargetUid
(),
req
.
getIcon
());
}
}
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerPullPrivateChatReq.java
View file @
97779fd3
...
@@ -14,7 +14,7 @@ public class HandlerPullPrivateChatReq extends PacketHandler {
...
@@ -14,7 +14,7 @@ public class HandlerPullPrivateChatReq extends PacketHandler {
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
PullPrivateChatReq
req
=
PullPrivateChatReq
.
parseFrom
(
payload
);
PullPrivateChatReq
req
=
PullPrivateChatReq
.
parseFrom
(
payload
);
session
.
getServer
().
getChat
Manager
().
handlePullPrivateChatReq
(
session
.
getPlayer
(),
req
.
getTargetUid
());
session
.
getServer
().
getChat
System
().
handlePullPrivateChatReq
(
session
.
getPlayer
(),
req
.
getTargetUid
());
// session.send(new PacketPullPrivateChatRsp(req.getTargetUid()));
// session.send(new PacketPullPrivateChatRsp(req.getTargetUid()));
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerPullRecentChatReq.java
View file @
97779fd3
...
@@ -10,6 +10,6 @@ import emu.grasscutter.server.packet.send.PacketPullRecentChatRsp;
...
@@ -10,6 +10,6 @@ import emu.grasscutter.server.packet.send.PacketPullRecentChatRsp;
public
class
HandlerPullRecentChatReq
extends
PacketHandler
{
public
class
HandlerPullRecentChatReq
extends
PacketHandler
{
@Override
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
session
.
getServer
().
getChat
Manager
().
handlePullRecentChatReq
(
session
.
getPlayer
());
session
.
getServer
().
getChat
System
().
handlePullRecentChatReq
(
session
.
getPlayer
());
}
}
}
}
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