📄 joinroom.java
字号:
/* * Copyright (c) 2000 Lyrisoft Solutions, Inc. * Used by permission */package com.lyrisoft.chat.server.remote.command;import com.lyrisoft.chat.Translator;import com.lyrisoft.chat.server.remote.ChatClient;import com.lyrisoft.chat.server.remote.ChatServer;import com.lyrisoft.chat.server.remote.RoomJoinException;import com.lyrisoft.chat.server.remote.IAuthenticator;public class JoinRoom implements ICommandProcessorRemote { public boolean process(ChatClient client, String[] args) { String room = null; try { if (args.length < 2) { client.generalError(getUsage(args[0])); } else if (args.length < 3) { client.getServer().joinRoom(client, args[1], null); return true; } else { client.getServer().joinRoom(client, args[1], args[2]); return true; } } catch (RoomJoinException e) { client.roomJoinError(e.getMessage(), args[1]); } return false; } public void processDistributed(String client, String origin, String[] args, ChatServer server) { if (args.length > 2) { server.remoteJoinRoom(origin, client, args[1], args[2]); } else { server.remoteJoinRoom(origin, client, args[1], null); } } public int accessRequired() { return IAuthenticator.USER; } public String getHelp() { return Translator.getMessage("help.join"); } public String getUsage(String myName) { return Translator.getMessage("usage2", myName, "<room to join> [<password>]"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -