Esempio n. 1
0
 /// <summary>
 /// Sends a new click distance to all logged in clients.
 /// </summary>
 public static void SendAllClickDistance()
 {
     foreach (var nc in ServerCore.Nh.ClientList) {
         if (!nc.CS.CPEExtensions.ContainsKey("ClickDistance"))
             continue;
         var distance = new SetClickDistance { Distance = (short)ServerCore.ClickDistance };
         nc.SendQueue.Enqueue(distance);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Sends additional pre-login packets after receiving a client's supported extensions.
        /// </summary>
        /// <param name="client"></param>
        public static void CPEPackets(NetworkClient client)
        {
            if (client.CS.CPEExtensions.ContainsKey("ClickDistance")) {
                var distance = new SetClickDistance {Distance = (short) ServerCore.ClickDistance};
                client.SendQueue.Enqueue(distance);
            }

            if (client.CS.CPEExtensions.ContainsKey("CustomBlocks")) {
                var cbsl = new CustomBlockSupportLevel {SupportLevel = CustomBlocksSupportLevel};
                client.SendQueue.Enqueue(cbsl);
            } else
                client.Login();
        }