Не знаю на скок правильно декомпилировании файл .
Помогите снять проверку лицензии. *
Помогите снять проверку лицензии. *
Java:
package atavism.server.plugins;
import atavism.agis.database.AccountDatabase;
import atavism.agis.database.ContentDatabase;
import atavism.agis.events.AbilityStatusEvent;
import atavism.agis.events.AbilityStatusMessage;
import atavism.agis.events.ConcludeQuest;
import atavism.agis.events.QuestResponse;
import atavism.agis.events.RequestQuestInfo;
import atavism.agis.plugins.AnimationClient;
import atavism.agis.plugins.ChatClient;
import atavism.agis.plugins.CombatClient;
import atavism.agis.plugins.DataLoggerClient;
import atavism.agis.plugins.QuestClient;
import atavism.agis.plugins.SocialClient;
import atavism.agis.plugins.ChatClient.TargetedComMessage;
import atavism.agis.plugins.QuestClient.QuestResponseMessage;
import atavism.agis.util.EventMessageHelper;
import atavism.agis.util.HelperFunctions;
import atavism.management.Management;
import atavism.msgsys.FilterUpdate;
import atavism.msgsys.Message;
import atavism.msgsys.MessageType;
import atavism.msgsys.MessageTypeFilter;
import atavism.msgsys.NoRecipientsException;
import atavism.msgsys.RPCTimeoutException;
import atavism.msgsys.SubjectMessage;
import atavism.msgsys.TargetMessage;
import atavism.server.engine.BasicWorldNode;
import atavism.server.engine.Database;
import atavism.server.engine.Engine;
import atavism.server.engine.EnginePlugin;
import atavism.server.engine.Event;
import atavism.server.engine.Namespace;
import atavism.server.engine.OID;
import atavism.server.events.ActivateItemEvent;
import atavism.server.events.AttachEvent;
import atavism.server.events.AuthorizedLoginEvent;
import atavism.server.events.AuthorizedLoginResponseEvent;
import atavism.server.events.AutoAttackEvent;
import atavism.server.events.ComEvent;
import atavism.server.events.CommandEvent;
import atavism.server.events.DirLocOrientEvent;
import atavism.server.events.ExtensionMessageEvent;
import atavism.server.events.FreeTerrainDecalEvent;
import atavism.server.events.LoadingStateEvent;
import atavism.server.events.LogoutEvent;
import atavism.server.events.ModelInfoEvent;
import atavism.server.events.NewLightEvent;
import atavism.server.events.NewTerrainDecalEvent;
import atavism.server.events.NotifyFreeObjectEvent;
import atavism.server.events.PlayerHaEvent;
import atavism.server.events.SceneLoadedEvent;
import atavism.server.events.WorldFileEvent;
import atavism.server.math.AOVector;
import atavism.server.math.Point;
import atavism.server.messages.LoginMessage;
import atavism.server.messages.LogoutMessage;
import atavism.server.messages.PerceptionFilter;
import atavism.server.messages.PerceptionTrigger;
import atavism.server.messages.PropertyMessage;
import atavism.server.messages.PerceptionMessage.ObjectNote;
import atavism.server.network.AOByteBuffer;
import atavism.server.network.ClientConnection;
import atavism.server.network.ClientTCPMessageIO;
import atavism.server.network.PacketAggregator;
import atavism.server.network.ClientConnection.AcceptCallback;
import atavism.server.network.rdp.RDPServer;
import atavism.server.network.rdp.RDPServerSocket;
import atavism.server.objects.DisplayContext;
import atavism.server.objects.InstanceEntryCallback;
import atavism.server.objects.InstanceRestorePoint;
import atavism.server.objects.InstanceTemplate;
import atavism.server.objects.Light;
import atavism.server.objects.LightData;
import atavism.server.objects.ObjectType;
import atavism.server.objects.ObjectTypes;
import atavism.server.objects.OceanData;
import atavism.server.objects.Player;
import atavism.server.objects.PlayerManager;
import atavism.server.objects.ProxyExtensionHook;
import atavism.server.objects.ProxyLoginCallback;
import atavism.server.objects.SoundData;
import atavism.server.objects.Template;
import atavism.server.objects.TerrainDecalData;
import atavism.server.objects.World;
import atavism.server.plugins.ClientParameter.ClientParameterMessage;
import atavism.server.plugins.InstanceClient.InstanceInfo;
import atavism.server.plugins.ProxyPlugin.1;
import atavism.server.plugins.ProxyPlugin.2;
import atavism.server.plugins.ProxyPlugin.3;
import atavism.server.plugins.WorldManagerClient.ExtensionMessage;
import atavism.server.plugins.WorldManagerClient.FreeRoadMessage;
import atavism.server.plugins.WorldManagerClient.MobPathMessage;
import atavism.server.plugins.WorldManagerClient.ObjectInfo;
import atavism.server.plugins.WorldManagerClient.PerceptionInfo;
import atavism.server.plugins.WorldManagerClient.SoundMessage;
import atavism.server.plugins.WorldManagerClient.TargetedExtensionMessage;
import atavism.server.telemetry.Prometheus;
import atavism.server.util.AOMeter;
import atavism.server.util.AORuntimeException;
import atavism.server.util.Base64;
import atavism.server.util.CountLogger;
import atavism.server.util.DebugUtils;
import atavism.server.util.EncryptionHelper;
import atavism.server.util.LockFactory;
import atavism.server.util.Log;
import atavism.server.util.Logger;
import atavism.server.util.ObjectLockManager;
import atavism.server.util.SQThreadPool;
import atavism.server.util.SecureToken;
import atavism.server.util.SecureTokenManager;
import atavism.server.util.ServerVersion;
import atavism.server.util.SquareQueue;
import atavism.server.util.TimeHistogram;
import atavism.server.util.CountLogger.Counter;
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.Timer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
public class ProxyPlugin extends EnginePlugin implements AcceptCallback, atavism.server.network.ClientConnection.MessageCallback {
private static int MESSAGE_QUEUE_THREADS = 16;
private static int EVENT_QUEUE_THREADS = 16;
private static int SLOW_EVENT_QUEUE_THREADS = 8;
private static final int RDP_CHANNELS_COUNT = 128;
public static final int PERCEPTION_GAIN_THRESHOLD = 20;
CountLogger countLogger = new CountLogger("ProxyMsg", 5000, 2);
Counter countMsgPerception;
Counter countMsgPerceptionGain;
Counter countMsgPerceptionLost;
Counter countMsgUpdateWNodeIn;
Counter countMsgUpdateWNodeOut;
Counter countMsgPropertyIn;
Counter countMsgPropertyOut;
Counter countMsgTargetedProperty;
Counter countMsgWNodeCorrectIn;
Counter countMsgWNodeCorrectOut;
Counter countMsgMobPathIn;
Counter countMsgMobPathOut;
public static boolean debugLic = false;
protected Lock commandMapLock = LockFactory.makeLock("CommandMapLock");
Map<String, atavism.server.plugins.ProxyPlugin.RegisteredCommand> commandMap = new HashMap();
atavism.server.plugins.ProxyPlugin.CommandAccessCheck defaultCommandAccess = new atavism.server.plugins.ProxyPlugin.DefaultCommandAccess((1)null);
SquareQueue<Player, Message> messageQQ = new SquareQueue("Message");
SQThreadPool messageThreadPool = null;
private final SquareQueue<Player, Event> eventQQ = new SquareQueue("Event");
private SQThreadPool<Player, Event> eventThreadPool = null;
private final SquareQueue<Player, Event> slowEventQQ = new SquareQueue("SlowEvent");
private SQThreadPool<Player, Event> slowEventThreadPool = null;
AOMeter clientMsgMeter = new AOMeter("ClientEventProcessorMeter");
protected ConcurrentHashMap<OID, Long> playerLastClientTime = new ConcurrentHashMap();
protected ConcurrentHashMap<OID, Long> playerLastServerTime = new ConcurrentHashMap();
protected ConcurrentHashMap<OID, Long> playerFirstSpeedHackTime = new ConcurrentHashMap();
protected ConcurrentHashMap<OID, Long> playerSpeedHackCount = new ConcurrentHashMap();
public boolean defaultAllowClientToClientMessage = false;
protected HashMap<String, MessageType> extensionMessageRegistry = new HashMap();
private final ExecutorService logoutExecutor = Executors.newCachedThreadPool();
protected AccountDatabase aDB;
protected PerceptionFilter perceptionFilter;
protected long perceptionSubId;
protected PerceptionFilter responderFilter;
protected PerceptionFilter responderFilter2;
protected long responderSubId;
protected long responderSubId2;
protected int clientPort;
protected static final Logger log = new Logger("ProxyPlugin");
atavism.server.plugins.ProxyPlugin.PlayerMessageCallback playerMessageCallback = new atavism.server.plugins.ProxyPlugin.PlayerMessageCallback(this);
protected PlayerManager playerManager = new PlayerManager();
protected ConcurrentHashMap<OID, String> playersOnlineList = new ConcurrentHashMap();
protected ConcurrentHashMap<OID, String> playersOnlineOnProxy = new ConcurrentHashMap();
protected TimeHistogram proxyQueueHistogram = null;
protected TimeHistogram proxyCallbackHistogram = null;
protected List<MessageType> extraPlayerMessageTypes = null;
private ProxyLoginCallback proxyLoginCallback = new atavism.server.plugins.ProxyPlugin.DefaultProxyLoginCallback((1)null);
private InstanceEntryCallback instanceEntryCallback = new atavism.server.plugins.ProxyPlugin.DefaultInstanceEntryCallback((1)null);
private int instanceEntryCount = 0;
private int chatSentCount = 0;
private int privateChatSentCount = 0;
public static final MessageType MSG_TYPE_VOICE_PARMS = MessageType.intern("ao.VOICE_PARMS");
public static final MessageType MSG_TYPE_PLAYER_PATH_REQ = MessageType.intern("ao.PLAYER_PATH_REQ");
public static final MessageType MSG_TYPE_UPDATE_PLAYER_IGNORE_LIST = MessageType.intern("ao.UPDATE_PLAYER_IGNORE_LIST");
public static final MessageType MSG_TYPE_GET_MATCHING_PLAYERS = MessageType.intern("ao.GET_MATCHING_PLAYERS");
public static final MessageType MSG_TYPE_PLAYER_IGNORE_LIST = MessageType.intern("ao.PLAYER_IGNORE_LIST");
public static final MessageType MSG_TYPE_PLAYER_IGNORE_LIST_REQ = MessageType.intern("ao.PLAYER_IGNORE_LIST_REQ");
public static final MessageType MSG_TYPE_RELAY_UPDATE_PLAYER_IGNORE_LIST = MessageType.intern("ao.RELAY_UPDATE_PLAYER_IGNORE_LIST");
public static final MessageType MSG_TYPE_GET_PLAYER_LOGIN_STATUS = MessageType.intern("ao.GET_PLAYER_LOGIN_STATUS");
public static final MessageType MSG_TYPE_LOGOUT_PLAYER = MessageType.intern("ao.LOGOUT_PLAYER");
public static final MessageType MSG_TYPE_ADD_STATIC_PERCEPTION = MessageType.intern("ao.ADD_STATIC_PERCEPTION");
public static final MessageType MSG_TYPE_REMOVE_STATIC_PERCEPTION = MessageType.intern("ao.REMOVE_STATIC_PERCEPTION");
public static final MessageType MSG_TYPE_LOGIN_SPAWNED = MessageType.intern("ao.LOGIN_SPAWNED");
public static final MessageType MSG_TYPE_ACCOUNT_LOGIN = MessageType.intern("ao.ACCOUNT_LOGIN");
public static final MessageType MSG_TYPE_SERVER_SHUTDOWN_MESSAGE = MessageType.intern("server.Shutdown_Message");
public static final MessageType MSG_TYPE_SERVER_SHUTDOWN = MessageType.intern("server.Shutdown");
public static final MessageType MSG_TYPE_SERVER_RELOAD = MessageType.intern("server.Reload");
protected static String voiceServerHost = "";
protected static Integer voiceServerPort = null;
public String serverCapabilitiesSentToClient = "DirLocOrient";
public static int DiffTimeToSkipDirLocOrientMessage = 500;
static int serverSocketReceiveBufferSize = 8388608;
public static int MaxConcurrentUsers = 2000;
public static int restriction_level = 0;
public static int idleTimeout = 900;
public static int silenceTimeout = 30;
public static int silenceLoadingTimeout = 900;
public static int maxMessagesBeforeConnectionReset = 2000;
public static int maxByteCountBeforeConnectionReset = 1000000;
public String capacityError = "Login Failed: Servers at capacity, please try again later.";
public String tokenError = "Login Failed: Secure token invalid.";
public static String SpeedhackChatMsg = "Detected Speedhack";
public static int SpeedhackCountToDisconect = 10;
public static int SpeedhackMinDiff = 8000;
private ClientTCPMessageIO clientTCPMessageIO = null;
Set<OID> adminSet = new HashSet();
Map<OID, ClientConnection> clientConnections = new ConcurrentHashMap();
Set<String> filteredProps = null;
Set<String> playerSpecificProps = null;
Set<String> cachedPlayerSpecificFilterProps = null;
String serverVersion = null;
protected Map<String, List<ProxyExtensionHook>> extensionHooks = new HashMap();
private int connectionLimit = 0;
boolean devMode = true;
public ProxyPlugin() {
super(getPluginName(), (atavism.msgsys.MessageCallback)null);
this.setPluginType("Proxy");
this.serverVersion = "10.7.0 " + ServerVersion.getBuildNumber();
String MessageQueueThreadPoolSize = Engine.properties.getProperty("atavism.proxy.MessageQueueThreadPoolSize");
if (MessageQueueThreadPoolSize != null) {
try {
int v = Integer.parseInt(MessageQueueThreadPoolSize);
MESSAGE_QUEUE_THREADS = v;
} catch (NumberFormatException var8) {
var8.printStackTrace();
Log.exception(var8);
}
}
String EventQueueThreadPoolSize = Engine.properties.getProperty("atavism.proxy.EventQueueThreadPoolSize");
if (EventQueueThreadPoolSize != null) {
try {
int v = Integer.parseInt(EventQueueThreadPoolSize);
EVENT_QUEUE_THREADS = v;
} catch (NumberFormatException var7) {
var7.printStackTrace();
Log.exception(var7);
}
}
String proxy_concurrent_logins = Engine.properties.getProperty("atavism.proxy.ConcurrentLogins");
if (proxy_concurrent_logins != null) {
try {
int v = Integer.parseInt(proxy_concurrent_logins);
SLOW_EVENT_QUEUE_THREADS = v;
} catch (NumberFormatException var6) {
var6.printStackTrace();
Log.exception(var6);
}
}
this.messageThreadPool = new SQThreadPool(this.messageQQ, new atavism.server.plugins.ProxyPlugin.MessageCallback(this, this), MESSAGE_QUEUE_THREADS);
this.eventThreadPool = new SQThreadPool(this.eventQQ, new atavism.server.plugins.ProxyPlugin.EventCallback(this), EVENT_QUEUE_THREADS);
this.slowEventThreadPool = new SQThreadPool(this.slowEventQQ, new atavism.server.plugins.ProxyPlugin.EventCallback(this), SLOW_EVENT_QUEUE_THREADS);
this.countMsgPerception = this.countLogger.addCounter("ao.PERCEPTION_INFO");
this.countMsgPerceptionGain = this.countLogger.addCounter("Perception.gain");
this.countMsgPerceptionLost = this.countLogger.addCounter("Perception.lost");
this.countMsgUpdateWNodeIn = this.countLogger.addCounter("ao.UPDATEWNODE.in");
this.countMsgUpdateWNodeOut = this.countLogger.addCounter("ao.UPDATEWNODE.out");
this.countMsgPropertyIn = this.countLogger.addCounter("ao.PROPERTY.in");
this.countMsgPropertyOut = this.countLogger.addCounter("ao.PROPERTY.out");
this.countMsgTargetedProperty = this.countLogger.addCounter("ao.TARGETED_PROPERTY");
this.countMsgWNodeCorrectIn = this.countLogger.addCounter("ao.WNODECORRECT.in");
this.countMsgWNodeCorrectOut = this.countLogger.addCounter("ao.WNODECORRECT.out");
this.countMsgMobPathIn = this.countLogger.addCounter("ao.MOB_PATH.in");
this.countMsgMobPathOut = this.countLogger.addCounter("ao.MOB_PATH.out");
ContentDatabase ctDB = new ContentDatabase(false);
String _silenceTimeout = ctDB.loadGameSetting("PLAYER_SILENCE_TIMEOUT");
if (_silenceTimeout != null) {
silenceTimeout = Integer.parseInt(_silenceTimeout);
}
this.aDB = new AccountDatabase(true);
this.addProxyExtensionHook("ao.heartbeat", new atavism.server.plugins.ProxyPlugin.PlayerHeartbeat((1)null));
(new Thread(new atavism.server.plugins.ProxyPlugin.PlayerTimeout(this, (1)null), "PlayerTimeout")).start();
}
private static String getPluginName() {
try {
String proxyPluginName = Engine.getAgent().getDomainClient().allocName("PLUGIN", "Proxy#");
return proxyPluginName;
} catch (IOException var2) {
throw new AORuntimeException("Could not allocate proxy plugin name", var2);
}
}
public static boolean isOnBlockList(OID subject, OID target) {
ExtensionMessage message = new ExtensionMessage(SocialClient.MSG_TYPE_IS_ON_BLOCK_LIST, "ao.IS_ON_BLOCK_LIST", subject);
message.setProperty("targetOid", target);
return Engine.getAgent().sendRPCReturnBoolean(message);
}
public boolean isDevMode() {
return this.devMode;
}
public void setDevMode(boolean mode) {
this.devMode = mode;
}
public List<MessageType> getExtraPlayerMessageTypes() {
return this.extraPlayerMessageTypes;
}
public void setExtraPlayerMessageTypes(List<MessageType> extraPlayerMessageTypes) {
this.extraPlayerMessageTypes = extraPlayerMessageTypes;
}
public void addExtraPlayerMessageType(MessageType messageType) {
if (this.extraPlayerMessageTypes == null) {
this.extraPlayerMessageTypes = new LinkedList();
}
this.extraPlayerMessageTypes.add(messageType);
}
public void addExtraPlayerExtensionMessageType(MessageType messageType) {
this.addExtraPlayerMessageType(messageType);
this.getHookManager().addHook(messageType, new atavism.server.plugins.ProxyPlugin.ExtensionHook(this));
}
public void addProxyExtensionHook(String subType, ProxyExtensionHook hook) {
synchronized(this.extensionHooks) {
List<ProxyExtensionHook> hookList = (List)this.extensionHooks.get(subType);
if (hookList == null) {
hookList = new ArrayList();
this.extensionHooks.put(subType, hookList);
}
((List)hookList).add(hook);
}
}
public Map<String, List<ProxyExtensionHook>> getProxyExtensionHooks(String subType) {
return this.extensionHooks;
}
public void onActivate() {
try {
PacketAggregator.initializeAggregation(Engine.getProperties());
String logProxyHistograms = Engine.properties.getProperty("atavism.log_proxy_histograms");
if (logProxyHistograms != null && logProxyHistograms.equals("true")) {
int interval = 5000;
String intervalString = Engine.properties.getProperty("atavism.log_proxy_histograms_interval");
if (intervalString != null) {
int newInterval = Integer.parseInt(intervalString);
if (newInterval > 0) {
interval = newInterval;
}
}
this.proxyQueueHistogram = new TimeHistogram("TimeInQ", interval);
this.proxyCallbackHistogram = new TimeHistogram("TimeInCallback", interval);
this.countLogger.start();
}
this.filteredProps = new HashSet();
this.playerSpecificProps = new HashSet();
this.cachedPlayerSpecificFilterProps = new HashSet();
this.addFilteredProperty("inv.bag");
this.addFilteredProperty(":loc");
this.addFilteredProperty("masterOid");
this.addFilteredProperty("agisobj.basedc");
this.addFilteredProperty("aoobj.dc");
this.addFilteredProperty("aoobj.followsterrainflag");
this.addFilteredProperty("aoobj.perceiver");
this.addFilteredProperty("aoobj.scale");
this.addFilteredProperty("aoobj.mobflag");
this.addFilteredProperty("aoobj.structflag");
this.addFilteredProperty("aoobj.userflag");
this.addFilteredProperty("aoobj.itemflag");
this.addFilteredProperty("aoobj.lightflag");
this.addFilteredProperty("namespace");
this.addFilteredProperty("regenEffectMap");
this.addFilteredProperty(WorldManagerClient.MOB_PATH_PROPERTY);
this.addFilteredProperty(WorldManagerClient.TEMPL_SOUND_DATA_LIST);
this.addFilteredProperty(WorldManagerClient.TEMPL_TERRAIN_DECAL_DATA);
this.addFilteredProperty("instanceStack");
this.addFilteredProperty("currentInstanceName");
this.addFilteredProperty("ignored_oids");
this.registerHooks();
atavism.server.plugins.ProxyPlugin.PluginMessageCallback pluginMessageCallback = new atavism.server.plugins.ProxyPlugin.PluginMessageCallback(this);
MessageTypeFilter filter = new MessageTypeFilter();
filter.addType(WorldManagerClient.MSG_TYPE_SYS_CHAT);
Engine.getAgent().createSubscription(filter, pluginMessageCallback);
LinkedList<MessageType> types = new LinkedList();
types.add(WorldManagerClient.MSG_TYPE_PERCEPTION_INFO);
types.add(WorldManagerClient.MSG_TYPE_ANIMATION);
types.add(WorldManagerClient.MSG_TYPE_DISPLAY_CONTEXT);
types.add(WorldManagerClient.MSG_TYPE_DETACH);
types.add(PropertyMessage.MSG_TYPE_PROPERTY);
types.add(ChatClient.MSG_TYPE_COM);
types.add(SocialClient.MSG_TYPE_BLOCK_LIST);
types.add(CombatClient.MSG_TYPE_DAMAGE);
types.add(WorldManagerClient.MSG_TYPE_UPDATEWNODE);
types.add(WorldManagerClient.MSG_TYPE_MOB_PATH);
types.add(WorldManagerClient.MSG_TYPE_WNODECORRECT);
types.add(WorldManagerClient.MSG_TYPE_ORIENT);
types.add(WorldManagerClient.MSG_TYPE_SOUND);
types.add(AnimationClient.MSG_TYPE_INVOKE_EFFECT);
types.add(WorldManagerClient.MSG_TYPE_EXTENSION);
types.add(WorldManagerClient.MSG_TYPE_P2P_EXTENSION);
types.add(InventoryClient.MSG_TYPE_INV_UPDATE);
types.add(CombatClient.MSG_TYPE_ABILITY_STATUS);
types.add(CombatClient.MSG_TYPE_ABILITY_UPDATE);
types.add(WorldManagerClient.MSG_TYPE_FOG);
types.add(WorldManagerClient.MSG_TYPE_ROAD);
types.add(WorldManagerClient.MSG_TYPE_NEW_DIRLIGHT);
types.add(WorldManagerClient.MSG_TYPE_SET_AMBIENT);
types.add(WorldManagerClient.MSG_TYPE_TARGETED_PROPERTY);
types.add(WorldManagerClient.MSG_TYPE_FREE_OBJECT);
types.add(MSG_TYPE_VOICE_PARMS);
types.add(MSG_TYPE_UPDATE_PLAYER_IGNORE_LIST);
types.add(MSG_TYPE_GET_MATCHING_PLAYERS);
types.add(MSG_TYPE_ADD_STATIC_PERCEPTION);
types.add(MSG_TYPE_REMOVE_STATIC_PERCEPTION);
if (this.extraPlayerMessageTypes != null) {
types.addAll(this.extraPlayerMessageTypes);
}
this.perceptionFilter = new PerceptionFilter(types, true);
PerceptionTrigger perceptionTrigger = new PerceptionTrigger();
this.perceptionSubId = Engine.getAgent().createSubscription(this.perceptionFilter, this.playerMessageCallback, 0, perceptionTrigger);
types.clear();
types.add(InstanceClient.MSG_TYPE_INSTANCE_ENTRY_REQ);
types.add(MSG_TYPE_PLAYER_IGNORE_LIST_REQ);
types.add(MSG_TYPE_GET_PLAYER_LOGIN_STATUS);
types.add(MSG_TYPE_LOGOUT_PLAYER);
this.responderFilter = new PerceptionFilter(types);
this.responderSubId = Engine.getAgent().createSubscription(this.responderFilter, this.playerMessageCallback, 8);
this.responderFilter2 = new PerceptionFilter();
this.responderSubId2 = Engine.getAgent().createSubscription(this.responderFilter2, this, 8);
types.clear();
types.add(Management.MSG_TYPE_GET_PLUGIN_STATUS);
Engine.getAgent().createSubscription(new MessageTypeFilter(types), pluginMessageCallback, 8);
MessageTypeFilter filter3 = new MessageTypeFilter();
filter3.addType(MSG_TYPE_ACCOUNT_LOGIN);
Engine.getAgent().createSubscription(filter3, this);
String log_rdp_counters = Engine.getProperty("atavism.log_rdp_counters");
if (log_rdp_counters == null || log_rdp_counters.equals("false")) {
RDPServer.setCounterLogging(false);
}
RDPServer.startRDPServer();
this.initializeVoiceServerInformation();
this.registerExtensionSubtype("voice_parms", MSG_TYPE_VOICE_PARMS);
this.registerExtensionSubtype("player_path_req", MSG_TYPE_PLAYER_PATH_REQ);
this.registerExtensionSubtype("player_path_req", MSG_TYPE_PLAYER_PATH_REQ);
this.registerExtensionSubtype("ao.UPDATE_PLAYER_IGNORE_LIST", MSG_TYPE_UPDATE_PLAYER_IGNORE_LIST);
this.registerExtensionSubtype("ao.GET_MATCHING_PLAYERS", MSG_TYPE_GET_MATCHING_PLAYERS);
this.registerExtensionSubtype("ao.PLAYER_IGNORE_LIST_REQ", MSG_TYPE_PLAYER_IGNORE_LIST_REQ);
Log.debug("ProxyPlugin before bindAddress");
InetSocketAddress bindAddress = this.getBindAddress();
Log.debug("ProxyPlugin after bindAddress " + bindAddress.getHostName() + " " + bindAddress.getAddress() + " " + bindAddress.getPort());
Log.debug("ProxyPlugin before server socket");
int port = Integer.parseInt(Engine.getProperty("atavism.proxy.bindport").trim());
Log.debug("Proxy: getBindAddress port=" + port);
String agent_name = Engine.getAgent().getName();
String[] an = agent_name.split("_");
int agentId = Integer.parseInt(an[1]);
port += agentId - 1;
int rdpChannels = Integer.parseInt(Engine.properties.getProperty("atavism.proxy.rdp_channels", String.valueOf(128)));
for(int i = 0; i < rdpChannels; ++i) {
RDPServerSocket serverSocket = new RDPServerSocket();
serverSocket.registerAcceptCallback(this);
serverSocket.bind(port, serverSocketReceiveBufferSize);
if (Log.loggingDebug) {
Log.debug("BIND: binding for client tcp and rdp packets on port " + bindAddress.getPort() + " with rdpsocket: " + serverSocket.toString());
}
}
Log.debug("BIND: bound server socket");
this.clientTCPMessageIO = ClientTCPMessageIO.setup(bindAddress, this, this);
Log.debug("BIND: setup clientTCPMessage");
this.clientTCPMessageIO.start("ClientIO");
Log.debug("BIND: started clientTCPMessage");
InetSocketAddress externalAddress = this.getExternalAddress(bindAddress);
Log.debug("BIND: got external Address " + externalAddress.getHostName() + " " + externalAddress.getAddress() + " " + externalAddress.getPort());
this.setPluginInfo("host=" + Engine.getProperty("atavism.proxy.externaladdress") + ",port=" + externalAddress.getPort());
Log.debug("Registering proxy plugin");
Engine.registerStatusReportingPlugin(this);
Log.debug("Proxy: activation done");
this.runCheck();
Gauge.builder("event_qq_size", new 1(this)).register(Prometheus.registry());
Gauge.builder("message_qq_size", new 2(this)).register(Prometheus.registry());
Gauge.builder("message_qq_unqueued_size", new 3(this)).register(Prometheus.registry());
} catch (Exception var16) {
throw new AORuntimeException("activate failed", var16);
}
}
private InetSocketAddress getBindAddress() throws IOException {
String propStr = Engine.getProperty("atavism.proxy.bindport");
Log.debug("Proxy: getBindAddress propStr=" + propStr);
int port;
if (propStr != null) {
port = Integer.parseInt(propStr.trim());
Log.debug("Proxy: getBindAddress port=" + port);
String agent_name = Engine.getAgent().getName();
String[] an = agent_name.split("_");
int agentId = Integer.parseInt(an[1]);
port += agentId - 1;
Log.debug("Proxy: getBindAddress port=" + port);
} else {
port = Integer.parseInt(Engine.getProperty("atavism.proxyport").trim());
}
Log.debug("Proxy: getBindAddress port=" + port);
propStr = Engine.getProperty("atavism.proxy.bindaddress");
Log.debug("Proxy: getBindAddress propStr=" + propStr + " " + Character.digit(propStr.charAt(0), 16) + " " + Character.digit(propStr.charAt(1), 16) + " " + Character.digit(propStr.charAt(2), 16) + " c=");
int count = 0;
if (propStr.contains(".")) {
for(int i = 0; i < propStr.length(); ++i) {
if (propStr.charAt(i) == '.') {
++count;
}
}
}
InetAddress address = null;
InetAddress[] address2 = null;
if (count == 3 && Character.digit(propStr.charAt(0), 10) != -1) {
}
if (propStr != null) {
try {
address = InetAddress.getByName(propStr.trim());
address2 = InetAddress.getAllByName(propStr.trim());
InetAddress[] var6 = address2;
int var7 = address2.length;
for(int var8 = 0; var8 < var7; ++var8) {
InetAddress ai = var6[var8];
Log.debug("Proxy: getBindAddress address2=" + ai + " " + ai.getHostName() + " " + ai.getHostAddress());
}
Log.debug("Proxy: getBindAddress address=" + address + " " + address.getHostName() + " " + address.getHostAddress());
} catch (UnknownHostException var10) {
log.error("getBindAddress " + var10.getMessage() + " " + var10.getLocalizedMessage());
}
}
Log.debug("Proxy: getBindAddress address=" + address + " " + address.getHostName() + " " + address.getAddress());
return new InetSocketAddress(address, port);
}
private InetSocketAddress getExternalAddress(InetSocketAddress bindAddress) throws IOException {
String propStr = Engine.getProperty("atavism.proxy.externalport");
Log.debug("Proxy: getExternalAddress ext port propStr=" + propStr);
int port;
if (propStr != null) {
port = Integer.parseInt(propStr.trim());
} else {
port = bindAddress.getPort();
}
Log.debug("Proxy: getExternalAddress port=" + port);
propStr = Engine.getProperty("atavism.proxy.externaladdress");
Log.debug("Proxy: getExternalAddress ext addr propStr=" + propStr);
InetAddress address;
if (propStr != null) {
address = InetAddress.getByName(propStr.trim());
} else {
address = bindAddress.getAddress();
Log.debug("Proxy: getExternalAddress else address=" + address);
if (address.isAnyLocalAddress()) {
address = InetAddress.getLocalHost();
Log.debug("Proxy: getExternalAddress get local host address=" + address + " " + address.getHostName() + " " + address.getHostAddress());
}
}
Log.debug("Proxy: getExternalAddress address=" + address + " " + address.getHostName() + " " + address.getAddress());
return new InetSocketAddress(address, port);
}
private String howla() {
String characters = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnoprstquwxyz123456789";
String k = "";
for(int i = 0; i < 14; ++i) {
Random random = new Random();
k = k + characters.charAt(random.nextInt(characters.length() - 1));
}
return k;
}
private void runCheck() {
String email = Engine.getProperty("atavism.licence.email");
String licencekey = Engine.getProperty("atavism.licence.key");
String proxy_id = Engine.getProperty("atavism.proxy.id");
int num = 0;
int proxyId = 0;
try {
if (proxy_id != null && proxy_id != "") {
proxyId = Integer.parseInt(proxy_id);
}
} catch (NumberFormatException var18) {
}
String[] url = new String[]{"https://apanel.atavismonline.com/login/verifyserver.php", "https://licensing2.dragonsan.com:2443/login/verifyserver.php", "https://licensing1.atavismonline.com/login/verifyserver.php", "https://licensing.dragonsan.com/login/verifyserver.php", "https://licensing1.dragonsan.com/login/verifyserver.php", "https://licensing.atavismonline.com/login/verifyserver.php", "https://licensing2.atavismonline.com/login/verifyserver.php"};
String resSor = this.howla();
atavism.server.plugins.ProxyPlugin.rck reCheck = new atavism.server.plugins.ProxyPlugin.rck(this, resSor);
Engine.getExecutor().scheduleAtFixedRate(reCheck, 300L, 300L, TimeUnit.SECONDS);
while(num < url.length) {
boolean failed = false;
try {
String res = "";
URL urlObj = new URL(url[num]);
URLConnection lu = urlObj.openConnection();
lu.setConnectTimeout(10000);
String data = "email=" + URLEncoder.encode(email, "UTF-8") + "&licence=" + URLEncoder.encode(licencekey, "UTF-8") + "&ver=" + URLEncoder.encode("10.7.0", "UTF-8") + "&addr=" + URLEncoder.encode(Engine.getProperty("atavism.proxy.bindaddress"), "UTF-8") + "&sor=" + URLEncoder.encode(resSor, "UTF-8") + "&c=" + URLEncoder.encode("0", "UTF-8") + "&cp=" + this.playerManager.getPlayerCount() + " &pi=" + proxyId + "&build=" + URLEncoder.encode(ServerVersion.getBuildDate(), "UTF-8") + "&m=" + MaxConcurrentUsers;
lu.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(lu.getOutputStream());
wr.write(data);
wr.flush();
BufferedReader rd = new BufferedReader(new InputStreamReader(lu.getInputStream()));
for(String line = ""; (line = rd.readLine()) != null; res = res + line) {
}
wr.flush();
wr.close();
if (debugLic) {
System.out.println("\n" + url[num] + "\n" + res + "\n");
}
res = HelperFunctions.readEncodedString(Base64.decode(res));
String[] output = res.split(":");
if (debugLic) {
System.out.println("\nsec: " + resSor + "\n s: " + HelperFunctions.readEncodedString(Base64.decode(output[2])) + "\n");
}
if (EncryptionHelper.passwordMD5Check(output[0], this.getTemp()) && resSor.equals(HelperFunctions.readEncodedString(Base64.decode(output[2])))) {
this.connectionLimit = Integer.parseInt(HelperFunctions.readEncodedString(Base64.decode(output[1])));
} else {
System.out.println("\nLicense verification failed");
Log.error("License verification failed");
}
Log.debug("CONNECTOR: connections set to: " + this.connectionLimit);
} catch (Exception var19) {
Log.error("CONNECTOR: failed verifying " + var19);
if (debugLic) {
System.out.println("\n" + url[num] + "\n" + var19);
}
++num;
failed = true;
}
if (!failed) {
return;
}
}
System.out.println("\nLicense verification failed");
Log.error("License verification failed");
this.connectionLimit = 0;
}
public Map<String, String> getStatusMap() {
Map<String, String> status = new HashMap();
status.put("players", Integer.toString(this.playerManager.getPlayerCount()));
return status;
}
public void registerCommand(String command, atavism.server.plugins.ProxyPlugin.CommandParser parser) {
this.commandMapLock.lock();
try {
this.commandMap.put(command, new atavism.server.plugins.ProxyPlugin.RegisteredCommand(parser, this.defaultCommandAccess));
} finally {
this.commandMapLock.unlock();
}
}
public void registerCommand(String command, atavism.server.plugins.ProxyPlugin.CommandParser parser, atavism.server.plugins.ProxyPlugin.CommandAccessCheck access) {
this.commandMapLock.lock();
try {
this.commandMap.put(command, new atavism.server.plugins.ProxyPlugin.RegisteredCommand(parser, access));
} finally {
this.commandMapLock.unlock();
}
}
void registerHooks() {
log.debug("registering hooks");
this.getHookManager().addHook(SocialClient.MSG_TYPE_BLOCK_LIST, new atavism.server.plugins.ProxyPlugin.BlockListHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_DISPLAY_CONTEXT, new atavism.server.plugins.ProxyPlugin.DisplayContextHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_DETACH, new atavism.server.plugins.ProxyPlugin.DetachHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_ANIMATION, new atavism.server.plugins.ProxyPlugin.AnimationHook(this));
this.getHookManager().addHook(AnimationClient.MSG_TYPE_INVOKE_EFFECT, new atavism.server.plugins.ProxyPlugin.InvokeEffectHook(this));
this.getHookManager().addHook(PropertyMessage.MSG_TYPE_PROPERTY, new atavism.server.plugins.ProxyPlugin.PropertyHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_EXTENSION, new atavism.server.plugins.ProxyPlugin.ExtensionHook(this));
this.getHookManager().addHook(CombatClient.MSG_TYPE_ABILITY_STATUS, new atavism.server.plugins.ProxyPlugin.AbilityStatusHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_TARGETED_PROPERTY, new atavism.server.plugins.ProxyPlugin.TargetedPropertyHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_PERCEPTION_INFO, new atavism.server.plugins.ProxyPlugin.PerceptionHook(this));
this.getHookManager().addHook(ChatClient.MSG_TYPE_COM, new atavism.server.plugins.ProxyPlugin.ComHook(this));
this.getHookManager().addHook(CombatClient.MSG_TYPE_DAMAGE, new atavism.server.plugins.ProxyPlugin.DamageHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_SYS_CHAT, new atavism.server.plugins.ProxyPlugin.SysChatHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_UPDATEWNODE, new atavism.server.plugins.ProxyPlugin.UpdateWNodeHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_MOB_PATH, new atavism.server.plugins.ProxyPlugin.UpdateMobPathHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_WNODECORRECT, new atavism.server.plugins.ProxyPlugin.WNodeCorrectHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_ORIENT, new atavism.server.plugins.ProxyPlugin.OrientHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_SOUND, new atavism.server.plugins.ProxyPlugin.SoundHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_FOG, new atavism.server.plugins.ProxyPlugin.FogHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_ROAD, new atavism.server.plugins.ProxyPlugin.RoadHook(this));
this.getHookManager().addHook(InventoryClient.MSG_TYPE_INV_UPDATE, new atavism.server.plugins.ProxyPlugin.InvUpdateHook(this));
this.getHookManager().addHook(CombatClient.MSG_TYPE_ABILITY_UPDATE, new atavism.server.plugins.ProxyPlugin.AbilityUpdateHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_NEW_DIRLIGHT, new atavism.server.plugins.ProxyPlugin.NewDirLightHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_FREE_OBJECT, new atavism.server.plugins.ProxyPlugin.FreeObjectHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_SET_AMBIENT, new atavism.server.plugins.ProxyPlugin.SetAmbientHook(this));
this.getHookManager().addHook(WorldManagerClient.MSG_TYPE_P2P_EXTENSION, new atavism.server.plugins.ProxyPlugin.P2PExtensionHook(this));
this.getHookManager().addHook(MSG_TYPE_VOICE_PARMS, new atavism.server.plugins.ProxyPlugin.VoiceParmsHook(this));
this.getHookManager().addHook(MSG_TYPE_PLAYER_PATH_REQ, new atavism.server.plugins.ProxyPlugin.PlayerPathReqHook(this));
this.getHookManager().addHook(InstanceClient.MSG_TYPE_INSTANCE_ENTRY_REQ, new atavism.server.plugins.ProxyPlugin.InstanceEntryReqHook(this));
this.getHookManager().addHook(Management.MSG_TYPE_GET_PLUGIN_STATUS, new atavism.server.plugins.ProxyPlugin.GetPluginStatusHook(this));
this.getHookManager().addHook(MSG_TYPE_UPDATE_PLAYER_IGNORE_LIST, new atavism.server.plugins.ProxyPlugin.UpdatePlayerIgnoreListHook(this));
this.getHookManager().addHook(MSG_TYPE_GET_MATCHING_PLAYERS, new atavism.server.plugins.ProxyPlugin.GetMatchingPlayersHook(this));
this.getHookManager().addHook(MSG_TYPE_PLAYER_IGNORE_LIST_REQ, new atavism.server.plugins.ProxyPlugin.PlayerIgnoreListReqHook(this));
this.getHookManager().addHook(MSG_TYPE_GET_PLAYER_LOGIN_STATUS, new atavism.server.plugins.ProxyPlugin.GetPlayerLoginStatusHook(this, (1)null));
this.getHookManager().addHook(MSG_TYPE_LOGOUT_PLAYER, new atavism.server.plugins.ProxyPlugin.LogoutPlayerHook(this, (1)null));
this.getHookManager().addHook(MSG_TYPE_ADD_STATIC_PERCEPTION, new atavism.server.plugins.ProxyPlugin.AddStaticPerceptionHook(this, (1)null));
this.getHookManager().addHook(MSG_TYPE_REMOVE_STATIC_PERCEPTION, new atavism.server.plugins.ProxyPlugin.RemoveStaticPerceptionHook(this, (1)null));
this.getHookManager().addHook(MSG_TYPE_ACCOUNT_LOGIN, new atavism.server.plugins.ProxyPlugin.AccountLoginHook(this, (1)null));
}
void callEngineOnMessage(Message message, int flags) {
super.handleMessage(message, flags);
}
protected void initializeVoiceServerInformation() {
voiceServerHost = Engine.properties.getProperty("atavism.voiceserver");
String s = Engine.properties.getProperty("atavism.voiceport");
if (s != null) {
voiceServerPort = Integer.parseInt(s);
}
if (Log.loggingDebug) {
log.debug("initializeVoiceServerInformation: voiceServerHost " + voiceServerHost + ", voiceServerPort " + voiceServerPort);
}
}
public void acceptConnection(ClientConnection con) {
Log.info("ProxyPlugin: CONNECTION remote=" + con);
con.registerMessageCallback(this);
}
public void processPacket(ClientConnection con, AOByteBuffer buf) {
try {
long time1 = System.nanoTime();
if (Log.loggingNet) {
if (ClientConnection.getLogMessageContents()) {
Log.net("ProxyPlugin.processPacket: con " + con + ", length " + buf.limit() + ", packet " + DebugUtils.byteArrayToHexString(buf));
} else {
Log.net("ProxyPlugin.processPacket: con " + con + ", buf " + buf);
}
}
Event event = Engine.getEventServer().parseBytes(buf, con);
if (event == null) {
Log.error("Engine: could not parse packet data, remote=" + con);
return;
}
SquareQueue<Player, Event> qq = this.eventQQ;
if (event instanceof AuthorizedLoginEvent) {
qq = this.slowEventQQ;
}
Player player = (Player)con.getAssociation();
if (player == null) {
if (!(event instanceof AuthorizedLoginEvent)) {
Log.error("Cannot process event for connection with no player: " + con);
return;
}
Log.info("ProxyPlugin: LOGIN_RECV remote=" + con + " playerOid=" + ((AuthorizedLoginEvent)event).getOid());
player = new Player(((AuthorizedLoginEvent)event).getOid(), con);
}
this.playerManager.processEvent(player, event, qq);
long time2 = System.nanoTime();
Timer.builder("process_packet_time").tags(new String[]{"event", event.getClass().getSimpleName()}).publishPercentiles(new double[]{0.9D}).register(Prometheus.registry()).record(Duration.ofNanos(time2 - time1));
} catch (AORuntimeException var10) {
Log.exception("ProxyPlugin.processPacket caught exception", var10);
}
}
public Set<OID> getPlayerOids() {
List<Player> players = new ArrayList(this.playerManager.getPlayerCount());
this.playerManager.getPlayers(players);
Set<OID> result = new HashSet(players.size());
Iterator var3 = players.iterator();
while(var3.hasNext()) {
Player player = (Player)var3.next();
result.add(player.getOid());
}
return result;
}
public List<String> getPlayerNames() {
List<Player> players = new ArrayList(this.playerManager.getPlayerCount());
Log.debug("ProxyPlugin.getPlayerNames: count is " + this.playerManager.getPlayerCount());
this.playerManager.getPlayers(players);
List<String> result = new ArrayList(players.size());
Iterator var3 = players.iterator();
while(var3.hasNext()) {
Player player = (Player)var3.next();
result.add(player.getName() + " " + player.getOid() + " " + this.getName());
}
Collections.sort(result);
return result;
}
public List<String> getAllPlayerNames() {
Log.debug("ProxyPlugin.getAllPlayerNames: count is " + this.playersOnlineList.size());
List<String> result = new ArrayList(this.playersOnlineList.size());
HashMap<OID, String> plays = new HashMap();
plays.putAll(this.playersOnlineList);
Iterator var3 = plays.keySet().iterator();
while(var3.hasNext()) {
OID player = (OID)var3.next();
result.add((String)plays.get(player) + " " + player + " " + (String)this.playersOnlineOnProxy.get(player));
}
Collections.sort(result);
return result;
}
public List<Player> getPlayers() {
List<Player> players = new ArrayList(this.playerManager.getPlayerCount());
this.playerManager.getPlayers(players);
return players;
}
public Player getPlayer(OID oid) {
return this.playerManager.getPlayer(oid);
}
public void addPlayerMessage(Message message, Player player) {
long start = System.nanoTime();
message.setEnqueueTime();
this.messageQQ.insert(player, message);
long microseconds = System.nanoTime() - start;
}
public void addFilteredProperty(String filteredProperty) {
this.filteredProps.add(filteredProperty);
this.cachedPlayerSpecificFilterProps.add(filteredProperty);
}
public void addPlayerSpecificProperty(String filteredProperty) {
this.playerSpecificProps.add(filteredProperty);
this.cachedPlayerSpecificFilterProps.add(filteredProperty);
}
protected void recreatePlayerSpecificCache() {
this.cachedPlayerSpecificFilterProps = new HashSet();
this.cachedPlayerSpecificFilterProps.addAll(this.filteredProps);
this.cachedPlayerSpecificFilterProps.addAll(this.playerSpecificProps);
}
protected boolean processLogin(ClientConnection con, AuthorizedLoginEvent loginEvent) {
Prometheus.registry().counter("player_login_request", new String[0]).increment();
OID playerOid = loginEvent.getOid();
String version = loginEvent.getVersion();
int nPlayers = this.playerManager.getPlayerCount();
String[] clientVersionCapabilities = null;
if (version != null && version.length() > 0) {
clientVersionCapabilities = version.split(",");
}
LinkedList<String> clientCapabilities = new LinkedList();
String clientVersion = "";
int i;
if (clientVersionCapabilities != null && clientVersionCapabilities.length > 0) {
clientVersion = clientVersionCapabilities[0];
for(i = 1; i < clientVersionCapabilities.length; ++i) {
clientCapabilities.add(clientVersionCapabilities[i].trim());
}
}
i = ServerVersion.compareVersionStrings(clientVersion, "10.7.0");
AuthorizedLoginResponseEvent loginResponse;
if (i != 0) {
Log.warn("processLogin: unsupported version " + clientVersion + " from player: " + playerOid);
loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, "Login Failed: Unsupported client version", this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "unsupported_version"}).increment();
return false;
} else {
if (this.isAdmin(playerOid) && nPlayers < this.connectionLimit) {
Log.debug("processLogin: player is admin, bypassing max check");
} else {
Log.debug("processLogin: player is not admin");
if (nPlayers >= MaxConcurrentUsers || nPlayers >= this.connectionLimit) {
Log.warn("processLogin: too many users, failed for player: " + playerOid);
loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, this.capacityError, this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "too_many_users_" + String.valueOf(this.connectionLimit)}).increment();
return false;
}
}
SecureToken token = SecureTokenManager.getInstance().importToken(loginEvent.getWorldToken());
boolean validToken = true;
if (!token.getValid()) {
Log.debug("token is not valid");
validToken = false;
}
OID characterOid = (OID)token.getProperty("character_oid");
if (Log.loggingDebug) {
Log.debug("PlayerOID: " + playerOid);
}
if (Log.loggingDebug) {
Log.debug("CharacterOID: " + characterOid);
}
if (!playerOid.equals(characterOid)) {
Log.debug("playerOid does not match character_oid");
validToken = false;
}
if (!token.getProperty("proxy_server").equals(Engine.getAgent().getName())) {
Log.debug("proxy_server does not match engine agent name");
validToken = false;
}
if (!validToken) {
Log.error("processLogin: invalid proxy token");
Event loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, this.tokenError, this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "invalid_token"}).increment();
return false;
} else {
try {
TargetMessage getPlayerLoginStatus = new TargetMessage(MSG_TYPE_GET_PLAYER_LOGIN_STATUS, playerOid);
atavism.server.plugins.ProxyPlugin.PlayerLoginStatus loginStatus = (atavism.server.plugins.ProxyPlugin.PlayerLoginStatus)Engine.getAgent().sendRPCReturnObject(getPlayerLoginStatus);
if (this.proxyLoginCallback.duplicateLogin(loginStatus, con)) {
if (loginStatus != null) {
if (Log.loggingInfo) {
Log.info("processLogin: LOGIN_DUPLICATE remote=" + con + " playerOid=" + playerOid + " name=" + loginStatus.name + " existingCon=" + loginStatus.clientCon + " existingProxy=" + loginStatus.proxyPluginName);
}
} else if (Log.loggingInfo) {
Log.info("processLogin: LOGIN_DUPLICATE remote=" + con + " playerOid=" + playerOid + " loginStatus is null");
}
log.debug("processLogin: Send logout");
Prometheus.registry().counter("player_logout", new String[]{"reason", "duplicate"}).increment();
TargetMessage logoutPly = new TargetMessage(MSG_TYPE_LOGOUT_PLAYER, playerOid);
Engine.getAgent().sendRPCReturnObject(logoutPly);
log.debug("processLogin: Send logout | ");
AuthorizedLoginResponseEvent loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, "Login Failed: Already connected", this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "duplicate"}).increment();
return false;
}
} catch (NoRecipientsException var20) {
if (Log.loggingDebug) {
log.debug("processLogin: OK! player is not logged " + var20);
}
}
Player player = new Player(playerOid, con);
player.setStatus(1);
if (!this.playerManager.addPlayer(player)) {
player = this.playerManager.getPlayer(playerOid);
Log.info("processLogin: LOGIN_DUPLICATE remote=" + con + " playerOid=" + playerOid + " existing=" + player.getConnection());
AuthorizedLoginResponseEvent loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, "Login Failed: Already connected", this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "duplicate_add"}).increment();
return false;
} else {
con.setAssociation(player);
player.setVersion(clientVersion);
player.setCapabilities(clientCapabilities);
String errorMessage = this.proxyLoginCallback.preLoad(player, con);
AuthorizedLoginResponseEvent loginResponse;
if (errorMessage != null) {
this.playerManager.removePlayer(playerOid);
loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, errorMessage, this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "pre_load_error"}).increment();
return false;
} else {
if (Log.loggingDebug) {
Log.debug("processLogin: loading object: " + playerOid + ", con=" + con);
}
if (!this.loadPlayerObject(player)) {
Log.error("processLogin: could not load object " + playerOid);
this.playerManager.removePlayer(playerOid);
loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, "Login Failed", this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "not_loaded"}).increment();
return false;
} else {
if (Log.loggingDebug) {
Log.debug("processLogin: loaded player object: " + playerOid);
}
errorMessage = this.proxyLoginCallback.postLoad(player, con);
if (errorMessage != null) {
this.playerManager.removePlayer(playerOid);
loginResponse = new AuthorizedLoginResponseEvent(playerOid, false, errorMessage, this.serverVersion);
con.send(loginResponse.toBytes());
Prometheus.registry().counter("player_login_result", new String[]{"status", "error"}).increment();
return false;
} else {
loginResponse = new AuthorizedLoginResponseEvent(playerOid, true, "Login Succeeded", this.serverVersion + ", " + this.serverCapabilitiesSentToClient);
con.send(loginResponse.toBytes());
if (Log.loggingDebug) {
Log.debug("Login response sent for playerOid=" + playerOid + " the authorized login response message is : " + loginResponse.getMessage());
}
this.playerManager.addStaticPerception(player, playerOid);
boolean loginOK = this.processLoginHelper(con, player);
if (Log.loggingDebug) {
log.debug("processLogin: loginOK?:" + loginOK + " | player=" + player);
}
if (!loginOK) {
if (Log.loggingDebug) {
Log.debug("processLogin: loading object: " + playerOid + ", con=" + con + " login failed disconect player");
}
con.setAssociation((Object)null);
if (this.perceptionFilter.removeTarget(playerOid)) {
FilterUpdate filterUpdate = new FilterUpdate(1);
filterUpdate.removeFieldValue(1, playerOid);
Engine.getAgent().applyFilterUpdate(this.perceptionSubId, filterUpdate);
this.responderFilter.removeTarget(playerOid);
this.responderFilter2.removeTarget(playerOid);
Engine.getAgent().applyFilterUpdate(this.responderSubId, filterUpdate);
Engine.getAgent().applyFilterUpdate(this.responderSubId2, filterUpdate);
}
this.playerManager.removeStaticPerception(player, playerOid);
this.playerManager.removePlayer(playerOid);
Prometheus.registry().counter("rdp_connection_closed", new String[]{"reason", "bad_login"}).increment();
con.close();
} else {
this.proxyLoginCallback.postSpawn(player, con);
this.playerManager.loginComplete(player, this.eventQQ);
SubjectMessage loginSpawned = new SubjectMessage(MSG_TYPE_LOGIN_SPAWNED);
loginSpawned.setSubject(playerOid);
Engine.getAgent().sendBroadcast(loginSpawned);
this.processPlayerIgnoreList(player);
OID accountID = (OID)EnginePlugin.getObjectProperty(playerOid, WorldManagerClient.NAMESPACE, "accountId");
this.clientConnections.put(accountID, con);
if (player.getStatus() == 3) {
atavism.server.plugins.ProxyPlugin.ConnectionResetMessage message = new atavism.server.plugins.ProxyPlugin.ConnectionResetMessage(this, con, player);
message.setEnqueueTime();
this.messageQQ.insert(player, message);
}
}
Prometheus.registry().counter("player_login_result", new String[]{"status", loginOK ? "ok" : "failed"}).increment();
if (Log.loggingDebug) {
log.debug("processLogin: loginOK?:" + loginOK + " || player=" + player);
log.debug("processLogin: loginOK:" + loginOK + " end");
}
return loginOK;
}
}
}
}
}
}
}
protected boolean loadPlayerObject(Player player) {
if (Log.loggingDebug) {
log.debug("loadPlayerObject player " + player);
}
InstanceRestorePoint restorePoint = null;
LinkedList restoreStack = null;
boolean first = true;
OID playerOid = player.getOid();
List<Namespace> namespaces = new ArrayList();
OID oidResult = ObjectManagerClient.loadSubObject(playerOid, namespaces);
if (Log.loggingDebug) {
log.debug("loadPlayerObject player " + player + " oidResult=" + oidResult);
}
if (oidResult == null) {
return false;
} else {
Point location = new Point();
OID instanceOid = Engine.getDatabase().getLocation(playerOid, WorldManagerClient.NAMESPACE, location);
if (Log.loggingDebug) {
log.debug("loadPlayerObject instanceOid " + instanceOid + " instanceEntryAllowed:" + this.instanceEntryAllowed(playerOid, instanceOid, location));
}
if (Log.loggingDebug) {
log.debug("loadPlayerObject: trying to load player into instance: " + instanceOid);
}
int guildID = this.aDB.GetGuildId(playerOid);
if (Log.loggingDebug) {
log.debug("loadPlayerObject: load player guildID: " + guildID);
}
while(true) {
try {
OID result = null;
if (this.instanceEntryAllowed(playerOid, instanceOid, location)) {
InstanceInfo instanceInfo = InstanceClient.getInstanceInfo(instanceOid, -262145);
if (Log.loggingDebug) {
log.debug("loadPlayerObject InstanceInfo " + instanceInfo + " plyOid=" + instanceInfo.playerOid + " tempId" + instanceInfo.templateID + " groupId" + instanceInfo.groupOid + " guildId" + instanceInfo.guildId + " start do ");
}
if (instanceInfo.oid != null && (instanceInfo.populationLimit < 1 || instanceInfo.playerPopulation < instanceInfo.populationLimit)) {
result = ObjectManagerClient.loadObject(playerOid);
if (Log.loggingDebug) {
Log.debug("loadPlayerObject: loading player into instance: " + instanceInfo.oid + " of ID: " + instanceInfo.templateID);
}
}
}
if (restoreStack != null && !restorePoint.getFallbackFlag()) {
EnginePlugin.setObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "instanceStack", restoreStack);
}
if (result == null) {
if (first) {
Integer instanceID = (Integer)EnginePlugin.getObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "currentInstanceName");
if (Log.loggingDebug) {
log.debug("Failed initial load, retrying with current instanceID=" + instanceID);
}
if (Log.loggingDebug) {
log.debug(" loadPlayerObject instanceID=" + instanceID + " playerOid=" + playerOid + " guildID=" + guildID);
}
if (instanceID > 0) {
instanceOid = this.instanceEntryCallback.selectInstance(player, instanceID, playerOid, guildID);
if (Log.loggingDebug) {
log.debug("loadPlayerObject instanceOid:" + instanceOid);
}
if (instanceOid != null) {
InstanceInfo instanceInfo = InstanceClient.getInstanceInfo(instanceOid, -262145, false);
if (Log.loggingDebug) {
log.debug(" loadPlayerObject InstanceInfo " + instanceInfo + " plyOid=" + instanceInfo.playerOid + " tempId=" + instanceInfo.templateID + " groupId=" + instanceInfo.groupOid + " guildId=" + instanceInfo.guildId);
}
if (instanceInfo.oid != null) {
if (instanceInfo.populationLimit > 0 && instanceInfo.playerPopulation >= instanceInfo.populationLimit) {
if (Log.loggingDebug) {
Log.debug("POP: got population: " + instanceInfo.playerPopulation + " and limit: " + instanceInfo.populationLimit);
}
instanceOid = handleFullInstance(instanceInfo.templateID, instanceInfo);
instanceInfo = InstanceClient.getInstanceInfo(instanceOid, -262145);
log.debug(" loadPlayerObject 2 InstanceInfo " + instanceInfo + " plyOid" + instanceInfo.playerOid + " tempId=" + instanceInfo.templateID + " groupId=" + instanceInfo.groupOid + " guildId=" + instanceInfo.guildId);
}
if (Log.loggingDebug) {
log.debug("Failed initial load, retrying with instanceOid=" + instanceOid + " and instanceName: " + instanceInfo.name);
}
BasicWorldNode wnode = new BasicWorldNode();
wnode.setInstanceOid(instanceOid);
ObjectManagerClient.fixWorldNode(playerOid, wnode);
first = false;
continue;
}
}
}
}
if (restorePoint != null && restorePoint.getFallbackFlag()) {
if (Log.loggingDebug) {
log.debug("loadPlayerObject instanceOid " + instanceOid + " restorePoint:" + restorePoint + " restorePoint.getFallbackFlag():" + restorePoint.getFallbackFlag() + " return false");
}
return false;
}
restoreStack = (LinkedList)EnginePlugin.getObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "instanceStack");
if (restoreStack != null && restoreStack.size() != 0) {
int size = restoreStack.size();
restorePoint = (InstanceRestorePoint)restoreStack.get(size - 1);
instanceOid = restorePoint.getInstanceOid();
if (restorePoint.getInstanceID() > 0) {
instanceOid = this.instanceEntryCallback.selectInstance(player, restorePoint.getInstanceID());
if (Log.loggingDebug) {
Log.debug("Failed finding matching instance, retrying with restore point instanceID=" + restorePoint.getInstanceID() + " result: " + instanceOid);
}
}
if (instanceOid != null) {
BasicWorldNode wnode = new BasicWorldNode();
wnode.setInstanceOid(instanceOid);
wnode.setLoc(restorePoint.getLoc());
wnode.setOrientation(restorePoint.getOrientation());
wnode.setDir(new AOVector(0.0F, 0.0F, 0.0F));
boolean rc = ObjectManagerClient.fixWorldNode(playerOid, wnode);
if (!rc) {
if (Log.loggingDebug) {
log.debug("loadPlayerObject instanceOid " + instanceOid + " rc:" + rc + " return false");
}
return false;
}
location = restorePoint.getLoc();
}
first = false;
if (!restorePoint.getFallbackFlag()) {
restoreStack.remove(size - 1);
}
continue;
}
Log.error("Failed finding matching instance, and restore stack is null or empty?" + restoreStack + " return false");
return false;
}
if (restorePoint != null) {
EnginePlugin.setObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "currentInstanceName", restorePoint.getInstanceID());
if (Log.loggingDebug) {
log.debug("INSTANCE: setting current instance prop: " + restorePoint.getInstanceID());
}
}
} catch (Exception var15) {
log.error("loadPlayerObject instanceOid " + instanceOid + " Exception: " + var15.getMessage() + " " + var15.getLocalizedMessage());
}
if (Log.loggingDebug) {
log.debug("loadPlayerObject instanceOid " + instanceOid + " END return true");
}
return true;
}
}
}
protected boolean processLoginHelper(ClientConnection con, Player player) {
OID playerOid = player.getOid();
ObjectInfo objInfo = WorldManagerClient.getObjectInfo(playerOid);
if (objInfo == null) {
Log.error("processLogin: Could not get player ObjectInfo oid=" + playerOid);
return false;
} else {
if (Log.loggingDebug) {
log.debug("processLoginHelper objInfo " + objInfo.instanceOid);
}
if (World.FollowsTerrainOverride != null) {
Log.debug("using follows terrain override");
objInfo.followsTerrain = World.FollowsTerrainOverride;
}
if (Log.loggingDebug) {
Log.debug("processLogin: got object info: " + objInfo);
}
player.setName(objInfo.name);
InstanceInfo instanceInfo = InstanceClient.getInstanceInfo(objInfo.instanceOid, -262145);
if (Log.loggingDebug) {
log.debug("InstanceInfo " + instanceInfo + " " + instanceInfo.playerOid + " " + instanceInfo.templateID + " " + instanceInfo.groupOid + " " + instanceInfo.guildId);
}
if (instanceInfo == null) {
Log.error("processLogin: unknown instanceOid=" + objInfo.instanceOid);
return false;
} else {
if (Log.loggingDebug) {
Log.debug("processLogin: sending template (scene) name: " + instanceInfo.templateName);
}
Event worldFileEvent = new WorldFileEvent(instanceInfo.templateName);
con.send(worldFileEvent.toBytes());
player.sceneLoading(true);
Log.debug("INFO: process login helper");
con.send(objInfo.toBuffer(playerOid));
DisplayContext dc = WorldManagerClient.getDisplayContext(playerOid);
ModelInfoEvent modelInfoEvent = new ModelInfoEvent(playerOid);
modelInfoEvent.setDisplayContext(dc);
if (Log.loggingDebug) {
Log.debug("processLogin: got dc: " + dc);
}
con.send(modelInfoEvent.toBytes());
Map<String, DisplayContext> childMap = dc.getChildDCMap();
if (childMap != null && !childMap.isEmpty()) {
Iterator var10 = childMap.keySet().iterator();
while(var10.hasNext()) {
String slot = (String)var10.next();
DisplayContext attachDC = (DisplayContext)childMap.get(slot);
if (attachDC == null) {
throw new AORuntimeException("attach DC is null for obj: " + playerOid);
}
OID attacheeOID = attachDC.getObjRef();
if (attacheeOID == null) {
throw new AORuntimeException("attachee oid is null for obj: " + playerOid);
}
if (Log.loggingDebug) {
Log.debug("processLogin: sending attach message to " + playerOid + " attaching to obj " + playerOid + ", object being attached=" + attacheeOID + " to slot " + slot + ", attachmentDC=" + attachDC);
}
AttachEvent event = new AttachEvent(playerOid, attacheeOID, slot, attachDC);
con.send(event.toBytes());
}
Log.debug("processLogin: done with processing attachments");
}
if (this.perceptionFilter.addTarget(playerOid)) {
FilterUpdate filterUpdate = new FilterUpdate(1);
filterUpdate.addFieldValue(1, playerOid);
Engine.getAgent().applyFilterUpdate(this.perceptionSubId, filterUpdate);
this.responderFilter.addTarget(playerOid);
this.responderFilter2.addTarget(playerOid);
Engine.getAgent().applyFilterUpdate(this.responderSubId, filterUpdate);
Engine.getAgent().applyFilterUpdate(this.responderSubId2, filterUpdate);
}
LoginMessage loginMessage = new LoginMessage(playerOid, objInfo.name);
loginMessage.setInstanceOid(objInfo.instanceOid);
loginMessage.setProxy(this.getName());
atavism.server.plugins.ProxyPlugin.AsyncRPCCallback asyncRPCCallback = new atavism.server.plugins.ProxyPlugin.AsyncRPCCallback(player, "processLogin: got LoginMessage response");
int expectedResponses = Engine.getAgent().sendBroadcastRPC(loginMessage, asyncRPCCallback);
asyncRPCCallback.waitForResponses(expectedResponses);
WorldManagerClient.updateObject(playerOid, playerOid);
TargetedExtensionMessage spawnBegin = new TargetedExtensionMessage(playerOid, playerOid);
spawnBegin.setExtensionType("ao.SCENE_BEGIN");
spawnBegin.setProperty("action", "login");
spawnBegin.setProperty("name", instanceInfo.name);
spawnBegin.setProperty("templateName", instanceInfo.templateName);
TargetedExtensionMessage spawnEnd = new TargetedExtensionMessage(playerOid, playerOid);
spawnEnd.setExtensionType("ao.SCENE_END");
spawnEnd.setProperty("action", "login");
spawnEnd.setProperty("name", instanceInfo.name);
spawnEnd.setProperty("templateName", instanceInfo.templateName);
Integer perceptionCount = WorldManagerClient.spawn(playerOid, spawnBegin, spawnEnd);
if (perceptionCount < 0) {
Log.error("processLogin: spawn failed error=" + perceptionCount + " playerOid=" + playerOid);
return perceptionCount == -2 ? false : false;
} else {
if (perceptionCount == 0 && player.supportsLoadingState()) {
player.setLoadingState(1);
con.send((new LoadingStateEvent(false)).toBytes());
}
if (Log.loggingDebug) {
Log.debug("processLogin: During login, perceptionCount is " + perceptionCount);
Log.debug("processLogin: spawned player, master playerOid=" + playerOid);
}
if (Log.loggingDebug) {
Log.debug("processLogin: sending over instance information for player " + playerOid + ", instance=" + instanceInfo.name + ", instanceOid=" + instanceInfo.oid);
}
this.updateInstancePerception(player.getOid(), (OID)null, instanceInfo.oid, instanceInfo.name);
return true;
}
}
}
}
public ProxyLoginCallback getProxyLoginCallback() {
return this.proxyLoginCallback;
}
public void setProxyLoginCallback(ProxyLoginCallback callback) {
this.proxyLoginCallback = callback;
}
private boolean instanceEntryAllowed(OID playerOid, OID instanceOid, Point location) {
return instanceOid == null ? false : this.instanceEntryCallback.instanceEntryAllowed(playerOid, instanceOid, location);
}
public InstanceEntryCallback getInstanceEntryCallback() {
return this.instanceEntryCallback;
}
public void setInstanceEntryCallback(InstanceEntryCallback callback) {
this.instanceEntryCallback = callback;
}
public void processRequestQuestInfo(ClientConnection con, RequestQuestInfo event) {
OID npcOid = event.getQuestNpcOid();
Player player = this.verifyPlayer("processRequestQuestInfo", event, con);
if (Log.loggingDebug) {
Log.debug("processRequestQuestInfo: player=" + player + ", npc=" + npcOid);
}
QuestClient.requestQuestInfo(npcOid, player.getOid());
}
public void processQuestResponse(ClientConnection con, QuestResponse event) {
Player player = this.verifyPlayer("processQuestResponse", event, con);
boolean acceptStatus = event.getResponse();
OID npcOid = event.getQuestNpcOid();
OID questOid = event.getQuestId();
if (Log.loggingDebug) {
Log.debug("processQuestResponse: player=" + player + ", npcOid=" + npcOid + ", acceptStatus=" + acceptStatus);
}
QuestResponseMessage msg = new QuestResponseMessage(npcOid, player.getOid(), questOid, acceptStatus);
Engine.getAgent().sendBroadcast(msg);
}
public void processReqConcludeQuest(ClientConnection con, ConcludeQuest event) {
Player player = this.verifyPlayer("processReqConcludeQuest", event, con);
OID mobOid = event.getQuestNpcOid();
if (Log.loggingDebug) {
Log.debug("processReqConclude: player=" + player + ", mobOid=" + mobOid);
}
QuestClient.requestConclude(mobOid, player.getOid());
}
public void connectionReset(ClientConnection con) {
Player player = (Player)con.getAssociation();
if (player == null) {
Log.info("ProxyPlugin: DISCONNECT remote=" + con);
} else {
if (Log.loggingInfo) {
Log.info("ProxyPlugin: DISCONNECT remote=" + con + " playerOid=" + player.getOid() + " name=" + player.getName() + " player=" + player);
Log.info("ProxyPlugin: DISCONNECT remote=" + con + " player=" + player);
}
this.playerManager.logout(player);
atavism.server.plugins.ProxyPlugin.ConnectionResetMessage message = new atavism.server.plugins.ProxyPlugin.ConnectionResetMessage(this, con, player);
message.setEnqueueTime();
this.messageQQ.insert(player, message);
}
}
protected void processConnectionResetInternal(atavism.server.plugins.ProxyPlugin.ConnectionResetMessage message) {
long startTime = System.currentTimeMillis();
ClientConnection con = message.getConnection();
Player player = message.getPlayer();
OID playerOid = player.getOid();
if (Log.loggingInfo) {
Log.info("ProxyPlugin: LOGOUT_BEGIN remote=" + con + " playerOid=" + player.getOid() + " name=" + player.getName());
}
if (player.getStatus() != 3) {
log.error("processConnectionReset: player status is " + Player.statusToString(player.getStatus()) + " should be " + Player.statusToString(3));
player.setStatus(3);
}
try {
try {
if (!WorldManagerClient.despawn(playerOid)) {
log.warn("processConnectionReset: despawn player failed for " + playerOid);
}
} catch (Exception var13) {
log.warn("processConnectionReset: despawn player failed for " + playerOid + " " + var13);
}
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal Removing perceptionFilter for palyer: " + playerOid);
}
if (this.perceptionFilter.removeTarget(playerOid)) {
FilterUpdate filterUpdate = new FilterUpdate(1);
filterUpdate.removeFieldValue(1, playerOid);
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal Removing perceptionFilter applyFilterUpdate for palyer: " + playerOid);
}
Engine.getAgent().applyFilterUpdate(this.perceptionSubId, filterUpdate);
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal Removing responderFilter for palyer: " + playerOid);
}
this.responderFilter.removeTarget(playerOid);
this.responderFilter2.removeTarget(playerOid);
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal Removing perceptionFilter applyFilterUpdate for palyer: " + playerOid);
}
Engine.getAgent().applyFilterUpdate(this.responderSubId, filterUpdate);
Engine.getAgent().applyFilterUpdate(this.responderSubId2, filterUpdate);
}
LogoutMessage logoutMessage = new LogoutMessage(playerOid, player.getName());
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal: Send LogoutMessage for player: " + playerOid + " and wait for response");
}
atavism.server.plugins.ProxyPlugin.AsyncRPCCallback asyncRPCCallback = new atavism.server.plugins.ProxyPlugin.AsyncRPCCallback(player, "processLogout: got LogoutMessage response");
int expectedResponses = Engine.getAgent().sendBroadcastRPC(logoutMessage, asyncRPCCallback);
if (Log.loggingDebug) {
Log.debug("processConnectionResetInternal: Send LogoutMessage for player: " + playerOid + " and wait for response expectedResponses=" + expectedResponses);
}
asyncRPCCallback.waitForResponses(expectedResponses);
OID accountID = this.aDB.getAccountForCharacter(playerOid);
if (Log.loggingDebug) {
Log.debug("Removing connection from client connection map for account: " + accountID);
}
if (this.clientConnections.containsKey(accountID) && ((ClientConnection)this.clientConnections.get(accountID)).isOpen()) {
Prometheus.registry().counter("rdp_connection_closed", new String[]{"reason", "internal_reset"}).increment();
((ClientConnection)this.clientConnections.get(accountID)).close();
}
this.clientConnections.remove(accountID);
if (!ObjectManagerClient.unloadObject(playerOid)) {
log.warn("processConnectionReset: unloadObject failed oid=" + playerOid);
}
} catch (NoRecipientsException var14) {
log.exception("ProxyPlugin.processConnectionResetInternal(): NoRecipientsException ", var14);
} catch (RPCTimeoutException var15) {
log.exception("ProxyPlugin.processConnectionResetInternal(): RPCTimeoutException ", var15);
} catch (Exception var16) {
log.exception("ProxyPlugin.processConnectionResetInternal(): Exception ", var16);
}
this.messageQQ.removeKey(player);
this.eventQQ.removeKey(player);
con.closeAggregator();
this.playerManager.removeStaticPerception(player, playerOid);
this.playerManager.removePlayer(playerOid);
if (Log.loggingInfo) {
Log.info("ProxyPlugin: LOGOUT_END remote=" + con + " playerOid=" + player.getOid() + " name=" + player.getName() + " in-queue=" + (startTime - message.getEnqueueTime()) + " processing=" + (System.currentTimeMillis() - startTime) + " nPlayers=" + this.playerManager.getPlayerCount());
}
synchronized(player) {
player.clearConnection();
player.notifyAll();
}
}
protected void processPlayerHa(ClientConnection con, PlayerHaEvent event) {
if (Log.loggingDebug) {
Log.debug("processPlayerHa: got dir loc orient event: " + event);
}
Player player = this.verifyPlayer("processPlayerHa", event, con);
long stime = System.currentTimeMillis();
long ctime = event.getTime();
long lctime = 0L;
long lstime = 0L;
try {
lctime = (Long)this.playerLastClientTime.get(player.getOid());
} catch (Exception var20) {
}
try {
lstime = (Long)this.playerLastServerTime.get(player.getOid());
} catch (Exception var19) {
}
this.playerLastClientTime.put(player.getOid(), event.getTime());
this.playerLastServerTime.put(player.getOid(), stime);
if (lctime > 0L && lstime > 0L && stime - lstime < (long)SpeedhackMinDiff) {
log.error("SPEEDHACK detected plyOid=" + player.getOid() + " Ct=" + ctime + " LCT=" + lctime + " ST=" + stime + " LST=" + lstime + " dst=" + (stime - lstime) + " dct=" + (ctime - lctime));
long count = 0L;
try {
count = (Long)this.playerSpeedHackCount.get(player.getOid());
} catch (Exception var18) {
}
++count;
this.playerSpeedHackCount.put(player.getOid(), count);
long fdtime = 0L;
try {
fdtime = (Long)this.playerFirstSpeedHackTime.get(player.getOid());
} catch (Exception var17) {
}
if (fdtime == 0L) {
fdtime = stime;
this.playerFirstSpeedHackTime.put(player.getOid(), stime);
}
if (SpeedhackChatMsg.length() > 1) {
TargetedComMessage comMsg = new TargetedComMessage();
comMsg.setString(SpeedhackChatMsg);
comMsg.setChannel(0);
comMsg.setChatterName("Admin");
comMsg.setTarget(player.getOid());
Engine.getAgent().sendBroadcast(comMsg);
}
HashMap<String, Serializable> logData = new HashMap();
logData.put("serverDeltaTime", stime - lstime);
logData.put("clientDeltaTime", ctime - lctime);
logData.put("firstDetection", fdtime);
logData.put("count", count);
DataLoggerClient.logData("SPEEDHACK", player.getOid(), (OID)null, (OID)null, logData);
if (count > (long)SpeedhackCountToDisconect) {
Prometheus.registry().counter("rdp_connection_closed", new String[]{"reason", "speed_hack"}).increment();
con.close();
this.playerLastClientTime.remove(player.getOid());
this.playerLastServerTime.remove(player.getOid());
this.playerFirstSpeedHackTime.remove(player.getOid());
this.playerSpeedHackCount.remove(player.getOid());
}
}
}
protected void processDirLocOrient(ClientConnection con, DirLocOrientEvent event) {
if (Log.loggingDebug) {
Log.debug("processDirLocOrient: got dir loc orient event: " + event);
}
Player player = this.verifyPlayer("processDirLoc", event, con);
BasicWorldNode wnode = new BasicWorldNode();
wnode.setDir(event.getDir());
wnode.setLoc(event.getLoc());
wnode.setOrientation(event.getQuaternion());
wnode.time = event.getTime();
wnode.mid = event.getId();
wnode.cid = event.getUId();
WorldManagerClient.updateWorldNode(player.getOid(), wnode);
}
protected void processCom(ClientConnection con, ComEvent event) {
Player player = this.verifyPlayer("processCom", event, con);
if (Log.loggingInfo) {
Log.info("ProxyPlugin: CHAT_SENT player=" + player + " channel=" + event.getChannelId() + " msg=[" + event.getMessage() + "]");
}
log.debug("processCom: CHAT_SENT");
if (!this.aDB.isOnBlackList(player.getOid(), event.getObjectOid())) {
this.incrementChatCount();
ChatClient.sendChatMsg(player.getOid(), player.getName(), event.getChannelId(), event.getMessage());
}
}
protected void processCommand(ClientConnection con, CommandEvent event) {
Player player = this.verifyPlayer("processCommand", event, con);
String cmd = event.getCommand().split(" ")[0];
if (Log.loggingDebug) {
log.debug("processCommand: cmd=" + cmd + ", fullCmd=" + event.getCommand());
}
this.commandMapLock.lock();
atavism.server.plugins.ProxyPlugin.RegisteredCommand command;
try {
command = (atavism.server.plugins.ProxyPlugin.RegisteredCommand)this.commandMap.get(cmd);
} finally {
this.commandMapLock.unlock();
}
if (command == null) {
Log.warn("processCommand: no parser for command: " + event.getCommand());
command = (atavism.server.plugins.ProxyPlugin.RegisteredCommand)this.commandMap.get("/unknowncmd");
if (command != null) {
Engine.setCurrentPlugin(this);
command.parser.parse(event);
Engine.setCurrentPlugin((EnginePlugin)null);
}
} else {
Engine.setCurrentPlugin(this);
if (command.access.allowed(event, this)) {
command.parser.parse(event);
} else {
Log.warn("Player " + player + " not allowed to run command '" + event.getCommand() + "'");
}
Engine.setCurrentPlugin((EnginePlugin)null);
}
}
protected void processAutoAttack(ClientConnection con, AutoAttackEvent event) {
CombatClient.autoAttack(event.getAttackerOid(), event.getTargetOid(), event.getAttackStatus());
}
protected void processActivateItem(ClientConnection con, ActivateItemEvent event) {
InventoryClient.activateObject(event.getItemOid(), event.getObjectOid(), event.getTargetOid());
}
protected void processAbilityStatusEvent(ClientConnection con, AbilityStatusEvent event) {
Player player = (Player)con.getAssociation();
AbilityStatusMessage msg = new AbilityStatusMessage(CombatClient.MSG_TYPE_ABILITY_STATUS, player.getOid(), event.getPropertyMap());
Engine.getAgent().sendBroadcast(msg);
}
protected void processLogout(ClientConnection con, LogoutEvent event) {
}
protected void processSceneLoaded(ClientConnection con, SceneLoadedEvent event) {
Player player = (Player)con.getAssociation();
player.sceneLoading(false);
if (Log.loggingDebug) {
Log.debug("SCENE: sceneLoading set to false for player: " + player.getOid());
}
}
protected void processExtensionMessageEvent(ClientConnection con, ExtensionMessageEvent event) {
String key = (String)event.getPropertyMap().get("ext_msg_subtype");
OID target = event.getTargetOid();
Player player = (Player)con.getAssociation();
if (Log.loggingDebug) {
Log.debug("processExtensionMessageEvent: " + player + " subType=" + key + " target=" + target);
}
List<ProxyExtensionHook> proxyHookList = (List)this.extensionHooks.get(key);
if (proxyHookList == null) {
if (target != null) {
TargetedExtensionMessage msg = new TargetedExtensionMessage(WorldManagerClient.MSG_TYPE_EXTENSION, target, player.getOid(), event.getClientTargeted(), event.getPropertyMap());
if (event.getClientTargeted()) {
msg.setMsgType(WorldManagerClient.MSG_TYPE_P2P_EXTENSION);
if (this.allowClientToClientMessage(player, target, msg)) {
Engine.getAgent().sendBroadcast(msg);
}
} else {
MessageType msgType = this.getExtensionMessageType(key);
if (msgType == null) {
Log.error("processExtensionMessageEvent: key '" + key + "' has no corresponding MessageType");
return;
}
msg.setMsgType(msgType);
Engine.getAgent().sendBroadcast(msg);
}
} else {
MessageType msgType = this.getExtensionMessageType(key);
if (msgType == null) {
Log.error("processExtensionMessageEvent: key '" + key + "' has no corresponding MessageType");
return;
}
ExtensionMessage msg = new ExtensionMessage(msgType, player.getOid(), event.getPropertyMap());
Engine.getAgent().sendBroadcast(msg);
}
} else {
Iterator var7 = proxyHookList.iterator();
while(var7.hasNext()) {
ProxyExtensionHook hook = (ProxyExtensionHook)var7.next();
hook.processExtensionEvent(event, player, this);
}
}
}
public void registerExtensionSubtype(String subtype, MessageType type) {
this.extensionMessageRegistry.put(subtype, type);
}
public MessageType unregisterExtensionSubtype(String subtype) {
return (MessageType)this.extensionMessageRegistry.remove(subtype);
}
public MessageType getExtensionMessageType(String subtype) {
return (MessageType)this.extensionMessageRegistry.get(subtype);
}
public boolean allowClientToClientMessage(Player sender, OID targetOid, TargetedExtensionMessage message) {
return this.defaultAllowClientToClientMessage;
}
protected boolean specialCaseNewProcessing(ObjectNote objectNote, Player player) {
long start = System.currentTimeMillis();
ClientConnection con = player.getConnection();
OID objOid = objectNote.getSubject();
ObjectType objType = objectNote.getObjectType();
if (objType == ObjectTypes.light) {
Log.debug("specialCaseNewProcessing: got a light object");
LightData lightData = (LightData)EnginePlugin.getObjectProperty(objOid, Namespace.WORLD_MANAGER, Light.LightDataPropertyKey);
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: light data=" + lightData);
}
NewLightEvent lightEvent = new NewLightEvent(player.getOid(), objOid, lightData);
con.send(lightEvent.toBytes());
return true;
} else if (objType.equals(WorldManagerClient.TEMPL_OBJECT_TYPE_TERRAIN_DECAL)) {
Log.debug("specialCaseNewProcessing: got a terrain decal object");
TerrainDecalData decalData = (TerrainDecalData)EnginePlugin.getObjectProperty(objOid, Namespace.WORLD_MANAGER, WorldManagerClient.TEMPL_TERRAIN_DECAL_DATA);
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: terrain decal data=" + decalData);
}
NewTerrainDecalEvent decalEvent = new NewTerrainDecalEvent(objOid, decalData);
con.send(decalEvent.toBytes());
return true;
} else if (objType.equals(WorldManagerClient.TEMPL_OBJECT_TYPE_POINT_SOUND)) {
Log.debug("specialCaseNewProcessing: got a point sound object");
List<SoundData> soundData = (List)EnginePlugin.getObjectProperty(objOid, Namespace.WORLD_MANAGER, WorldManagerClient.TEMPL_SOUND_DATA_LIST);
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: sound data=" + soundData);
}
SoundMessage soundMsg = new SoundMessage(objOid);
soundMsg.setSoundData(soundData);
con.send(soundMsg.toBuffer());
return true;
} else {
PerceptionInfo perceptionInfo = (PerceptionInfo)objectNote.getObjectInfo();
if (perceptionInfo.objectInfo == null) {
return true;
} else {
MobPathMessage pathMsg = (MobPathMessage)perceptionInfo.objectInfo.getProperty(WorldManagerClient.MOB_PATH_PROPERTY);
if (Log.loggingDebug) {
Log.debug("INFO: MobPathMessage special case with player/npc: " + perceptionInfo.objectInfo.name);
}
con.send(perceptionInfo.objectInfo.toBuffer(player.getOid()));
if (Log.loggingDebug) {
Log.debug("INFO: specialCaseNewProcessing " + perceptionInfo.displayContext);
}
if (perceptionInfo.displayContext != null) {
ModelInfoEvent modelInfoEvent = new ModelInfoEvent(objOid);
modelInfoEvent.setDisplayContext(perceptionInfo.displayContext);
con.send(modelInfoEvent.toBytes());
} else if (Log.loggingDebug) {
Log.debug("No display context for " + objOid + " " + perceptionInfo.objectInfo);
}
if (pathMsg != null) {
if (pathMsg.pathExpired()) {
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: for mob " + objOid + ", last mob path expired " + pathMsg.toString());
}
} else {
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: for mob " + objOid + ", sending last mob path " + pathMsg.toString());
}
AOByteBuffer pathBuf = pathMsg.toBuffer();
con.send(pathBuf);
}
}
Map<String, DisplayContext> childMap = null;
if (perceptionInfo.displayContext != null) {
childMap = perceptionInfo.displayContext.getChildDCMap();
}
if (childMap != null && !childMap.isEmpty()) {
Iterator var11 = childMap.keySet().iterator();
while(var11.hasNext()) {
String slot = (String)var11.next();
DisplayContext attachDC = (DisplayContext)childMap.get(slot);
if (attachDC == null) {
throw new AORuntimeException("attach DC is null for obj: " + objOid);
}
OID attacheeOID = attachDC.getObjRef();
if (attacheeOID == null) {
throw new AORuntimeException("attachee oid is null for obj: " + objOid);
}
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: sending attach message to " + player.getOid() + " attaching to obj " + objOid + ", object being attached=" + attacheeOID + " to slot " + slot + ", attachmentDC=" + attachDC);
}
AttachEvent event = new AttachEvent(objOid, attacheeOID, slot, attachDC);
con.send(event.toBytes());
}
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: done with processing attachments");
}
}
long finish = System.currentTimeMillis();
if (Log.loggingDebug) {
Log.debug("specialCaseNewProcessing: finished.\tplayerOid=" + player.getOid() + ", oid=" + objOid + " in " + (finish - start) + " ms");
}
return false;
}
}
}
protected boolean specialCaseFreeProcessing(ObjectNote objectNote, Player player) {
if (player.getOid().equals(objectNote.getSubject())) {
Log.debug("ignoring free object message to self");
return true;
} else {
ClientConnection con = player.getConnection();
if (!con.isOpen()) {
con = null;
}
OID objOid = objectNote.getSubject();
if (objectNote.getObjectType() == ObjectTypes.road) {
if (Log.loggingDebug) {
Log.debug("specialCaseFreeProcessing: playerOid=" + player.getOid() + ", roadSegmentOid=" + objOid);
}
this.handleFreeRoad(con, objOid);
return true;
} else if (objectNote.getObjectType().equals(WorldManagerClient.TEMPL_OBJECT_TYPE_TERRAIN_DECAL)) {
if (Log.loggingDebug) {
Log.debug("specialCaseFreeProcessing: playerOid=" + player.getOid() + ", decalOid=" + objOid);
}
FreeTerrainDecalEvent decalEvent = new FreeTerrainDecalEvent(objOid);
if (con != null) {
con.send(decalEvent.toBytes());
}
return true;
} else {
if (Log.loggingDebug) {
Log.debug("specialCaseFreeProcessing: playerOid=" + player.getOid() + ", objOid=" + objOid);
}
NotifyFreeObjectEvent freeEvent = new NotifyFreeObjectEvent(player.getOid(), objOid);
if (con != null) {
con.send(freeEvent.toBytes());
}
return false;
}
}
}
protected void handleFreeRoad(ClientConnection con, OID objOid) {
FreeRoadMessage freeRoadMsg = new FreeRoadMessage(objOid);
AOByteBuffer buf = freeRoadMsg.toBuffer();
if (con != null) {
con.send(buf);
}
}
public static void addStaticPerception(OID playerOid, OID oid) {
addStaticPerception(playerOid, oid, (String)null, (ObjectType)null, false);
}
public static void addStaticPerception(OID oid, OID oid2, String name, ObjectType type) {
addStaticPerception(oid, oid2, name, type, true);
}
private static void addStaticPerception(OID playerOid, OID oid, String name, ObjectType type, boolean hasObjectInfo) {
atavism.server.plugins.ProxyPlugin.AddStaticPerceptionMessage message = new atavism.server.plugins.ProxyPlugin.AddStaticPerceptionMessage(MSG_TYPE_ADD_STATIC_PERCEPTION);
message.setTarget(playerOid);
message.setSubject(oid);
message.setName(name);
message.setType(type);
message.setHasObjectInfo(hasObjectInfo);
Engine.getAgent().sendBroadcast(message);
}
public static void removeStaticPerception(OID playerOid, OID oid) {
TargetMessage message = new TargetMessage(MSG_TYPE_REMOVE_STATIC_PERCEPTION);
message.setTarget(playerOid);
message.setSubject(oid);
Engine.getAgent().sendBroadcast(message);
}
protected void processPlayerIgnoreList(Player player) {
if (player.getStatus() == 3) {
Log.error("ProxyPlugin.processPlayerIgnoreList: Aborting... player.getStatus() is STATUS_LOGOUT");
} else {
this.sendPlayerIgnoreList(player);
}
}
protected void sendPlayerIgnoreList(Player player) {
String missing = " Missing ";
}
public void updateIgnoredOids(Player player, List<OID> nowIgnored, List<OID> noLongerIgnored) {
}
public List<Object> matchingPlayers(Player player, String playerName, Boolean exactMatch) {
boolean match = exactMatch == null ? true : exactMatch;
List<Object> matchLists = Engine.getDatabase().getOidsAndNamesMatchingName(playerName, match);
List<OID> oids = (List)matchLists.get(0);
List<String> names = (List)matchLists.get(1);
if (Log.loggingDebug) {
log.debug("ProxyPlugin.matchingPlayers: For player " + player.getOid() + ", found " + (oids == null ? 0 : oids.size()) + " players: " + Database.makeOidCollectionString(oids) + " " + (match ? "exactly matching" : "starting with") + " name '" + playerName + "':" + Database.makeNameCollectionString(names));
}
return matchLists;
}
public boolean isOnBlockList2(OID playerOid, OID targetOid) {
if (Log.loggingDebug) {
log.debug("IsOnBlockList: SocialPlugin started for: " + playerOid);
}
boolean isOnBlockList = this.aDB.isOnBlackList(playerOid, targetOid);
String targetName;
if (isOnBlockList) {
targetName = WorldManagerClient.getObjectInfo(targetOid).name;
EventMessageHelper.SendErrorEvent(playerOid, "ErrorPlayerOnBlockList", 0, targetName);
} else {
isOnBlockList = this.aDB.isOnBlackList(targetOid, playerOid);
if (isOnBlockList) {
targetName = WorldManagerClient.getObjectInfo(targetOid).name;
EventMessageHelper.SendErrorEvent(playerOid, "ErrorPlayerYourOnBlockList", 0, targetName);
}
}
if (Log.loggingDebug) {
log.debug("IsOnBlockList: SocialPlugin finished for: " + playerOid);
}
return isOnBlockList;
}
private boolean isPlayerConnectionValid(Player player) {
ClientConnection con = player.getConnection();
return con != null && con.isOpen();
}
public static OID handleFullInstance(int instanceTemplateID, InstanceInfo instanceInfo) {
if (Log.loggingDebug) {
Log.debug("POP: instance full with template: " + instanceTemplateID);
}
int instanceNum = 1;
String instanceName = "";
InstanceTemplate island = InstanceClient.getInstanceTemplate(instanceTemplateID);
OID instanceOid;
while(true) {
instanceName = island.getName() + "_" + instanceNum;
instanceOid = InstanceClient.getInstanceOid(instanceName);
if (instanceOid != null) {
instanceInfo = InstanceClient.getInstanceInfo(instanceOid, -262145);
if (instanceInfo.populationLimit < 1 || instanceInfo.playerPopulation < instanceInfo.populationLimit) {
break;
}
} else {
Template overrideTemplate = new Template();
overrideTemplate.put(Namespace.INSTANCE, "name", instanceName);
overrideTemplate.setName(instanceName);
instanceOid = InstanceClient.createInstance(instanceTemplateID, overrideTemplate);
if (instanceOid != null) {
break;
}
}
++instanceNum;
}
return instanceOid;
}
private void updateInstancePerception(OID playerOid, OID prevInstanceOid, OID destInstanceOid, String destInstanceName) {
if (prevInstanceOid != null) {
removeStaticPerception(playerOid, prevInstanceOid);
}
addStaticPerception(playerOid, destInstanceOid, destInstanceName, ObjectTypes.instance);
}
protected void pushInstanceRestorePoint(Player player, BasicWorldNode loc) {
OID playerOid = player.getOid();
if (Log.loggingDebug) {
log.debug("pushInstanceRestorePoint " + playerOid);
}
InstanceRestorePoint restorePoint = new InstanceRestorePoint();
restorePoint.setInstanceOid(loc.getInstanceOid());
restorePoint.setLoc(loc.getLoc());
restorePoint.setOrientation(loc.getOrientation());
InstanceInfo instanceInfo = InstanceClient.getInstanceInfo(loc.getInstanceOid(), 8);
restorePoint.setInstanceID(instanceInfo.templateID);
LinkedList<Object> restoreStack = (LinkedList)EnginePlugin.getObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "instanceStack");
if (restoreStack == null) {
restoreStack = new LinkedList();
}
restoreStack.add(restorePoint);
EnginePlugin.setObjectProperty(playerOid, Namespace.OBJECT_MANAGER, "instanceStack", restoreStack);
}
protected void sendOceanData(OceanData oceanData, Player player) {
TargetedExtensionMessage oceanMsg = new ClientParameterMessage(player.getOid());
oceanMsg.setProperty("Ocean.DisplayOcean", oceanData.displayOcean.toString());
if (oceanData.useParams != null) {
oceanMsg.setProperty("Ocean.UseParams", oceanData.useParams.toString());
}
if (oceanData.waveHeight != null) {
oceanMsg.setProperty("Ocean.WaveHeight", oceanData.waveHeight.toString());
}
if (oceanData.seaLevel != null) {
oceanMsg.setProperty("Ocean.SeaLevel", oceanData.seaLevel.toString());
}
if (oceanData.bumpScale != null) {
oceanMsg.setProperty("Ocean.BumpScale", oceanData.bumpScale.toString());
}
if (oceanData.bumpSpeedX != null) {
oceanMsg.setProperty("Ocean.BumpSpeedX", oceanData.bumpSpeedX.toString());
}
if (oceanData.bumpSpeedZ != null) {
oceanMsg.setProperty("Ocean.BumpSpeedZ", oceanData.bumpSpeedZ.toString());
}
if (oceanData.textureScaleX != null) {
oceanMsg.setProperty("Ocean.TextureScaleX", oceanData.textureScaleX.toString());
}
if (oceanData.textureScaleZ != null) {
oceanMsg.setProperty("Ocean.TextureScaleZ", oceanData.textureScaleZ.toString());
}
if (oceanData.deepColor != null) {
oceanMsg.setProperty("Ocean.DeepColor", oceanData.deepColor.toString());
}
if (oceanData.shallowColor != null) {
oceanMsg.setProperty("Ocean.ShallowColor", oceanData.shallowColor.toString());
}
player.getConnection().send(oceanMsg.toBuffer(player.getVersion()));
}
protected Player verifyPlayer(String context, Event event, ClientConnection con) {
Player player = (Player)con.getAssociation();
if (!player.getOid().equals(event.getObjectOid())) {
throw new AORuntimeException(context + ": con doesn't match player " + player + " against eventOid " + event.getObjectOid());
} else {
return player;
}
}
public void incrementChatCount() {
++this.chatSentCount;
}
public void incrementPrivateChatCount() {
++this.privateChatSentCount;
}
public void addAdmin(OID oid) {
if (Log.loggingDebug) {
log.debug("ProxyPlugin.addAdmin: adding oid " + oid);
}
this.lock.lock();
try {
this.adminSet.add(oid);
} finally {
this.lock.unlock();
}
}
public Set<OID> getAdmins() {
this.lock.lock();
HashSet var1;
try {
var1 = new HashSet(this.adminSet);
} finally {
this.lock.unlock();
}
return var1;
}
public boolean isAdmin(OID playerOid) {
this.lock.lock();
boolean var2;
try {
if (playerOid != null) {
AccountDatabase aDB = new AccountDatabase(false);
int status = aDB.getCharacterAccountStatus(playerOid);
boolean var4 = status == 5;
return var4;
}
var2 = false;
} finally {
this.lock.unlock();
}
return var2;
}
public int GetConnectionLimit() {
return this.connectionLimit;
}
protected Object createMBeanInstance() {
return new atavism.server.plugins.ProxyPlugin.ProxyJMX(this);
}
private String getTemp() {
return "47bedc488b0106b2219dd2e2ff5524fd";
}
// $FF: synthetic method
static SquareQueue access$200(ProxyPlugin x0) {
return x0.eventQQ;
}
// $FF: synthetic method
static String access$300(ProxyPlugin x0) {
return x0.getTemp();
}
// $FF: synthetic method
static int access$402(ProxyPlugin x0, int x1) {
return x0.connectionLimit = x1;
}
// $FF: synthetic method
static int access$400(ProxyPlugin x0) {
return x0.connectionLimit;
}
// $FF: synthetic method
static ObjectLockManager access$1100(ProxyPlugin x0) {
return x0.getObjectLockManager();
}
// $FF: synthetic method
static int access$1200(ProxyPlugin x0) {
return x0.instanceEntryCount;
}
// $FF: synthetic method
static int access$1300(ProxyPlugin x0) {
return x0.chatSentCount;
}
// $FF: synthetic method
static int access$1400(ProxyPlugin x0) {
return x0.privateChatSentCount;
}
// $FF: synthetic method
static ExecutorService access$1500(ProxyPlugin x0) {
return x0.logoutExecutor;
}
// $FF: synthetic method
static boolean access$1600(ProxyPlugin x0, Player x1) {
return x0.isPlayerConnectionValid(x1);
}
// $FF: synthetic method
static InstanceEntryCallback access$1700(ProxyPlugin x0) {
return x0.instanceEntryCallback;
}
// $FF: synthetic method
static boolean access$1800(ProxyPlugin x0, OID x1, OID x2, Point x3) {
return x0.instanceEntryAllowed(x1, x2, x3);
}
// $FF: synthetic method
static void access$1900(ProxyPlugin x0, OID x1, OID x2, OID x3, String x4) {
x0.updateInstancePerception(x1, x2, x3, x4);
}
// $FF: synthetic method
static int access$1208(ProxyPlugin x0) {
return x0.instanceEntryCount++;
}
}