Exemple #1
0
        internal GameSocket(ServerChildTcpSocket socket, GameSocketProtocol protocol)
        {
            _internalSocket = socket;
            _lengthBuffer = new byte[protocol.Reader.LengthBytes];

            Habbo = HabboDistributor.GetPreLoginHabbo(this);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="SimpleServerChildTcpSocket"/>.
        /// </summary>
        /// <param name="socket">The socket to wrap.</param>
        internal SimpleServerChildTcpSocket(ServerChildTcpSocket socket)
        {
            Socket = socket;

            // Create the receive buffer for the socket
            Packetizer = new SocketPacketProtocol(Socket);

            // Initialize the keepalive timer
            KeepaliveTimer          = new Timer();
            KeepaliveTimer.Elapsed += KeepaliveTimerTimeout;

            // Start reading
            Packetizer.Start();

            // Start writing keepalive packets as necessary
            KeepaliveTimer.SetPeriodic(TimeSpan.FromSeconds(5));
        }
        /// <summary>
        /// Initializes a new instance of <see cref="SimpleServerChildTcpSocket"/>.
        /// </summary>
        /// <param name="socket">The socket to wrap.</param>
        internal SimpleServerChildTcpSocket(ServerChildTcpSocket socket)
        {
            Socket = socket;

            // Create the receive buffer for the socket
            Packetizer = new SocketPacketProtocol(Socket);

            // Initialize the keepalive timer
            KeepaliveTimer = new Timer();
            KeepaliveTimer.Elapsed += KeepaliveTimerTimeout;

            // Start reading
            Packetizer.Start();

            // Start writing keepalive packets as necessary
            KeepaliveTimer.SetPeriodic(TimeSpan.FromSeconds(5));
        }