Added debug output for various player appearing/disappearing events

This commit is contained in:
Obique PSWG
2015-12-13 10:59:38 -06:00
parent ce4509bb6d
commit 757232dc0d
3 changed files with 38 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package utilities;
import resources.control.Service;
import resources.objects.creature.CreatureObject;
import resources.player.Player;
import resources.server_info.Log;
public class DebugUtilities {
public static void printPlayerCharacterDebug(Service service, Player p, String identifyingText) {
CreatureObject c = p.getCreatureObject();
boolean hasGhost = c.getSlottedObject("ghost") != null;
Log.d(service, "[%s] PLAY=%s/%d CREO=%s/%d hasGhost=%b", identifyingText, p.getUsername(), p.getUserId(), c.getName(), c.getObjectId(), hasGhost);
}
public static void printPlayerCharacterDebug(Service service, CreatureObject c, String identifyingText) {
Player p = c.getOwner();
String username = "null";
int id = 0;
if (p != null) {
username = p.getUsername();
id = p.getUserId();
}
boolean hasGhost = c.getSlottedObject("ghost") != null;
Log.d(service, "[%s] PLAY=%s/%d CREO=%s/%d hasGhost=%b", identifyingText, username, id, c.getName(), c.getObjectId(), hasGhost);
}
}