mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Added sending broadcast message to all users on server from Admin Console.
This commit is contained in:
parent
8536d9d78d
commit
bdb2754847
10 changed files with 114 additions and 33 deletions
|
|
@ -1,8 +0,0 @@
|
|||
#default levels
|
||||
log4j.rootLogger=debug, console
|
||||
|
||||
#console log
|
||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
|
||||
log4j.appender.console.Threshold=debug
|
||||
|
|
@ -28,16 +28,17 @@
|
|||
|
||||
package mage.interfaces;
|
||||
|
||||
import mage.game.match.MatchOptions;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageException;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.game.GameException;
|
||||
import mage.game.match.MatchOptions;
|
||||
import mage.game.tournament.TournamentOptions;
|
||||
import mage.utils.MageVersion;
|
||||
import mage.view.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -120,6 +121,7 @@ public interface MageServer {
|
|||
public List<UserView> getUsers(String sessionId) throws MageException;
|
||||
public void disconnectUser(String sessionId, String userSessionId) throws MageException;
|
||||
public void removeTable(String sessionId, UUID tableId) throws MageException;
|
||||
public void sendBroadcastMessage(String sessionId, String message) throws MageException;
|
||||
|
||||
// messages of the day
|
||||
public Object getServerMessagesCompressed(String sessionId) throws MageException;
|
||||
|
|
|
|||
|
|
@ -573,6 +573,20 @@ public class Session {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean sendBroadcastMessage(String message) {
|
||||
try {
|
||||
if (isConnected()) {
|
||||
server.sendBroadcastMessage(sessionId, message);
|
||||
return true;
|
||||
}
|
||||
} catch (MageException ex) {
|
||||
handleMageException(ex);
|
||||
} catch (Throwable t) {
|
||||
handleThrowable(t);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean joinGame(UUID gameId) {
|
||||
try {
|
||||
if (isConnected()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue