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
05e13d81
Commit
05e13d81
authored
May 15, 2022
by
muhammadeko
Committed by
Melledy
May 14, 2022
Browse files
Modify chat manager to give plugin ability to change it
parent
7a66f228
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/managers/ChatManager.java
→
src/main/java/emu/grasscutter/game/managers/ChatManager
/ChatManager
.java
View file @
05e13d81
package
emu.grasscutter.game.managers
;
package
emu.grasscutter.game.managers
.ChatManager
;
import
emu.grasscutter.command.CommandMap
;
import
emu.grasscutter.game.player.Player
;
...
...
@@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketPrivateChatNotify;
import
java.util.Arrays
;
import
java.util.List
;
public
class
ChatManager
{
public
class
ChatManager
implements
ChatManagerHandler
{
static
final
List
<
Character
>
PREFIXES
=
Arrays
.
asList
(
'/'
,
'!'
);
private
final
GameServer
server
;
...
...
src/main/java/emu/grasscutter/game/managers/ChatManager/ChatManagerHandler.java
0 → 100644
View file @
05e13d81
package
emu.grasscutter.game.managers.ChatManager
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.server.game.GameServer
;
public
interface
ChatManagerHandler
{
GameServer
getServer
();
void
sendPrivateMessage
(
Player
player
,
int
targetUid
,
String
message
);
void
sendPrivateMessage
(
Player
player
,
int
targetUid
,
int
emote
);
void
sendTeamMessage
(
Player
player
,
int
channel
,
String
message
);
void
sendTeamMessage
(
Player
player
,
int
channel
,
int
icon
);
}
src/main/java/emu/grasscutter/server/game/GameServer.java
View file @
05e13d81
...
...
@@ -10,12 +10,12 @@ import emu.grasscutter.game.drop.DropManager;
import
emu.grasscutter.game.dungeons.DungeonManager
;
import
emu.grasscutter.game.expedition.ExpeditionManager
;
import
emu.grasscutter.game.gacha.GachaManager
;
import
emu.grasscutter.game.managers.ChatManager
;
import
emu.grasscutter.game.managers.ChatManager.ChatManager
;
import
emu.grasscutter.game.managers.ChatManager.ChatManagerHandler
;
import
emu.grasscutter.game.managers.InventoryManager
;
import
emu.grasscutter.game.managers.MultiplayerManager
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.quest.ServerQuestHandler
;
import
emu.grasscutter.game.quest.handlers.QuestBaseHandler
;
import
emu.grasscutter.game.shop.ShopManager
;
import
emu.grasscutter.game.tower.TowerScheduleManager
;
import
emu.grasscutter.game.world.World
;
...
...
@@ -44,7 +44,7 @@ public final class GameServer extends KcpServer {
private
final
Map
<
Integer
,
Player
>
players
;
private
final
Set
<
World
>
worlds
;
private
final
ChatManager
chatManager
;
private
ChatManager
Handler
chatManager
;
private
final
InventoryManager
inventoryManager
;
private
final
GachaManager
gachaManager
;
private
final
ShopManager
shopManager
;
...
...
@@ -107,9 +107,12 @@ public final class GameServer extends KcpServer {
return
worlds
;
}
public
ChatManager
getChatManager
()
{
public
ChatManager
Handler
getChatManager
()
{
return
chatManager
;
}
public
void
setChatManager
(
ChatManagerHandler
chatManager
)
{
this
.
chatManager
=
chatManager
;
}
public
InventoryManager
getInventoryManager
()
{
return
inventoryManager
;
...
...
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