예제 #1
0
        public static void HandleTabCompletePacket(Client client, TabCompletePacket packet)
        {
            var str = new StringBuilder();
            var s   = (from a in client.GetServer().GetClients() where a.Username.Contains(packet.Text) select a).ToList();

            if (!s.Any())
            {
                return;
            }
            if (s.Count() > 1)
            {
                foreach (var c in s)
                {
                    str.Append(c.Username);
                }
                str.Append('\0');
            }
            else
            {
                str.Append(s[0].Username);
            }
            client.Send_Sync_Packet(new TabCompletePacket {
                Text = str.ToString()
            });
        }
예제 #2
0
파일: Client.Recv.cs 프로젝트: OBASI/c-raft
 public static void HandleTabCompletePacket(Client client, TabCompletePacket packet)
 {
     var str = new StringBuilder();
     var s = (from a in client.GetServer().GetClients() where a.Username.Contains(packet.Text) select a).ToList();
     if (!s.Any())
     {
         return;
     }
     if (s.Count() > 1)
     {
         foreach (var c in s)
         {
             str.Append(c.Username);
         }
         str.Append('\0');
     }
     else
     {
         str.Append(s[0].Username);
     }
     client.Send_Sync_Packet(new TabCompletePacket { Text = str.ToString() });
 }