本文整理汇总了C#中Aurora.Framework.Classified.ToOSD方法的典型用法代码示例。如果您正苦于以下问题:C# Classified.ToOSD方法的具体用法?C# Classified.ToOSD怎么用?C# Classified.ToOSD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Framework.Classified
的用法示例。
在下文中一共展示了Classified.ToOSD方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
//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.MySqlEscape(),
classified.Category,
classified.SimName.MySqlEscape(),
classified.CreatorUUID,
classified.ClassifiedUUID,
OSDParser.SerializeJsonString(classified.ToOSD()),
classified.ScopeID
};
return GD.Insert("userclassifieds", values.ToArray());
}
示例2: AddClassified
public bool AddClassified (Classified classified)
{
if (GetUserProfile (classified.CreatorUUID) == null)
return false;
//It might be updating, delete the old
GD.Delete ("userclassifieds", new string[1] { "ClassifiedUUID" }, new object[1] { classified.ClassifiedUUID });
List<object> values = new List<object>();
values.Add(classified.Name);
values.Add(classified.Category);
values.Add(classified.SimName);
values.Add(classified.CreatorUUID);
values.Add(classified.ClassifiedUUID);
values.Add(OSDParser.SerializeJsonString(classified.ToOSD()));
return GD.Insert("userclassifieds", values.ToArray());
}
示例3: ClassifiedInfoUpdate
public void ClassifiedInfoUpdate(UUID queryclassifiedID, uint queryCategory, string queryName, string queryDescription, UUID queryParcelID,
uint queryParentEstate, UUID querySnapshotID, Vector3 queryGlobalPos, byte queryclassifiedFlags,
int queryclassifiedPrice, IClientAPI remoteClient)
{
//Security check
IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);
if (info == null)
return;
ScenePresence p = GetRegionUserIsIn(remoteClient.AgentId).GetScenePresence(remoteClient.AgentId);
if(p == null)
return; //Just fail
IMoneyModule money = p.Scene.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
if (money.AmountCovered(remoteClient, queryclassifiedPrice))
money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, "Add Classified");
else
{
remoteClient.SendAlertMessage("You do not have enough money to complete this upload.");
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());
}
UUID creatorUUID = remoteClient.AgentId;
UUID classifiedUUID = queryclassifiedID;
uint category = queryCategory;
string name = queryName;
string description = queryDescription;
uint parentestate = queryParentEstate;
UUID snapshotUUID = querySnapshotID;
string simname = remoteClient.Scene.RegionInfo.RegionName;
Vector3 globalpos = queryGlobalPos;
byte classifiedFlags = queryclassifiedFlags;
int classifiedPrice = queryclassifiedPrice;
UUID parceluuid = p.currentParcelUUID;
string parcelname = "Unknown";
IParcelManagementModule parcelManagement = GetRegionUserIsIn(remoteClient.AgentId).RequestModuleInterface<IParcelManagementModule>();
if (parcelManagement != null)
{
ILandObject parcel = parcelManagement.GetLandObject(p.AbsolutePosition.X, p.AbsolutePosition.Y);
if (parcel != null)
{
parcelname = parcel.LandData.Name;
parceluuid = parcel.LandData.InfoUUID;
}
}
uint creationdate = (uint)Util.UnixTimeSinceEpoch();
uint expirationdate = (uint)Util.UnixTimeSinceEpoch() + (365 * 24 * 60 * 60);
Classified classified = new Classified();
classified.ClassifiedUUID = classifiedUUID;
classified.CreatorUUID = creatorUUID;
classified.CreationDate = creationdate;
classified.ExpirationDate = expirationdate;
classified.Category = category;
classified.Name = name;
classified.Description = description;
classified.ParcelUUID = parceluuid;
classified.ParentEstate = parentestate;
classified.SnapshotUUID = snapshotUUID;
classified.SimName = simname;
classified.GlobalPos = globalpos;
classified.ParcelName = parcelname;
classified.ClassifiedFlags = classifiedFlags;
classified.PriceForListing = classifiedPrice;
info.Classifieds.Add(classified.ClassifiedUUID.ToString(), classified.ToOSD());
ProfileFrontend.UpdateUserProfile(info);
}
示例4: AddClassified
public bool AddClassified (Classified classified)
{
try
{
List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (classified.CreatorUUID.ToString (), "RemoteServerURI");
foreach (string url in serverURIs)
{
OSDMap map = new OSDMap ();
map["Method"] = "addclassified";
map["Classified"] = classified.ToOSD ();
WebUtils.PostToService (url + "osd", map, false, false);
}
}
catch (Exception e)
{
m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
}
return true;
}
示例5: 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, // was
classified.ClassifiedUUID,
OSDParser.SerializeJsonString(classified.ToOSD()),
classified.ScopeID, // testing new
classified.PriceForListing,
keywords
};
return GD.Insert("userclassifieds", values.ToArray());
}