Exemplo n.º 1
0
 internal async Task <DataTable> GetStreamers()
 {
     try
     {
         var args = new List <KeyValuePair <string, object> >
         {
             new KeyValuePair <string, object>("_type", "twitch")
         };
         return(await _mySql.RunProcedure("streams_GetStreams", args));
     }
     catch (Exception e)
     {
         Ttv.Logger.LogError($"SQL Error:{e.Message}\n{e}");
         return(new DataTable());
     }
 }
Exemplo n.º 2
0
        internal static async Task GiveExp(string member, bool voice = false, decimal expOverride = 0)
        {
            var exp  = LevelOptions.ExpPerMessage;
            var args = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("_userid", member)
            };

            if (voice)
            {
                exp = expOverride;
                args.Add(new KeyValuePair <string, object>("_exp", exp.ToString(CultureInfo.InvariantCulture)));
                try
                {
                    await mSql.RunProcedure("Levels_GiveVoiceExp", args);
                }
                catch (Exception e)
                {
                    DbLogger.LogError($"{e}");
                }
                return;
            }

            if (expOverride > 0)
            {
                exp = expOverride;
            }

            args.Add(new KeyValuePair <string, object>("_exp", exp.ToString(CultureInfo.InvariantCulture)));
            try
            {
                await mSql.RunProcedure("Levels_GiveMsgExp", args);
            }
            catch (Exception e)
            {
                DbLogger.LogError($"{e}");
            }
        }