Merge branch 'master' into vehicles

0.6.8-post-fixes
Melanie 2009-10-01 14:08:15 +01:00
commit 41ff39414b
307 changed files with 3296 additions and 5638 deletions

View File

@ -53,6 +53,11 @@
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.serialization.tests">
<arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.serialization.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
</exec>
@ -223,6 +228,11 @@
<arg value="-xml=test-results/OpenSim.Framework.Communications.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.serialization.tests">
<arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Framework.Serialization.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.servers.tests">
<arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Framework.Servers.Tests.dll-Results.xml" />

View File

@ -69,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
protected CommunicationsManager m_commsManager;
protected GridInfoService m_gridInfoService;
protected IHyperlink HGServices = null;
protected IRegionCreator m_regionCreator;
@ -144,7 +143,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
// We are in grid mode
InitialiseHGGridServices(libraryRootFolder);
}
HGCommands.HGServices = HGServices;
}
protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder)
@ -187,19 +185,12 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
}
protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder)
{
HGGridServicesStandalone gridService
= new HGGridServicesStandalone(
m_openSim.NetServersInfo, m_httpServer, m_openSim.SceneManager);
{
m_commsManager
= new HGCommunicationsStandalone(
m_openSim.ConfigurationSettings, m_openSim.NetServersInfo, m_httpServer,
gridService,
libraryRootFolder, false);
libraryRootFolder, false);
HGServices = gridService;
CreateGridInfoService();
}
@ -210,8 +201,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
m_openSim.NetServersInfo,
m_openSim.SceneManager, libraryRootFolder);
HGServices = ((HGCommunicationsGridMode) m_commsManager).HGServices;
m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
if (m_openSim.userStatsURI != String.Empty)

View File

@ -69,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private string m_name = "RemoteAdminPlugin";
private string m_version = "0.0";
//AnakinLohner 0.6.5-post-fixes
//guard for XmlRpc-related methods
private void FailIfRemoteAdminDisabled(string requestName)
{
@ -142,7 +141,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
availableMethods["admin_acl_remove"] = XmlRpcAccessListRemove;
availableMethods["admin_acl_list"] = XmlRpcAccessListList;
// Either enable full remote functionality or just selected features
// Either enable full remote functionality or just selected features
string enabledMethods = m_config.GetString("enabled_methods", "all");
// To get this, you must explicitly specify "all" or
@ -469,7 +468,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: CreateRegion: new request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("CreateRegion");
XmlRpcResponse response = new XmlRpcResponse();
@ -477,7 +475,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
lock (rslock)
{
int m_regionLimit = m_config.GetInt("region_limit", 0);
bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false);
bool m_publicAccess = m_config.GetBoolean("create_region_public", true);
@ -502,7 +499,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// check whether we still have space left (iff we are using limits)
if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit)
throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first",
throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first",
m_regionLimit));
// extract or generate region ID now
Scene scene = null;
@ -561,7 +558,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
region.ExternalHostName = (string) requestData["external_address"];
string masterFirst = (string) requestData["region_master_first"];
@ -580,10 +576,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (masterFirst != String.Empty && masterLast != String.Empty) // User requests a master avatar
{
// no client supplied UUID: look it up...
CachedUserInfo userInfo
CachedUserInfo userInfo
= m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(
masterFirst, masterLast);
if (null == userInfo)
{
m_log.InfoFormat("master avatar does not exist, creating it");
@ -636,7 +632,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
region.RegionID, regionXmlPath);
region.SaveRegionToFile("dynamic region", regionXmlPath);
}
}
else
{
region.Persistent = false;
@ -664,7 +660,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
parcel.landData.Flags |= (uint) ParcelFlags.AllowVoiceChat;
parcel.landData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan;
((Scene)newscene).LandChannel.UpdateLandObject(parcel.landData.LocalID, parcel.landData);
((Scene)newscene).LandChannel.UpdateLandObject(parcel.landData.LocalID, parcel.landData);
}
}
@ -684,7 +680,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: CreateRegion: request complete");
return response;
}
@ -756,7 +752,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
return response;
}
}
/// <summary>
/// Close a region.
/// <summary>
@ -798,7 +794,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
Hashtable requestData = (Hashtable) request.Params[0];
checkStringParameters(request, new string[] {"password"});
if (requestData.ContainsKey("region_id") &&
!String.IsNullOrEmpty((string) requestData["region_id"]))
{
@ -899,8 +895,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (!m_app.SceneManager.TryGetScene(regionName, out scene))
throw new Exception(String.Format("region \"{0}\" does not exist", regionName));
// Modify access
scene.RegionInfo.EstateSettings.PublicAccess =
// Modify access
scene.RegionInfo.EstateSettings.PublicAccess =
getBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess);
if (scene.RegionInfo.Persistent)
scene.RegionInfo.EstateSettings.Save();
@ -988,8 +984,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: CreateUser: new request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("CreateUser");
XmlRpcResponse response = new XmlRpcResponse();
@ -1024,13 +1019,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requestData.Contains("user_email"))
email = (string)requestData["user_email"];
CachedUserInfo userInfo =
CachedUserInfo userInfo =
m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname);
if (null != userInfo)
throw new Exception(String.Format("Avatar {0} {1} already exists", firstname, lastname));
UUID userID =
UUID userID =
m_app.CommunicationsManager.UserAdminService.AddUser(firstname, lastname,
passwd, email, regX, regY);
@ -1101,7 +1096,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: UserExists: new request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("UserExists");
XmlRpcResponse response = new XmlRpcResponse();
@ -1117,8 +1111,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
string firstname = (string) requestData["user_firstname"];
string lastname = (string) requestData["user_lastname"];
CachedUserInfo userInfo
= m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname);
CachedUserInfo userInfo
= m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname);
responseData["user_firstname"] = firstname;
responseData["user_lastname"] = lastname;
@ -1131,10 +1125,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
else
{
responseData["success"] = true;
responseData["lastlogin"] = userInfo.UserProfile.LastLogin;
responseData["lastlogin"] = userInfo.UserProfile.LastLogin;
}
response.Value = responseData;
}
catch (Exception e)
@ -1252,7 +1245,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requestData.ContainsKey("about_virtual_world"))
aboutAvatar = (string)requestData["about_virtual_world"];
UserProfileData userProfile
UserProfileData userProfile
= m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname);
if (null == userProfile)
@ -1308,20 +1301,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
return response;
}
/// <summary>
/// This method is called by the user-create and user-modify methods to establish
/// or change, the user's appearance. Default avatar names can be specified via
/// the config file, but must correspond to avatars in the default appearance
/// the config file, but must correspond to avatars in the default appearance
/// file, or pre-existing in the user database.
/// This should probably get moved into somewhere more core eventually.
/// </summary>
private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid)
{
m_log.DebugFormat("[RADMIN] updateUserAppearance");
string dmale = m_config.GetString("default_male", "Default Male");
@ -1347,7 +1338,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
break;
}
}
// Has an explicit model been specified?
if (requestData.Contains("model"))
@ -1384,7 +1375,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
return;
}
// Set current user's appearance. This bit is easy. The appearance structure is populated with
// Set current user's appearance. This bit is easy. The appearance structure is populated with
// actual asset ids, however to complete the magic we need to populate the inventory with the
// assets in question.
@ -1393,7 +1384,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}",
userid, model);
}
/// <summary>
/// This method is called by updateAvatarAppearance once any specified model has been
/// ratified, or an appropriate default value has been adopted. The intended prototype
@ -1402,19 +1393,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private void establishAppearance(UUID dest, UUID srca)
{
m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca);
AvatarAppearance ava = m_app.CommunicationsManager.AvatarService.GetUserAppearance(srca);
// If the model has no associated appearance we're done.
// if (ava == null)
// if (ava == null)
// {
// return new AvatarAppearance();
// }
if (ava == null)
if (ava == null)
return;
UICallback sic = new UICallback();
@ -1423,7 +1413,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>();
iserv.GetUserInventory(dest, dic.callback);
@ -1434,7 +1423,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (sic.OK && dic.OK)
{
InventoryFolderImpl efolder;
InventoryFolderImpl srcf = sic.root.FindFolderForType(5);
InventoryFolderImpl dstf = dic.root.FindFolderForType(5);
@ -1460,7 +1448,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (item.Folder == folder.ID)
{
InventoryItemBase dsti = new InventoryItemBase();
dsti.ID = UUID.Random();
dsti.ID = UUID.Random();
dsti.Name = item.Name;
dsti.Description = item.Description;
dsti.InvType = item.InvType;
@ -1494,7 +1482,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
ava.SetWearable(i, dw);
}
}
}
else
{
@ -1502,7 +1489,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava);
}
catch (Exception e)
{
@ -1510,16 +1496,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController
dest, e.Message);
return;
}
return;
return;
}
///<summary>
/// This method is called if a given model avatar name can not be found. If the external
/// file has already been loaded once, then control returns immediately. If not, then it
/// file has already been loaded once, then control returns immediately. If not, then it
/// looks for a default appearance file. This file contains XML definitions of zero or more named
/// avatars, each avatar can specify zero or more "outfits". Each outfit is a collection
/// avatars, each avatar can specify zero or more "outfits". Each outfit is a collection
/// of items that together, define a particular ensemble for the avatar. Each avatar should
/// indicate which outfit is the default, and this outfit will be automatically worn. The
/// other outfits are provided to allow "real" avatars a way to easily change their outfits.
@ -1527,7 +1512,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private bool createDefaultAvatars()
{
// Only load once
if (daload)
@ -1543,10 +1527,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
string dafn = null;
//AnakinLohner 0.6.5-post-fixes
//m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini
if (m_config != null)
{
@ -1555,7 +1537,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (File.Exists(dafn))
{
XmlDocument doc = new XmlDocument();
string name = "*unknown*";
string email = "anon@anon";
@ -1630,12 +1611,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID);
include = true;
include = true;
}
catch (Exception e)
{
m_log.DebugFormat("[RADMIN] Error creating user {0} : {1}", name, e.Message);
include = false;
include = false;
}
// OK, User has been created OK, now we can install the inventory.
@ -1654,7 +1635,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
mava = new AvatarAppearance();
}
{
AvatarWearable[] wearables = mava.Wearables;
for (int i=0; i<wearables.Length; i++)
@ -1670,8 +1651,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (uic.OK)
try
{
m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory",
m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory",
uic.folders.Count, uic.items.Count);
InventoryFolderImpl cfolder = uic.root.FindFolderForType(5);
@ -1699,7 +1679,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
foreach (XmlElement outfit in outfits)
{
m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}",
GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?"));
@ -1707,7 +1686,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
select = (GetStringAttribute(outfit,"default","no") == "yes");
efolder = null;
// If the folder already exists, re-use it. The defaults may
// If the folder already exists, re-use it. The defaults may
// change over time. Augment only.
foreach (InventoryFolderImpl folder in uic.folders)
{
@ -1756,10 +1735,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
InventoryItemBase iitem = null;
if ((iitem = efolder.FindAsset(assetid)) == null)
if ((iitem = efolder.FindAsset(assetid)) == null)
{
iitem = new InventoryItemBase();
iitem.ID = UUID.Random();
iitem.ID = UUID.Random();
iitem.Name = GetStringAttribute(item,"name","");
iitem.Description = GetStringAttribute(item,"desc","");
iitem.InvType = GetIntegerAttribute(item,"invtype",-1);
@ -1820,9 +1799,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
return true;
}
/// <summary>
/// Load an OAR file into a region..
/// <summary>
@ -1859,9 +1837,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Received Load OAR Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Load OAR");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -1962,9 +1939,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Received Save OAR Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Save OAR");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -2003,7 +1979,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
if (archiver != null)
{
scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted;
@ -2014,11 +1989,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
else
throw new Exception("Archiver module not present for scene");
responseData["saved"] = true;
response.Value = responseData;
}
catch (Exception e)
{
@ -2045,7 +2018,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Received Load XML Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Load XML");
XmlRpcResponse response = new XmlRpcResponse();
@ -2129,12 +2101,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
}
public XmlRpcResponse XmlRpcSaveXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Save XML Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Save XML");
XmlRpcResponse response = new XmlRpcResponse();
@ -2220,7 +2190,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Received Query XML Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Query XML");
XmlRpcResponse response = new XmlRpcResponse();
@ -2255,9 +2224,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
else throw new Exception("neither region_name nor region_uuid given");
Scene s = m_app.SceneManager.CurrentScene;
int health = s.GetHealth();
responseData["health"] = health;
response.Value = responseData;
@ -2280,7 +2247,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Received Command XML Administrator Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Command XML");
XmlRpcResponse response = new XmlRpcResponse();
@ -2320,12 +2286,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public XmlRpcResponse XmlRpcAccessListClear(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Access List Clear Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Access List Clear");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -2360,7 +2324,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
s.RegionInfo.EstateSettings.EstateAccess = new UUID[]{};
if (s.RegionInfo.Persistent)
s.RegionInfo.EstateSettings.Save();
}
catch (Exception e)
{
@ -2368,7 +2331,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = false;
responseData["error"] = e.Message;
}
finally
{
@ -2381,12 +2343,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public XmlRpcResponse XmlRpcAccessListAdd(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Access List Add Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Access List Add");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -2419,7 +2379,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
int addk = 0;
if (requestData.Contains("users"))
if (requestData.Contains("users"))
{
UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService;
Scene s = m_app.SceneManager.CurrentScene;
@ -2450,7 +2410,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
responseData["added"] = addk;
}
catch (Exception e)
{
@ -2458,7 +2417,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = false;
responseData["error"] = e.Message;
}
finally
{
@ -2471,12 +2429,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public XmlRpcResponse XmlRpcAccessListRemove(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Access List Remove Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Access List Remove");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -2509,7 +2465,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
int remk = 0;
if (requestData.Contains("users"))
if (requestData.Contains("users"))
{
UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService;
Scene s = m_app.SceneManager.CurrentScene;
@ -2539,7 +2495,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
responseData["removed"] = remk;
}
catch (Exception e)
{
@ -2547,7 +2502,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = false;
responseData["error"] = e.Message;
}
finally
{
@ -2560,12 +2514,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public XmlRpcResponse XmlRpcAccessListList(XmlRpcRequest request, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Access List List Request");
//AnakinLohner 0.6.5-post-fixes
FailIfRemoteAdminDisabled("Access List List");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -2608,9 +2560,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
users[user.ToString()] = udata.UserProfile.Name;
}
}
responseData["users"] = users;
responseData["users"] = users;
}
catch (Exception e)
{
@ -2618,7 +2569,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = false;
responseData["error"] = e.Message;
}
finally
{
@ -2695,12 +2645,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public void Dispose()
{
}
}
class UICallback
{
private Object uilock = new Object();
internal InventoryFolderImpl root = null;
internal List<InventoryFolderImpl> folders;
@ -2720,7 +2668,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public void GetInventory()
{
Dictionary<UUID, InventoryFolderImpl> fmap = new Dictionary<UUID, InventoryFolderImpl>();
if (OK == false)
@ -2729,7 +2676,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
if (OK == false)
System.Threading.Monitor.Wait(uilock);
}
}
}
// Got the inventory OK. So now merge the content of the default appearance
@ -2774,8 +2721,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
fmap[item.Folder].Items.Add(item.ID, item);
}
}
}
}

View File

@ -218,7 +218,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
httpResponse.ContentType = "text/xml";
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
if (serialiser != null)
if (serialiser != null)
serialiser.SavePrimsToXml2(scene, new StreamWriter(httpResponse.OutputStream), min, max);
return "";

View File

@ -304,7 +304,7 @@ namespace OpenSim.Client.MXP.ClientStack
String typeName = ToOmType(primShape.PCode);
m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName);
PerceptionEventMessage pe = new PerceptionEventMessage();
PerceptionEventMessage pe = new PerceptionEventMessage();
pe.ObjectFragment.ObjectId = objectID.Guid;
pe.ObjectFragment.ParentObjectId = Guid.Empty;

View File

@ -54,7 +54,7 @@ namespace OpenSim.Data
/// <summary>
/// Get a user from a given uri.
/// </summary>
/// </summary>
/// <param name="uri"></param>
/// <returns>The user data profile. Null if no user is found.</returns>
UserProfileData GetUserByUri(Uri uri);

View File

@ -175,7 +175,7 @@ namespace OpenSim.Data.MSSQL
(@id, @name, @description, @assetType, @local,
@temporary, @create_time, @access_time, @data)";
string assetName = asset.Name;
string assetName = asset.Name;
if (asset.Name.Length > 64)
{
assetName = asset.Name.Substring(0, 64);
@ -223,7 +223,7 @@ namespace OpenSim.Data.MSSQL
local = @local, temporary = @temporary, data = @data
WHERE id = @keyId;";
string assetName = asset.Name;
string assetName = asset.Name;
if (asset.Name.Length > 64)
{
assetName = asset.Name.Substring(0, 64);

View File

@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL
insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm);
insertBuilder.Append(String.Join("', '", fields));
insertBuilder.Append("') values ( @principalID, @");
insertBuilder.Append("') values (@principalID, @");
insertBuilder.Append(String.Join(", @", fields));
insertBuilder.Append(")");

View File

@ -428,7 +428,7 @@ namespace OpenSim.Data.MSSQL
@inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType,
@creationDate, @groupID, @groupOwned, @flags)";
string itemName = item.Name;
string itemName = item.Name;
if (item.Name.Length > 64)
{
itemName = item.Name.Substring(0, 64);
@ -529,7 +529,7 @@ namespace OpenSim.Data.MSSQL
{
itemDesc = item.Description.Substring(0, 128);
m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length.ToString() + " to " + itemDesc.Length.ToString() + " characters on update");
}
}
using (AutoClosingSqlCommand command = database.Query(sql))
{

View File

@ -146,7 +146,7 @@ namespace OpenSim.Data.MSSQL
sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID);
sceneObjectPart.UUID = groupID;
}
}
grp = new SceneObjectGroup(sceneObjectPart);
}

View File

@ -52,7 +52,7 @@ namespace OpenSim.Data.MSSQL
conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "UserStore");
m.Update();
}
}
}
public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query)
@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL
StringBuilder insertBuilder = new StringBuilder();
insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm);
insertBuilder.Append(String.Join("', '", fields));
insertBuilder.Append("') values ( @principalID, @scopeID, @");
insertBuilder.Append("') values (@principalID, @scopeID, @");
insertBuilder.Append(String.Join(", @", fields));
insertBuilder.Append(")");

View File

@ -1146,7 +1146,7 @@ ELSE
if (reader.IsDBNull(reader.GetOrdinal("homeRegionID")))
retval.HomeRegionID = UUID.Zero;
else
retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]);
retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]);
retval.Created = Convert.ToInt32(reader["created"].ToString());
retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
@ -1200,7 +1200,7 @@ ELSE
if (reader.IsDBNull(reader.GetOrdinal("partner")))
retval.Partner = UUID.Zero;
else
retval.Partner = new UUID((Guid)reader["partner"]);
retval.Partner = new UUID((Guid)reader["partner"]);
}
else
{

View File

@ -204,7 +204,7 @@ namespace OpenSim.Data.MySQL
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)",
_dbConnection.Connection);
string assetName = asset.Name;
string assetName = asset.Name;
if (asset.Name.Length > 64)
{
assetName = asset.Name.Substring(0, 64);

View File

@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL
{
string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
String.Join("`, `", fields) +
"`) values ( ?principalID, ?" + String.Join(", ?", fields) + ")";
"`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
cmd.CommandText = insert;

View File

@ -325,10 +325,10 @@ namespace OpenSim.Data.MySQL
UUID GroupID = UUID.Zero;
UUID.TryParse((string)reader["avatarID"], out Owner);
UUID.TryParse((string)reader["groupID"], out GroupID);
item.Owner = Owner;
item.Owner = Owner;
item.GroupID = GroupID;
// Rest of the parsing. If these UUID's fail, we're dead anyway
// Rest of the parsing. If these UUID's fail, we're dead anyway
item.ID = new UUID((string) reader["inventoryID"]);
item.AssetID = new UUID((string) reader["assetID"]);
item.AssetType = (int) reader["assetType"];
@ -472,7 +472,7 @@ namespace OpenSim.Data.MySQL
+ ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate"
+ ", ?groupID, ?groupOwned, ?flags)";
string itemName = item.Name;
string itemName = item.Name;
if (item.Name.Length > 64)
{
itemName = item.Name.Substring(0, 64);
@ -484,7 +484,7 @@ namespace OpenSim.Data.MySQL
{
itemDesc = item.Description.Substring(0, 128);
m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length + " to " + itemDesc.Length + " characters on add item");
}
}
try
{
@ -590,12 +590,12 @@ namespace OpenSim.Data.MySQL
"REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES ";
sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)";
string folderName = folder.Name;
string folderName = folder.Name;
if (folderName.Length > 64)
{
folderName = folderName.Substring(0, 64);
m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder");
}
}
database.CheckConnection();

View File

@ -464,7 +464,7 @@ namespace OpenSim.Data.MySQL
prim.Name, prim.UUID, prim.GroupPosition, groupID);
prim.UUID = groupID;
}
}
grp = new SceneObjectGroup(prim);
}
@ -533,7 +533,7 @@ namespace OpenSim.Data.MySQL
/// <summary>
/// Load in a prim's persisted inventory.
/// </summary>
/// <param name="prim">The prim</param>
/// <param name="prim">The prim</param>
private void LoadItems(SceneObjectPart prim)
{
lock (m_Connection)
@ -773,7 +773,7 @@ namespace OpenSim.Data.MySQL
"use_estate_sun, fixed_sun, sun_position, " +
"covenant, Sandbox, sunvectorx, sunvectory, " +
"sunvectorz, loaded_creation_datetime, " +
"loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " +
"loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " +
"?BlockFly, ?AllowDamage, ?RestrictPushing, " +
"?AllowLandResell, ?AllowLandJoinDivide, " +
"?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +

View File

@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL
{
string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" +
String.Join("`, `", fields) +
"`) values ( ?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")";
"`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")";
cmd.CommandText = insert;

View File

@ -632,7 +632,7 @@ namespace OpenSim.Data.MySQL
UUID zero = UUID.Zero;
if (user.ID == zero)
{
return;
return;
}
MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile");
@ -666,7 +666,7 @@ namespace OpenSim.Data.MySQL
{
UUID zero = UUID.Zero;
if (agent.ProfileID == zero || agent.SessionID == zero)
return;
return;
MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent");
try

View File

@ -155,7 +155,7 @@ namespace OpenSim.Data.NHibernate
m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id);
}
return obj;
}
}
}
/// <summary>

View File

@ -86,7 +86,7 @@ namespace OpenSim.Data.NHibernate
m_log.InfoFormat("[NHIBERNATE] GetUserByUUID: {0} ", uuid);
user = (UserProfileData)manager.Get(typeof(UserProfileData), uuid);
if (user != null)
if (user != null)
{
UserAgentData agent = GetAgentByUUID(uuid);
if (agent != null)
@ -245,7 +245,7 @@ namespace OpenSim.Data.NHibernate
UserProfileData user=GetUserByUUID(agentID);
user.WebLoginKey = webLoginKey;
UpdateUserProfile(user);
return;
return;
}
public override void AddNewUserFriend(UUID ownerId, UUID friendId, uint perms)
@ -258,7 +258,7 @@ namespace OpenSim.Data.NHibernate
{
manager.Insert(new UserFriend(UUID.Random(), friendId, ownerId, perms));
}
return;
return;
}
private bool FriendRelationExists(UUID ownerId, UUID friendId)

View File

@ -47,7 +47,7 @@ namespace OpenSim.Data.Null
{
List<RegionData> ret = new List<RegionData>();
foreach(RegionData r in m_regionData.Values)
foreach (RegionData r in m_regionData.Values)
{
if (regionName.Contains("%"))
{
@ -71,7 +71,7 @@ namespace OpenSim.Data.Null
{
List<RegionData> ret = new List<RegionData>();
foreach(RegionData r in m_regionData.Values)
foreach (RegionData r in m_regionData.Values)
{
if (r.posX == posX && r.posY == posY)
ret.Add(r);
@ -95,7 +95,7 @@ namespace OpenSim.Data.Null
{
List<RegionData> ret = new List<RegionData>();
foreach(RegionData r in m_regionData.Values)
foreach (RegionData r in m_regionData.Values)
{
if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY)
ret.Add(r);

View File

@ -137,7 +137,7 @@ namespace OpenSim.Data
public uint maturity;
//Data Wrappers
//Data Wrappers
public string RegionName
{
get { return regionName; }

View File

@ -496,7 +496,7 @@ namespace OpenSim.Data.SQLite
{
//m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
DataTable dbItems = ds.Tables["primitems"];
DataTable dbItems = ds.Tables["primitems"];
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
DataRow[] dbItemRows = dbItems.Select(sql);
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();

View File

@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests
public UUID item2;
public UUID item3;
public static Random random;
public static Random random;
public string itemname1 = "item1";
@ -173,7 +173,7 @@ namespace OpenSim.Data.Tests
UUID tmp0 = UUID.Random();
UUID tmp1 = UUID.Random();
UUID tmp2 = UUID.Random();
UUID tmp3 = UUID.Random();
UUID tmp3 = UUID.Random();
UUID newregion = UUID.Random();
SceneObjectPart p1 = NewSOP("SoP 1",tmp1);
SceneObjectPart p2 = NewSOP("SoP 2",tmp2);
@ -224,7 +224,7 @@ namespace OpenSim.Data.Tests
random.NextBytes(partsys);
DateTime expires = new DateTime(2008, 12, 20);
DateTime rezzed = new DateTime(2009, 07, 15);
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
@ -261,7 +261,7 @@ namespace OpenSim.Data.Tests
sop.Shape = pbshap;
sop.GroupPosition = groupos;
sop.RotationOffset = rotoff;
sop.CreatorID = creator;
sop.CreatorID = creator;
sop.InventorySerial = iserial;
sop.TaskInventory = dic;
sop.ObjectFlags = objf;
@ -306,7 +306,7 @@ namespace OpenSim.Data.Tests
Assert.That(expires,Is.EqualTo(sop.Expires), "Assert.That(expires,Is.EqualTo(sop.Expires))");
Assert.That(rezzed,Is.EqualTo(sop.Rezzed), "Assert.That(rezzed,Is.EqualTo(sop.Rezzed))");
Assert.That(offset,Is.EqualTo(sop.OffsetPosition), "Assert.That(offset,Is.EqualTo(sop.OffsetPosition))");
Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))");
Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))");
Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity), "Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity))");
Assert.That(accel,Is.EqualTo(sop.Acceleration), "Assert.That(accel,Is.EqualTo(sop.Acceleration))");
Assert.That(description,Is.EqualTo(sop.Description), "Assert.That(description,Is.EqualTo(sop.Description))");
@ -319,7 +319,7 @@ namespace OpenSim.Data.Tests
Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))");
Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))");
// This is necessary or object will not be inserted in DB
// This is necessary or object will not be inserted in DB
sop.ObjectFlags = 0;
SceneObjectGroup sog = new SceneObjectGroup(sop);
@ -332,11 +332,11 @@ namespace OpenSim.Data.Tests
// Makes sure there are no double insertions:
db.StoreObject(sog,region3);
sogs = db.LoadObjects(region3);
Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
// Tests if the parameters were inserted correctly
SceneObjectPart p = sogs[0].RootPart;
SceneObjectPart p = sogs[0].RootPart;
Assert.That(regionh,Is.EqualTo(p.RegionHandle), "Assert.That(regionh,Is.EqualTo(p.RegionHandle))");
//Assert.That(localid,Is.EqualTo(p.LocalId), "Assert.That(localid,Is.EqualTo(p.LocalId))");
Assert.That(groupos,Is.EqualTo(p.GroupPosition), "Assert.That(groupos,Is.EqualTo(p.GroupPosition))");
@ -402,7 +402,7 @@ namespace OpenSim.Data.Tests
random.NextBytes(partsys);
DateTime expires = new DateTime(2010, 12, 20);
DateTime rezzed = new DateTime(2005, 07, 15);
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
@ -418,7 +418,7 @@ namespace OpenSim.Data.Tests
PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
pbshap = PrimitiveBaseShape.Default;
Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
byte updatef = (byte) random.Next(127);
byte updatef = (byte) random.Next(127);
// Updates the region with new values
SceneObjectGroup sog2 = FindSOG("Adam West", region3);
@ -427,7 +427,7 @@ namespace OpenSim.Data.Tests
sog2.RootPart.Shape = pbshap;
sog2.RootPart.GroupPosition = groupos;
sog2.RootPart.RotationOffset = rotoff;
sog2.RootPart.CreatorID = creator;
sog2.RootPart.CreatorID = creator;
sog2.RootPart.TaskInventory = dic;
sog2.RootPart.Name = name;
sog2.RootPart.Material = material;
@ -492,12 +492,12 @@ namespace OpenSim.Data.Tests
{
UUID tmp = UUID.Random();
SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp);
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next());
Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next());
sop.GroupPosition = groupos;
sop.RotationOffset = rotoff;
@ -648,7 +648,7 @@ namespace OpenSim.Data.Tests
{
InventoryItemBase i = new InventoryItemBase();
UUID id = UUID.Random();
i.ID = id;
i.ID = id;
UUID folder = UUID.Random();
i.Folder = folder;
UUID owner = UUID.Random();
@ -666,13 +666,13 @@ namespace OpenSim.Data.Tests
i.NextPermissions = nextperm;
uint curperm = (uint) random.Next();
i.CurrentPermissions = curperm;
uint baseperm = (uint) random.Next();
uint baseperm = (uint) random.Next();
i.BasePermissions = baseperm;
uint eoperm = (uint) random.Next();
i.EveryOnePermissions = eoperm;
int assettype = random.Next();
i.AssetType = assettype;
UUID groupid = UUID.Random();
UUID groupid = UUID.Random();
i.GroupID = groupid;
bool groupown = true;
i.GroupOwned = groupown;
@ -1010,7 +1010,7 @@ namespace OpenSim.Data.Tests
private SceneObjectPart NewSOP(string name, UUID uuid)
{
SceneObjectPart sop = new SceneObjectPart();
SceneObjectPart sop = new SceneObjectPart();
sop.Name = name;
sop.Description = name;
sop.Text = RandomName();
@ -1042,12 +1042,12 @@ namespace OpenSim.Data.Tests
int size = random.Next(5,12);
char ch ;
for (int i=0; i<size; i++)
{
{
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
name.Append(ch);
}
return name.ToString();
}
}
// private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name)
// {
// InventoryFolderBase f = new InventoryFolderBase();

View File

@ -152,7 +152,7 @@ namespace OpenSim.Data.Tests
u1.FirstName = "Ugly";
db.UpdateUserProfile(u1);
Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))");
Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))");
}
[Test]
@ -174,7 +174,7 @@ namespace OpenSim.Data.Tests
db.AddNewUserProfile(u4);
Assert.That(db.GetUserByUUID(zero),Is.Null);
Assert.That(db.GetUserByUUID(user4),Is.Null);
}
}
[Test]
public void T015_UserPersistency()
@ -218,7 +218,7 @@ namespace OpenSim.Data.Tests
//HomeRegionX and HomeRegionY must only use 24 bits
homeregx = ((homeregx << 8) >> 8);
homeregy = ((homeregy << 8) >> 8);
homeregy = ((homeregy << 8) >> 8);
u.ID = id;
u.WebLoginKey = webloginkey;
@ -299,7 +299,7 @@ namespace OpenSim.Data.Tests
uint homeregx = (uint) random.Next();
uint homeregy = (uint) random.Next();
Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5));
Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5));
Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5));
int created = random.Next();
int lastlogin = random.Next();
string userinvuri = RandomName();
@ -359,7 +359,7 @@ namespace OpenSim.Data.Tests
Assert.That(email,Is.EqualTo(u1a.Email), "Assert.That(email,Is.EqualTo(u1a.Email))");
Assert.That(passhash,Is.EqualTo(u1a.PasswordHash), "Assert.That(passhash,Is.EqualTo(u1a.PasswordHash))");
Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt), "Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt))");
Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))");
Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))");
Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX), "Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX))");
Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY), "Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY))");
Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))");
@ -426,7 +426,7 @@ namespace OpenSim.Data.Tests
UserAgentData a2 = db.GetAgentByName(fname2,lname2);
UserAgentData a3 = db.GetAgentByName(name3);
Assert.That(user2,Is.EqualTo(a2.ProfileID), "Assert.That(user2,Is.EqualTo(a2.ProfileID))");
Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))");
Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))");
}
[Test]
@ -501,11 +501,11 @@ namespace OpenSim.Data.Tests
db.AddNewUserFriend(user1,user3, 2);
db.AddNewUserFriend(user1,user2, 4);
List<FriendListItem> fl1 = db.GetUserFriendList(user1);
Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))");
Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))");
perms.Add(user2,1);
perms.Add(user3,2);
for (int i = 0; i < fl1.Count; i++)
{
{
Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner), "Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner))");
friends.Add(fl1[i].Friend,1);
temp = perms[fl1[i].Friend];
@ -544,7 +544,7 @@ namespace OpenSim.Data.Tests
db.UpdateUserFriendPerms(user1, user3, 4);
fl1 = db.GetUserFriendList(user1);
Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))");
Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))");
}
[Test]
@ -560,7 +560,7 @@ namespace OpenSim.Data.Tests
[Test]
public void T041_UserAppearancePersistency()
{
AvatarAppearance appear = new AvatarAppearance();
AvatarAppearance appear = new AvatarAppearance();
UUID owner = UUID.Random();
int serial = random.Next();
byte[] visualp = new byte[218];
@ -698,7 +698,7 @@ namespace OpenSim.Data.Tests
int size = random.Next(5,12);
char ch ;
for (int i=0; i<size; i++)
{
{
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
name.Append(ch);
}

View File

@ -43,7 +43,7 @@ namespace OpenSim.Data
public abstract UserAgentData GetAgentByUUID(UUID user);
public abstract UserAgentData GetAgentByName(string name);
public abstract UserAgentData GetAgentByName(string fname, string lname);
public UserProfileData GetUserByUri(Uri uri) { return null; }
public UserProfileData GetUserByUri(Uri uri) { return null; }
public abstract void StoreWebLoginKey(UUID agentID, UUID webLoginKey);
public abstract void AddNewUserProfile(UserProfileData user);

View File

@ -59,7 +59,7 @@ namespace OpenSim.Framework
// Body
defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
// Skin
defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");

View File

@ -28,7 +28,7 @@
using OpenMetaverse;
namespace OpenSim.Framework.Capabilities
{
{
/// <summary>
/// Capabilities utility methods
/// </summary>

View File

@ -57,7 +57,7 @@ namespace OpenSim.Framework.Client
// Porting Guide from old IM
// SendIM(...)
// Loses FromAgentSession - this should be added by implementers manually.
//
//
public interface IClientIM
{

View File

@ -177,9 +177,9 @@ namespace OpenSim.Framework
}
public void ViewerEffectHandler(IClientAPI sender, List<ViewerEffectEventHandlerArg> args)
{
{
// TODO: don't create new blocks if recycling an old packet
List<ViewerEffectPacket.EffectBlock> effectBlock = new List<ViewerEffectPacket.EffectBlock>();
List<ViewerEffectPacket.EffectBlock> effectBlock = new List<ViewerEffectPacket.EffectBlock>();
for (int i = 0; i < args.Count; i++)
{
ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock();

View File

@ -70,7 +70,7 @@ namespace OpenSim.Framework
/// <summary>
/// How many operations between time checks.
/// </summary>
/// </summary>
private const int DefaultOperationsBetweenTimeChecks = 40;
/// <summary>
@ -168,7 +168,7 @@ namespace OpenSim.Framework
private int m_version;
/// <summary>
/// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class.
/// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class.
/// </summary>
public CnmMemoryCache()
: this(DefaultMaxSize)
@ -277,7 +277,7 @@ namespace OpenSim.Framework
/// </param>
protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size)
{
// Add to newest generation
// Add to newest generation
if (!m_newGeneration.Set(bucketIndex, key, value, size))
{
// Failed to add new generation
@ -311,7 +311,7 @@ namespace OpenSim.Framework
/// Bucket index is remainder when element key's hash value is divided by bucket count.
/// </para>
/// <para>
/// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2.
/// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2.
/// </para>
/// </remarks>
protected virtual int GetBucketIndex(TKey key)
@ -367,7 +367,7 @@ namespace OpenSim.Framework
/// </summary>
private void RecycleGenerations()
{
// Rotate old generation to new generation, new generation to old generation
// Rotate old generation to new generation, new generation to old generation
IGeneration temp = m_newGeneration;
m_newGeneration = m_oldGeneration;
m_newGeneration.Clear();
@ -522,7 +522,7 @@ namespace OpenSim.Framework
/// <summary>
/// Index of first element's in element chain.
/// </summary>
/// <value>
/// <value>
/// -1 if there is no element in bucket; otherwise first element's index in the element chain.
/// </value>
/// <remarks>
@ -692,7 +692,7 @@ namespace OpenSim.Framework
/// </summary>
/// <value>
/// 0 if element is free; otherwise larger than 0.
/// </value>
/// </value>
public long Size;
/// <summary>
@ -771,7 +771,7 @@ namespace OpenSim.Framework
/// </returns>
/// <exception cref="InvalidOperationException">
/// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called.
/// </exception>
/// </exception>
public KeyValuePair<TKey, TValue> Current
{
get
@ -1405,10 +1405,10 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
public bool IsSizeLimited
@ -1438,7 +1438,7 @@ namespace OpenSim.Framework
}
/// <summary>
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// </summary>
/// <value>
/// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@ -1449,7 +1449,7 @@ namespace OpenSim.Framework
/// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from
/// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
/// stay longer in cache.
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
/// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
@ -1503,7 +1503,7 @@ namespace OpenSim.Framework
/// <seealso cref="ICnmCache{TKey,TValue}.Set"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
public long MaxElementSize
{
get { return m_maxElementSize; }
@ -1517,7 +1517,7 @@ namespace OpenSim.Framework
/// <value>
/// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// <remarks>
/// <remarks>
/// <para>
/// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
/// </para>
@ -1562,10 +1562,10 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
public long Size
@ -1576,9 +1576,9 @@ namespace OpenSim.Framework
/// <summary>
/// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </summary>
/// <value>
/// <value>
/// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// </value>
/// <remarks>
/// <para>
/// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/>
@ -1630,7 +1630,7 @@ namespace OpenSim.Framework
/// </para>
/// <para>
/// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
/// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
/// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
/// </para>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
@ -1810,7 +1810,7 @@ namespace OpenSim.Framework
/// </summary>
/// <returns>
/// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
/// the specified key; otherwise, <see langword="false"/>.
/// the specified key; otherwise, <see langword="false"/>.
/// </returns>
/// <param name="key">
/// The key whose <paramref name="value"/> to get.

View File

@ -142,7 +142,7 @@ namespace OpenSim.Framework
/// </returns>
/// <exception cref="InvalidOperationException">
/// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called.
/// </exception>
/// </exception>
public KeyValuePair<TKey, TValue> Current
{
get { return m_enumerator.Current; }
@ -327,10 +327,10 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
public bool IsSizeLimited
@ -366,7 +366,7 @@ namespace OpenSim.Framework
}
/// <summary>
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// </summary>
/// <value>
/// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@ -377,7 +377,7 @@ namespace OpenSim.Framework
/// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from
/// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
/// stay longer in cache.
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
/// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
@ -440,7 +440,7 @@ namespace OpenSim.Framework
/// <seealso cref="ICnmCache{TKey,TValue}.Set"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
public long MaxElementSize
{
get
@ -458,7 +458,7 @@ namespace OpenSim.Framework
/// <value>
/// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// <remarks>
/// <remarks>
/// <para>
/// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
/// </para>
@ -507,10 +507,10 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
/// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
/// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
public long Size
@ -527,9 +527,9 @@ namespace OpenSim.Framework
/// <summary>
/// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </summary>
/// <value>
/// <value>
/// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// </value>
/// <remarks>
/// <para>
/// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/>
@ -584,7 +584,7 @@ namespace OpenSim.Framework
/// </para>
/// <para>
/// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
/// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
/// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
/// </para>
/// </remarks>
/// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
@ -704,7 +704,7 @@ namespace OpenSim.Framework
/// </summary>
/// <returns>
/// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
/// the specified key; otherwise, <see langword="false"/>.
/// the specified key; otherwise, <see langword="false"/>.
/// </returns>
/// <param name="key">
/// The key whose <paramref name="value"/> to get.

View File

@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Cache
/// Stores user profile and inventory data received from backend services for a particular user.
/// </summary>
public class CachedUserInfo
{
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//// <value>
@ -190,7 +190,7 @@ namespace OpenSim.Framework.Communications.Cache
resolvedFolders.Add(folder);
resolvedFolderDictionary[folder.ID] = folder;
parentFolder.AddChildFolder(folder);
}
}
}
} // foreach (folder in pendingCategorizationFolders[parentFolder.ID])
@ -219,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary>
/// Fetch inventory for this user.
/// </summary>
/// This has to be executed as a separate step once user information is retreived.
/// This has to be executed as a separate step once user information is retreived.
/// This will occur synchronously if the inventory service is in the same process as this class, and
/// asynchronously otherwise.
public void FetchInventory()
@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Cache
///
/// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
/// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
/// and needs to be changed.
/// and needs to be changed.
///
/// <param name="folderID"></param>
/// <param name="type"></param>
@ -500,7 +500,7 @@ namespace OpenSim.Framework.Communications.Cache
InventoryFolderImpl oldParentFolder = RootFolder.FindFolder(folder.ParentID);
if (oldParentFolder != null)
{
{
oldParentFolder.RemoveChildFolder(folderID);
parentFolder.AddChildFolder(folder);
}

View File

@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
/// User profiles indexed by name
/// </summary>
private readonly Dictionary<string, CachedUserInfo> m_userProfilesByName
= new Dictionary<string, CachedUserInfo>();
= new Dictionary<string, CachedUserInfo>();
/// <summary>
/// The root library folder.
@ -123,35 +123,35 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary>
/// Get details of the given user.
/// </summary>
/// If the user isn't in cache then the user is requested from the profile service.
/// If the user isn't in cache then the user is requested from the profile service.
/// <param name="userID"></param>
/// <returns>null if no user details are found</returns>
/// <returns>null if no user details are found</returns>
public CachedUserInfo GetUserDetails(string fname, string lname)
{
lock (m_userProfilesByName)
{
{
CachedUserInfo userInfo;
if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo))
if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo))
{
return userInfo;
}
}
else
{
{
UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname);
if (userProfile != null)
return AddToCaches(userProfile);
return AddToCaches(userProfile);
else
return null;
}
}
}
}
/// <summary>
/// Get details of the given user.
/// </summary>
/// If the user isn't in cache then the user is requested from the profile service.
/// If the user isn't in cache then the user is requested from the profile service.
/// <param name="userID"></param>
/// <returns>null if no user details are found</returns>
public CachedUserInfo GetUserDetails(UUID userID)
@ -185,20 +185,20 @@ namespace OpenSim.Framework.Communications.Cache
// probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via
// returning a read only class from the cache).
// public bool StoreProfile(UserProfileData userProfile)
// {
// {
// lock (m_userProfilesById)
// {
// {
// CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
//
//
// if (userInfo != null)
// {
// userInfo.m_userProfile = userProfile;
// userInfo.m_userProfile = userProfile;
// m_commsManager.UserService.UpdateUserProfile(userProfile);
//
//
// return true;
// }
// }
//
//
// return false;
// }
@ -220,7 +220,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
return createdUserInfo;
return createdUserInfo;
}
/// <summary>
@ -234,7 +234,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if (m_userProfilesById.ContainsKey(userId))
{
CachedUserInfo userInfo = m_userProfilesById[userId];
CachedUserInfo userInfo = m_userProfilesById[userId];
m_userProfilesById.Remove(userId);
lock (m_userProfilesByName)
@ -244,7 +244,7 @@ namespace OpenSim.Framework.Communications.Cache
return true;
}
}
}
return false;
}

View File

@ -35,6 +35,8 @@ using System.Text;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using log4net;
namespace OpenSim.Framework.Communications.Clients
@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Clients
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason)
public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, out string reason)
{
reason = String.Empty;
@ -166,7 +168,7 @@ namespace OpenSim.Framework.Communications.Clients
}
public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData)
public bool DoChildAgentUpdateCall(GridRegion region, IAgentData cAgentData)
{
// Eventually, we want to use a caps url instead of the agentID
string uri = string.Empty;
@ -260,7 +262,7 @@ namespace OpenSim.Framework.Communications.Clients
return true;
}
public bool DoRetrieveRootAgentCall(RegionInfo region, UUID id, out IAgentData agent)
public bool DoRetrieveRootAgentCall(GridRegion region, UUID id, out IAgentData agent)
{
agent = null;
// Eventually, we want to use a caps url instead of the agentID
@ -348,7 +350,7 @@ namespace OpenSim.Framework.Communications.Clients
}
public bool DoCloseAgentCall(RegionInfo region, UUID id)
public bool DoCloseAgentCall(GridRegion region, UUID id)
{
string uri = string.Empty;
try
@ -391,7 +393,7 @@ namespace OpenSim.Framework.Communications.Clients
return true;
}
public bool DoCreateObjectCall(RegionInfo region, ISceneObject sog, string sogXml2, bool allowScriptCrossing)
public bool DoCreateObjectCall(GridRegion region, ISceneObject sog, string sogXml2, bool allowScriptCrossing)
{
ulong regionHandle = GetRegionHandle(region.RegionHandle);
string uri
@ -474,7 +476,7 @@ namespace OpenSim.Framework.Communications.Clients
}
public bool DoCreateObjectCall(RegionInfo region, UUID userID, UUID itemID)
public bool DoCreateObjectCall(GridRegion region, UUID userID, UUID itemID)
{
ulong regionHandle = GetRegionHandle(region.RegionHandle);
string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/";
@ -646,7 +648,7 @@ namespace OpenSim.Framework.Communications.Clients
return false;
}
public virtual void SendUserInformation(RegionInfo regInfo, AgentCircuitData aCircuit)
public virtual void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit)
{
}

View File

@ -59,11 +59,6 @@ namespace OpenSim.Framework.Communications
}
protected IMessagingService m_messageService;
public IGridServices GridService
{
get { return m_gridService; }
}
protected IGridServices m_gridService;
public UserProfileCacheService UserProfileCacheService
{
@ -95,8 +90,8 @@ namespace OpenSim.Framework.Communications
public IUserAdminService UserAdminService
{
get { return m_userAdminService; }
}
protected IUserAdminService m_userAdminService;
}
protected IUserAdminService m_userAdminService;
/// <summary>
/// Constructor

View File

@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications
/// Update avatar appearance information
/// </summary>
/// <param name="user"></param>
/// <param name="appearance"></param>
/// <param name="appearance"></param>
void UpdateUserAppearance(UUID user, AvatarAppearance appearance);
}
}

View File

@ -1,92 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using OpenMetaverse;
namespace OpenSim.Framework.Communications
{
public interface IGridServices
{
string gdebugRegionName { get; set; }
/// <summary>
/// If true, then regions will accept logins from the user service. If false, then they will not.
/// </summary>
bool RegionLoginsEnabled { get; set; }
/// <summary>
/// Register a region with the grid service.
/// </summary>
/// <param name="regionInfos"> </param>
/// <returns></returns>
/// <exception cref="System.Exception">Thrown if region registration failed</exception>
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
/// <summary>
/// Deregister a region with the grid service.
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
/// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
bool DeregisterRegion(RegionInfo regionInfo);
/// <summary>
/// Get information about the regions neighbouring the given co-ordinates.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
RegionInfo RequestNeighbourInfo(ulong regionHandle);
RegionInfo RequestNeighbourInfo(UUID regionID);
RegionInfo RequestNeighbourInfo(string name);
RegionInfo RequestNeighbourInfo(string host, uint port);
RegionInfo RequestClosestRegion(string regionName);
Dictionary<string, string> GetGridSettings();
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
// not complete yet, only contains the fields needed for ParcelInfoReqeust
LandData RequestLandData(ulong regionHandle, uint x, uint y);
/// <summary>
/// Get information about regions starting with the provided name.
/// </summary>
/// <param name="name">
/// The name to match against.
/// </param>
/// <param name="maxNumber">
/// The maximum number of results to return.
/// </param>
/// <returns>
/// A list of <see cref="RegionInfo"/>s of regions with matching name. If the
/// grid-server couldn't be contacted or returned an error, return null.
/// </returns>
List<RegionInfo> RequestNamedRegions(string name, int maxNumber);
}
}

View File

@ -66,6 +66,6 @@ namespace OpenSim.Framework.Communications
/// <param name="lastName"></param>
/// <param name="newPassword"></param>
/// <returns>true if the update was successful, false otherwise</returns>
bool ResetUserPassword(string firstName, string lastName, string newPassword);
bool ResetUserPassword(string firstName, string lastName, string newPassword);
}
}

View File

@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications
/// <param name="friendlistowner">The agent that who's friends list is being updated</param>
/// <param name="friend">The agent that is getting or loosing permissions</param>
/// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms);
void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms);
/// <summary>
/// Logs off a user on the user server
@ -128,9 +128,9 @@ namespace OpenSim.Framework.Communications
///
/// <param name="friendlistowner">The agent for whom we're retreiving the friends Data.</param>
/// <returns>
/// A List of FriendListItems that contains info about the user's friends.
/// A List of FriendListItems that contains info about the user's friends.
/// Always returns a list even if the user has no friends
/// </returns>
/// </returns>
List<FriendListItem> GetUserFriendList(UUID friendlistowner);
// This probably shouldn't be here, it belongs to IAuthentication
@ -149,7 +149,7 @@ namespace OpenSim.Framework.Communications
/// <param name="userID"></param>
/// <param name="password"></param>
/// <returns></returns>
bool AuthenticateUserByPassword(UUID userID, string password);
bool AuthenticateUserByPassword(UUID userID, string password);
// Temporary Hack until we move everything to the new service model
void SetInventoryService(IInventoryService invService);

View File

@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Osp
public string Name { get { return "OspInventoryWrapperPlugin"; } }
public string Version { get { return "0.1"; } }
public void Initialise() {}
public void Initialise() {}
public void Initialise(string connect) {}
public void Dispose() {}
@ -80,9 +80,9 @@ namespace OpenSim.Framework.Communications.Osp
}
protected InventoryItemBase PostProcessItem(InventoryItemBase item)
{
{
item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_commsManager);
return item;
return item;
}
public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); }

View File

@ -33,13 +33,13 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
namespace OpenSim.Framework.Communications.Osp
{
{
/// <summary>
/// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for
/// identifying user profiles or supplying a simple name if no profile is available.
/// </summary>
public class OspResolver
{
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const string OSPA_PREFIX = "ospa:";
@ -73,7 +73,7 @@ namespace OpenSim.Framework.Communications.Osp
{
return
OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
}
}
/// <summary>
/// Resolve an osp string into the most suitable internal OpenSim identifier.
@ -89,13 +89,13 @@ namespace OpenSim.Framework.Communications.Osp
/// is returned.
/// </returns>
public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager)
{
{
if (!ospa.StartsWith(OSPA_PREFIX))
return UUID.Zero;
m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
string ospaMeat = ospa.Substring(OSPA_PREFIX.Length);
string ospaMeat = ospa.Substring(OSPA_PREFIX.Length);
string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY);
foreach (string tuple in ospaTuples)
@ -162,7 +162,7 @@ namespace OpenSim.Framework.Communications.Osp
tempUserProfile.ID = HashName(tempUserProfile.Name);
m_log.DebugFormat(
"[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID);
"[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID);
commsManager.UserService.AddTemporaryUserProfile(tempUserProfile);
return tempUserProfile.ID;

View File

@ -1072,7 +1072,7 @@ namespace OpenSim.Framework.Communications.Services
/// <param name="user"></param>
/// <param name="response"></param>
/// <param name="remoteClient"></param>
/// <returns>true if the region was successfully contacted, false otherwise</returns>
/// <returns>true if the region was successfully contacted, false otherwise</returns>
protected abstract bool PrepareLoginToRegion(
RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client);

View File

@ -33,9 +33,9 @@ using OpenMetaverse;
using OpenSim.Data;
namespace OpenSim.Framework.Communications
{
{
/// <summary>
/// Plugin for managing temporary user profiles.
/// Plugin for managing temporary user profiles.
/// </summary>
public class TemporaryUserProfilePlugin : IUserDataPlugin
{
@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications
public string Name { get { return "TemporaryUserProfilePlugin"; } }
public string Version { get { return "0.1"; } }
public void Initialise() {}
public void Initialise() {}
public void Initialise(string connect) {}
public void Dispose() {}

View File

@ -152,8 +152,8 @@ namespace OpenSim.Framework.Communications.Tests
public virtual bool AuthenticateUserByPassword(UUID userID, string password)
{
throw new NotImplementedException();
}
throw new NotImplementedException();
}
}
}
}

View File

@ -133,7 +133,7 @@ namespace OpenSim.Framework.Communications.Tests
timedOut = true;
lock (this)
{
{
UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}
@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Tests
CachedUserInfo userInfo;
lock (this)
{
{
userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}
@ -171,7 +171,7 @@ namespace OpenSim.Framework.Communications.Tests
CachedUserInfo userInfo;
lock (this)
{
{
userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}
@ -206,7 +206,7 @@ namespace OpenSim.Framework.Communications.Tests
CachedUserInfo userInfo;
lock (this)
{
{
userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}
@ -271,7 +271,7 @@ namespace OpenSim.Framework.Communications.Tests
CachedUserInfo userInfo;
lock (this)
{
{
userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}
@ -311,7 +311,7 @@ namespace OpenSim.Framework.Communications.Tests
CachedUserInfo userInfo;
lock (this)
{
{
userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
Monitor.Wait(this, 60000);
}

View File

@ -318,7 +318,7 @@ namespace OpenSim.Framework.Communications.Tests
{
TestHelper.InMethod();
//Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
//Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
//log4net.Config.XmlConfigurator.Configure();
string error_already_logged = "You appear to be already logged in. " +

View File

@ -94,9 +94,9 @@ namespace OpenSim.Framework.Communications
public void AddPlugin(string provider, string connect)
{
m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect));
}
}
#region UserProfile
#region UserProfile
public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
{
@ -650,15 +650,17 @@ namespace OpenSim.Framework.Communications
public virtual UUID AddUser(
string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID)
{
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
UserProfileData user = new UserProfileData();
user.PasswordSalt = Util.Md5Hash(UUID.Random().ToString());
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + user.PasswordSalt);
user.HomeLocation = new Vector3(128, 128, 100);
user.ID = SetUUID;
user.FirstName = firstName;
user.SurName = lastName;
user.PasswordHash = md5PasswdHash;
user.PasswordSalt = String.Empty;
user.Created = Util.UnixTimeSinceEpoch();
user.HomeLookAt = new Vector3(100, 100, 100);
user.HomeRegionX = regX;
@ -922,8 +924,8 @@ namespace OpenSim.Framework.Communications
if (md5PasswordHash == userProfile.PasswordHash)
return true;
else
return false;
}
return false;
}
#endregion
}

View File

@ -88,7 +88,7 @@ namespace OpenSim.Framework.Console
/// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param>
/// <returns></returns>
public List<string> GetHelp(string[] cmd)
{
{
List<string> help = new List<string>();
List<string> helpParts = new List<string>(cmd);
@ -115,7 +115,7 @@ namespace OpenSim.Framework.Console
/// <param name="helpParts"></param>
/// <returns></returns>
private List<string> CollectHelp(List<string> helpParts)
{
{
string originalHelpRequest = string.Join(" ", helpParts.ToArray());
List<string> help = new List<string>();
@ -132,7 +132,7 @@ namespace OpenSim.Framework.Console
if (dict[helpPart] is Dictionary<string, Object>)
dict = (Dictionary<string, object>)dict[helpPart];
helpParts.RemoveAt(0);
helpParts.RemoveAt(0);
}
// There was a command for the given help string
@ -149,7 +149,7 @@ namespace OpenSim.Framework.Console
}
return help;
}
}
private List<string> CollectHelp(Dictionary<string, object> dict)
{
@ -180,7 +180,7 @@ namespace OpenSim.Framework.Console
/// <param name="longhelp"></param>
/// <param name="fn"></param>
public void AddCommand(string module, bool shared, string command,
string help, string longhelp, CommandDelegate fn)
string help, string longhelp, CommandDelegate fn)
{
AddCommand(module, shared, command, help, longhelp,
String.Empty, fn);

View File

@ -90,13 +90,13 @@ namespace OpenSim.Framework
m_configMember.addConfigurationOption("allow_forceful_banlines",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Allow Forceful Banlines", "TRUE", true);
"Allow Forceful Banlines", "TRUE", true);
m_configMember.addConfigurationOption("allow_region_registration",
ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Allow regions to register immediately upon grid server startup? true/false",
"True",
false);
false);
m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Remote console access user name [Default: disabled]", "", false);
@ -147,7 +147,7 @@ namespace OpenSim.Framework
break;
case "allow_region_registration":
AllowRegionRegistration = (bool)configuration_result;
break;
break;
case "console_user":
ConsoleUser = (string)configuration_result;
break;

View File

@ -34,23 +34,23 @@ namespace OpenSim.Framework
/// <summary>
/// Interface to the local asset cache. This is the mechanism through which assets can be added and requested.
/// </summary>
/// </summary>
public interface IAssetCache : IPlugin
{
/// <value>
/// The 'server' from which assets can be requested and to which assets are persisted.
/// </value>
/// </value>
void Initialise(ConfigSettings cs);
void Initialise(ConfigSettings cs);
/// <summary>
/// Report statistical data to the log.
/// </summary>
/// </summary>
void ShowState();
/// <summary>
/// Clear the asset cache.
/// </summary>
/// </summary>
void Clear();
/// <summary>
@ -58,7 +58,7 @@ namespace OpenSim.Framework
/// </summary>
/// <param name="assetId"></param>
/// <param name="asset"></param>
/// <returns>true if the asset was in the cache, false if it was not</returns>
/// <returns>true if the asset was in the cache, false if it was not</returns>
bool TryGetCachedAsset(UUID assetID, out AssetBase asset);
/// <summary>
@ -69,7 +69,7 @@ namespace OpenSim.Framework
/// <param name="isTexture"></param>
/// A callback invoked when the asset has either been found or not found.
/// If the asset was found this is called with the asset UUID and the asset data
/// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param>
/// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param>
void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture);
/// <summary>
@ -84,13 +84,13 @@ namespace OpenSim.Framework
///
/// <param name="assetID"></param>
/// <param name="isTexture"></param>
/// <returns>null if the asset could not be retrieved</returns>
/// <returns>null if the asset could not be retrieved</returns>
AssetBase GetAsset(UUID assetID, bool isTexture);
/// <summary>
/// Add an asset to both the persistent store and the cache.
/// </summary>
/// <param name="asset"></param>
/// <param name="asset"></param>
void AddAsset(AssetBase asset);
/// <summary>
@ -100,14 +100,14 @@ namespace OpenSim.Framework
/// of the asset cache. This is needed because the osdynamic
/// texture code grows the asset cache without bounds. The
/// real solution here is a much better cache archicture, but
/// this is a stop gap measure until we have such a thing.
/// this is a stop gap measure until we have such a thing.
void ExpireAsset(UUID assetID);
/// <summary>
/// Handle an asset request from the client. The result will be sent back asynchronously.
/// </summary>
/// <param name="userInfo"></param>
/// <param name="transferRequest"></param>
/// <param name="transferRequest"></param>
void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest);
}

View File

@ -810,7 +810,7 @@ namespace OpenSim.Framework
/// </summary>
void Start();
void Stop();
void Stop();
// void ActivateGesture(UUID assetId, UUID gestureId);
@ -824,7 +824,7 @@ namespace OpenSim.Framework
/// </summary>
/// <param name="agentID">The id of the agent associated with the appearance</param>
/// <param name="visualParams"></param>
/// <param name="textureEntry"></param>
/// <param name="textureEntry"></param>
void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry);
void SendStartPingCheck(byte seq);
@ -833,7 +833,7 @@ namespace OpenSim.Framework
/// Tell the client that an object has been deleted
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="localID"></param>
/// <param name="localID"></param>
void SendKillObject(ulong regionHandle, uint localID);
void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);

View File

@ -180,16 +180,16 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="MaxElementSize"/>
/// <seealso cref="Size"/>
/// <seealso cref="MaxSize"/>
/// <seealso cref="MaxSize"/>
/// <seealso cref="IsCountLimited"/>
/// <seealso cref="IsTimeLimited"/>
bool IsSizeLimited { get; }
/// <summary>
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
/// </summary>
/// <value>
/// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@ -200,7 +200,7 @@ namespace OpenSim.Framework
/// or <see cref="TryGetValue"/> methods in <see cref="ExpirationTime"/> , then element is automatically removed from
/// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
/// stay longer in cache.
/// </remarks>
/// </remarks>
/// <seealso cref="ExpirationTime"/>
/// <seealso cref="PurgeExpired"/>
/// <seealso cref="IsCountLimited"/>
@ -237,7 +237,7 @@ namespace OpenSim.Framework
/// <seealso cref="Set"/>
/// <seealso cref="IsSizeLimited"/>
/// <seealso cref="Size"/>
/// <seealso cref="MaxSize"/>
/// <seealso cref="MaxSize"/>
long MaxElementSize { get; }
/// <summary>
@ -246,7 +246,7 @@ namespace OpenSim.Framework
/// <value>
/// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// <remarks>
/// <remarks>
/// <para>
/// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
/// </para>
@ -278,10 +278,10 @@ namespace OpenSim.Framework
/// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
/// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
/// </para>
/// </remarks>
/// </remarks>
/// <seealso cref="MaxElementSize"/>
/// <seealso cref="IsSizeLimited"/>
/// <seealso cref="MaxSize"/>
/// <seealso cref="MaxSize"/>
/// <seealso cref="IsCountLimited"/>
/// <seealso cref="ExpirationTime"/>
long Size { get; }
@ -289,9 +289,9 @@ namespace OpenSim.Framework
/// <summary>
/// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </summary>
/// <value>
/// <value>
/// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
/// </value>
/// </value>
/// <remarks>
/// <para>
/// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/>
@ -322,7 +322,7 @@ namespace OpenSim.Framework
/// </para>
/// <para>
/// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
/// may stay longer than <see cref="ExpirationTime"/> in the cache.
/// may stay longer than <see cref="ExpirationTime"/> in the cache.
/// </para>
/// </remarks>
/// <seealso cref="IsTimeLimited"/>
@ -418,7 +418,7 @@ namespace OpenSim.Framework
/// </summary>
/// <returns>
/// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
/// the specified key; otherwise, <see langword="false"/>.
/// the specified key; otherwise, <see langword="false"/>.
/// </returns>
/// <param name="key">
/// The key whose <paramref name="value"/> to get.

View File

@ -46,8 +46,6 @@ namespace OpenSim.Framework
public delegate bool CloseAgentConnection(UUID agentID);
public delegate bool RegionUp(RegionInfo region);
public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData);
public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message);
@ -65,7 +63,6 @@ namespace OpenSim.Framework
event AcknowledgePrimCross OnAcknowledgePrimCrossed;
event UpdateNeighbours OnNeighboursUpdate;
event CloseAgentConnection OnCloseAgentConnection;
event RegionUp OnRegionUp;
event ChildAgentUpdate OnChildAgentUpdate;
event LogOffUser OnLogOffUser;
event GetLandData OnGetLandData;

View File

@ -55,7 +55,7 @@ namespace OpenSim.Framework
GodTakeCopy = 5,
Delete = 6,
Return = 9
};
};
public interface IScene
{
@ -74,7 +74,7 @@ namespace OpenSim.Framework
void CloseAllAgents(uint circuitcode);
void Restart(int seconds);
bool OtherRegionUp(RegionInfo thisRegion);
//RegionInfo OtherRegionUp(RegionInfo thisRegion);
string GetSimulatorVersion();

View File

@ -32,7 +32,7 @@ namespace OpenSim.Framework
{
public interface ISceneObject
{
UUID UUID { get; }
UUID UUID { get; }
ISceneObject CloneForNewScene();
string ToXml2();
string ExtraToXmlString();

View File

@ -89,7 +89,7 @@ namespace OpenSim.Framework
ID = id;
Name = name;
Owner = owner;
ParentID = parent;
ParentID = parent;
}
public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version)

View File

@ -304,7 +304,7 @@ namespace OpenSim.Framework
/// <summary>
/// Find a folder given a PATH_DELIMITER delimited path starting from this folder
/// </summary>
/// </summary>
///
/// This method does not handle paths that contain multiple delimitors
///
@ -314,7 +314,7 @@ namespace OpenSim.Framework
/// FIXME: Delimitors which occur in names themselves are not currently escapable.
///
/// <param name="path">
/// The path to the required folder.
/// The path to the required folder.
/// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
/// </param>
/// <returns>null if the folder is not found</returns>

View File

@ -34,10 +34,10 @@ namespace OpenSim.Framework
/// Inventory Item - contains all the properties associated with an individual inventory piece.
/// </summary>
public class InventoryItemBase : InventoryNodeBase, ICloneable
{
{
/// <value>
/// The inventory type of the item. This is slightly different from the asset type in some situations.
/// </value>
/// </value>
public int InvType
{
get
@ -54,7 +54,7 @@ namespace OpenSim.Framework
/// <value>
/// The folder this item is contained in
/// </value>
/// </value>
public UUID Folder
{
get
@ -71,7 +71,7 @@ namespace OpenSim.Framework
/// <value>
/// The creator of this item
/// </value>
/// </value>
public string CreatorId
{
get
@ -114,7 +114,7 @@ namespace OpenSim.Framework
{
m_creatorIdAsUuid = value;
}
}
}
protected UUID m_creatorIdAsUuid = UUID.Zero;
/// <value>
@ -130,13 +130,13 @@ namespace OpenSim.Framework
set
{
m_description = value;
}
}
}
protected string m_description = String.Empty;
/// <value>
///
/// </value>
/// </value>
public uint NextPermissions
{
get
@ -153,7 +153,7 @@ namespace OpenSim.Framework
/// <value>
/// A mask containing permissions for the current owner (cannot be enforced)
/// </value>
/// </value>
public uint CurrentPermissions
{
get
@ -170,7 +170,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public uint BasePermissions
{
get
@ -187,7 +187,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public uint EveryOnePermissions
{
get
@ -204,7 +204,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public uint GroupPermissions
{
get
@ -221,7 +221,7 @@ namespace OpenSim.Framework
/// <value>
/// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
/// </value>
/// </value>
public int AssetType
{
get
@ -238,7 +238,7 @@ namespace OpenSim.Framework
/// <value>
/// The UUID of the associated asset on the asset server
/// </value>
/// </value>
public UUID AssetID
{
get
@ -255,7 +255,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public UUID GroupID
{
get
@ -272,13 +272,13 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public bool GroupOwned
{
get
{
return m_groupOwned;
}
}
set
{
@ -289,7 +289,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public int SalePrice
{
get
@ -306,7 +306,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public byte SaleType
{
get
@ -323,7 +323,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public uint Flags
{
get
@ -340,7 +340,7 @@ namespace OpenSim.Framework
/// <value>
///
/// </value>
/// </value>
public int CreationDate
{
get

View File

@ -31,12 +31,12 @@ namespace OpenSim.Framework
{
/// <summary>
/// Common base class for inventory nodes of different types (files, folders, etc.)
/// </summary>
/// </summary>
public class InventoryNodeBase
{
{
/// <summary>
/// The name of the node (64 characters or less)
/// </summary>
/// </summary>
public virtual string Name
{
get { return m_name; }
@ -51,17 +51,17 @@ namespace OpenSim.Framework
{
get { return m_id; }
set { m_id = value; }
}
}
private UUID m_id;
/// <summary>
/// The agent who's inventory this is contained by
/// </summary>
/// </summary>
public virtual UUID Owner
{
get { return m_owner; }
set { m_owner = value; }
}
private UUID m_owner;
private UUID m_owner;
}
}

View File

@ -32,7 +32,7 @@ namespace OpenSim.Framework
{
public class NetworkServersInfo
{
public string AssetSendKey = String.Empty;
public string AssetSendKey = String.Empty;
public string AssetURL = "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/";
public string GridRecvKey = String.Empty;
@ -102,8 +102,7 @@ namespace OpenSim.Framework
ConfigSettings.DefaultInventoryServerHttpPort.ToString());
secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
MessagingURL = config.Configs["Network"].GetString("messaging_server_url",
"http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort);
MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty);
}
}
}

View File

@ -47,7 +47,6 @@ namespace OpenSim.Framework
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
private RegionUp handlerRegionUp = null; // OnRegionUp;
private LogOffUser handlerLogOffUser = null;
private GetLandData handlerGetLandData = null;
@ -62,7 +61,6 @@ namespace OpenSim.Framework
public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
public event CloseAgentConnection OnCloseAgentConnection;
public event RegionUp OnRegionUp;
public event ChildAgentUpdate OnChildAgentUpdate;
public event LogOffUser OnLogOffUser;
public event GetLandData OnGetLandData;
@ -108,17 +106,6 @@ namespace OpenSim.Framework
return false;
}
public virtual bool TriggerRegionUp(RegionInfo region)
{
handlerRegionUp = OnRegionUp;
if (handlerRegionUp != null)
{
handlerRegionUp(region);
return true;
}
return false;
}
public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
{
handlerChildAgentUpdate = OnChildAgentUpdate;

View File

@ -1040,7 +1040,7 @@ namespace OpenSim.Framework
public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI)
{
RegionInfo regionInfo;
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort);
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort);
regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName);
regionInfo.RemotingPort = remotingPort;
regionInfo.RemotingAddress = externalHostName;

View File

@ -0,0 +1,191 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Framework.Serialization.External
{
/// <summary>
/// Serialize and deserialize LandData as an external format.
/// </summary>
public class LandDataSerializer
{
protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
/// <summary>
/// Reify/deserialize landData
/// </summary>
/// <param name="serializedLandData"></param>
/// <returns></returns>
/// <exception cref="System.Xml.XmlException"></exception>
public static LandData Deserialize(byte[] serializedLandData)
{
return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length));
}
/// <summary>
/// Reify/deserialize landData
/// </summary>
/// <param name="serializedLandData"></param>
/// <returns></returns>
/// <exception cref="System.Xml.XmlException"></exception>
public static LandData Deserialize(string serializedLandData)
{
LandData landData = new LandData();
StringReader sr = new StringReader(serializedLandData);
XmlTextReader xtr = new XmlTextReader(sr);
xtr.ReadStartElement("LandData");
landData.Area = Convert.ToInt32( xtr.ReadElementString("Area"));
landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID"));
landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID"));
landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category"));
landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate"));
landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice"));
landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID"));
landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID"));
landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned"));
landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap"));
landData.Description = xtr.ReadElementString("Description");
landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags"));
landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType"));
landData.Name = xtr.ReadElementString("Name");
landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status"));
landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID"));
landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale"));
landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID"));
landData.MediaURL = xtr.ReadElementString("MediaURL");
landData.MusicURL = xtr.ReadElementString("MusicURL");
landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID"));
landData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
xtr.Read();
if (xtr.Name != "ParcelAccessList")
throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name));
if (!xtr.IsEmptyElement)
{
while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
{
ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry();
xtr.ReadStartElement("ParcelAccessEntry");
pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID"));
pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time"));
pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
xtr.ReadEndElement();
landData.ParcelAccessList.Add(pae);
}
}
xtr.Read();
landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours"));
landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice"));
landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice"));
landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID"));
landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation"));
landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt"));
landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell"));
landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime"));
xtr.ReadEndElement();
xtr.Close();
sr.Close();
return landData;
}
public static string Serialize(LandData landData)
{
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
xtw.Formatting = Formatting.Indented;
xtw.WriteStartDocument();
xtw.WriteStartElement("LandData");
xtw.WriteElementString("Area", Convert.ToString(landData.Area));
xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID));
xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString());
xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category));
xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate));
xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice));
xtw.WriteElementString("GlobalID", landData.GlobalID.ToString());
xtw.WriteElementString("GroupID", landData.GroupID.ToString());
xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned));
xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap));
xtw.WriteElementString("Description", landData.Description);
xtw.WriteElementString("Flags", Convert.ToString((uint)landData.Flags));
xtw.WriteElementString("LandingType", Convert.ToString((byte)landData.LandingType));
xtw.WriteElementString("Name", landData.Name);
xtw.WriteElementString("Status", Convert.ToString((sbyte)landData.Status));
xtw.WriteElementString("LocalID", landData.LocalID.ToString());
xtw.WriteElementString("MediaAutoScale", Convert.ToString(landData.MediaAutoScale));
xtw.WriteElementString("MediaID", landData.MediaID.ToString());
xtw.WriteElementString("MediaURL", landData.MediaURL);
xtw.WriteElementString("MusicURL", landData.MusicURL);
xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
xtw.WriteStartElement("ParcelAccessList");
foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList)
{
xtw.WriteStartElement("ParcelAccessEntry");
xtw.WriteElementString("AgentID", pal.AgentID.ToString());
xtw.WriteElementString("Time", pal.Time.ToString("s"));
xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags));
xtw.WriteEndElement();
}
xtw.WriteEndElement();
xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours));
xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice));
xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice));
xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString());
xtw.WriteElementString("UserLocation", landData.UserLocation.ToString());
xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString());
xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell));
xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime));
xtw.WriteEndElement();
xtw.Close();
sw.Close();
return sw.ToString();
}
}
}

View File

@ -158,7 +158,7 @@ namespace OpenSim.Framework.Serialization.External
settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString());
break;
}
}
}
xtr.ReadEndElement();
xtr.ReadStartElement("Terrain");
@ -200,8 +200,8 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteStartElement("RegionSettings");
xtw.WriteStartElement("General");
xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString());
xtw.WriteStartElement("General");
xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString());
xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString());
xtw.WriteElementString("AllowLandJoinDivide", settings.AllowLandJoinDivide.ToString());
xtw.WriteElementString("BlockFly", settings.BlockFly.ToString());

View File

@ -36,7 +36,7 @@ namespace OpenSim.Framework.Serialization.External
/// Serialize and deserialize region settings as an external format.
/// </summary>
public class UserProfileSerializer
{
{
public const int MAJOR_VERSION = 0;
public const int MINOR_VERSION = 1;
@ -65,6 +65,6 @@ namespace OpenSim.Framework.Serialization.External
sw.Close();
return sw.ToString();
}
}
}
}

View File

@ -0,0 +1,131 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using NUnit.Framework;
namespace OpenSim.Framework.Serialization.Tests
{
[TestFixture]
public class LandDataSerializerTest
{
private LandData land;
private LandData landWithParcelAccessList;
private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>2009-10-01T00:00:00</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>2010-10-20T00:00:00</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
[SetUp]
public void setup()
{
// setup LandData object
this.land = new LandData();
this.land.AABBMax = new Vector3(0, 0, 0);
this.land.AABBMin = new Vector3(128, 128, 128);
this.land.Area = 128;
this.land.AuctionID = 0;
this.land.AuthBuyerID = new UUID();
this.land.Category = ParcelCategory.Residential;
this.land.ClaimDate = 0;
this.land.ClaimPrice = 0;
this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
this.land.GroupPrims = 0;
this.land.Description = "land data to test LandDataSerializer";
this.land.Flags = (uint)(ParcelFlags.AllowDamage | ParcelFlags.AllowVoiceChat);
this.land.LandingType = (byte)LandingType.Direct;
this.land.Name = "LandDataSerializerTest Land";
this.land.Status = ParcelStatus.Leased;
this.land.LocalID = 0;
this.land.MediaAutoScale = (byte)0x01;
this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
this.land.OwnerID = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf");
this.landWithParcelAccessList = this.land.Copy();
this.landWithParcelAccessList.ParcelAccessList.Clear();
ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry();
pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
pae0.Flags = AccessList.Ban;
pae0.Time = new DateTime(2009, 10, 01);
this.landWithParcelAccessList.ParcelAccessList.Add(pae0);
ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry();
pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
pae1.Flags = AccessList.Access;
pae1.Time = new DateTime(2010, 10, 20);
this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
}
/// <summary>
/// Test the LandDataSerializer.Serialize() method
/// </summary>
[Test]
public void LandDataSerializerSerializeTest()
{
string serialized = LandDataSerializer.Serialize(this.land);
Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
Assert.That(serialized == LandDataSerializerTest.preSerialized,
"result of Serialize(LandData) does not match expected result");
string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList);
Assert.That(serializedWithParcelAccessList.Length > 0,
"Serialize(LandData) returned empty string for LandData object with ParcelAccessList");
Assert.That(serializedWithParcelAccessList == LandDataSerializerTest.preSerializedWithParcelAccessList,
"result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list");
}
/// <summary>
/// Test the LandDataSerializer.Deserialize() method
/// </summary>
[Test]
public void TestLandDataSerializerDeserializeFromStringTest()
{
LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
Assert.That(reifiedLandData != null, "Deserialize(string) returned null");
Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList);
Assert.That(reifiedLandDataWithParcelAccessList != null,
"Deserialize(string) returned null (pre-serialized with parcel access list)");
Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID,
"Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)");
Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name,
"Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)");
}
}
}

View File

@ -158,7 +158,7 @@ namespace OpenSim.Framework.Servers
m_consoleAppender.Threshold = Level.All;
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
}
}
m_console.Commands.AddCommand("base", false, "quit",
"quit",
@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
/// </summary>
/// </summary>
public virtual void ShutdownSpecific() {}
/// <summary>
@ -286,7 +286,7 @@ namespace OpenSim.Framework.Servers
/// </summary>
public virtual void Startup()
{
m_log.Info("[STARTUP]: Beginning startup processing");
m_log.Info("[STARTUP]: Beginning startup processing");
EnhanceVersionInformation();
@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
/// </summary>
/// </summary>
public virtual void Shutdown()
{
ShutdownSpecific();
@ -367,7 +367,7 @@ namespace OpenSim.Framework.Servers
}
public virtual void HandleShow(string module, string[] cmd)
{
{
List<string> args = new List<string>(cmd);
args.RemoveAt(0);
@ -375,7 +375,7 @@ namespace OpenSim.Framework.Servers
string[] showParams = args.ToArray();
switch (showParams[0])
{
{
case "info":
Notice("Version: " + m_version);
Notice("Startup directory: " + m_startupDirectory);

View File

@ -168,7 +168,7 @@ namespace OpenSim.Framework.Servers.HttpServer
"[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
}
}, null);
}, null);
}
}
}

View File

@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public BaseHttpServer(uint port, bool ssl) : this (port)
{
m_ssl = ssl;
m_ssl = ssl;
}
public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl)
@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer
lock (m_rpcHandlers)
{
m_rpcHandlers[method] = handler;
m_rpcHandlersKeepAlive[method] = keepAlive; // default
m_rpcHandlersKeepAlive[method] = keepAlive; // default
}
return true;
@ -323,7 +323,7 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpRequest request = objstate.oreq;
OSHttpResponse resp = objstate.oresp;
HandleRequest(request,resp);
HandleRequest(request,resp);
}
public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
@ -712,7 +712,7 @@ namespace OpenSim.Framework.Servers.HttpServer
lock (m_rpcHandlers)
{
methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method);
}
}
if (methodWasFound)
{
@ -931,7 +931,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (IOException e)
{
m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e);
m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e);
}
catch (SocketException e)
{
@ -1368,7 +1368,7 @@ namespace OpenSim.Framework.Servers.HttpServer
bestMatch = pattern;
}
}
}
}
if (String.IsNullOrEmpty(bestMatch))
{
@ -1480,7 +1480,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
}
}
}
}
public void SendHTML404(OSHttpResponse response, string host)
@ -1589,7 +1589,7 @@ namespace OpenSim.Framework.Servers.HttpServer
// if you want more detailed trace information from the HttpServer
//m_httpListener2.UseTraceLogs = true;
//m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor;
//m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor;
}
else
{
@ -1624,7 +1624,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
public void httpServerDisconnectMonitor(IHttpClientContext source, SocketError err)
{
{
switch (err)
{
case SocketError.NotSocket:
@ -1635,7 +1635,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
public void httpServerException(object source, Exception exception)
{
{
m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
/*
if (HTTPDRunning)// && NotSocketErrors > 5)
@ -1662,7 +1662,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (NullReferenceException)
{
m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer.");
m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer.");
}
}

View File

@ -128,6 +128,6 @@ namespace OpenSim.Framework.Servers.HttpServer
string GetHTTP404(string host);
string GetHTTP500();
string GetHTTP500();
}
}

View File

@ -59,11 +59,11 @@ namespace OpenSim.Framework.Servers.HttpServer
int length = 0;
using (StreamWriter writer = new StreamWriter(buffer))
{
writer.WriteLine(obj);
writer.Write(obj);
writer.Flush();
length = (int)buffer.Length;
}
length = (int)obj.Length;
request.ContentLength = length;
Stream requestStream = request.GetRequestStream();

View File

@ -56,7 +56,7 @@ namespace OpenSim
public const int VERSIONINFO_VERSION_LENGTH = 27;
/// <value>
/// This is the external interface version. It is separate from the OpenSimulator project version.
/// This is the external interface version. It is separate from the OpenSimulator project version.
///
/// This version number should be
/// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible
@ -67,7 +67,7 @@ namespace OpenSim
///
/// Having this version number allows the grid service to reject connections from regions running a version
/// of the code that is too old.
///
///
/// </value>
public readonly static int MajorInterfaceVersion = 6;
}

View File

@ -35,9 +35,9 @@ namespace OpenSim.Framework
///
/// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats
/// storage.
/// </summary>
/// </summary>
public class SimStats
{
{
public uint RegionX
{
get { return m_regionX; }
@ -47,25 +47,25 @@ namespace OpenSim.Framework
public uint RegionY
{
get { return m_regionY; }
}
}
private uint m_regionY;
public SimStatsPacket.RegionBlock RegionBlock
{
get { return m_regionBlock; }
}
}
private SimStatsPacket.RegionBlock m_regionBlock;
public SimStatsPacket.StatBlock[] StatsBlock
{
get { return m_statsBlock; }
}
}
private SimStatsPacket.StatBlock[] m_statsBlock;
public uint RegionFlags
{
get { return m_regionFlags; }
}
}
private uint m_regionFlags;
public uint ObjectCapacity
@ -76,7 +76,7 @@ namespace OpenSim.Framework
public UUID RegionUUID
{
get { return regionUUID;}
get { return regionUUID; }
}
private UUID regionUUID;

View File

@ -38,7 +38,7 @@ namespace OpenSim.Framework
/// A dictionary for task inventory.
/// </summary>
/// This class is not thread safe. Callers must synchronize on Dictionary methods or Clone() this object before
/// iterating over it.
/// iterating over it.
public class TaskInventoryDictionary : Dictionary<UUID, TaskInventoryItem>,
ICloneable, IXmlSerializable
{

View File

@ -57,7 +57,7 @@ namespace OpenSim.Framework
}
private static void ThreadTrackerThreadLoop()
{
{
try
{
while (true)
@ -70,8 +70,8 @@ namespace OpenSim.Framework
{
m_log.ErrorFormat(
"[THREAD TRACKER]: Thread tracker cleanup thread terminating with exception. Please report this error. Exception is {0}",
e);
}
e);
}
}
public static void Add(Thread thread)

View File

@ -133,7 +133,7 @@ namespace OpenSim.Framework
m_configMember.addConfigurationOption("library_location",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Path to library control file",
string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false);
string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false);
m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"DLL for database provider", "OpenSim.Data.MySQL.dll", false);

View File

@ -217,7 +217,7 @@ namespace OpenSim.Framework
public string Name
{
get { return String.Format("{0} {1}", m_firstname, m_surname); }
}
}
public string Email
{

View File

@ -54,7 +54,7 @@ namespace OpenSim.Framework
/// </summary>
public class Util
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static uint nextXferID = 5000;
private static Random randomClass = new Random();
@ -136,7 +136,7 @@ namespace OpenSim.Framework
float dx = a.X - b.X;
float dy = a.Y - b.Y;
float dz = a.Z - b.Z;
return (dx*dx + dy*dy + dz*dz) < (amount*amount);
return (dx*dx + dy*dy + dz*dz) < (amount*amount);
}
/// <summary>
@ -975,7 +975,7 @@ namespace OpenSim.Framework
else
{
os = ReadEtcIssue();
}
}
if (os.Length > 45)
{
@ -1203,6 +1203,32 @@ namespace OpenSim.Framework
return found.ToArray();
}
public static string ServerURI(string uri)
{
if (uri == string.Empty)
return string.Empty;
// Get rid of eventual slashes at the end
uri = uri.TrimEnd('/');
IPAddress ipaddr1 = null;
string port1 = "";
try
{
ipaddr1 = Util.GetHostFromURL(uri);
}
catch { }
try
{
port1 = uri.Split(new char[] { ':' })[2];
}
catch { }
// We tried our best to convert the domain names to IP addresses
return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri;
}
#region FireAndForget Threading Pattern
public static void FireAndForget(System.Threading.WaitCallback callback)

View File

@ -70,6 +70,6 @@ namespace OpenSim.Grid.MessagingServer.Modules
{
//throw new Exception("The method or operation is not implemented.");
return null;
}
}
}
}

View File

@ -47,7 +47,7 @@ namespace OpenSim.Grid.UserServer.Modules
/// <summary>
/// Hypergrid login service used in grid mode.
/// </summary>
/// </summary>
public class UserLoginAuthService : HGLoginAuthService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -34,6 +34,7 @@ using System.Text.RegularExpressions;
using log4net;
using Nwc.XmlRpc;
using OpenMetaverse;
using Nini.Config;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
@ -42,6 +43,9 @@ using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Grid.UserServer.Modules
{
@ -51,7 +55,7 @@ namespace OpenSim.Grid.UserServer.Modules
/// <summary>
/// Login service used in grid mode.
/// </summary>
/// </summary>
public class UserLoginService : LoginService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -63,6 +67,8 @@ namespace OpenSim.Grid.UserServer.Modules
public UserConfig m_config;
private readonly IRegionProfileRouter m_regionProfileService;
private IGridService m_GridService;
protected BaseHttpServer m_httpServer;
public UserLoginService(
@ -76,6 +82,8 @@ namespace OpenSim.Grid.UserServer.Modules
m_defaultHomeY = m_config.DefaultY;
m_interInventoryService = inventoryService;
m_regionProfileService = regionProfileService;
m_GridService = new GridServicesConnector(config.GridServerURL.ToString());
}
public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers)
@ -203,47 +211,38 @@ namespace OpenSim.Grid.UserServer.Modules
protected override RegionInfo RequestClosestRegion(string region)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(region,
m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
}
else
{
return null;
}
return GridRegionToRegionInfo(m_GridService.GetRegionByName(UUID.Zero, region));
}
protected override RegionInfo GetRegionInfo(ulong homeRegionHandle)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionHandle,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
}
else
{
return null;
}
uint x = 0, y = 0;
Utils.LongToUInts(homeRegionHandle, out x, out y);
return GridRegionToRegionInfo(m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y));
}
protected override RegionInfo GetRegionInfo(UUID homeRegionId)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionId,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
}
else
{
return GridRegionToRegionInfo(m_GridService.GetRegionByUUID(UUID.Zero, homeRegionId));
}
private RegionInfo GridRegionToRegionInfo(GridRegion gregion)
{
if (gregion == null)
return null;
}
RegionInfo rinfo = new RegionInfo();
rinfo.ExternalHostName = gregion.ExternalHostName;
rinfo.HttpPort = gregion.HttpPort;
rinfo.InternalEndPoint = gregion.InternalEndPoint;
rinfo.RegionID = gregion.RegionID;
rinfo.RegionLocX = (uint)(gregion.RegionLocX / Constants.RegionSize);
rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize);
rinfo.RegionName = gregion.RegionName;
rinfo.ScopeID = gregion.ScopeID;
rinfo.ServerURI = gregion.ServerURI;
return rinfo;
}
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
@ -280,9 +279,8 @@ namespace OpenSim.Grid.UserServer.Modules
//response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath);
// Take off trailing / so that the caps path isn't //CAPS/someUUID
if (regionInfo.httpServerURI.EndsWith("/"))
regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1);
response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath);
string uri = regionInfo.httpServerURI.Trim(new char[] { '/' });
response.SeedCapability = uri + CapsUtil.GetCapsSeedPath(capsPath);
// Notify the target of an incoming user

View File

@ -229,7 +229,7 @@ namespace OpenSim.Grid.UserServer.Modules
UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid);
if (null == userProfile)
return Util.CreateUnknownUserErrorResponse();
return Util.CreateUnknownUserErrorResponse();
string authed;
@ -249,12 +249,12 @@ namespace OpenSim.Grid.UserServer.Modules
// "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}",
// remoteClient, userUuid, authed);
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
responseData["auth_user"] = authed;
response.Value = responseData;
return response;
return response;
}
public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient)

View File

@ -187,13 +187,13 @@ namespace OpenSim.Grid.UserServer
/// <param name="inventoryService"></param>
protected virtual void StartupUserServerModules()
{
m_log.Info("[STARTUP]: Establishing data connection");
m_log.Info("[STARTUP]: Establishing data connection");
//we only need core components so we can request them from here
IInterServiceInventoryServices inventoryService;
TryGet<IInterServiceInventoryServices>(out inventoryService);
CommunicationsManager commsManager = new UserServerCommsManager(inventoryService);
CommunicationsManager commsManager = new UserServerCommsManager(inventoryService);
//setup database access service, for now this has to be created before the other modules.
m_userDataBaseService = new UserDataBaseService(commsManager);

View File

@ -28,9 +28,9 @@
using OpenSim.Framework.Communications;
namespace OpenSim.Grid.UserServer
{
{
public class UserServerCommsManager : CommunicationsManager
{
{
public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService)
: base(null, null)
{

View File

@ -91,7 +91,7 @@ namespace OpenSim
m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
}
// Check if the system is compatible with OpenSimulator.
// Check if the system is compatible with OpenSimulator.
// Ensures that the minimum system requirements are met
m_log.Info("Performing compatibility checks... ");
string supported = String.Empty;

View File

@ -43,16 +43,11 @@ namespace OpenSim
public class HGCommands
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static IHyperlink HGServices = null;
private static uint m_autoMappingX = 0;
private static uint m_autoMappingY = 0;
private static bool m_enableAutoMapping = false;
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
{
HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices);
HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager);
return
new HGScene(
@ -61,213 +56,5 @@ namespace OpenSim
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
}
public static void RunHGCommand(string command, string[] cmdparams, Scene scene)
{
if (command.Equals("link-mapping"))
{
if (cmdparams.Length == 2)
{
try
{
m_autoMappingX = Convert.ToUInt32(cmdparams[0]);
m_autoMappingY = Convert.ToUInt32(cmdparams[1]);
m_enableAutoMapping = true;
}
catch (Exception)
{
m_autoMappingX = 0;
m_autoMappingY = 0;
m_enableAutoMapping = false;
}
}
}
else if (command.Equals("link-region"))
{
if (cmdparams.Length < 3)
{
if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
{
LoadXmlLinkFile(cmdparams, scene);
}
else
{
LinkRegionCmdUsage();
}
return;
}
if (cmdparams[2].Contains(":"))
{
// New format
uint xloc, yloc;
string mapName;
try
{
xloc = Convert.ToUInt32(cmdparams[0]);
yloc = Convert.ToUInt32(cmdparams[1]);
mapName = cmdparams[2];
if (cmdparams.Length > 3)
for (int i = 3; i < cmdparams.Length; i++)
mapName += " " + cmdparams[i];
m_log.Info(">> MapName: " + mapName);
//internalPort = Convert.ToUInt32(cmdparams[4]);
//remotingPort = Convert.ToUInt32(cmdparams[5]);
}
catch (Exception e)
{
m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
LinkRegionCmdUsage();
return;
}
HGHyperlink.TryLinkRegionToCoords(scene, null, mapName, xloc, yloc);
}
else
{
// old format
RegionInfo regInfo;
uint xloc, yloc;
uint externalPort;
string externalHostName;
try
{
xloc = Convert.ToUInt32(cmdparams[0]);
yloc = Convert.ToUInt32(cmdparams[1]);
externalPort = Convert.ToUInt32(cmdparams[3]);
externalHostName = cmdparams[2];
//internalPort = Convert.ToUInt32(cmdparams[4]);
//remotingPort = Convert.ToUInt32(cmdparams[5]);
}
catch (Exception e)
{
m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
LinkRegionCmdUsage();
return;
}
//if (TryCreateLink(xloc, yloc, externalPort, externalHostName, out regInfo))
if (HGHyperlink.TryCreateLink(scene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo))
{
if (cmdparams.Length >= 5)
{
regInfo.RegionName = "";
for (int i = 4; i < cmdparams.Length; i++)
regInfo.RegionName += cmdparams[i] + " ";
}
}
}
return;
}
else if (command.Equals("unlink-region"))
{
if (cmdparams.Length < 1)
{
UnlinkRegionCmdUsage();
return;
}
if (HGHyperlink.TryUnlinkRegion(scene, cmdparams[0]))
m_log.InfoFormat("[HGrid]: Successfully unlinked {0}", cmdparams[0]);
else
m_log.InfoFormat("[HGrid]: Unable to unlink {0}, region not found", cmdparams[0]);
}
}
private static void LoadXmlLinkFile(string[] cmdparams, Scene scene)
{
//use http://www.hgurl.com/hypergrid.xml for test
try
{
XmlReader r = XmlReader.Create(cmdparams[0]);
XmlConfigSource cs = new XmlConfigSource(r);
string[] excludeSections = null;
if (cmdparams.Length == 2)
{
if (cmdparams[1].ToLower().StartsWith("excludelist:"))
{
string excludeString = cmdparams[1].ToLower();
excludeString = excludeString.Remove(0, 12);
char[] splitter = {';'};
excludeSections = excludeString.Split(splitter);
}
}
for (int i = 0; i < cs.Configs.Count; i++)
{
bool skip = false;
if ((excludeSections != null) && (excludeSections.Length > 0))
{
for (int n = 0; n < excludeSections.Length; n++)
{
if (excludeSections[n] == cs.Configs[i].Name.ToLower())
{
skip = true;
break;
}
}
}
if (!skip)
{
ReadLinkFromConfig(cs.Configs[i], scene);
}
}
}
catch (Exception e)
{
m_log.Error(e.ToString());
}
}
private static void ReadLinkFromConfig(IConfig config, Scene scene)
{
RegionInfo regInfo;
uint xloc, yloc;
uint externalPort;
string externalHostName;
uint realXLoc, realYLoc;
xloc = Convert.ToUInt32(config.GetString("xloc", "0"));
yloc = Convert.ToUInt32(config.GetString("yloc", "0"));
externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
externalHostName = config.GetString("externalHostName", "");
realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
realYLoc = Convert.ToUInt32(config.GetString("real-yloc", "0"));
if (m_enableAutoMapping)
{
xloc = (uint) ((xloc%100) + m_autoMappingX);
yloc = (uint) ((yloc%100) + m_autoMappingY);
}
if (((realXLoc == 0) && (realYLoc == 0)) ||
(((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
{
if (
HGHyperlink.TryCreateLink(scene, null, xloc, yloc, "", externalPort,
externalHostName, out regInfo))
{
regInfo.RegionName = config.GetString("localName", "");
}
}
}
private static void LinkRegionCmdUsage()
{
m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>]");
m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName> <HttpPort> [<LocalName>]");
m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]");
}
private static void UnlinkRegionCmdUsage()
{
m_log.Info("Usage: unlink-region <HostName>:<HttpPort>");
m_log.Info("Usage: unlink-region <LocalName>");
}
}
}

View File

@ -497,7 +497,7 @@ namespace OpenSim
{
if (cmd.Length < 4)
{
m_log.Error("Usage: create region <region name> <region_file.xml>");
m_log.Error("Usage: create region <region name> <region_file.ini>");
return;
}
if (cmd[3].EndsWith(".xml"))
@ -524,7 +524,7 @@ namespace OpenSim
}
else
{
m_log.Error("Usage: create region <region name> <region_file.xml>");
m_log.Error("Usage: create region <region name> <region_file.ini>");
return;
}
}
@ -755,11 +755,6 @@ namespace OpenSim
}
break;
case "link-region":
case "unlink-region":
case "link-mapping":
HGCommands.RunHGCommand(command, cmdparams, m_sceneManager.CurrentOrFirstScene);
break;
}
}
@ -1250,20 +1245,20 @@ namespace OpenSim
protected void LoadOar(string module, string[] cmdparams)
{
try
{
{
if (cmdparams.Length > 2)
{
m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]);
m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]);
}
else
{
m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME);
m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME);
}
}
catch (Exception e)
{
m_log.Error(e.Message);
}
}
}
/// <summary>

View File

@ -98,7 +98,7 @@ namespace OpenSim
/// <value>
/// The config information passed into the OpenSimulator region server.
/// </value>
/// </value>
public OpenSimConfigSource ConfigSource
{
get { return m_config; }
@ -383,14 +383,14 @@ namespace OpenSim
scene.SetModuleInterfaces();
// Prims have to be loaded after module configuration since some modules may be invoked during the load
// Prims have to be loaded after module configuration since some modules may be invoked during the load
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
// moved these here as the terrain texture has to be created after the modules are initialized
// and has to happen before the region is registered with the grid.
scene.CreateTerrainTexture(false);
// TODO : Try setting resource for region xstats here on scene
// TODO : Try setting resource for region xstats here on scene
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
try
@ -399,7 +399,7 @@ namespace OpenSim
}
catch (Exception e)
{
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e);
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
// Carrying on now causes a lot of confusion down the
// line - we need to get the user's attention
@ -507,7 +507,7 @@ namespace OpenSim
/// Remove a region from the simulator without deleting it permanently.
/// </summary>
/// <param name="scene"></param>
/// <returns></returns>
/// <returns></returns>
public void CloseRegion(Scene scene)
{
// only need to check this if we are not at the
@ -526,7 +526,7 @@ namespace OpenSim
/// Remove a region from the simulator without deleting it permanently.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <returns></returns>
public void CloseRegion(string name)
{
Scene target;
@ -539,7 +539,7 @@ namespace OpenSim
/// </summary>
/// <param name="regionInfo"></param>
/// <param name="clientServer"> </param>
/// <returns></returns>
/// <returns></returns>
protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer)
{
return SetupScene(regionInfo, 0, null, out clientServer);
@ -750,7 +750,7 @@ namespace OpenSim
}
public string Path
{
{
// This is for the OpenSimulator instance and is the osSecret hashed
get { return "/" + osXStatsURI + "/"; }
}
@ -791,7 +791,7 @@ namespace OpenSim
}
public string Path
{
{
// This is for the OpenSimulator instance and is the user provided URI
get { return "/" + osUXStatsURI + "/"; }
}

View File

@ -87,9 +87,9 @@ namespace OpenSim.Region.ClientStack
public IClientNetworkServer CreateServer(
IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port,
AgentCircuitManager authenticateClass)
{
{
return CreateServer(
_listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass);
_listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass);
}
/// <summary>
@ -104,11 +104,11 @@ namespace OpenSim.Region.ClientStack
/// </param>
/// <param name="assetCache"></param>
/// <param name="authenticateClass"></param>
/// <returns></returns>
/// <returns></returns>
public IClientNetworkServer CreateServer(
IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource,
AgentCircuitManager authenticateClass)
{
{
if (plugin != null)
{
IClientNetworkServer server =

View File

@ -32,7 +32,7 @@ namespace OpenSim.Region.ClientStack
///
/// At the moment this is very incomplete - other tweakable settings could be added. This is also somewhat LL client
/// oriented right now.
/// </summary>
/// </summary>
public class ClientStackUserSettings
{
/// <summary>

View File

@ -31,7 +31,7 @@ using OpenMetaverse.Packets;
using OpenSim.Framework;
namespace OpenSim.Region.ClientStack.LindenUDP
{
{
public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes);
public delegate void PacketDrop(Packet pack, Object id);
public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, UUID agentID, ThrottleOutPacketType throttlePacketType);
@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// Take action depending on the type and contents of an received packet.
/// </summary>
/// <param name="item"></param>
/// <param name="item"></param>
void ProcessInPacket(LLQueItem item);
void ProcessOutPacket(LLQueItem item);

View File

@ -127,7 +127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
m_asset = asset;
m_asset = asset;
}
RunUpdate();
}
@ -198,7 +198,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
try
{
Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, (int)cFirstPacketSize);
client.SendImageFirstPart(TexturePacketCount(), m_requestedUUID, (uint)m_asset.Data.Length, firstImageData, 2);
client.SendImageFirstPart(TexturePacketCount(), m_requestedUUID, (uint)m_asset.Data.Length, firstImageData, 2);
}
catch (Exception)
{

View File

@ -2332,7 +2332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return itemBlock;
}
public void SendBulkUpdateInventory(InventoryNodeBase node)
public void SendBulkUpdateInventory(InventoryNodeBase node)
{
if (node is InventoryItemBase)
SendBulkUpdateInventoryItem((InventoryItemBase)node);
@ -2937,7 +2937,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else if (m_avatarTerseUpdates.Count == 1)
{
lock (m_avatarTerseUpdateTimer)
m_avatarTerseUpdateTimer.Start();
m_avatarTerseUpdateTimer.Start();
}
}
}

View File

@ -143,7 +143,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TextureThrottle = new LLPacketThrottle(1000, throttleMaxBPS / 2, 4000, userSettings.ClientThrottleMultipler);
// Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second.
// Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second.
ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings;
@ -410,7 +410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack);
SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Length);
ResendThrottle.AddBytes(qpack.Length);
@ -470,7 +470,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack);
SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Length);
TextureThrottle.AddBytes(qpack.Length);
qchanged = true;

View File

@ -48,11 +48,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// Tweakable user settings
/// </summary>
private ClientStackUserSettings m_userSettings;
private ClientStackUserSettings m_userSettings;
public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings)
{
m_userSettings = userSettings;
m_userSettings = userSettings;
m_networkHandler = networkHandler;
m_networkHandler.RegisterPacketServer(this);
@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode);
if (!sessionInfo.Authorised)
return false;
return false;
return true;
}
@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="proxyEP"></param>
/// <returns>
/// true if a new circuit was created, false if a circuit with the given circuit code already existed
/// </returns>
/// </returns>
public virtual bool AddNewClient(
EndPoint epSender, UseCircuitCodePacket useCircuit,
AuthenticateResponse sessionInfo, EndPoint proxyEP)

View File

@ -26,7 +26,7 @@
*/
namespace OpenSim.Region.ClientStack.LindenUDP
{
{
public class LLPacketThrottle
{
private readonly int m_maxAllowableThrottle;
@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public int Min
{
get { return m_minAllowableThrottle; }
}
}
public int Current
{
@ -105,13 +105,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public int Throttle
{
get { return m_currentThrottle; }
get { return m_currentThrottle; }
set
{
if (value < m_minAllowableThrottle)
{
m_currentThrottle = m_minAllowableThrottle;
}
}
else if (value > m_maxAllowableThrottle)
{
m_currentThrottle = m_maxAllowableThrottle;

View File

@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier");
if (config.Contains("client_socket_rcvbuf_size"))
m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size");
}
}
m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler);
m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ?
@ -228,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_log.Debug("[CLIENT]: " + e);
}
}
}
if (proxyPortOffset != 0)
@ -254,7 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (packet != null)
{
if (packet.Type == PacketType.UseCircuitCode)
AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy);
AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy);
else
ProcessInPacket(packet, epSender);
}
@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
catch (Exception e)
{
m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e);
}
}
}
/// <summary>
@ -299,7 +299,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected virtual void BeginReceive()
{
m_socket.BeginReceiveFrom(
RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null);
RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null);
}
/// <summary>
@ -322,7 +322,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// ENDLESS LOOP ON PURPOSE!
// Reset connection and get next UDP packet off the buffer
// If the UDP packet is part of the same stream, this will happen several hundreds of times before
// the next set of UDP data is for a valid client.
// the next set of UDP data is for a valid client.
try
{
@ -347,7 +347,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_log.ErrorFormat("[CLIENT]: Exception thrown during BeginReceive(): {0}", ex);
}
}
}
}
/// <summary>
/// Close a client circuit. This is done in response to an exception on receive, and should not be called
@ -363,12 +363,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_packetServer.CloseCircuit(circuit);
if (e != null)
if (e != null)
m_log.ErrorFormat(
"[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e);
"[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e);
}
}
}
}
/// <summary>
/// Finish the process of asynchronously receiving the next bit of raw data
@ -410,7 +410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName);
// Uhh, what object, and why? this needs better handling.
}
}
return hasReceivedOkay;
}
@ -422,10 +422,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="epSender"></param>
/// <param name="epProxy"></param>
protected virtual void AddNewClient(UseCircuitCodePacket useCircuit, EndPoint epSender, EndPoint epProxy)
{
{
//Slave regions don't accept new clients
if (m_localScene.RegionStatus != RegionStatus.SlaveScene)
{
{
AuthenticateResponse sessionInfo;
bool isNewCircuit = false;
@ -441,8 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
lock (clientCircuits)
{
if (!clientCircuits.ContainsKey(epSender))
{
clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
{
clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
isNewCircuit = true;
}
}
@ -461,9 +461,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//m_log.DebugFormat(
// "[CONNECTION SUCCESS]: Incoming client {0} (circuit code {1}) received and authenticated for {2}",
// useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName);
}
}
// useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName);
}
}
// Ack the UseCircuitCode packet
PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
@ -605,7 +605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
return;
}
}
lock (clientCircuits)
{

View File

@ -28,7 +28,7 @@
using OpenMetaverse;
namespace OpenSim.Region.ClientStack.LindenUDP
{
{
public class LLUtil
{
/// <summary>

View File

@ -54,7 +54,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
catch
{
// I don't care, just leave log4net off
}
}
}
/// <summary>
@ -63,20 +63,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
/// <param name="scene"></param>
/// <param name="testLLUDPServer"></param>
/// <param name="testPacketServer"></param>
/// <param name="acm">Agent circuit manager used in setting up the stack</param>
/// <param name="acm">Agent circuit manager used in setting up the stack</param>
protected void SetupStack(
IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer,
out AgentCircuitManager acm)
{
IConfigSource configSource = new IniConfigSource();
ClientStackUserSettings userSettings = new ClientStackUserSettings();
testLLUDPServer = new TestLLUDPServer();
testLLUDPServer = new TestLLUDPServer();
acm = new AgentCircuitManager();
uint port = 666;
uint port = 666;
testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm);
testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings);
testLLUDPServer.LocalScene = scene;
testLLUDPServer.LocalScene = scene;
}
/// <summary>
@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
acm.AddNewCircuit(circuitCode, acd);
testLLUDPServer.LoadReceive(uccp, epSender);
testLLUDPServer.LoadReceive(uccp, epSender);
testLLUDPServer.ReceiveData(null);
}
@ -142,15 +142,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb };
onp.Header.Zerocoded = false;
return onp;
return onp;
}
/// <summary>
/// Test adding a client to the stack
/// </summary>
[Test, LongRunning]
[Test, LongRunning]
public void TestAddClient()
{
{
TestHelper.InMethod();
uint myCircuitCode = 123456;
@ -177,7 +177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.ReceiveData(null);
// Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet
@ -185,8 +185,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
acm.AddNewCircuit(myCircuitCode, acd);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.ReceiveData(null);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.ReceiveData(null);
// Should succeed now
Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
@ -196,24 +196,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
/// <summary>
/// Test removing a client from the stack
/// </summary>
[Test]
[Test]
public void TestRemoveClient()
{
TestHelper.InMethod();
uint myCircuitCode = 123457;
uint myCircuitCode = 123457;
TestLLUDPServer testLLUDPServer;
TestLLPacketServer testLLPacketServer;
AgentCircuitManager acm;
SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm);
SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm);
AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm);
testLLUDPServer.RemoveClientCircuit(myCircuitCode);
testLLUDPServer.RemoveClientCircuit(myCircuitCode);
Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode));
// Check that removing a non-existant circuit doesn't have any bad effects
testLLUDPServer.RemoveClientCircuit(101);
testLLUDPServer.RemoveClientCircuit(101);
Assert.IsFalse(testLLUDPServer.HasCircuit(101));
}
@ -232,8 +232,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
TestLLUDPServer testLLUDPServer;
TestLLPacketServer testLLPacketServer;
AgentCircuitManager acm;
SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
AddClient(myCircuitCode, testEp, testLLUDPServer, acm);
SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
AddClient(myCircuitCode, testEp, testLLUDPServer, acm);
byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 };
@ -252,7 +252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp);
testLLUDPServer.ReceiveData(null);
Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1));
Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1));
Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1));
}
@ -270,17 +270,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
uint circuitCodeA = 130000;
EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300);
UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300");
UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300");
UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300");
uint circuitCodeB = 130001;
EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301);
UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301");
UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301");
UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301");
TestLLUDPServer testLLUDPServer;
TestLLPacketServer testLLPacketServer;
AgentCircuitManager acm;
SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm);
AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm);
@ -292,8 +292,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA));
Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3));
Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3));
}
Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3));
Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3));
}
}
}

Some files were not shown because too many files have changed in this diff Show More