Removed custom remote who packet.

This commit is contained in:
MobiusDevelopment 2019-07-31 06:45:33 +00:00
parent 96de9c7ab0
commit 1bfea0f2ae
4 changed files with 2 additions and 181 deletions

View File

@ -81,14 +81,6 @@ BackupDays = 30
# Misc Server Settings
# ---------------------------------------------------------------------------
# Setting emulation off the kernel (package SendStatus)
RemoteWhoLog = True
RemoteWhoSendTrash = True
RemoteWhoMaxOnline = 329
RemoteOnlineIncrement = 50
RemoteWhoForceInc = 50
RemotePrivStoreFactor = 12
# Datapack root directory.
# Defaults to current directory from which the server is started unless the below line is uncommented.
# WARNING: <u><b><font color="red">If the specified path is invalid, it will lead to multiple errors!</font></b></u>

View File

@ -34,7 +34,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Random;
import java.util.logging.Logger;
import org.l2jmobius.commons.util.ClassMasterSettings;
@ -213,14 +212,6 @@ public final class Config
public static String BACKUP_PATH;
public static int BACKUP_DAYS;
public static boolean RESERVE_HOST_ON_LOGIN = false;
public static boolean RWHO_LOG;
public static int RWHO_FORCE_INC;
public static int RWHO_KEEP_STAT;
public static int RWHO_MAX_ONLINE;
public static boolean RWHO_SEND_TRASH;
public static int RWHO_ONLINE_INCREMENT;
public static float RWHO_PRIV_STORE_FACTOR;
public static int RWHO_ARRAY[] = new int[13];
public static boolean IS_TELNET_ENABLED;
@ -1358,37 +1349,6 @@ public final class Config
DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
SCRIPT_ROOT = new File(serverSettings.getProperty("ScriptRoot", "./data/scripts").replaceAll("\\\\", "/")).getCanonicalFile();
final Random ppc = new Random();
int z = ppc.nextInt(6);
if (z == 0)
{
z += 2;
}
for (int x = 0; x < 8; x++)
{
if (x == 4)
{
RWHO_ARRAY[x] = 44;
}
else
{
RWHO_ARRAY[x] = 51 + ppc.nextInt(z);
}
}
RWHO_ARRAY[11] = 37265 + ppc.nextInt((z * 2) + 3);
RWHO_ARRAY[8] = 51 + ppc.nextInt(z);
z = 36224 + ppc.nextInt(z * 2);
RWHO_ARRAY[9] = z;
RWHO_ARRAY[10] = z;
RWHO_ARRAY[12] = 1;
RWHO_LOG = Boolean.parseBoolean(serverSettings.getProperty("RemoteWhoLog", "false"));
RWHO_SEND_TRASH = Boolean.parseBoolean(serverSettings.getProperty("RemoteWhoSendTrash", "false"));
RWHO_MAX_ONLINE = Integer.parseInt(serverSettings.getProperty("RemoteWhoMaxOnline", "0"));
RWHO_KEEP_STAT = Integer.parseInt(serverSettings.getProperty("RemoteOnlineKeepStat", "5"));
RWHO_ONLINE_INCREMENT = Integer.parseInt(serverSettings.getProperty("RemoteOnlineIncrement", "0"));
RWHO_PRIV_STORE_FACTOR = Float.parseFloat(serverSettings.getProperty("RemotePrivStoreFactor", "0"));
RWHO_FORCE_INC = Integer.parseInt(serverSettings.getProperty("RemoteWhoForceInc", "0"));
}
catch (Exception e)
{

View File

@ -21,7 +21,6 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
import org.l2jmobius.gameserver.network.serverpackets.KeyPacket;
import org.l2jmobius.gameserver.network.serverpackets.SendStatus;
public final class ProtocolVersion extends GameClientPacket
{
@ -37,21 +36,7 @@ public final class ProtocolVersion extends GameClientPacket
@Override
protected void runImpl()
{
// this packet is never encrypted
if ((_version == 65534) || (_version == -2)) // Ping
{
getClient().close((GameServerPacket) null);
}
else if ((_version == 65533) || (_version == -3)) // RWHO
{
if (Config.RWHO_LOG)
{
LOGGER.info(getClient() + " RWHO received");
}
getClient().close(new SendStatus());
}
else if ((_version < Config.MIN_PROTOCOL_REVISION) || (_version > Config.MAX_PROTOCOL_REVISION))
if ((_version < Config.MIN_PROTOCOL_REVISION) || (_version > Config.MAX_PROTOCOL_REVISION))
{
LOGGER.info("Client: " + getClient() + " -> Protocol Revision: " + _version + " is invalid. Minimum is " + Config.MIN_PROTOCOL_REVISION + " and Maximum is " + Config.MAX_PROTOCOL_REVISION + " are supported. Closing connection.");
LOGGER.warning("Wrong Protocol Version " + _version);
@ -59,8 +44,7 @@ public final class ProtocolVersion extends GameClientPacket
}
else
{
final KeyPacket pk = new KeyPacket(getClient().enableCrypt());
getClient().sendPacket(pk);
getClient().sendPacket(new KeyPacket(getClient().enableCrypt()));
}
}
}

View File

@ -1,115 +0,0 @@
/*
* 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 org.l2jmobius.gameserver.network.serverpackets;
import java.util.Random;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.World;
public final class SendStatus extends GameServerPacket
{
private int online_players = 0;
private int max_online = 0;
private int online_priv_store = 0;
private float priv_store_factor = 0;
@Override
public void runImpl()
{
}
@Override
protected final void writeImpl()
{
final Random ppc = new Random();
online_players = World.getAllPlayersCount() + Config.RWHO_ONLINE_INCREMENT;
if (online_players > Config.RWHO_MAX_ONLINE)
{
Config.RWHO_MAX_ONLINE = online_players;
}
max_online = Config.RWHO_MAX_ONLINE;
priv_store_factor = Config.RWHO_PRIV_STORE_FACTOR;
online_players = World.getAllPlayersCount() + ((World.getAllPlayersCount() * Config.RWHO_ONLINE_INCREMENT) / 100) + Config.RWHO_FORCE_INC;
online_priv_store = (int) ((online_players * priv_store_factor) / 100);
writeC(0x00); // Packet ID
writeD(0x01); // World ID
writeD(max_online); // Max Online
writeD(online_players); // Current Online
writeD(online_players); // Current Online
writeD(online_priv_store); // Priv.Sotre Chars
// SEND TRASH
if (Config.RWHO_SEND_TRASH)
{
writeH(0x30);
writeH(0x2C);
writeH(0x36);
writeH(0x2C);
if (Config.RWHO_ARRAY[12] == Config.RWHO_KEEP_STAT)
{
int z;
z = ppc.nextInt(6);
if (z == 0)
{
z += 2;
}
for (int x = 0; x < 8; x++)
{
if (x == 4)
{
Config.RWHO_ARRAY[x] = 44;
}
else
{
Config.RWHO_ARRAY[x] = 51 + ppc.nextInt(z);
}
}
Config.RWHO_ARRAY[11] = 37265 + ppc.nextInt((z * 2) + 3);
Config.RWHO_ARRAY[8] = 51 + ppc.nextInt(z);
z = 36224 + ppc.nextInt(z * 2);
Config.RWHO_ARRAY[9] = z;
Config.RWHO_ARRAY[10] = z;
Config.RWHO_ARRAY[12] = 1;
}
for (int z = 0; z < 8; z++)
{
if (z == 3)
{
Config.RWHO_ARRAY[z] -= 1;
}
writeH(Config.RWHO_ARRAY[z]);
}
writeD(Config.RWHO_ARRAY[8]);
writeD(Config.RWHO_ARRAY[9]);
writeD(Config.RWHO_ARRAY[10]);
writeD(Config.RWHO_ARRAY[11]);
Config.RWHO_ARRAY[12]++;
writeD(0x00);
writeD(0x02);
}
}
}