mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:30:02 +08:00
Fix a bug where estate not found would result in a dummy estate record with erroneous information.
Also, added conversion of EstateSettings from/to key-value pairs in preparation for robust net work connectors.
This commit is contained in:
committed by
Justin Clark-Casey
parent
75d21aa71a
commit
4da471a5aa
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -411,5 +412,23 @@ namespace OpenSim.Framework
|
||||
{
|
||||
return l_EstateGroups.Contains(groupID);
|
||||
}
|
||||
|
||||
public Dictionary<string, object> ToMap()
|
||||
{
|
||||
Dictionary<string, object> map = new Dictionary<string, object>();
|
||||
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (PropertyInfo p in properties)
|
||||
map[p.Name] = p.GetValue(this, null);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public EstateSettings(Dictionary<string, object> map)
|
||||
{
|
||||
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (PropertyInfo p in properties)
|
||||
p.SetValue(this, map[p.Name], null);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user