本文整理汇总了C#中IGenericData.Query方法的典型用法代码示例。如果您正苦于以下问题:C# IGenericData.Query方法的具体用法?C# IGenericData.Query怎么用?C# IGenericData.Query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGenericData
的用法示例。
在下文中一共展示了IGenericData.Query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(IGenericData GenericData, IConfigSource source, string defaultConnectionString)
{
if(source.Configs["AuroraConnectors"].GetString("AbuseReportsConnector", "LocalConnector") == "LocalConnector")
{
GD = GenericData;
if (source.Configs[Name] != null)
defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);
GD.ConnectToDatabase(defaultConnectionString);
List<string> Results = GD.Query("Method", "abusereports", "Passwords", "Password");
if (Results.Count == 0)
{
string newPass = MainConsole.Instance.PasswdPrompt("Password to access Abuse Reports");
GD.Insert("passwords", new object[] { "abusereports", Util.Md5Hash(Util.Md5Hash(newPass)) });
}
DataManager.DataManager.RegisterPlugin(Name, this);
}
}
示例2: Initialize
public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
{
if (handleConfig(source, defaultConnectionString))
{
if (!Enabled)
{
Warn("not loaded, disabled in config.");
}
else
{
GD = GenericData;
GD.ConnectToDatabase(m_connectionString, "WebAPI", true);
QueryFilter filter = new QueryFilter();
filter.andFilters["user"] = UUID.Zero;
List<string> query = GD.Query(new string[2]{
"method",
"rate"
}, c_table_access, filter, null, null, null);
if (query.Count % 2 == 0)
{
Dictionary<string, uint?> DAR = new Dictionary<string, uint?>();
for (int i = 0; i < query.Count; i += 2)
{
if (string.IsNullOrEmpty(query[i + 1]))
{
DAR[query[i]] = null;
}
else
{
DAR[query[i]] = uint.Parse(query[i + 1]);
}
}
DataManager.DataManager.RegisterPlugin(this);
}
else
{
MainConsole.Instance.Error("[" + Name + "]: Could not find default access rate limits");
}
}
}
}
示例3: Initialize
public void Initialize(IGenericData genericData, IConfigSource source, IRegistryCore simBase,
string defaultConnectionString)
{
if (source.Configs["AuroraConnectors"].GetString("AssetConnector", "LocalConnector") !=
"LocalConnectorBlackHole")
return;
m_Gd = genericData;
m_Enabled = true;
if (source.Configs["Handlers"].GetString("AssetHandler", "") != "AssetService")
return;
m_CacheDirectory = source.Configs["BlackHole"].GetString("CacheDirector", m_CacheDirectory);
m_CacheDirectoryBackup = source.Configs["BlackHole"].GetString("BackupCacheDirector", m_CacheDirectoryBackup);
NumberOfDaysForOldAssets = source.Configs["BlackHole"].GetInt("AssetsAreOldAfterHowManyDays", 30) * -1;
m_Enabled = true;
m_pointInventory2ParentAssets = source.Configs["BlackHole"].GetBoolean("PointInventoryToParentAssets", true);
if (!Directory.Exists(m_CacheDirectoryBackup))
Directory.CreateDirectory(m_CacheDirectoryBackup);
if (!Directory.Exists(m_CacheDirectoryBackup))
{
MainConsole.Instance.Error(
"Check your Main.ini and ensure your backup directory is set! under [BlackHole] BackupCacheDirector");
m_Enabled = false;
return;
}
if (!Directory.Exists(m_CacheDirectory))
Directory.CreateDirectory(m_CacheDirectory);
if (!Directory.Exists(m_CacheDirectory))
{
MainConsole.Instance.Error(
"Check your Main.ini and ensure your cache directory is set! under [BlackHole] m_CacheDirectory");
m_Enabled = false;
return;
}
if (source.Configs[Name] != null)
defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);
genericData.ConnectToDatabase(defaultConnectionString, "BlackholeAsset",
source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));
m_InvalidChars.AddRange(Path.GetInvalidPathChars());
m_InvalidChars.AddRange(Path.GetInvalidFileNameChars());
if (m_Enabled)
{
MainConsole.Instance.Error("[BlackholeAssets]: Blackhole assets enabled");
DataManager.DataManager.RegisterPlugin(this);
try
{
needsConversion = (m_Gd.Query(new string[1] { "id" }, "assets", null, null, null, null).Count >= 1);
}
catch
{
// the assets table might not exist if they next used it..
needsConversion = false;
}
convertCount = 0;
taskTimer.Interval = 60000;
taskTimer.Elapsed += t_Elapsed;
taskTimer.Start();
}
}