private void allocFindedClient(ClientInfo client)
        {
            if (Clients.ContainsKey(client.Name))
            {
                CloseClient(client);
                return;
            }

            Clients.Add(client.Name, client);
            DebugAdapter.Log($"Client \"{client.Name}\" has join to server");

            sendner.asynListeningClient(client, allocSendedMessageClientFromServer, allocDropClientSendMessage);
        }
示例#2
0
        public void Connect(string ip, int port)
        {
            if (isWorking)
            {
                DebugAdapter.Log("You already connect");
                return;
            }

            info = new ClientInfo(info.Name, info.hashPassword);
            info.ClientTCP.Connect(ip, port);
            stream = info.ClientTCP.GetStream();
            sendner.Start();
            isWorking = true;
            SendCommand <TemplateConnect>(info.Name + " " + info.hashPassword);
            sendner.asynListeningClient(info, allocServerSended, allocToDrop);
        }