com.cubeia.firebase.server.processor
Class Notifier

java.lang.Object
  extended by com.cubeia.firebase.server.processor.Notifier
All Implemented Interfaces:
GameNotifier

public class Notifier
extends java.lang.Object
implements GameNotifier


Constructor Summary
Notifier(FirebaseTable table, Sender<ClientEvent<?>> clientRouter, boolean useCommit)
           
 
Method Summary
 void broadcast(SystemMessageAction msg)
          Broadcast a message to the system.
 void commit()
           
 void notifyAllPlayers(java.util.Collection<? extends GameAction> actions)
          Notify all players with the supplied actions.
 void notifyAllPlayers(java.util.Collection<? extends GameAction> actions, boolean watchers)
          Notify all players with the supplied actions.
 void notifyAllPlayers(GameAction action)
          Notify all players and watchers with the supplied action.
 void notifyAllPlayers(GameAction action, boolean watchers)
          Notify all players with the supplied action.
 void notifyAllPlayersExceptOne(java.util.Collection<? extends GameAction> actions, int skip)
          Notify all players with the supplied actions.
 void notifyAllPlayersExceptOne(java.util.Collection<? extends GameAction> actions, int skip, boolean watchers)
          Notify all players with the supplied actions.
 void notifyAllPlayersExceptOne(GameAction action, int skip)
          Notify all players and watchers except the given one with the supplied action.
 void notifyAllPlayersExceptOne(GameAction action, int skip, boolean watchers)
          Notify all players except the given one with the supplied action.
 void notifyPlayer(int playerid, java.util.Collection<? extends GameAction> actions)
          Notify the given player with the supplied actions
 void notifyPlayer(int playerid, GameAction action)
          Notify the given player with the supplied action
 void sendToClient(int playerid, java.util.Collection<? extends GameAction> actions)
          Send multiple actions to the given player.
 void sendToClient(int playerid, GameAction action)
          Send the supplied action to the given player.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Notifier

public Notifier(FirebaseTable table,
                Sender<ClientEvent<?>> clientRouter,
                boolean useCommit)
Method Detail

commit

public void commit()

broadcast

public void broadcast(SystemMessageAction msg)
Description copied from interface: GameNotifier
Broadcast a message to the system. This will effectively send the message to all currently logged in players. Please use this method with extreme care.

Specified by:
broadcast in interface GameNotifier
Parameters:
msg - Message to send, must not be null

sendToClient

public void sendToClient(int playerid,
                         GameAction action)
Description copied from interface: GameNotifier

Send the supplied action to the given player. This sending method ignores current status of player at the table.

DO NOT use this method on player with status = TABLE_LOCAL.

Specified by:
sendToClient in interface GameNotifier

sendToClient

public void sendToClient(int playerid,
                         java.util.Collection<? extends GameAction> actions)
Description copied from interface: GameNotifier

Send multiple actions to the given player. This sending method ignores current status of player at the table.

DO NOT use this method on player with status = TABLE_LOCAL.

Specified by:
sendToClient in interface GameNotifier

notifyPlayer

public void notifyPlayer(int playerid,
                         GameAction action)
Description copied from interface: GameNotifier
Notify the given player with the supplied action

Specified by:
notifyPlayer in interface GameNotifier

notifyPlayer

public void notifyPlayer(int playerid,
                         java.util.Collection<? extends GameAction> actions)
Description copied from interface: GameNotifier

Notify the given player with the supplied actions

Specified by:
notifyPlayer in interface GameNotifier

notifyAllPlayers

public void notifyAllPlayers(GameAction action)
Description copied from interface: GameNotifier
Notify all players and watchers with the supplied action. All players in this case will be all players that will need the update. Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayers in interface GameNotifier

notifyAllPlayers

public void notifyAllPlayers(GameAction action,
                             boolean watchers)
Description copied from interface: GameNotifier
Notify all players with the supplied action. All players in this case will be all players that will need the update. Eg. at a poker table all players are all clients at the table as well as all observers. Watchers will be included if the watchers flag is set to true.

Specified by:
notifyAllPlayers in interface GameNotifier

notifyAllPlayers

public void notifyAllPlayers(java.util.Collection<? extends GameAction> actions)
Description copied from interface: GameNotifier

Notify all players with the supplied actions. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayers in interface GameNotifier

notifyAllPlayers

public void notifyAllPlayers(java.util.Collection<? extends GameAction> actions,
                             boolean watchers)
Description copied from interface: GameNotifier

Notify all players with the supplied actions. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayers in interface GameNotifier

notifyAllPlayersExceptOne

public void notifyAllPlayersExceptOne(GameAction action,
                                      int skip)
Description copied from interface: GameNotifier

Notify all players and watchers except the given one with the supplied action. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayersExceptOne in interface GameNotifier

notifyAllPlayersExceptOne

public void notifyAllPlayersExceptOne(GameAction action,
                                      int skip,
                                      boolean watchers)
Description copied from interface: GameNotifier

Notify all players except the given one with the supplied action. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Watchers will be included if the watchers flag is set to true.

Specified by:
notifyAllPlayersExceptOne in interface GameNotifier

notifyAllPlayersExceptOne

public void notifyAllPlayersExceptOne(java.util.Collection<? extends GameAction> actions,
                                      int skip)
Description copied from interface: GameNotifier

Notify all players with the supplied actions. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayersExceptOne in interface GameNotifier

notifyAllPlayersExceptOne

public void notifyAllPlayersExceptOne(java.util.Collection<? extends GameAction> actions,
                                      int skip,
                                      boolean watchers)
Description copied from interface: GameNotifier

Notify all players with the supplied actions. All players in this case will be all players that will need the update.

Eg. at a poker table all players are all clients at the table as well as all observers.

Specified by:
notifyAllPlayersExceptOne in interface GameNotifier


Copyright © 2011 Cubeia Ltd. All Rights Reserved.