Class UdpConnection

java.lang.Object
zombie.network.PacketsCache
zombie.core.raknet.UdpConnection
All Implemented Interfaces:
IConnection

public class UdpConnection extends PacketsCache implements IConnection
  • Field Details

    • usernames

      public String[] usernames
    • lastConnections

      public static HashMap<String,Long> lastConnections
    • lastUnauthorizedPacket

      public long lastUnauthorizedPacket
    • password

      public String password
    • releventPos

      public Vector3[] releventPos
    • playerIds

      public short[] playerIds
    • players

      public IsoPlayer[] players
    • connectArea

      public Vector3[] connectArea
    • checksumState

      public UdpConnection.ChecksumState checksumState
    • checksumTime

      public long checksumTime
    • awaitingCoopApprove

      public boolean awaitingCoopApprove
    • isCoopHost

      public boolean isCoopHost
    • chunkObjectState

      public final gnu.trove.list.array.TShortArrayList chunkObjectState
    • netStatistics

      public ZNetStatistics netStatistics
    • pingHistory

      public final Deque<Integer> pingHistory
    • CONNECTION_GRACE_INTERVAL

      public static final long CONNECTION_GRACE_INTERVAL
      See Also:
    • CONNECTION_READY_INTERVAL

      public static final long CONNECTION_READY_INTERVAL
      See Also:
    • connectionTimestamp

      public long connectionTimestamp
    • googleAuth

      public boolean googleAuth
    • timerSendZombie

      public UpdateTimer timerSendZombie
    • timerUpdateAnimal

      public HashMap<Short, UpdateTimer> timerUpdateAnimal
  • Constructor Details

    • UdpConnection

      public UdpConnection(UdpEngine engine, long connectedGuid, int index)
  • Method Details

    • getMaxPlayers

      public int getMaxPlayers()
    • setMaxPlayers

      public void setMaxPlayers(int maxPlayers)
    • getPeer

      public RakNetPeerInterface getPeer()
    • getConnectedGUID

      public long getConnectedGUID()
      Specified by:
      getConnectedGUID in interface IConnection
    • getIDStr

      public String getIDStr()
      Specified by:
      getIDStr in interface IConnection
    • setIDStr

      public void setIDStr(String idStr)
    • getOwnerId

      public long getOwnerId()
    • setOwnerId

      public void setOwnerId(long ownerId)
    • setPinged

      public void setPinged(boolean ping)
    • wasInLoadingQueue

      public boolean wasInLoadingQueue()
      Specified by:
      wasInLoadingQueue in interface IConnection
    • setWasInLoadingQueue

      public void setWasInLoadingQueue(boolean wasInLoadingQueue)
    • getPlayerDownloadServer

      public PlayerDownloadServer getPlayerDownloadServer()
      Specified by:
      getPlayerDownloadServer in interface IConnection
    • setPlayerDownloadServer

      public void setPlayerDownloadServer(PlayerDownloadServer playerDownloadServer)
    • getZombieListHash

      public int getZombieListHash()
    • setZombieListHash

      public void setZombieListHash(int zombieListHash)
    • isNeighborPlayer

      public boolean isNeighborPlayer()
    • getServerIP

      public String getServerIP()
    • getPlayerAt

      public IsoPlayer getPlayerAt(int playerIndex)
      Specified by:
      getPlayerAt in interface IConnection
    • setPlayerAt

      public void setPlayerAt(int playerIndex, IsoPlayer player)
      Specified by:
      setPlayerAt in interface IConnection
    • startPacket

      public ByteBufferWriter startPacket()
      Specified by:
      startPacket in interface IConnection
    • startPingPacket

      public ByteBufferWriter startPingPacket()
    • isRelevantTo

      public boolean isRelevantTo(float x, float y)
      Specified by:
      isRelevantTo in interface IConnection
    • getRelevantAndDistance

      public float getRelevantAndDistance(float x, float y, float z)
    • RelevantToPlayerIndex

      public boolean RelevantToPlayerIndex(int n, float x, float y)
    • RelevantTo

      public boolean RelevantTo(float x, float y, float radius)
    • cancelPacket

      public void cancelPacket()
      Specified by:
      cancelPacket in interface IConnection
    • getLastConnection

      public long getLastConnection()
      Specified by:
      getLastConnection in interface IConnection
    • setLastConnection

      public void setLastConnection(long lastConnection)
    • getBufferPosition

      public int getBufferPosition()
    • endPacket

      public void endPacket(int priority, int reliability, byte ordering)
      Specified by:
      endPacket in interface IConnection
    • getUserName

      public String getUserName()
      Specified by:
      getUserName in interface IConnection
    • getUserName

      public String getUserName(int playerIndex)
      Specified by:
      getUserName in interface IConnection
    • setRelevantRange

      public void setRelevantRange(byte b)
      Specified by:
      setRelevantRange in interface IConnection
    • getRelevantRange

      public byte getRelevantRange()
    • endPacket

      public void endPacket()
    • endPacketImmediate

      public void endPacketImmediate()
    • endPacketUnordered

      public void endPacketUnordered()
    • endPacketUnreliable

      public void endPacketUnreliable()
    • endPacketSuperHighUnreliable

      public void endPacketSuperHighUnreliable()
    • endPingPacket

      public void endPingPacket()
    • getInetSocketAddress

      public InetSocketAddress getInetSocketAddress()
    • forceDisconnect

      public void forceDisconnect(String description)
      Specified by:
      forceDisconnect in interface IConnection
    • setFullyConnected

      public void setFullyConnected()
      Specified by:
      setFullyConnected in interface IConnection
    • getSteamId

      public long getSteamId()
      Specified by:
      getSteamId in interface IConnection
    • setSteamId

      public void setSteamId(long steamId)
    • getIP

      public String getIP()
      Specified by:
      getIP in interface IConnection
    • setIP

      public void setIP(String ip)
    • getPlayerId

      public short getPlayerId(int playerIndex)
      Specified by:
      getPlayerId in interface IConnection
    • setChunkGridWidth

      public void setChunkGridWidth(int range)
      Specified by:
      setChunkGridWidth in interface IConnection
    • setLoadedCells

      public void setLoadedCells(int playerIndex, ClientServerMap clientServerMap)
      Specified by:
      setLoadedCells in interface IConnection
    • getLoadedCell

      public ClientServerMap getLoadedCell(int playerIndex)
      Specified by:
      getLoadedCell in interface IConnection
    • setConnectArea

      public void setConnectArea(int playerIndex, Vector3 connectArea)
      Specified by:
      setConnectArea in interface IConnection
    • getRelevantPos

      public Vector3 getRelevantPos(int playerIndex)
      Specified by:
      getRelevantPos in interface IConnection
    • setConnectionTimestamp

      public void setConnectionTimestamp(long interval)
      Specified by:
      setConnectionTimestamp in interface IConnection
    • getValidator

      public PacketValidator getValidator()
      Specified by:
      getValidator in interface IConnection
    • getChunkGridWidth

      public int getChunkGridWidth()
      Specified by:
      getChunkGridWidth in interface IConnection
    • getIndex

      public int getIndex()
    • setIndex

      public void setIndex(int index)
    • isAllChatMuted

      public boolean isAllChatMuted()
    • setAllChatMuted

      public void setAllChatMuted(boolean allChatMuted)
    • setUserName

      public void setUserName(String userName)
    • setUserName

      public void setUserName(int playerIndex, String userName)
      Specified by:
      setUserName in interface IConnection
    • setRelevantPos

      public void setRelevantPos(int playerIndex, Vector3 vector3)
      Specified by:
      setRelevantPos in interface IConnection
    • setPlayerId

      public void setPlayerId(int playerIndex, short playerID)
      Specified by:
      setPlayerId in interface IConnection
    • checkReady

      public void checkReady()
    • isReady

      public boolean isReady()
    • setReady

      public void setReady(boolean ready)
    • isGoogleAuthTimeout

      public boolean isGoogleAuthTimeout()
    • isConnectionAttemptTimeout

      public boolean isConnectionAttemptTimeout()
    • isConnectionGraceIntervalTimeout

      public boolean isConnectionGraceIntervalTimeout()
    • isFullyConnected

      public boolean isFullyConnected()
    • calcCountPlayersInRelevantPosition

      public void calcCountPlayersInRelevantPosition()
    • getStatistics

      public ZNetStatistics getStatistics()
    • getAveragePing

      public int getAveragePing()
    • getLastPing

      public int getLastPing()
    • getLowestPing

      public int getLowestPing()
    • getMTUSize

      public int getMTUSize()
      Specified by:
      getMTUSize in interface IConnection
    • getConnectionType

      public UdpConnection.ConnectionType getConnectionType()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasPlayer

      public boolean hasPlayer(String userName)
      Specified by:
      hasPlayer in interface IConnection
    • getRole

      public Role getRole()
      Specified by:
      getRole in interface IConnection
    • setRole

      public void setRole(Role role)
      Specified by:
      setRole in interface IConnection
    • havePlayer

      public boolean havePlayer(IsoPlayer p)
    • getPlayerIndex

      public byte getPlayerIndex(IsoPlayer p)