Atavism Version 2018.1AGIS API

atavism.server.objects
Class PlayerManager

java.lang.Object
  extended by atavism.server.objects.PlayerManager

public class PlayerManager
extends java.lang.Object

Keeps track of all players currently logged in and manages what can perceive them and what they can perceive


Constructor Summary
PlayerManager()
           
 
Method Summary
 boolean addPlayer(Player player)
           
 boolean addStaticPerception(Player player, OID subjectOid)
          Add the static perception of the subjectOid by the player.
 void addWorldPerception(Player player, java.util.Collection<PerceptionMessage.ObjectNote> objectNotes, java.util.List<OID> newSubjects)
          Goes through the list of objects the player can now perceive and adds the player to the list of who can see the object.
 int getLoginCount()
           
 int getLoginSeconds()
           
 int getLogoutCount()
           
 int getPeakPlayerCount()
           
 java.util.List<Player> getPerceivers(OID subjectOid)
          Gets the list of players who can perceive the the subjectOid.
 Player getPlayer(ClientConnection conn)
           
 Player getPlayer(OID playerOid)
           
 int getPlayerCount()
           
 void getPlayers(java.util.Collection<Player> pp)
           
 java.util.List<Player> getTimedoutPlayers(long activityTimeoutMS, long contactTimeoutMS, long loadingTimeoutMS)
           
 void loginComplete(Player player, SquareQueue<Player,Event> eventQQ)
           
 boolean logout(Player player)
           
 void processEvent(Player player, Event event, SquareQueue<Player,Event> eventQQ)
           
 Player removePlayer(OID playerOid)
           
 boolean removeStaticPerception(Player player, OID playerOid)
          Remove the static perception of the subjectOid by the player.
 void removeWorldPerception(Player player, java.util.Collection<PerceptionMessage.ObjectNote> objectNotes, java.util.List<OID> deleteSubjects)
          Goes through the list of objects the player can no longer perceive and removes the player to the list of who can see the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerManager

public PlayerManager()
Method Detail

addPlayer

public boolean addPlayer(Player player)

getPlayer

public Player getPlayer(OID playerOid)

getPlayer

public Player getPlayer(ClientConnection conn)

removePlayer

public Player removePlayer(OID playerOid)

getPlayerCount

public int getPlayerCount()

getPeakPlayerCount

public int getPeakPlayerCount()

getLoginCount

public int getLoginCount()

getLogoutCount

public int getLogoutCount()

getLoginSeconds

public int getLoginSeconds()

getPlayers

public void getPlayers(java.util.Collection<Player> pp)

addWorldPerception

public void addWorldPerception(Player player,
                               java.util.Collection<PerceptionMessage.ObjectNote> objectNotes,
                               java.util.List<OID> newSubjects)
Goes through the list of objects the player can now perceive and adds the player to the list of who can see the object.

Parameters:
player -
objectNotes -
newSubjects -

removeWorldPerception

public void removeWorldPerception(Player player,
                                  java.util.Collection<PerceptionMessage.ObjectNote> objectNotes,
                                  java.util.List<OID> deleteSubjects)
Goes through the list of objects the player can no longer perceive and removes the player to the list of who can see the object.

Parameters:
player -
objectNotes -
newSubjects -

addStaticPerception

public boolean addStaticPerception(Player player,
                                   OID subjectOid)
Add the static perception of the subjectOid by the player.

Parameters:
player -
subjectOid -
Returns:
true if this caused the subjectOid to be perceived

removeStaticPerception

public boolean removeStaticPerception(Player player,
                                      OID playerOid)
Remove the static perception of the subjectOid by the player.

Parameters:
player -
playerOid -
Returns:
true if there are no more perceivers for the subjectOid

getPerceivers

public java.util.List<Player> getPerceivers(OID subjectOid)
Gets the list of players who can perceive the the subjectOid. Called when a message is picked up by the PlayerMessageCallback to determine all the players who should be sent the message.

Parameters:
subjectOid -
Returns:

processEvent

public void processEvent(Player player,
                         Event event,
                         SquareQueue<Player,Event> eventQQ)

loginComplete

public void loginComplete(Player player,
                          SquareQueue<Player,Event> eventQQ)

logout

public boolean logout(Player player)

getTimedoutPlayers

public java.util.List<Player> getTimedoutPlayers(long activityTimeoutMS,
                                                 long contactTimeoutMS,
                                                 long loadingTimeoutMS)


Copyright © 2018 Dragonsan Studios Sp. z o.o.