public class DefaultNetProtocol extends SMYLDObject implements NetProtocol
| Modifier and Type | Field and Description |
|---|---|
protected HashMap<String,NetCommand> |
commands |
static String |
MSG_CMD_CLOSE |
static String |
MSG_CMD_CLOSE_DESC |
static String |
MSG_CMD_HELP |
static String |
MSG_CMD_HELP_ANS |
static String |
MSG_CMD_HELP_DESC |
static String |
MSG_CMD_UNKNOWN_ANS |
static String |
MSG_NEW_LINE |
static String |
MSG_OVER_CONNECTION |
static String |
MSG_WELCOME |
NEW_LINE, OS_NEW_LINE| Constructor and Description |
|---|
DefaultNetProtocol() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCommand(NetCommand newCommand) |
void |
answerToClient(String clientKey,
String answerText,
HashMap<String,ClientNode> clients) |
protected String |
getCommand(String incomingText) |
String |
getConnectionNoOver() |
String |
getHelp() |
String |
getWelcomeMessage() |
protected void |
init() |
void |
processMessage(ClientNode sourceNode,
String incomingMessage) |
debug, getLenName, insertInstanceValue, printInstanceValues, toStringprotected HashMap<String,NetCommand> commands
public static final String MSG_NEW_LINE
public static final String MSG_WELCOME
public static final String MSG_OVER_CONNECTION
public static final String MSG_CMD_UNKNOWN_ANS
public static final String MSG_CMD_HELP
public static final String MSG_CMD_HELP_DESC
public static final String MSG_CMD_HELP_ANS
public static final String MSG_CMD_CLOSE
public static final String MSG_CMD_CLOSE_DESC
protected void init()
protected void addCommand(NetCommand newCommand)
public String getHelp()
public String getWelcomeMessage()
getWelcomeMessage in interface NetProtocolpublic String getConnectionNoOver()
getConnectionNoOver in interface NetProtocolpublic void processMessage(ClientNode sourceNode, String incomingMessage)
processMessage in interface NetProtocolpublic void answerToClient(String clientKey, String answerText, HashMap<String,ClientNode> clients)
Copyright © 2019 SMYLD. All rights reserved.