net.jetrix.protocols
Class TspecProtocol
java.lang.Object
net.jetrix.protocols.AbstractProtocol
net.jetrix.protocols.TetrinetProtocol
net.jetrix.protocols.TspecProtocol
- All Implemented Interfaces:
- Protocol
public class TspecProtocol
- extends TetrinetProtocol
An abstract protocol to communicate with a client.
- Version:
- $Revision: 798 $, $Date: 2009-02-18 16:24:28 +0100 (Wed, 18 Feb 2009) $
- Author:
- Emmanuel Bourg
| Methods inherited from class net.jetrix.protocols.TetrinetProtocol |
applyStyle, decode, encode, getEOL, getStyles, stripStyle, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate |
TspecProtocol
public TspecProtocol()
getName
public String getName()
- Return the name of this protocol
- Specified by:
getName in interface Protocol- Overrides:
getName in class TetrinetProtocol
- Returns:
- the name of this protocol
getMessage
public Message getMessage(String line)
- Parse the specified string and return the corresponding server
message for this protocol.
- Specified by:
getMessage in interface Protocol- Overrides:
getMessage in class TetrinetProtocol
- Parameters:
line - the client message to parse
- Returns:
- the
Message equivalent of the specified
String or null if the protocol cannot understand the message.
translate
public String translate(Message m,
Locale locale)
- Translate the specified message into a string that will be sent
to a client using this protocol.
- Specified by:
translate in interface Protocol- Overrides:
translate in class TetrinetProtocol
- Parameters:
m - the message to translatelocale - the locale used for internationalized text messages
- Returns:
- the String equivalent in this protocol for the specified
Message or null if it can't be translated.
translate
public String translate(SpectatorListMessage m,
Locale locale)
- Overrides:
translate in class TetrinetProtocol
translate
public String translate(SmsgMessage m,
Locale locale)
- Overrides:
translate in class TetrinetProtocol
translate
public String translate(JoinMessage m,
Locale locale)
- Overrides:
translate in class TetrinetProtocol
translate
public String translate(LeaveMessage m,
Locale locale)
- Overrides:
translate in class TetrinetProtocol
Copyright © 2001-2010. All Rights Reserved.