예제 #1
0
        private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
        {
            GroupAccountDetailsReplyPacket details = (GroupAccountDetailsReplyPacket)packet;

            if (GroupAccountDetailsCallbacks.ContainsKey(details.AgentData.GroupID))
            {
                GroupAccountDetails account = new GroupAccountDetails();

                account.CurrentInterval = details.MoneyData.CurrentInterval;
                account.IntervalDays    = details.MoneyData.IntervalDays;
                account.StartDate       = Helpers.FieldToString(details.MoneyData.StartDate);

                account.HistoryItems = new List <KeyValuePair <string, int> >();

                foreach (GroupAccountDetailsReplyPacket.HistoryDataBlock block in details.HistoryData)
                {
                    KeyValuePair <string, int> item =
                        new KeyValuePair <string, int>(Helpers.FieldToString(block.Description), block.Amount);

                    account.HistoryItems.Add(item);
                }

                GroupAccountDetailsCallbacks[details.AgentData.GroupID](account);
            }
        }
        private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
        {
            GroupAccountDetailsReplyPacket details = (GroupAccountDetailsReplyPacket)packet;

            if (GroupAccountDetailsCallbacks.ContainsKey(details.AgentData.GroupID))
            {
                GroupAccountDetails account = new GroupAccountDetails();

                account.CurrentInterval = details.MoneyData.CurrentInterval;
                account.IntervalDays = details.MoneyData.IntervalDays;
                account.StartDate = Helpers.FieldToString(details.MoneyData.StartDate);

                account.HistoryItems = new List<KeyValuePair<string, int>>();

                foreach (GroupAccountDetailsReplyPacket.HistoryDataBlock block in details.HistoryData)
                {
                    KeyValuePair<string, int> item =
                        new KeyValuePair<string, int>(Helpers.FieldToString(block.Description), block.Amount);

                    account.HistoryItems.Add(item);
                }

                GroupAccountDetailsCallbacks[details.AgentData.GroupID](account);
            }
        }
예제 #3
0
        private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
        {
            if (OnGroupAccountDetails != null)
            {
                GroupAccountDetailsReplyPacket details = (GroupAccountDetailsReplyPacket)packet;
                GroupAccountDetails account = new GroupAccountDetails();

                account.CurrentInterval = details.MoneyData.CurrentInterval;
                account.IntervalDays = details.MoneyData.IntervalDays;
                account.StartDate = Helpers.FieldToUTF8String(details.MoneyData.StartDate);

                account.HistoryItems = new List<KeyValuePair<string, int>>();

                foreach (GroupAccountDetailsReplyPacket.HistoryDataBlock block in details.HistoryData)
                {
                    KeyValuePair<string, int> item =
                        new KeyValuePair<string, int>(Helpers.FieldToUTF8String(block.Description), block.Amount);

                    account.HistoryItems.Add(item);
                }

                try { OnGroupAccountDetails(account); }
                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
            }
        }