mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 16:49:03 +00:00
Various Changes (#614)
* Clean Old Log Files * Various Changes * Moved minutes.log to log folder * Made SERVER_LOG_DIR constant * Moved FILE_SYSTEM_DIR to GameConstants & Deleted org.apollo.jagcached.Constants * Removed unused minutes.log from data/data * Removed Duplicate RSAKeyGen * Moved RSAKeyGen from com.rs2.net.rsa to com.rs2.util.rsa * Removed data/net.xml & Created Moved NetworkConstants.java * Add HTTP & Jaggrab Port's to ConfigLoader * IntelliJ Reformat ConfigLoader.java * Fix Mistake * Attempt #2 * Woops, wrong port
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.rs2.game.players;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import com.rs2.GameConstants;
|
||||
|
||||
import com.rs2.Constants;
|
||||
import com.rs2.GameEngine;
|
||||
import com.rs2.game.content.minigames.castlewars.CastleWars;
|
||||
import com.rs2.game.npcs.Npc;
|
||||
@@ -12,9 +13,9 @@ import com.rs2.world.GlobalDropsHandler;
|
||||
|
||||
public class PlayerHandler {
|
||||
|
||||
public static Player players[] = new Player[GameConstants.MAX_PLAYERS];
|
||||
public static Player players[] = new Player[Constants.MAX_PLAYERS];
|
||||
public static int playerCount = 0, playerShopCount = 0;
|
||||
public static String playersCurrentlyOn[] = new String[GameConstants.MAX_PLAYERS];
|
||||
public static String playersCurrentlyOn[] = new String[Constants.MAX_PLAYERS];
|
||||
public static boolean updateAnnounced;
|
||||
public static boolean updateRunning;
|
||||
public static int updateSeconds;
|
||||
@@ -22,14 +23,14 @@ public class PlayerHandler {
|
||||
private boolean kickAllPlayers = false;
|
||||
|
||||
static {
|
||||
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
|
||||
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
|
||||
players[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean newPlayerClient(Client client1) {
|
||||
int slot = -1;
|
||||
for (int i = 1; i < GameConstants.MAX_PLAYERS; i++) {
|
||||
for (int i = 1; i < Constants.MAX_PLAYERS; i++) {
|
||||
if (players[i] == null || players[i].disconnected) {
|
||||
slot = i;
|
||||
break;
|
||||
@@ -43,7 +44,7 @@ public class PlayerHandler {
|
||||
players[slot] = client1;
|
||||
players[slot].isActive = true;
|
||||
players[slot].connectedFrom = client1.isBot ? "127.0.0.1" : ((InetSocketAddress) client1.getSession().getRemoteAddress()).getAddress().getHostAddress();
|
||||
if (GameConstants.SERVER_DEBUG) {
|
||||
if (Constants.SERVER_DEBUG) {
|
||||
Misc.println("Player Slot " + slot + " slot 0 " + players[0]
|
||||
+ " Player Hit " + players[slot]);
|
||||
}
|
||||
@@ -56,7 +57,7 @@ public class PlayerHandler {
|
||||
|
||||
public static int getNonPlayerCount() {
|
||||
int count = 0;
|
||||
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
|
||||
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
|
||||
if (players[i] != null) {
|
||||
if (players[i].playerRights >= 1) {
|
||||
count++;
|
||||
@@ -73,7 +74,7 @@ public class PlayerHandler {
|
||||
public void updatePlayerNames() {
|
||||
playerShopCount = 0;
|
||||
playerCount = 0;
|
||||
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
|
||||
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
|
||||
if (players[i] != null) {
|
||||
playersCurrentlyOn[i] = players[i].playerName;
|
||||
if (players[i].isBot)
|
||||
@@ -331,7 +332,7 @@ public class PlayerHandler {
|
||||
}
|
||||
|
||||
private final Stream updateBlock = new Stream(
|
||||
new byte[GameConstants.BUFFER_SIZE]);
|
||||
new byte[Constants.BUFFER_SIZE]);
|
||||
|
||||
public void updatePlayer(Player plr, Stream outStr) {
|
||||
// synchronized(plr) {
|
||||
|
||||
Reference in New Issue
Block a user