Beispiel #1
0
        private object StipendsPayOutEvent(string functionName, object parameters)
        {
            if (functionName != "StipendsPayout")
            {
                return(null);
            }
            StipendsInfo si = new StipendsInfo();

            si.FromOSD((OSDMap)OSDParser.DeserializeJson(parameters.ToString()));
            IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         ua          = userService.GetUserAccount(null, si.AgentID);

            if ((ua != null) && (ua.UserFlags >= 0) && ((!m_options.StipendsPremiumOnly) || ((ua.UserLevel & Constants.USER_FLAG_MEMBER) == Constants.USER_FLAG_MEMBER)))
            {
                if (m_options.GiveStipendsOnlyWhenLoggedIn)
                {
                    ICapsService       capsService = m_registry.RequestModuleInterface <ICapsService>();
                    IClientCapsService client      = capsService.GetClientCapsService(ua.PrincipalID);
                    if (client == null)
                    {
                        return("");
                    }
                }
                IMoneyModule mo = m_registry.RequestModuleInterface <IMoneyModule>();
                if (mo == null)
                {
                    return(null);
                }
                UUID transid = UUID.Random();
                MainConsole.Instance.Info("[MONEY MODULE] Stipend Payment for " + ua.FirstName + " " + ua.LastName + " is now running");
                if (m_currencyService.UserCurrencyTransfer(ua.PrincipalID, UUID.Zero, (uint)m_options.Stipend, "Stipend Payment", TransactionType.StipendPayment, transid))
                {
                    return(transid.ToString());
                }
            }
            return("");
        }
 object StipendsPayOutEvent(string functionName, object parameters)
 {
     if (functionName != "StipendsPayout")
         return null;
     StipendsInfo si = new StipendsInfo ();
     si.FromOSD ((OSDMap)OSDParser.DeserializeJson (parameters.ToString ()));
     IUserAccountService userService = m_registry.RequestModuleInterface<IUserAccountService> ();
     UserAccount ua = userService.GetUserAccount (null, si.AgentID);
     if ((ua != null) && (ua.UserFlags >= 0) && ((!m_options.StipendsPremiumOnly) || ((ua.UserLevel & Constants.USER_FLAG_MEMBER) == Constants.USER_FLAG_MEMBER)))
     {
         if (m_options.GiveStipendsOnlyWhenLoggedIn)
         {
             ICapsService capsService = m_registry.RequestModuleInterface<ICapsService> ();
             IClientCapsService client = capsService.GetClientCapsService (ua.PrincipalID);
             if (client == null)
                 return "";
         }
         IMoneyModule mo = m_registry.RequestModuleInterface<IMoneyModule> ();
         if (mo == null)
             return null;
         UUID transid = UUID.Random ();
         MainConsole.Instance.Info ("[MONEY MODULE] Stipend Payment for " + ua.FirstName + " " + ua.LastName + " is now running");
         if (m_currencyService.UserCurrencyTransfer (ua.PrincipalID, UUID.Zero, (uint)m_options.Stipend, "Stipend Payment", TransactionType.StipendPayment, transid))
         {
             return transid.ToString ();
         }
     }
     return "";
 }