本文整理汇总了C#中OSDArray类的典型用法代码示例。如果您正苦于以下问题:C# OSDArray类的具体用法?C# OSDArray怎么用?C# OSDArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSDArray类属于命名空间,在下文中一共展示了OSDArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DeserializeJson
public static OSD DeserializeJson(JsonData json)
{
switch (json.GetJsonType())
{
case JsonType.Boolean:
return OSD.FromBoolean((bool)json);
case JsonType.Int:
return OSD.FromInteger((int)json);
case JsonType.Long:
return OSD.FromLong((long)json);
case JsonType.Double:
return OSD.FromReal((double)json);
case JsonType.String:
string str = (string)json;
if (String.IsNullOrEmpty(str))
return new OSD();
else
return OSD.FromString(str);
case JsonType.Array:
OSDArray array = new OSDArray(json.Count);
for (int i = 0; i < json.Count; i++)
array.Add(DeserializeJson(json[i]));
return array;
case JsonType.Object:
OSDMap map = new OSDMap(json.Count);
IDictionaryEnumerator e = ((IOrderedDictionary)json).GetEnumerator();
while (e.MoveNext())
map.Add((string)e.Key, DeserializeJson((JsonData)e.Value));
return map;
case JsonType.None:
default:
return new OSD();
}
}
开发者ID:RavenB,项目名称:gridsearch,代码行数:34,代码来源:OSDJson.cs
示例2: PackAgentCircuitData
public OSDMap PackAgentCircuitData()
{
OSDMap args = new OSDMap();
args["agent_id"] = OSD.FromUUID(AgentID);
args["base_folder"] = OSD.FromUUID(BaseFolder);
args["caps_path"] = OSD.FromString(CapsPath);
OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count);
foreach (KeyValuePair<ulong, string> kvp in ChildrenCapSeeds)
{
OSDMap pair = new OSDMap();
pair["handle"] = OSD.FromString(kvp.Key.ToString());
pair["seed"] = OSD.FromString(kvp.Value);
childrenSeeds.Add(pair);
}
if (ChildrenCapSeeds.Count > 0)
args["children_seeds"] = childrenSeeds;
args["child"] = OSD.FromBoolean(child);
args["circuit_code"] = OSD.FromString(circuitcode.ToString());
args["first_name"] = OSD.FromString(firstname);
args["last_name"] = OSD.FromString(lastname);
args["inventory_folder"] = OSD.FromUUID(InventoryFolder);
args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
args["session_id"] = OSD.FromUUID(SessionID);
args["start_pos"] = OSD.FromString(startpos.ToString());
return args;
}
开发者ID:ChrisD,项目名称:opensim,代码行数:29,代码来源:AgentCircuitData.cs
示例3: OnMessageReceived
protected OSDMap OnMessageReceived(OSDMap message)
{
//If it is an async message request, make sure that the request is valid and check it
if (message["Method"] == "AsyncMessageRequest")
{
try
{
OSDMap response = new OSDMap();
OSDArray array = new OSDArray();
if (m_regionMessages.ContainsKey(message["RegionHandle"].AsULong()))
{
foreach (OSDMap asyncMess in m_regionMessages[message["RegionHandle"].AsULong()])
{
array.Add(asyncMess);
}
m_regionMessages.Remove(message["RegionHandle"].AsULong());
}
response["Messages"] = array;
return response;
}
catch
{
}
}
return null;
}
开发者ID:kow,项目名称:Aurora-Sim,代码行数:26,代码来源:RemoteAsyncMessagePostService.cs
示例4: DeserializeJson
public static OSD DeserializeJson(JsonData json)
{
switch (json.GetJsonType())
{
case JsonType.Boolean:
return OSD.FromBoolean((bool)json);
case JsonType.Int:
return OSD.FromInteger((int)json);
case JsonType.Long:
return OSD.FromLong((long)json);
case JsonType.Double:
return OSD.FromReal((double)json);
case JsonType.String:
string str = (string)json;
if (String.IsNullOrEmpty(str))
return new OSD();
else
return OSD.FromString(str);
case JsonType.Array:
OSDArray array = new OSDArray(json.Count);
for (int i = 0; i < json.Count; i++)
array.Add(DeserializeJson(json[i]));
return array;
case JsonType.Object:
OSDMap map = new OSDMap(json.Count);
foreach (KeyValuePair<string, JsonData> kvp in json)
map.Add(kvp.Key, DeserializeJson(kvp.Value));
return map;
case JsonType.None:
default:
return new OSD();
}
}
开发者ID:RavenB,项目名称:gridsearch,代码行数:33,代码来源:OSDJson.cs
示例5: GetParcelsByRegion
OSDMap GetParcelsByRegion (OSDMap map)
{
var resp = new OSDMap ();
resp ["Parcels"] = new OSDArray ();
resp ["Total"] = OSD.FromInteger (0);
var directory = DataPlugins.RequestPlugin<IDirectoryServiceConnector> ();
if (directory != null && map.ContainsKey ("Region") == true) {
UUID regionID = UUID.Parse (map ["Region"]);
UUID scopeID = map.ContainsKey ("ScopeID") ? UUID.Parse (map ["ScopeID"].ToString ()) : UUID.Zero;
UUID owner = map.ContainsKey ("Owner") ? UUID.Parse (map ["Owner"].ToString ()) : UUID.Zero;
uint start = map.ContainsKey ("Start") ? uint.Parse (map ["Start"].ToString ()) : 0;
uint count = map.ContainsKey ("Count") ? uint.Parse (map ["Count"].ToString ()) : 10;
ParcelFlags flags = map.ContainsKey ("Flags") ? (ParcelFlags)int.Parse (map ["Flags"].ToString ()) : ParcelFlags.None;
ParcelCategory category = map.ContainsKey ("Category") ? (ParcelCategory)uint.Parse (map ["Flags"].ToString ()) : ParcelCategory.Any;
uint total = directory.GetNumberOfParcelsByRegion (regionID, owner, flags, category);
if (total > 0) {
resp ["Total"] = OSD.FromInteger ((int)total);
if (count == 0) {
return resp;
}
List<LandData> regionParcels = directory.GetParcelsByRegion (start, count, regionID, owner, flags, category);
OSDArray parcels = new OSDArray (regionParcels.Count);
regionParcels.ForEach (delegate (LandData parcel) {
parcels.Add (LandData2WebOSD (parcel));
});
resp ["Parcels"] = parcels;
}
}
return resp;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:34,代码来源:ParcelAPI.cs
示例6: GetAbuseReports
OSDMap GetAbuseReports (OSDMap map)
{
var resp = new OSDMap ();
var areports = m_registry.RequestModuleInterface<IAbuseReports> ();
int start = map ["Start"].AsInteger ();
int count = map ["Count"].AsInteger ();
bool active = map ["Active"].AsBoolean ();
List<AbuseReport> arList = areports.GetAbuseReports (start, count, active);
var AbuseReports = new OSDArray ();
if (arList != null) {
foreach (AbuseReport rpt in arList) {
AbuseReports.Add (rpt.ToOSD ());
}
}
resp ["AbuseReports"] = AbuseReports;
resp ["Start"] = OSD.FromInteger (start);
resp ["Count"] = OSD.FromInteger (count);
resp ["Active"] = OSD.FromBoolean (active);
return resp;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:25,代码来源:AbusereportsAPI.cs
示例7: ToOSD
public OSD ToOSD()
{
OSDArray array = new OSDArray(4) {null, null, null, null};
array[0] = new OSDMap {{"regionID", RegionID}};
Cycle.ToOSD(ref array);
Water.ToOSD(ref array);
return array;
}
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:9,代码来源:RegionLightShare.cs
示例8: ToOSD
public override OSDMap ToOSD()
{
OSDMap map = new OSDMap();
map["Items"] = new OSDArray(Items.ConvertAll<OSD>((item) => item.ToOSD()));
map["Folders"] = new OSDArray(Folders.ConvertAll<OSD>((folder) => folder.ToOSD()));
map["UserID"] = UserID;
return map;
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:10,代码来源:InventoryCollection.cs
示例9: ToOSD
public OSDMap ToOSD()
{
OSDMap map = new OSDMap();
map["AuctionStart"] = AuctionStart;
map["AuctionLength"] = AuctionLength;
map["Description"] = Description;
OSDArray array = new OSDArray();
foreach (AuctionBid bid in AuctionBids)
array.Add(bid.ToOSD());
map["AuctionBids"] = array;
return map;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:12,代码来源:IAuctionModule.cs
示例10: AddRegion
/// <summary>
/// This adds the entire region into the search database
/// </summary>
/// <param name="args"></param>
public void AddRegion(List<LandData> parcels)
{
OSDMap mess = new OSDMap();
OSDArray requests = new OSDArray();
foreach (LandData data in parcels)
requests.Add(data.ToOSD());
mess["Requests"] = requests;
mess["Method"] = "addregion";
List<string> m_ServerURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
foreach (string m_ServerURI in m_ServerURIs)
{
WebUtils.PostToService (m_ServerURI + "osd", mess, false, false);
}
}
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:18,代码来源:RemoteDirectoryServiceConnector.cs
示例11: ToOSD
public override OSDMap ToOSD()
{
OSDMap result = new OSDMap();
foreach (KeyValuePair<ulong, List<mapItemReply>> kvp in items)
{
OSDArray array = new OSDArray();
foreach (mapItemReply item in kvp.Value)
{
array.Add(item.ToOSD());
}
result[kvp.Key.ToString()] = array;
}
return result;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:14,代码来源:MapItemReplyStruct.cs
示例12: ProductInfoRequestCAP
byte[] ProductInfoRequestCAP(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
//OSDMap data = m_service.GetCAPS ();
var data = new OSDArray();
var mf = new OSDMap ();
mf ["name"] = "mainland_full";
mf ["description"] = "Mainland / Full Region";
mf ["sku"] = "001";
data.Add(mf);
var mh = new OSDMap ();
mh ["name"] = "mainland_homestead";
mh ["description"] = "Mainland / Homestead";
mh ["sku"] = "011";
data.Add(mh);
var mo = new OSDMap ();
mo ["name"] = "mainland_openspace";
mo ["description"] = "Mainland / Openspace";
mo ["sku"] = "021";
data.Add(mo);
var ef = new OSDMap ();
ef ["name"] = "estate_full";
ef ["description"] = "Estate / Full Region";
ef ["sku"] = "002";
data.Add(ef);
var eh = new OSDMap ();
eh ["name"] = "estate_homestead";
eh ["description"] = "Estate / Homestead";
eh ["sku"] = "012";
data.Add(eh);
var eo = new OSDMap ();
eo ["name"] = "estate_openspace";
eo ["description"] = "Estate / Openspace";
eo ["sku"] = "022";
data.Add(eo);
var wh = new OSDMap ();
wh ["name"] = "universe_homes";
wh ["description"] = "Universe Homes / Full Region";
wh ["sku"] = "101";
data.Add(wh);
return OSDParser.SerializeLLSDXmlBytes (data);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:49,代码来源:ProductInfoRequest.cs
示例13: LoadFromOSD
void LoadFromOSD(ConcurrentDictionary<string, FilterItem> items, OSDArray filters)
{
try
{
foreach (var filter in filters)
{
if (filter is OSDMap)
{
var item = FilterItem.FromOSD((OSDMap)filter);
items[item.Name] = item;
}
}
}
catch { }
}
开发者ID:nivardus,项目名称:libopenmetaverse,代码行数:15,代码来源:MainWindow.Persistance.cs
示例14: ToOSD
public OSDArray ToOSD(ref OSDArray array)
{
OSDMap settings = new OSDMap();
OSDArray cycle = new OSDArray();
foreach (KeyValuePair<string, SkyData> kvp in DataSettings)
{
cycle.Add(new OSDArray {kvp.Key, kvp.Value.preset_name});
settings[kvp.Value.preset_name] = kvp.Value.ToOSD();
}
array[1] = cycle;
array[2] = settings;
return array;
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:15,代码来源:RegionLightShare.cs
示例15: EnableSimulator
public static OSDMap EnableSimulator(ulong regionHandle, IPAddress ip, int port)
{
OSDMap llsdSimInfo = new OSDMap(3);
llsdSimInfo.Add("Handle", OSD.FromULong(regionHandle));
llsdSimInfo.Add("IP", OSD.FromBinary(ip.GetAddressBytes()));
llsdSimInfo.Add("Port", OSD.FromInteger(port));
OSDArray arr = new OSDArray(1);
arr.Add(llsdSimInfo);
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("SimulatorInfo", arr);
return llsdBody;
}
开发者ID:RavenB,项目名称:gridsearch,代码行数:16,代码来源:CapsMessages.cs
示例16: EnableSimulator
public static OSD EnableSimulator(ulong handle, IPEndPoint endPoint)
{
OSDMap llsdSimInfo = new OSDMap(3);
llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle)));
llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes()));
llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port));
OSDArray arr = new OSDArray(1);
arr.Add(llsdSimInfo);
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("SimulatorInfo", arr);
return BuildEvent("EnableSimulator", llsdBody);
}
开发者ID:kf6kjg,项目名称:halcyon,代码行数:16,代码来源:EventQueueHelper.cs
示例17: EnableSimulator
public static OSD EnableSimulator (ulong handle, byte[] IPAddress, int Port, int RegionSizeX, int RegionSizeY)
{
OSDMap llsdSimInfo = new OSDMap (3) {
{ "Handle", new OSDBinary (ulongToByteArray (handle)) },
{ "IP", new OSDBinary (IPAddress) },
{ "Port", new OSDInteger (Port) },
{ "RegionSizeX", OSD.FromUInteger ((uint)RegionSizeX) },
{ "RegionSizeY", OSD.FromUInteger ((uint)RegionSizeY) }
};
OSDArray arr = new OSDArray (1) { llsdSimInfo };
OSDMap llsdBody = new OSDMap (1) { { "SimulatorInfo", arr } };
return buildEvent ("EnableSimulator", llsdBody);
}
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:16,代码来源:EventQueueHelper.cs
示例18: EnableSimulator
public static OSD EnableSimulator(ulong handle, byte[] IPAddress, int Port)
{
OSDMap llsdSimInfo = new OSDMap(3);
llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle)));
llsdSimInfo.Add("IP", new OSDBinary(IPAddress));
llsdSimInfo.Add("Port", new OSDInteger(Port));
OSDArray arr = new OSDArray(1);
arr.Add(llsdSimInfo);
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("SimulatorInfo", arr);
return buildEvent("EnableSimulator", llsdBody);
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:16,代码来源:EventQueueHelper.cs
示例19: GetGroups
OSDMap GetGroups (OSDMap map)
{
var resp = new OSDMap ();
var start = map.ContainsKey ("Start") ? map ["Start"].AsUInteger () : 0;
resp ["Start"] = start;
resp ["Total"] = 0;
var groups = DataPlugins.RequestPlugin<IGroupsServiceConnector> ();
var Groups = new OSDArray ();
if (groups != null) {
var sort = new Dictionary<string, bool> ();
var boolFields = new Dictionary<string, bool> ();
if (map.ContainsKey ("Sort") && map ["Sort"].Type == OSDType.Map) {
var fields = (OSDMap)map ["Sort"];
foreach (string field in fields.Keys) {
sort [field] = int.Parse (fields [field]) != 0;
}
}
if (map.ContainsKey ("BoolFields") && map ["BoolFields"].Type == OSDType.Map) {
var fields = (OSDMap)map ["BoolFields"];
foreach (string field in fields.Keys) {
boolFields [field] = int.Parse (fields [field]) != 0;
}
}
var reply = groups.GetGroupRecords (
AdminAgentID,
start,
map.ContainsKey ("Count") ? map ["Count"].AsUInteger () : 10,
sort,
boolFields
);
if (reply.Count > 0) {
foreach (GroupRecord groupReply in reply) {
Groups.Add (GroupRecord2OSDMap (groupReply));
}
}
resp ["Total"] = groups.GetNumberOfGroups (AdminAgentID, boolFields);
}
resp ["Groups"] = Groups;
return resp;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:44,代码来源:GroupAPI.cs
示例20: GetRegions
OSDMap GetRegions (OSDMap map)
{
OSDMap resp = new OSDMap ();
RegionFlags type = map.Keys.Contains ("RegionFlags") ? (RegionFlags)map ["RegionFlags"].AsInteger () : RegionFlags.RegionOnline;
int start = map.Keys.Contains ("Start") ? map ["Start"].AsInteger () : 0;
if (start < 0) {
start = 0;
}
int count = map.Keys.Contains ("Count") ? map ["Count"].AsInteger () : 10;
if (count < 0) {
count = 1;
}
var regiondata = DataPlugins.RequestPlugin<IRegionData> ();
Dictionary<string, bool> sort = new Dictionary<string, bool> ();
string [] supportedSort = {
"SortRegionName",
"SortLocX",
"SortLocY"
};
foreach (string sortable in supportedSort) {
if (map.ContainsKey (sortable)) {
sort [sortable.Substring (4)] = map [sortable].AsBoolean ();
}
}
List<GridRegion> regions = regiondata.Get (type, sort);
OSDArray Regions = new OSDArray ();
if (start < regions.Count) {
int i = 0;
int j = regions.Count <= (start + count) ? regions.Count : (start + count);
for (i = start; i < j; ++i) {
Regions.Add (regions [i].ToOSD ());
}
}
resp ["Start"] = OSD.FromInteger (start);
resp ["Count"] = OSD.FromInteger (count);
resp ["Total"] = OSD.FromInteger (regions.Count);
resp ["Regions"] = Regions;
return resp;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:44,代码来源:RegionAPI.cs
注:本文中的OSDArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论