📄 c_who.java
字号:
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package l1j.server.server.clientpackets;
import java.util.logging.Logger;
import l1j.server.Config;
import l1j.server.server.ClientThread;
import l1j.server.server.model.L1World;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.gametime.L1GameRestart;
import l1j.server.server.serverpackets.S_WhoAmount;
import l1j.server.server.serverpackets.S_WhoCharinfo;
//伊川
import l1j.server.server.serverpackets.S_SystemMessage;
// Referenced classes of package l1j.server.server.clientpackets:
// ClientBasePacket
public class C_Who extends ClientBasePacket {
private static final String C_WHO = "[C] C_Who";
private static l1j.eric.EricLogger _log = l1j.eric.EricLogger.getLogger2(C_Who.class.getName());
public C_Who(byte[] decrypt, ClientThread client) {
super(decrypt);
String s = readS();
L1PcInstance find = L1World.getInstance().getPlayer(s);
L1PcInstance pc = client.getActiveChar();
if (find != null) {
S_WhoCharinfo s_whocharinfo = new S_WhoCharinfo(find);
pc.sendPackets(s_whocharinfo);
} else {
if (Config.ALT_WHO_COMMAND) {
String amount = String.valueOf(L1World.getInstance()
.getAllPlayers().size());
S_WhoAmount s_whoamount = new S_WhoAmount(amount);
pc.sendPackets(s_whoamount);
pc.sendPackets(new S_SystemMessage("現在位置:"+pc.getLocation().getMapId()+ " "+
pc.getLocation().getX()+" "+pc.getLocation().getY()));
pc.sendPackets(new S_SystemMessage("伺服器將於 " +L1GameRestart.getWillRestartTime()+" 分鐘後重新啟動"));
int i=1;
for (L1PcInstance pc1 : L1World.getInstance().getAllPlayers()) {
if (pc.isGm() == true) {
pc.sendPackets(new S_SystemMessage(i + ".玩家 [ " + pc1.getName() + " ] 所屬血盟:( " + pc1.getClanname() + " ) 等級: " + pc1.getLevel() + ""));
} else {
pc.sendPackets(new S_SystemMessage(i + ".玩家 [ " + pc1.getName() + " ] 所屬血盟:( " + pc1.getClanname() + " )"));
}
i++;
}
}
// 対象が居ない場合はメッセージ表示する?わかる方修正お願いします。
}
}
@Override
public String getType() {
return C_WHO;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -