예제 #1
0
        /// <summary>
        /// Called when "All" message is being sent. Returns the cancel effect.
        /// </summary>
        public bool OnChatSending(string message)
        {
            switch (message)
            {
            case "PING":
                m_Ping = new System.Diagnostics.Stopwatch();
                m_Ping.Start();
                break;

            case "TIME":
                message = "[xBot] Server time : " + InfoManager.GetServerTime().ToString("HH:mm:ss | dd/MM/yyyy");
                PacketBuilder.Client.SendNotice(message);
                if (Proxy.ClientlessMode)
                {
                    Window.Get.LogChatMessage(Window.Get.Chat_rtbxAll, "xBot", message);
                }
                // cancel it
                return(true);

            case "ISEEDEADPEOPLE":
                if (!Proxy.ClientlessMode)
                {
                    for (int i = 0; i < InfoManager.Players.Count; i++)
                    {
                        SRPlayer player = InfoManager.Players.GetAt(i);
                        if (player.GameStateType != SRModel.GameState.None)
                        {
                            Packet p = new Packet(Agent.Opcode.SERVER_ENTITY_STATE_UPDATE);
                            p.WriteUInt(player.UniqueID);
                            p.WriteUShort(4);
                            Proxy.InjectToClient(p);
                        }
                    }
                    message = "[xBot] The void has been revealed!";
                    PacketBuilder.Client.SendNotice(message);
                }
                return(true);
            }
            return(false);
        }