dispatch joins to the target room
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
package com.muwire.gui
|
package com.muwire.gui
|
||||||
|
|
||||||
|
import java.util.logging.Level
|
||||||
|
|
||||||
import com.muwire.core.Core
|
import com.muwire.core.Core
|
||||||
import com.muwire.core.Persona
|
import com.muwire.core.Persona
|
||||||
|
import com.muwire.core.chat.ChatCommand
|
||||||
|
import com.muwire.core.chat.ChatAction
|
||||||
import com.muwire.core.chat.ChatConnectionAttemptStatus
|
import com.muwire.core.chat.ChatConnectionAttemptStatus
|
||||||
import com.muwire.core.chat.ChatConnectionEvent
|
import com.muwire.core.chat.ChatConnectionEvent
|
||||||
import com.muwire.core.chat.ChatLink
|
import com.muwire.core.chat.ChatLink
|
||||||
@@ -72,8 +76,19 @@ class ChatServerModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleChatMessage(ChatMessageEvent e) {
|
private void handleChatMessage(ChatMessageEvent e) {
|
||||||
log.info("dispatching to room ${e.room}")
|
ChatCommand chatCommand
|
||||||
mvcGroup.childrenGroups[e.room]?.controller?.handleChatMessage(e)
|
try {
|
||||||
|
chatCommand = new ChatCommand(e.payload)
|
||||||
|
} catch (Exception badCommand) {
|
||||||
|
log.log(Level.WARNING,"bad chat command",badCommand)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
String room = e.room
|
||||||
|
if (chatCommand.action == ChatAction.JOIN) {
|
||||||
|
room = chatCommand.payload
|
||||||
|
}
|
||||||
|
log.info("dispatching to room ${room}")
|
||||||
|
mvcGroup.childrenGroups[room]?.controller?.handleChatMessage(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleLeave(Persona p) {
|
private void handleLeave(Persona p) {
|
||||||
|
Reference in New Issue
Block a user