Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 2173)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -325,6 +325,11 @@
/** How much adena receive characters who pick two or less of the winning number */
public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
+
+ public static int RWHO_MAX_ONLINE;
+ public static int RWHO_ONLINE_INCREMENT;
+ public static float RWHO_PRIV_STORE_FACTOR;
+
/** Minimum siz e of a party that may enter dimensional rift */
public static int RIFT_MIN_PARTY_SIZE;
@@ -350,6 +355,8 @@
public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
+
+
/* **************************************************************************
* GM CONFIG General GM AccessLevel *
************************************************************************* */
@@ -1209,6 +1216,10 @@
MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
+ RWHO_MAX_ONLINE = Integer.parseInt(serverSettings.getProperty("RemoteWhoMaxOnline", "0"));
+ RWHO_ONLINE_INCREMENT = Integer.parseInt(serverSettings.getProperty("RemoteOnlineIncrement", "0"));
+ RWHO_PRIV_STORE_FACTOR = Float.parseFloat(serverSettings.getProperty("RemotePrivStoreFactor", "0"));
+
if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
{
throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
Index: java/net/sf/l2j/gameserver/clientpackets/ProtocolVersion.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/ProtocolVersion.java (revision 2173)
+++ java/net/sf/l2j/gameserver/clientpackets/ProtocolVersion.java (working copy)
@@ -22,6 +22,7 @@
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.serverpackets.KeyPacket;
+import net.sf.l2j.gameserver.serverpackets.SendStatus;
/**
* This class ...
@@ -38,7 +39,7 @@
@Override protected void readImpl()
{
- _version = readD();
+ _version = readH();
}
@Override@@ -51,7 +52,14 @@
// this is just a ping attempt from the new C2 client
getClient().closeNow();
}
- else if (_version < Config.MIN_PROTOCOL_REVISION || _version > Config.MAX_PROTOCOL_REVISION)
+
+ if (_version == 65533)
+ {
+ _log.info(getClient().toString()+" RWHO received");
+ SendStatus s = new SendStatus();
+ getClient().close(s);
+ }
+ else if (_version < Config.MIN_PROTOCOL_REVISION || _version > Config.MAX_PROTOCOL_REVISION)
{
_log.info("Client: "+getClient().toString()+" -> Protocol Revision: " + _version + " is invalid. Minimum is "+Config.MIN_PROTOCOL_REVISION+" and Maximum is "+Config.MAX_PROTOCOL_REVISION+" are supported. Closing connection.");
_log.warning("Wrong Protocol Version "+_version);
@@ -63,7 +71,6 @@
{
_log.fine("Client Protocol Revision is ok: "+_version);
}
-
KeyPacket pk = new KeyPacket(getClient().enableCrypt());
getClient().sendPacket(pk);
}
Index: java/net/sf/l2j/gameserver/serverpackets/SendStatus.java
===================================================================
--- java/net/sf/l2j/gameserver/serverpackets/SendStatus.java (revision 0)
+++ java/net/sf/l2j/gameserver/serverpackets/SendStatus.java (revision 0)
@@ -0,0 +1,77 @@
+/*
+ * 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 net.sf.l2j.gameserver.serverpackets;
+import java.util.Random;
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.model.L2World;
+
+public final class SendStatus extends L2GameServerPacket
+{
+ private static final String _S__00_STATUS = "[S] 00 rWho";
+ 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()
+ {
+
+ online_players = L2World.getInstance().getAllPlayersCount() +Config.RWHO_ONLINE_INCREMENT;
+ max_online = Config.RWHO_MAX_ONLINE;
+ priv_store_factor = Config.RWHO_PRIV_STORE_FACTOR;
+
+ Random ppc = new Random();
+
+ if (online_players != 0)
+ online_priv_store = (int)((online_players + ppc.nextInt(online_players)) * priv_store_factor);
+
+ 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
+ writeH(0x30);
+ writeH(0x2C);
+ for (int x = 0; x<11; x++) {
+ writeH(41+ppc.nextInt(17));
+ }
+ writeD(43+ppc.nextInt(17));
+ int z = 36219+ppc.nextInt(1987);
+ writeD(z);
+ writeD(z);
+ writeD(37211+ppc.nextInt(2397));
+ writeD(0x00);
+ writeD(0x02);
+ }
+
+ /* (non-Javadoc)
+ *
@see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
+ */
+
@Override+ public String getType()
+ {
+ return _S__00_STATUS;
+ }
+}