Beispiel #1
0
        public override void FireEvent()
        {
            m_clock.time = m_clock.time.AddMinutes(1);

            // Temp massive update, when I could change speed time client based,
            // we just have to sync it with save char.
            System.Collections.IDictionaryEnumerator EnumClients;
            EnumClients = WorldServer.GetClientsEnum();
            while (EnumClients.MoveNext())
            {
                if (((WorldClient)(EnumClients.Value)).Player.InWorld)
                {
                    ((WorldClient)(EnumClients.Value)).Player.updateTime();
                }
            }
            eventTime = DateTime.Now.AddSeconds(60 / m_clock.SpeedRatio);
            EventManager.AddEvent(this);
        }
Beispiel #2
0
        static bool OnBroadcast(WorldClient client, string input)
        {
            if (client.Player.AccessLvl < ACCESSLEVEL.GM)
            {
                Chat.System(client, "You do not have access to this command");
                return(false);
            }

            string[] split = input.Split(' ');
            if (split.Length <= 1)
            {
                Chat.System(client, "!Broadcast <msg>");
                return(false);
            }
            string msg;

            try
            {
                msg = input.Substring(10);
            }
            catch (Exception)
            {
                Chat.System(client, "Invalid message");
                return(false);
            }

            if (msg == null)
            {
                Chat.System(client, "You have to set a message!");
                return(false);
            }

            System.Collections.IDictionaryEnumerator EnumClients;
            EnumClients = WorldServer.GetClientsEnum();
            while (EnumClients.MoveNext())
            {
                Chat.System(((WorldClient)(EnumClients.Value)), "Broadcast : " + msg);
            }

            return(true);
        }