Package net.sf.colossus.webserver
Class ChatChannel
- java.lang.Object
-
- net.sf.colossus.webserver.ChatChannel
-
public class ChatChannel extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]chatHelpprivate java.lang.StringchatIdprivate java.io.PrintWriterchatLogprivate static java.lang.String[]contactHelpprivate static java.lang.Stringdoubledashesprivate static java.util.logging.LoggerLOGGERprivate static java.lang.String[]pingHelpprivate ChatMsgStoragestorageprivate UserDBuserDBprivate FormatWhenwhenFormatter
-
Constructor Summary
Constructors Constructor Description ChatChannel(java.lang.String id, WebServerOptions options, UserDB userDB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendToChatlog(ChatMessage msg)voidcreateStoreAndDeliverMessage(java.lang.String sender, java.lang.String message)voidcreateWelcomeMessage()private voiddeliverMessage(ChatMessage msg, UserDB userDB)voiddeliverMessageOfTheDayToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines)Send message of the day lines to one client.private voiddeliverMessageToClient(ChatMessage msg, IWebClient client, boolean isResent)voiddeliverOldVersionWarning(java.lang.String chatId, java.lang.String userName, IWebClient client)Send message of the day lines to one client.voiddispose()java.lang.StringgetChannelId()voidhandleShowInfo(IWebClient client, User user)voidhandleUnknownCommand(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)private java.lang.StringonlineTimeFromSeconds(long totalsecs)private java.io.PrintWriteropenLogForAppend(WebServerOptions options)voidsendHelpToClient(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)voidsendLinesToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines, boolean spacer, java.lang.String sender)Send an arraylist full of lines to one client.voidshowContactHelp(java.lang.String chatId, IWebClient client)voidtellLastMessagesToOne(IWebClient client)
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
userDB
private final UserDB userDB
-
chatId
private final java.lang.String chatId
-
storage
private final ChatMsgStorage storage
-
chatLog
private final java.io.PrintWriter chatLog
-
whenFormatter
private final FormatWhen whenFormatter
-
doubledashes
private static final java.lang.String doubledashes
- See Also:
- Constant Field Values
-
chatHelp
private static final java.lang.String[] chatHelp
-
pingHelp
private static final java.lang.String[] pingHelp
-
contactHelp
private static final java.lang.String[] contactHelp
-
-
Constructor Detail
-
ChatChannel
public ChatChannel(java.lang.String id, WebServerOptions options, UserDB userDB)
-
-
Method Detail
-
getChannelId
public java.lang.String getChannelId()
-
dispose
public void dispose()
-
createWelcomeMessage
public void createWelcomeMessage()
-
deliverMessageOfTheDayToClient
public void deliverMessageOfTheDayToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines)Send message of the day lines to one client.
-
handleUnknownCommand
public void handleUnknownCommand(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)
-
sendHelpToClient
public void sendHelpToClient(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)
-
showContactHelp
public void showContactHelp(java.lang.String chatId, IWebClient client)- Parameters:
chatId- Id of the chatclient- WebClient connection who requested the contact help
-
sendLinesToClient
public void sendLinesToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines, boolean spacer, java.lang.String sender)Send an arraylist full of lines to one client.
-
handleShowInfo
public void handleShowInfo(IWebClient client, User user)
-
onlineTimeFromSeconds
private java.lang.String onlineTimeFromSeconds(long totalsecs)
-
deliverOldVersionWarning
public void deliverOldVersionWarning(java.lang.String chatId, java.lang.String userName, IWebClient client)Send message of the day lines to one client.
-
createStoreAndDeliverMessage
public void createStoreAndDeliverMessage(java.lang.String sender, java.lang.String message)
-
deliverMessage
private void deliverMessage(ChatMessage msg, UserDB userDB)
-
deliverMessageToClient
private void deliverMessageToClient(ChatMessage msg, IWebClient client, boolean isResent)
-
tellLastMessagesToOne
public void tellLastMessagesToOne(IWebClient client)
-
openLogForAppend
private java.io.PrintWriter openLogForAppend(WebServerOptions options)
-
appendToChatlog
private void appendToChatlog(ChatMessage msg)
-
-