コード例 #1
0
        private void OnConnected(object sender, EventArgs e)
        {
            // Send first packet
            Send(new S0001Authenticate(this));

            // After 3 seconds, sending random chat
            ThreadExtension.DelayAndExecute(StartSendingRandomChat, 3000);
        }
コード例 #2
0
        public InternalClient(Guid guid, ILog log, IScsServerClient client, string ip, PacketService packetService, IServer server)
        {
            Guid = guid;

            Log           = log;
            _client       = client;
            IP            = ip;
            _server       = server;
            PacketService = packetService;

            _client.WireProtocol = new AuthProtocol();

            _client.Disconnected    += OnTCPDisconnected;
            _client.MessageReceived += OnReceiveMessage;

            ThreadExtension.DelayAndExecute(WaitForFirstPacket, WaitTime);
        }