本文整理汇总了C#中Aurora.Framework.Classified.FromOSD方法的典型用法代码示例。如果您正苦于以下问题:C# Classified.FromOSD方法的具体用法?C# Classified.FromOSD怎么用?C# Classified.FromOSD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Framework.Classified
的用法示例。
在下文中一共展示了Classified.FromOSD方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClassifiedDelete
public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
{
//Security check
IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);
if (info == null)
return;
if (info.Classifieds.ContainsKey(queryClassifiedID.ToString()))
{
Classified oldClassified = new Classified();
oldClassified.FromOSD((OSDMap)info.Classifieds[queryClassifiedID.ToString()]);
if (oldClassified.CreatorUUID != remoteClient.AgentId)
return;
info.Classifieds.Remove(queryClassifiedID.ToString());
ProfileFrontend.UpdateUserProfile(info);
}
}
示例2: GodClassifiedDelete
public void GodClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
{
if (GetRegionUserIsIn(remoteClient.AgentId).Permissions.IsGod(remoteClient.AgentId))
{
IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);
if (info == null)
return;
if (info.Classifieds.ContainsKey(queryClassifiedID.ToString()))
{
Classified oldClassified = new Classified();
oldClassified.FromOSD((OSDMap)info.Classifieds[queryClassifiedID.ToString()]);
info.Classifieds.Remove(queryClassifiedID.ToString());
ProfileFrontend.UpdateUserProfile(info);
}
}
}
示例3: GetClassifieds
public List<Classified> GetClassifieds (UUID ownerID)
{
List<Classified> classifieds = new List<Classified> ();
List<string> query = GD.Query (new string[1] { "OwnerUUID" }, new object[1] { ownerID }, "userclassifieds", "*");
for (int i = 0; i < query.Count; i+=6)
{
Classified classified = new Classified ();
classified.FromOSD ((OSDMap)OSDParser.DeserializeJson (query[i+5]));
classifieds.Add (classified);
}
return classifieds;
}
示例4: GetClassified
public Classified GetClassified(UUID queryClassifiedID)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["ClassifiedUUID"] = queryClassifiedID;
List<string> query = GD.Query(new string[1] { "*" }, "userclassifieds", filter, null, null, null);
if (query.Count < 6)
{
return null;
}
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
return classified;
}
示例5: RemoveClassifieds
/// <summary>
/// Remove classifieds from the search database
/// LOCAL Only, called by the profile service
/// </summary>
/// <param name="dictionary">objects of the dictionary are OSDMaps made from Classified</param>
public void RemoveClassifieds(Dictionary<string, object> dictionary)
{
//Remove all the UUIDs in the given dictionary from search
foreach (object o in dictionary.Values)
{
//Pull out the OSDMaps
OSDMap map = (OSDMap)o;
Classified c = new Classified();
c.FromOSD(map);
List<string> Keys = new List<string>();
Keys.Add("ClassifiedUUID");
List<object> Values = new List<object>();
Values.Add(c.ClassifiedUUID);
GD.Delete("profileclassifieds", Keys.ToArray(), Values.ToArray());
}
}
示例6: GetClassifiedsInRegion
/// <summary>
/// Gets all classifieds in the given region
/// </summary>
/// <param name="regionName"></param>
/// <returns></returns>
public Classified[] GetClassifiedsInRegion(string regionName)
{
List<Classified> Classifieds = new List<Classified>();
List<string> retVal = GD.Query ("SimName", regionName, "userclassifieds", "*");
if (retVal.Count == 0)
return Classifieds.ToArray();
Classified classified = new Classified();
for (int i = 0; i < retVal.Count; i += 6)
{
//Pull the classified out of OSD
classified.FromOSD((OSDMap)OSDParser.DeserializeJson(retVal[i + 5]));
Classifieds.Add(classified);
classified = new Classified();
}
return Classifieds.ToArray();
}
示例7: GetClassifieds
public List<Classified> GetClassifieds(UUID ownerID)
{
object remoteValue = DoRemote(ownerID);
if (remoteValue != null || m_doRemoteOnly)
return (List<Classified>)remoteValue;
QueryFilter filter = new QueryFilter();
filter.andFilters["OwnerUUID"] = ownerID;
List<string> query = GD.Query(new[] { "*" }, "userclassifieds", filter, null, null, null);
List<Classified> classifieds = new List<Classified>();
for (int i = 0; i < query.Count; i += 7)
{
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 5]));
classifieds.Add(classified);
}
return classifieds;
}
示例8: GetClassifiedByID
public Classified GetClassifiedByID(UUID id)
{
object remoteValue = DoRemote(id);
if (remoteValue != null || m_doRemoteOnly)
return (Classified)remoteValue;
QueryFilter filter = new QueryFilter();
Dictionary<string, object> where = new Dictionary<string, object>(1);
where.Add("ClassifiedUUID", id);
filter.andFilters = where;
List<string> retVal = GD.Query(new[] { "*" }, "userclassifieds", filter, null, null, null);
if ((retVal == null) || (retVal.Count == 0)) return null;
Classified classified = new Classified();
classified.FromOSD((OSDMap)OSDParser.DeserializeJson(retVal[6]));
return classified;
}
示例9: GetClassifiedsInRegion
/// <summary>
/// Gets all classifieds in the given region
/// </summary>
/// <param name = "regionName"></param>
/// <returns></returns>
public Classified[] GetClassifiedsInRegion(string regionName)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["SimName"] = regionName;
List<string> retVal = GD.Query(new string[] { "*" }, "userclassifieds", filter, null, null, null);
if (retVal.Count == 0)
{
return new Classified[0] { };
}
List<Classified> Classifieds = new List<Classified>();
Classified classified;
for (int i = 0; i < retVal.Count; i += 6)
{
classified = new Classified();
//Pull the classified out of OSD
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));
Classifieds.Add(classified);
}
return Classifieds.ToArray();
}
示例10: GetClassified
public Classified GetClassified(UUID queryClassifiedID)
{
object remoteValue = DoRemote(queryClassifiedID);
if (remoteValue != null || m_doRemoteOnly)
return (Classified)remoteValue;
QueryFilter filter = new QueryFilter();
filter.andFilters["ClassifiedUUID"] = queryClassifiedID;
List<string> query = GD.Query(new[] { "*" }, "userclassifieds", filter, null, null, null);
if (query.Count < 6)
{
return null;
}
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
return classified;
}
示例11: FindClassifieds
/// <summary>
/// Searches for classifieds
/// </summary>
/// <param name = "queryText"></param>
/// <param name = "category"></param>
/// <param name = "queryFlags"></param>
/// <param name = "StartQuery"></param>
/// <returns></returns>
public DirClassifiedReplyData[] FindClassifieds(string queryText, string category, uint queryFlags, int StartQuery)
{
QueryFilter filter = new QueryFilter();
filter.andLikeFilters["Name"] = "%" + queryText + "%";
if (int.Parse(category) != (int)DirectoryManager.ClassifiedCategories.Any) //Check the category
{
filter.andFilters["Category"] = category;
}
List<string> retVal = GD.Query(new string[1] { "*" }, "userclassifieds", filter, null, (uint)StartQuery, 50);
if (retVal.Count == 0)
{
return new DirClassifiedReplyData[0] { };
}
List<DirClassifiedReplyData> Data = new List<DirClassifiedReplyData>();
DirClassifiedReplyData replyData;
for (int i = 0; i < retVal.Count; i += 6)
{
//Pull the classified out of OSD
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));
replyData = new DirClassifiedReplyData
{
classifiedFlags = classified.ClassifiedFlags,
classifiedID = classified.ClassifiedUUID,
creationDate = classified.CreationDate,
expirationDate = classified.ExpirationDate,
price = classified.PriceForListing,
name = classified.Name
};
//Check maturity levels
if ((replyData.classifiedFlags & (uint)DirectoryManager.ClassifiedFlags.Mature) == (uint)DirectoryManager.ClassifiedFlags.Mature)
{
if ((queryFlags & (uint)DirectoryManager.ClassifiedQueryFlags.Mature) == (uint)DirectoryManager.ClassifiedQueryFlags.Mature)
{
Data.Add(replyData);
}
}
else
{ //Its PG, add all
Data.Add(replyData);
}
}
return Data.ToArray();
}
示例12: GetClassified
public Classified GetClassified(UUID queryClassifiedID)
{
Dictionary<string, object> where = new Dictionary<string, object>(1);
where["ClassifiedUUID"] = queryClassifiedID;
List<string> query = GD.Query(new string[1] { "*" }, "userclassifieds", new QueryFilter
{
andFilters = where
}, null, null, null);
if (query.Count < 6)
{
return null;
}
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
return classified;
}
示例13: GetClassifieds
public List<Classified> GetClassifieds(UUID ownerID)
{
Dictionary<string, object> where = new Dictionary<string, object>(1);
where["OwnerUUID"] = ownerID;
List<string> query = GD.Query(new string[1] { "*" }, "userclassifieds", new QueryFilter
{
andFilters = where
}, null, null, null);
List<Classified> classifieds = new List<Classified>();
for (int i = 0; i < query.Count; i += 6)
{
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 5]));
classifieds.Add(classified);
}
return classifieds;
}
示例14: FindClassifieds
public List<DirClassifiedReplyData> FindClassifieds(string queryText, string category, uint queryFlags, int StartQuery, UUID scopeID)
{
object remoteValue = DoRemote(queryText, category, queryFlags, StartQuery, scopeID);
if (remoteValue != null || m_doRemoteOnly)
return (List<DirClassifiedReplyData>)remoteValue;
QueryFilter filter = new QueryFilter();
filter.andLikeFilters["Name"] = "%" + queryText + "%";
if (int.Parse(category) != (int)DirectoryManager.ClassifiedCategories.Any) //Check the category
filter.andFilters["Category"] = category;
if (scopeID != UUID.Zero)
filter.andFilters["ScopeID"] = scopeID;
List<string> retVal = GD.Query(new[] { "*" }, "userclassifieds", filter, null, (uint)StartQuery, 50);
if (retVal.Count == 0)
return new List<DirClassifiedReplyData>();
List<DirClassifiedReplyData> Data = new List<DirClassifiedReplyData>();
for (int i = 0; i < retVal.Count; i += 9)
{
//Pull the classified out of OSD
Classified classified = new Classified();
classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));
DirClassifiedReplyData replyData = new DirClassifiedReplyData
{
classifiedFlags = classified.ClassifiedFlags,
classifiedID = classified.ClassifiedUUID,
creationDate = classified.CreationDate,
expirationDate = classified.ExpirationDate,
price = classified.PriceForListing,
name = classified.Name
};
//Check maturity levels
if ((replyData.classifiedFlags & (uint)DirectoryManager.ClassifiedFlags.Mature) != (uint)DirectoryManager.ClassifiedFlags.Mature)
{
if ((queryFlags & (uint)DirectoryManager.ClassifiedQueryFlags.Mature) == (uint)DirectoryManager.ClassifiedQueryFlags.Mature)
Data.Add(replyData);
}
else
//Its Mature, add all
Data.Add(replyData);
}
return Data;
}
示例15: GetClassified
public Classified GetClassified (UUID queryClassifiedID)
{
try
{
List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf ("RemoteServerURI");
foreach (string url in serverURIs)
{
OSDMap map = new OSDMap ();
map["Method"] = "getclassified";
map["ClassifiedUUID"] = queryClassifiedID;
OSDMap response = WebUtils.PostToService (url + "osd", map, true, true);
if (response["_Result"].Type == OSDType.Map)
{
OSDMap responsemap = (OSDMap)response["_Result"];
Classified info = new Classified ();
info.FromOSD (responsemap);
return info;
}
}
}
catch (Exception e)
{
m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
}
return null;
}