Beispiel #1
0
        /// <summary>
        /// Dodaje nową wiadomość do istniejącego zgłoszenia
        /// </summary>
        /// <param name="callId"></param>
        /// <param name="newMessage"></param>
        public static void CreatePhoneCallMessage(int callId, string newMessage)
        {
            EmergencyPhone callInfo = GetPhoneCallInfo(callId);

            if (callInfo == null)
            {
                return;
            }
            if (callInfo.Messages.Count > 10)
            {
                callInfo.Messages.RemoveAt(1);
            }
            callInfo.Messages.Add(new EmergencyPhoneMessage(Global.GetTimestamp(), newMessage));
        }
Beispiel #2
0
        /// <summary>
        /// Dodaje nowe zgłoszenie jednocześnie informując o nim grupy
        /// </summary>
        /// <param name="player"></param>
        /// <param name="phoneNumber"></param>
        /// <param name="groupType"></param>
        /// <param name="phoneMessage"></param>
        public static void CreatePhoneCall(Client player, int phoneNumber, int groupType, string phoneMessage)
        {
            int            index    = GetLowestId();
            EmergencyPhone newClass = new EmergencyPhone
            {
                Id          = index,
                GroupType   = groupType,
                LastAction  = Global.GetTimestamp(),
                Messages    = new List <EmergencyPhoneMessage>(),
                PhoneNumber = phoneNumber,
                Position    = player.Position,
                TimeAdded   = Global.GetTimestamp()
            };

            newClass.Messages.Add(new EmergencyPhoneMessage(Global.GetTimestamp(), phoneMessage));
            Groups.Library.SendGroupTypeOocMessage(groupType, "Nadeszło nowe zgłoszenie. Sprawdź je za pomocą komendy" +
                                                   "/zgłoszenia lub /g [slot] zgłoszenia.");
            EmergencyPhones.Add(newClass.Id, newClass);
        }