本文整理汇总了C#中Aurora.Framework.QueryFilter类的典型用法代码示例。如果您正苦于以下问题:C# QueryFilter类的具体用法?C# QueryFilter怎么用?C# QueryFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryFilter类属于Aurora.Framework命名空间,在下文中一共展示了QueryFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBySession
public ViewerStatsMessage GetBySession(UUID sessionID)
{
QueryFilter filter = new QueryFilter();
filter.andFilters.Add("session_id", sessionID);
List<string> results = GD.Query(new string[1] {"*"}, m_realm, filter, null, null, null);
return BuildSession(results, 0);
}
示例2: GetAgent
public IAgentInfo GetAgent(UUID agentID)
{
/*object remoteValue = DoRemoteForUser(agentID, agentID);
if (remoteValue != null)
return (IAgentInfo)remoteValue;*/
IAgentInfo agent = new IAgentInfo();
List<string> query = null;
try
{
QueryFilter filter = new QueryFilter();
filter.andFilters["ID"] = agentID;
filter.andFilters["`Key`"] = "AgentInfo";
query = GD.Query(new string[1] { "`Value`" }, "userdata", filter, null, null, null);
}
catch
{
}
if (query == null || query.Count == 0)
{
return null; //Couldn't find it, return null then.
}
OSDMap agentInfo = (OSDMap) OSDParser.DeserializeLLSDXml(query[0]);
agent.FromOSD(agentInfo);
agent.PrincipalID = agentID;
return agent;
}
示例3: FindLSLData
public List<string> FindLSLData(string token, string key)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["Token"] = token.MySqlEscape(50);
filter.andFilters["KeySetting"] = token.MySqlEscape(50);
return GD.Query(new string[1] { "*" }, "lslgenericdata", filter, null, null, null);
}
示例4: AddClassified
public bool AddClassified(Classified classified)
{
object remoteValue = DoRemote(classified);
if (remoteValue != null || m_doRemoteOnly)
return remoteValue != null && (bool) remoteValue;
if (GetUserProfile(classified.CreatorUUID) == null)
return false;
string keywords = classified.Description;
if (keywords.Length > 512)
keywords = keywords.Substring(keywords.Length - 512, 512);
//It might be updating, delete the old
QueryFilter filter = new QueryFilter();
filter.andFilters["ClassifiedUUID"] = classified.ClassifiedUUID;
GD.Delete("userclassifieds", filter);
List<object> values = new List<object>
{
classified.Name,
classified.Category,
classified.SimName,
classified.CreatorUUID,
classified.ScopeID,
classified.ClassifiedUUID,
OSDParser.SerializeJsonString(classified.ToOSD()),
classified.PriceForListing,
keywords
};
return GD.Insert("userclassifieds", values.ToArray());
}
示例5: Delete
public bool Delete(UUID id, bool ignoreFlags)
{
try
{
if (!ignoreFlags)
{
AssetBase asset = GetAsset(id, false);
if (asset == null)
return false;
if ((int) (asset.Flags & AssetFlags.Maptile) != 0 || //Depriated, use Deletable instead
(int) (asset.Flags & AssetFlags.Deletable) != 0)
ignoreFlags = true;
}
if (ignoreFlags)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["id"] = id;
m_Gd.Delete("assets", filter);
}
}
catch (Exception e)
{
if (MainConsole.Instance != null)
MainConsole.Instance.Error("[LocalAssetDatabase] Error while deleting asset " + e);
}
return true;
}
示例6: GetFriends
public FriendInfo[] GetFriends(UUID principalID)
{
List<FriendInfo> infos = new List<FriendInfo>();
QueryTables tables = new QueryTables();
tables.AddTable(m_realm, "my");
tables.AddTable(m_realm, "his", JoinType.Inner,
new[,] {{"my.Friend", "his.PrincipalID"}, {"my.PrincipalID", "his.Friend"}});
QueryFilter filter = new QueryFilter();
filter.andFilters["my.PrincipalID"] = principalID;
List<string> query = GD.Query(new string[]
{
"my.Friend",
"my.Flags",
"his.Flags"
}, tables, filter, null, null, null);
//These are used to get the other flags below
for (int i = 0; i < query.Count; i += 3)
{
FriendInfo info = new FriendInfo
{
PrincipalID = principalID,
Friend = query[i],
MyFlags = int.Parse(query[i + 1]),
TheirFlags = int.Parse(query[i + 2])
};
infos.Add(info);
}
return infos.ToArray();
}
示例7: GetUserProfile
/// <summary>
/// Get a user's profile
/// </summary>
/// <param name = "agentID"></param>
/// <returns></returns>
public IUserProfileInfo GetUserProfile(UUID agentID)
{
IUserProfileInfo UserProfile = new IUserProfileInfo();
//Try from the user profile first before getting from the DB
if (UserProfilesCache.TryGetValue(agentID, out UserProfile))
return UserProfile;
else
{
QueryFilter filter = new QueryFilter();
filter.andFilters["ID"] = agentID;
filter.andFilters["`Key`"] = "LLProfile";
List<string> query = null;
//Grab it from the almost generic interface
query = GD.Query(new string[] { "Value" }, "userdata", filter, null, null, null);
if (query == null || query.Count == 0)
return null;
//Pull out the OSDmap
OSDMap profile = (OSDMap) OSDParser.DeserializeLLSDXml(query[0]);
UserProfile = new IUserProfileInfo();
UserProfile.FromOSD(profile);
//Add to the cache
UserProfilesCache[agentID] = UserProfile;
return UserProfile;
}
}
示例8: Delete
public bool Delete(UUID ownerID, string friend)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["PrincipalID"] = ownerID;
filter.andFilters["Friend"] = friend;
return GD.Delete(m_realm, filter);
}
示例9: Get
public UserInfo Get(string userID, bool checkOnlineStatus, out bool onlineStatusChanged)
{
onlineStatusChanged = false;
QueryFilter filter = new QueryFilter();
filter.andFilters["UserID"] = userID;
List<string> query = GD.Query(new string[1] {"*"}, m_realm, filter, null, null, null);
if (query.Count == 0)
{
return null;
}
UserInfo user = ParseQuery(query)[0];
//Check LastSeen
DateTime timeLastSeen = Util.ToDateTime(int.Parse(query[2]));
DateTime timeNow = DateTime.Now.ToUniversalTime();
if (checkOnlineStatus && m_checkLastSeen && user.IsOnline && (timeLastSeen.AddHours(1) < timeNow))
{
MainConsole.Instance.Warn("[UserInfoService]: Found a user (" + user.UserID +
") that was not seen within the last hour " +
"(since " + timeLastSeen.ToLocalTime().ToString() + ", time elapsed " +
(timeNow - timeLastSeen).Days + " days, " + (timeNow - timeLastSeen).Hours +
" hours)! Logging them out.");
user.IsOnline = false;
Set(user);
onlineStatusChanged = true;
}
return user;
}
示例10: DeleteFolders
public virtual bool DeleteFolders(string field, string val, bool safe)
{
QueryFilter filter = new QueryFilter();
filter.andFilters[field] = val;
if (safe)
{
filter.andFilters["type"] = "-1";
}
return GD.Delete(m_foldersrealm, filter);
}
示例11: GetAvatarArchive
public AvatarArchive GetAvatarArchive(string Name)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["Name"] = Name;
List<string> RetVal = GD.Query(new string[] { "*" }, "avatararchives", filter, null, null, null);
return (RetVal.Count == 0) ? null : new AvatarArchive {
Name = RetVal[0],
ArchiveXML = RetVal[1]
};
}
示例12: FindLSLData
public List<string> FindLSLData(string token, string key)
{
object remoteValue = DoRemote(token, key);
if (remoteValue != null || m_doRemoteOnly)
return (List<string>) remoteValue;
QueryFilter filter = new QueryFilter();
filter.andFilters["Token"] = token;
filter.andFilters["KeySetting"] = key;
return GD.Query(new string[1] {"*"}, "lslgenericdata", filter, null, null, null);
}
示例13: Get
public SchedulerItem Get(string id)
{
if (id != "")
{
QueryFilter filter = new QueryFilter();
filter.andFilters["id"] = id;
List<string> results = m_Gd.Query(theFields, "scheduler", filter, null, null, null);
return LoadFromList(results);
}
return null;
}
示例14: DeleteAccount
public bool DeleteAccount(UUID userID, bool archiveInformation)
{
if (archiveInformation)
{
return GD.Update(m_realm, new Dictionary<string, object> {{"UserLevel", -2}}, null,
new QueryFilter {andFilters = new Dictionary<string, object> {{"PrincipalID", userID}}},
null, null);
}
QueryFilter filter = new QueryFilter();
filter.andFilters.Add("PrincipalID", userID);
return GD.Delete(m_realm, filter);
}
示例15: Store
public bool Store(UUID PrincipalID, string Friend, int Flags, int Offered)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["PrincipalID"] = PrincipalID;
filter.andFilters["Friend"] = Friend;
GD.Delete(m_realm, filter);
Dictionary<string, object> row = new Dictionary<string, object>(4);
row["PrincipalID"] = PrincipalID;
row["Friend"] = Friend;
row["Flags"] = Flags;
row["Offered"] = Offered;
return GD.Insert(m_realm, row);
}