Class CompositeClientBroadcaster
java.lang.Object
it.polimi.ingsw.gc14.Network.CompositeClientBroadcaster
Forwards every notification to both the RMI and the TCP transport layers.
This follows the Composite pattern: the caller interacts with a single broadcaster without knowing which protocols are active underneath.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompositeClientBroadcaster(RMIServer rmiServer, TCPServer tcpServer) Constructs a composite broadcaster backed by the given RMI and TCP servers. -
Method Summary
Modifier and TypeMethodDescriptionvoidForwards the model snapshot to every client on both transports.voidnotifyAll(NetworkEvent event) Forwards the event to both the RMI and the TCP server.
-
Field Details
-
rmiServer
RMI transport used to reach RMI-connected clients. -
tcpServer
TCP transport used to reach TCP-connected clients.
-
-
Constructor Details
-
CompositeClientBroadcaster
-
-
Method Details
-
notifyAll
Forwards the event to both the RMI and the TCP server. Each server is responsible for filtering error events to the requesting player only.- Parameters:
event- the network event to broadcast.
-
notifyAll
Forwards the model snapshot to every client on both transports.- Parameters:
model- the mini model snapshot to broadcast.
-