Addition of admin online command.
This commit is contained in:
parent
8f335f289e
commit
11411164f7
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -443,6 +444,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -444,6 +445,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -445,6 +446,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -445,6 +446,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -445,6 +446,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -445,6 +446,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -446,6 +447,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -419,6 +419,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -107,6 +107,7 @@ import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -446,6 +447,7 @@ public class MasterHandler
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -406,6 +406,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -102,6 +102,7 @@ import handlers.admincommandhandlers.AdminMenu;
|
||||
import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCondOverride;
|
||||
@ -402,6 +403,7 @@ public class MasterHandler
|
||||
AdminMessages.class,
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPetition.class,
|
||||
AdminPForge.class,
|
||||
|
115
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -406,6 +406,9 @@
|
||||
<!-- ADMIN MONSTER RACE -->
|
||||
<admin command="admin_mons" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -102,6 +102,7 @@ import handlers.admincommandhandlers.AdminMenu;
|
||||
import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminMonsterRace;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCondOverride;
|
||||
@ -403,6 +404,7 @@ public class MasterHandler
|
||||
AdminMessages.class,
|
||||
AdminMobGroup.class,
|
||||
AdminMonsterRace.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPetition.class,
|
||||
AdminPForge.class,
|
||||
|
115
L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -443,6 +444,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -443,6 +444,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -443,6 +444,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -443,6 +444,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -444,6 +445,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -444,6 +445,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
@ -416,6 +416,9 @@
|
||||
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
|
||||
<admin command="admin_mobgroup_invul" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN ONLINE -->
|
||||
<admin command="admin_online" accessLevel="100" />
|
||||
|
||||
<!-- ADMIN PATH NODE -->
|
||||
<admin command="admin_path_find" accessLevel="100" />
|
||||
|
||||
|
@ -106,6 +106,7 @@ import handlers.admincommandhandlers.AdminMessages;
|
||||
import handlers.admincommandhandlers.AdminMissingHtmls;
|
||||
import handlers.admincommandhandlers.AdminMobGroup;
|
||||
import handlers.admincommandhandlers.AdminOlympiad;
|
||||
import handlers.admincommandhandlers.AdminOnline;
|
||||
import handlers.admincommandhandlers.AdminPForge;
|
||||
import handlers.admincommandhandlers.AdminPathNode;
|
||||
import handlers.admincommandhandlers.AdminPcCafePoints;
|
||||
@ -444,6 +445,7 @@ public class MasterHandler
|
||||
AdminMissingHtmls.class,
|
||||
AdminMobGroup.class,
|
||||
AdminOlympiad.class,
|
||||
AdminOnline.class,
|
||||
AdminPathNode.class,
|
||||
AdminPcCafePoints.class,
|
||||
AdminPetition.class,
|
||||
|
115
L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
115
L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminOnline.java
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminOnline implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_online"
|
||||
};
|
||||
|
||||
protected static int state = -1;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equalsIgnoreCase("admin_online"))
|
||||
{
|
||||
final List<String> ips = new ArrayList<>();
|
||||
int total = 0;
|
||||
int online = 0;
|
||||
int offline = 0;
|
||||
int peace = 0;
|
||||
int notPeace = 0;
|
||||
int instanced = 0;
|
||||
int combat = 0;
|
||||
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final String ip = player.getIPAddress();
|
||||
if ((ip != null) && !ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
}
|
||||
|
||||
total++;
|
||||
|
||||
if (player.isOnline())
|
||||
{
|
||||
online++;
|
||||
}
|
||||
|
||||
if (player.isInOfflineMode())
|
||||
{
|
||||
offline++;
|
||||
}
|
||||
|
||||
if (player.isInsideZone(ZoneId.PEACE))
|
||||
{
|
||||
peace++;
|
||||
}
|
||||
else
|
||||
{
|
||||
notPeace++;
|
||||
}
|
||||
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
instanced++;
|
||||
}
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || (player.getPvpFlag() > 0) || player.isInsideZone(ZoneId.PVP) || player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
combat++;
|
||||
}
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Online Player Report");
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total count: " + total);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total online: " + online);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Total offline: " + offline);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
BuilderUtil.sendSysMessage(activeChar, "Unique IPs: " + ips.size());
|
||||
BuilderUtil.sendSysMessage(activeChar, "In peace zone: " + peace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Not in peace zone: " + notPeace);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In instances: " + instanced);
|
||||
BuilderUtil.sendSysMessage(activeChar, "In combat: " + combat);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user