public void SendExperienceLog(IAgent agent, ObjectGroup grp, ExperienceLogType permissions, UUID experienceID)
        {
            var gm = new GenericMessage
            {
                Method    = "ExperienceEvent",
                Invoice   = experienceID,
                SessionID = UUID.Zero,
                AgentID   = agent.ID
            };
            var llsd = new Map
            {
                { "OwnerID", grp.Owner.ID },
                { "Permission", (int)permissions },
                { "IsAttachment", grp.IsAttached }
            };

            using (var ms = new MemoryStream())
            {
                LlsdXml.Serialize(llsd, ms);
                gm.ParamList.Add(ms.ToArray());
            }
            gm.ParamList.Add((grp.Name + "\0").ToUTF8Bytes());
            ParcelInfo pInfo;

            if (!grp.IsAttached && Parcels.TryGetValue(grp.GlobalPosition, out pInfo))
            {
                gm.ParamList.Add((pInfo.Name + "\0").ToUTF8Bytes());
            }
            agent.SendMessageAlways(gm, ID);
        }
Exemplo n.º 2
0
        public static void AdjustCustomerExperience(int customerSysNo, decimal experience, ExperienceLogType type, string memo)
        {
            CustomerExperienceLog entity = new CustomerExperienceLog();

            entity.CustomerSysNo = customerSysNo;
            entity.Amount        = experience;
            entity.Memo          = memo;
            entity.Type          = type;


            CustomerBasicInfo customer = GetCustomerInfo(customerSysNo);
            var totalExperience        = customer.TotalExperience.Value;

            totalExperience = totalExperience + entity.Amount.Value;
            if (totalExperience < 0)
            {
                throw new BusinessException("顾客的最终经验值必须为正值");
            }

            CustomerDA.UpdateExperience(entity.CustomerSysNo.Value, totalExperience);

            CustomerExperienceLog cuslog = new CustomerExperienceLog();

            cuslog.CustomerSysNo = entity.CustomerSysNo;
            cuslog.Amount        = entity.Amount;
            cuslog.Memo          = string.Format("(用户系统号:{0};原值:{1}){2}",
                                                 entity.CustomerSysNo, totalExperience - cuslog.Amount, entity.Memo);
            cuslog.Type = entity.Type;
            CustomerDA.InsertExperienceLog(cuslog);

            CustomerDA.SetRank(entity.CustomerSysNo.Value);
        }
Exemplo n.º 3
0
        public virtual void AdjustCustomerExperience(int customerSysNo, decimal experience, ExperienceLogType type, string memo)
        {
            CustomerExperienceLog entity = new CustomerExperienceLog();

            entity.CustomerSysNo = customerSysNo;
            entity.Amount        = experience;
            entity.Memo          = memo;
            entity.Type          = type;
            ObjectFactory <ExperienceProcessor> .Instance.Adjust(entity);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 调整客户经验值
 /// </summary>
 /// <param name="customerSysNo">客户编号</param>
 /// <param name="adjustAmount">金额</param>
 /// <param name="type"></param>
 /// <param name="memo"></param>
 internal static void AdjustCustomerExperience(int customerSysNo, decimal adjustAmount, ExperienceLogType type, string memo)
 {
     ObjectFactory <ICustomerBizInteract> .Instance.AdjustCustomerExperience(customerSysNo, adjustAmount, type, memo);
 }