forked from MagicBane/Server
DispatchManager is now an official manager singleton.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
package engine.net;
|
||||
|
||||
import engine.gameManager.DispatchManager;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -21,12 +22,11 @@ import java.util.regex.Pattern;
|
||||
// All outgoing Protocol messages to the player are managed through the MessageDispatcher.class.
|
||||
// All incoming Protocol messages from the player are managed by the Protocol.class.
|
||||
//
|
||||
// A DispatchMessage is configured (Protocol messsage) and wrapped in a Dispatch (distribution list).
|
||||
// A Dispatch can be submitted to the MessageDispatcher for delivery from any thread.
|
||||
// A Dispatch is configured wrapping a Protocol message and a distribution list is built.
|
||||
//
|
||||
// Dispatches are interleaved between channels. This is to ensure
|
||||
// a combat or movement message is not delayed by spam clicking a
|
||||
// larger message. Choose your channel wisely.
|
||||
// The system interleaves dispatches between two channels. This is to ensure that
|
||||
// a critical combat or movement message will not be delayed by spam clicking a larger
|
||||
// message with no temporal immediacy. Pick the correct channel will this in mind.
|
||||
|
||||
public class MessageDispatcher implements Runnable {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class MessageDispatcher implements Runnable {
|
||||
this.messageDispatch = _messageQueue[dispatchChannel.getChannelID()].poll();
|
||||
|
||||
if (this.messageDispatch != null) {
|
||||
DispatchMessage.serializeDispatch(this.messageDispatch);
|
||||
DispatchManager.serializeDispatch(this.messageDispatch);
|
||||
shouldBlock = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user