Represents an encrypted network session.
Inheritance: OpenStory.Networking.EncryptedNetworkSession, IServerSession
Esempio n. 1
0
        /// <inheritdoc />
        public void Dispose()
        {
            if (!_isDisposed)
            {
                Misc.AssignNullAndDispose(ref _accountSession);

                _keepAliveTimer.Close();

                ServerSession.Close("Client disposed.");

                _isDisposed = true;
            }
        }
Esempio n. 2
0
        private void SendPing(object sender, ElapsedEventArgs e)
        {
            if (_sentPings.Increment() > MissedPingsAllowed)
            {
                Disconnect("No ping response.");
                return;
            }

            using (var ping = PacketFactory.CreatePacket("Ping"))
            {
                ServerSession.WritePacket(ping.ToByteArray());
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Writes a packet to the client's stream.
 /// </summary>
 /// <param name="data">The data of the packet.</param>
 public void WritePacket(byte[] data)
 {
     ServerSession.WritePacket(data);
 }