Definition at line 39 of file Session.php.
 
◆ __construct()
      
        
          | raklib\generic\Session::__construct  | 
          ( | 
          \Logger |           $logger,  | 
        
        
           | 
           | 
          InternetAddress |           $address,  | 
        
        
           | 
           | 
          int |           $clientId,  | 
        
        
           | 
           | 
          int |           $mtuSize,  | 
        
        
           | 
           | 
          int |           $recvMaxSplitParts = PHP_INT_MAX,  | 
        
        
           | 
           | 
          int |           $recvMaxConcurrentSplits = PHP_INT_MAX ) | 
        
      
 
 
◆ addEncapsulatedToQueue()
      
        
          | raklib\generic\Session::addEncapsulatedToQueue  | 
          ( | 
          EncapsulatedPacket |           $packet,  | 
        
        
           | 
           | 
          bool |           $immediate ) | 
        
      
 
 
◆ forciblyDisconnect()
      
        
          | raklib\generic\Session::forciblyDisconnect  | 
          ( | 
          int |           $reason | ) | 
           | 
        
      
 
Disconnects the session with immediate effect, regardless of current session state. Usually used in timeout cases.
- Parameters
 - 
  
    | int | $reason | one of the DisconnectReason constants @phpstan-param DisconnectReason::* $reason | 
  
   
- See also
 - DisconnectReason 
 
Definition at line 327 of file Session.php.
 
 
◆ getAddress()
      
        
          | raklib\generic\Session::getAddress  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ getID()
      
        
          | raklib\generic\Session::getID  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ getLogger()
      
        
          | raklib\generic\Session::getLogger  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ getRakNetTimeMS()
  
  
      
        
          | raklib\generic\Session::getRakNetTimeMS  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Returns a monotonically increasing timestamp. It does not need to match UNIX time. This is used to calculate ping. 
Definition at line 154 of file Session.php.
 
 
◆ getState()
      
        
          | raklib\generic\Session::getState  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ handlePacket()
      
        
          | raklib\generic\Session::handlePacket  | 
          ( | 
          Packet |           $packet | ) | 
           | 
        
      
 
 
◆ handleRakNetConnectionPacket()
  
  
      
        
          | raklib\generic\Session::handleRakNetConnectionPacket  | 
          ( | 
          string |           $packet | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
Called when a packet is received while the session is in the "connecting" state. This should only handle RakNet connection packets. Any other packets should be ignored. 
Reimplemented in raklib\server\ServerSession.
 
 
◆ initiateDisconnect()
      
        
          | raklib\generic\Session::initiateDisconnect  | 
          ( | 
          int |           $reason | ) | 
           | 
        
      
 
Initiates a graceful asynchronous disconnect which ensures both parties got all packets.
- Parameters
 - 
  
    | int | $reason | one of the DisconnectReason constants @phpstan-param DisconnectReason::* $reason | 
  
   
- See also
 - DisconnectReason 
 
Definition at line 310 of file Session.php.
 
 
◆ isConnected()
      
        
          | raklib\generic\Session::isConnected  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ isFullyDisconnected()
      
        
          | raklib\generic\Session::isFullyDisconnected  | 
          ( | 
           | ) | 
           | 
        
      
 
Returns whether the session is ready to be destroyed (either properly cleaned up or forcibly terminated) 
Definition at line 350 of file Session.php.
 
 
◆ isTemporary()
      
        
          | raklib\generic\Session::isTemporary  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ onDisconnect()
  
  
      
        
          | raklib\generic\Session::onDisconnect  | 
          ( | 
          int |           $reason | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
Called when the session is terminated for any reason.
- Parameters
 - 
  
    | int | $reason | one of the DisconnectReason::* constants @phpstan-param DisconnectReason::* $reason | 
  
   
- See also
 - DisconnectReason 
 
Reimplemented in raklib\server\ServerSession.
 
 
◆ onPacketAck()
  
  
      
        
          | raklib\generic\Session::onPacketAck  | 
          ( | 
          int |           $identifierACK | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
 
◆ onPacketReceive()
  
  
      
        
          | raklib\generic\Session::onPacketReceive  | 
          ( | 
          string |           $packet | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
Called when a user packet (ID >= ID_USER_PACKET_ENUM) is received from the remote peer.
- See also
 - MessageIdentifiers::ID_USER_PACKET_ENUM 
 
Reimplemented in raklib\server\ServerSession.
 
 
◆ onPingMeasure()
  
  
      
        
          | raklib\generic\Session::onPingMeasure  | 
          ( | 
          int |           $pingMS | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
 
◆ queueConnectedPacket()
  
  
      
        
          | raklib\generic\Session::queueConnectedPacket  | 
          ( | 
          ConnectedPacket |           $packet,  | 
         
        
           | 
           | 
          int |           $reliability,  | 
         
        
           | 
           | 
          int |           $orderChannel,  | 
         
        
           | 
           | 
          bool |           $immediate = false ) | 
         
       
   | 
  
protected   | 
  
 
 
◆ sendPacket()
  
  
      
        
          | raklib\generic\Session::sendPacket  | 
          ( | 
          Packet |           $packet | ) | 
           | 
         
       
   | 
  
abstractprotected   | 
  
 
 
◆ sendPing()
  
  
      
        
          | raklib\generic\Session::sendPing  | 
          ( | 
          int |           $reliability = PacketReliability::UNRELIABLE | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ update()
      
        
          | raklib\generic\Session::update  | 
          ( | 
          float |           $time | ) | 
           | 
        
      
 
 
◆ $address
◆ $state
  
  
      
        
          | int raklib\generic\Session::$state = self::STATE_CONNECTING | 
         
       
   | 
  
protected   | 
  
 
 
◆ MIN_MTU_SIZE
      
        
          | const raklib\generic\Session::MIN_MTU_SIZE = 400 | 
        
      
 
 
◆ STATE_CONNECTED
      
        
          | const raklib\generic\Session::STATE_CONNECTED = 1 | 
        
      
 
 
◆ STATE_CONNECTING
      
        
          | const raklib\generic\Session::STATE_CONNECTING = 0 | 
        
      
 
 
◆ STATE_DISCONNECT_NOTIFIED
      
        
          | const raklib\generic\Session::STATE_DISCONNECT_NOTIFIED = 3 | 
        
      
 
 
◆ STATE_DISCONNECT_PENDING
      
        
          | const raklib\generic\Session::STATE_DISCONNECT_PENDING = 2 | 
        
      
 
 
◆ STATE_DISCONNECTED
      
        
          | const raklib\generic\Session::STATE_DISCONNECTED = 4 | 
        
      
 
 
The documentation for this class was generated from the following file: