aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2009-10-02 08:23:38 +0100
committerMelanie2009-10-02 08:23:38 +0100
commit31d8cec0f8cd47ff445edc7771e5e73825a57927 (patch)
treea2d60604317739fa530502c40ffc71bab2a5c494
parentRestore the missing image handling to the image manager. The missing (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.zip
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.gz
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.bz2
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.xz
Merge branch 'master' into diva-textures
-rw-r--r--.nant/local.include10
-rw-r--r--OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs15
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs151
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs4
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs2
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs3
-rw-r--r--OpenSim/ApplicationPlugins/Rest/RestPlugin.cs2
-rw-r--r--OpenSim/Client/Linden/LLProxyLoginModule.cs2
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginModule.cs2
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs2
-rw-r--r--OpenSim/Data/IRegionData.cs5
-rw-r--r--OpenSim/Data/IUserData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAssetData.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLInventoryData.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLRegionData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserAccountData.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLAuthenticationData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs12
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs6
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs38
-rw-r--r--OpenSim/Data/MySQL/MySQLUserAccountData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs4
-rw-r--r--OpenSim/Data/MySQL/Resources/004_GridStore.sql6
-rw-r--r--OpenSim/Data/NHibernate/NHibernateManager.cs2
-rw-r--r--OpenSim/Data/NHibernate/NHibernateUserData.cs6
-rw-r--r--OpenSim/Data/Null/NullRegionData.cs12
-rw-r--r--OpenSim/Data/RegionProfileData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs2
-rw-r--r--OpenSim/Data/Tests/BasicRegionTest.cs38
-rw-r--r--OpenSim/Data/Tests/BasicUserTest.cs22
-rw-r--r--OpenSim/Data/UserDataBase.cs2
-rw-r--r--OpenSim/Framework/AvatarWearable.cs2
-rw-r--r--OpenSim/Framework/Capabilities/CapsUtil.cs2
-rw-r--r--OpenSim/Framework/Client/IClientIM.cs2
-rw-r--r--OpenSim/Framework/ClientManager.cs4
-rw-r--r--OpenSim/Framework/CnmMemoryCache.cs40
-rw-r--r--OpenSim/Framework/CnmSynchronizedCache.cs26
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs38
-rw-r--r--OpenSim/Framework/Communications/Clients/RegionClient.cs16
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs9
-rw-r--r--OpenSim/Framework/Communications/IAvatarService.cs2
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs92
-rw-r--r--OpenSim/Framework/Communications/IUserAdminService.cs2
-rw-r--r--OpenSim/Framework/Communications/IUserService.cs18
-rw-r--r--OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs6
-rw-r--r--OpenSim/Framework/Communications/Osp/OspResolver.cs12
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs7
-rw-r--r--OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs6
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs5
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs12
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs2
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs34
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs10
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs19
-rw-r--r--OpenSim/Framework/GridConfig.cs6
-rw-r--r--OpenSim/Framework/IAssetCache.cs22
-rw-r--r--OpenSim/Framework/IClientAPI.cs6
-rw-r--r--OpenSim/Framework/ICnmCache.cs24
-rw-r--r--OpenSim/Framework/IRegionCommsListener.cs3
-rw-r--r--OpenSim/Framework/IScene.cs4
-rw-r--r--OpenSim/Framework/ISceneObject.cs2
-rw-r--r--OpenSim/Framework/InventoryFolderBase.cs2
-rw-r--r--OpenSim/Framework/InventoryFolderImpl.cs4
-rw-r--r--OpenSim/Framework/InventoryItemBase.cs40
-rw-r--r--OpenSim/Framework/InventoryNodeBase.cs12
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs5
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs13
-rw-r--r--OpenSim/Framework/RegionInfo.cs73
-rw-r--r--OpenSim/Framework/Serialization/External/LandDataSerializer.cs191
-rw-r--r--OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs6
-rw-r--r--OpenSim/Framework/Serialization/External/UserProfileSerializer.cs4
-rw-r--r--OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs131
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs12
-rw-r--r--OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs112
-rw-r--r--OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs11
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs3
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs6
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs95
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs6
-rw-r--r--OpenSim/Framework/SimStats.cs14
-rw-r--r--OpenSim/Framework/TaskInventoryDictionary.cs2
-rw-r--r--OpenSim/Framework/ThreadTracker.cs6
-rw-r--r--OpenSim/Framework/UserConfig.cs2
-rw-r--r--OpenSim/Framework/UserProfileData.cs2
-rw-r--r--OpenSim/Framework/Util.cs65
-rw-r--r--OpenSim/Grid/MessagingServer.Modules/MessageService.cs86
-rw-r--r--OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs2
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs2
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginService.cs70
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserManager.cs56
-rw-r--r--OpenSim/Grid/UserServer/Main.cs8
-rw-r--r--OpenSim/Grid/UserServer/UserServerCommsManager.cs4
-rw-r--r--OpenSim/Region/Application/Application.cs2
-rw-r--r--OpenSim/Region/Application/HGCommands.cs215
-rw-r--r--OpenSim/Region/Application/OpenSim.cs14
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs26
-rw-r--r--OpenSim/Region/ClientStack/ClientStackManager.cs8
-rw-r--r--OpenSim/Region/ClientStack/ClientStackUserSettings.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs8
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs8
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs38
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs52
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs3
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs12
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs6
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs10
-rw-r--r--OpenSim/Region/ClientStack/ThrottleSettings.cs12
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs13
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs11
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGGridServices.cs1024
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs159
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGGridServicesStandalone.cs259
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGUserServices.cs2
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs10
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs410
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs19
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs4
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs937
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs37
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs2
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs2
-rw-r--r--OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs4
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs24
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs16
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs50
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs72
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs36
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs208
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml4
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs265
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs134
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs303
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs795
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs240
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs79
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs194
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs141
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs63
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs3
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs12
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs113
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs26
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs39
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs52
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs16
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs98
-rw-r--r--OpenSim/Region/DataSnapshot/EstateSnapshot.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ICommander.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDialogModule.cs14
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityCreator.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IFriendsModule.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IGodsModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandChannel.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs10
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISoundModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IVegetationModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IVoiceModule.cs (renamed from OpenSim/Framework/Communications/IHyperlink.cs)21
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/AvatarAnimations.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Border.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityBase.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs50
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs232
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs37
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs196
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs367
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs33
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs28
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs43
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs12
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs20
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs55
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs2
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs2
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs234
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs4
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs4
-rw-r--r--OpenSim/Region/Physics/Manager/VehicleConstants.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs87
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs69
-rw-r--r--OpenSim/Region/Physics/Meshing/PrimMesher.cs27
-rw-r--r--OpenSim/Region/Physics/Meshing/SculptMesh.cs14
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs132
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs17
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs54
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs115
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs8
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs4
-rw-r--r--OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs2
-rw-r--r--OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs2
-rw-r--r--OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/ScriptLoader.cs2
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs28
-rw-r--r--OpenSim/Server/Base/ProtocolVersions.cs56
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs120
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs13
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs12
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs6
-rw-r--r--OpenSim/Server/Handlers/Authorization/AuthorizationServerConnector.cs11
-rw-r--r--OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs2
-rw-r--r--OpenSim/Server/Handlers/Base/ServerConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs14
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerConnector.cs (renamed from OpenSim/Services/Grid/GridService.cs)60
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs451
-rw-r--r--OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs208
-rw-r--r--OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs11
-rw-r--r--OpenSim/Server/Handlers/Land/LandServiceInConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs10
-rw-r--r--OpenSim/Server/Handlers/Neighbour/NeighbourServiceInConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs2
-rw-r--r--OpenSim/Server/ServerMain.cs50
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs4
-rw-r--r--OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs6
-rw-r--r--OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs6
-rw-r--r--OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs6
-rw-r--r--OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs150
-rw-r--r--OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs449
-rw-r--r--OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs252
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs36
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs13
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs22
-rw-r--r--OpenSim/Services/GridService/GridService.cs199
-rw-r--r--OpenSim/Services/GridService/GridServiceBase.cs84
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs287
-rw-r--r--OpenSim/Services/Interfaces/IHyperlink.cs (renamed from OpenSim/Framework/Servers/CheckSumServer.cs)23
-rw-r--r--OpenSim/Services/Interfaces/INeighbourService.cs3
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs2
-rw-r--r--OpenSim/Tests/Clients/Grid/GridClient.cs204
-rw-r--r--OpenSim/Tests/Clients/Grid/GridForm.html11
-rw-r--r--OpenSim/Tests/Common/LongRunningAttribute.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestAssetService.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs6
-rw-r--r--OpenSim/Tests/Common/Mock/TestLandChannel.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestScene.cs6
-rw-r--r--OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs76
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs29
-rw-r--r--OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs8
-rw-r--r--OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs14
-rw-r--r--OpenSim/Tools/Compiler/Program.cs62
-rw-r--r--bin/OpenSim.Example.xml48
-rw-r--r--bin/OpenSim.Grid.AssetServer.exe.config35
-rw-r--r--bin/OpenSim.Grid.InventoryServer.exe.config35
-rw-r--r--bin/OpenSim.GridServer.ini.example35
-rw-r--r--bin/OpenSim.Server.ini.example11
-rw-r--r--bin/OpenSim.Services.ini.example19
-rw-r--r--bin/OpenSim.ini.example8
-rw-r--r--bin/config-include/Grid.ini7
-rw-r--r--bin/config-include/GridCommon.ini.example5
-rw-r--r--bin/config-include/GridHypergrid.ini14
-rw-r--r--bin/config-include/Standalone.ini5
-rw-r--r--bin/config-include/StandaloneCommon.ini.example7
-rw-r--r--bin/config-include/StandaloneHypergrid.ini16
-rw-r--r--prebuild.xml218
356 files changed, 8373 insertions, 5947 deletions
diff --git a/.nant/local.include b/.nant/local.include
index 8c72c80..f78c6a6 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -53,6 +53,11 @@
53 </exec> 53 </exec>
54 <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" /> 54 <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
55 55
56 <exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.serialization.tests">
57 <arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
58 </exec>
59 <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.serialization.tests)==0}" />
60
56 <exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests"> 61 <exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
57 <arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" /> 62 <arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
58 </exec> 63 </exec>
@@ -223,6 +228,11 @@
223 <arg value="-xml=test-results/OpenSim.Framework.Communications.Tests.dll-Results.xml" /> 228 <arg value="-xml=test-results/OpenSim.Framework.Communications.Tests.dll-Results.xml" />
224 </exec> 229 </exec>
225 230
231 <exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.serialization.tests">
232 <arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
233 <arg value="-xml=test-results/OpenSim.Framework.Serialization.Tests.dll-Results.xml" />
234 </exec>
235
226 <exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.servers.tests"> 236 <exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.servers.tests">
227 <arg value="./bin/OpenSim.Framework.Servers.Tests.dll" /> 237 <arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
228 <arg value="-xml=test-results/OpenSim.Framework.Servers.Tests.dll-Results.xml" /> 238 <arg value="-xml=test-results/OpenSim.Framework.Servers.Tests.dll-Results.xml" />
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
index 6a66116..0f827b0 100644
--- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
@@ -69,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
69 69
70 protected CommunicationsManager m_commsManager; 70 protected CommunicationsManager m_commsManager;
71 protected GridInfoService m_gridInfoService; 71 protected GridInfoService m_gridInfoService;
72 protected IHyperlink HGServices = null;
73 72
74 protected IRegionCreator m_regionCreator; 73 protected IRegionCreator m_regionCreator;
75 74
@@ -144,7 +143,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
144 // We are in grid mode 143 // We are in grid mode
145 InitialiseHGGridServices(libraryRootFolder); 144 InitialiseHGGridServices(libraryRootFolder);
146 } 145 }
147 HGCommands.HGServices = HGServices;
148 } 146 }
149 147
150 protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder) 148 protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder)
@@ -187,19 +185,12 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
187 } 185 }
188 186
189 protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder) 187 protected virtual void InitialiseHGStandaloneServices(LibraryRootFolder libraryRootFolder)
190 { 188 {
191 HGGridServicesStandalone gridService
192 = new HGGridServicesStandalone(
193 m_openSim.NetServersInfo, m_httpServer, m_openSim.SceneManager);
194
195 m_commsManager 189 m_commsManager
196 = new HGCommunicationsStandalone( 190 = new HGCommunicationsStandalone(
197 m_openSim.ConfigurationSettings, m_openSim.NetServersInfo, m_httpServer, 191 m_openSim.ConfigurationSettings, m_openSim.NetServersInfo, m_httpServer,
198 gridService, 192 libraryRootFolder, false);
199 libraryRootFolder, false);
200 193
201 HGServices = gridService;
202
203 CreateGridInfoService(); 194 CreateGridInfoService();
204 } 195 }
205 196
@@ -210,8 +201,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
210 m_openSim.NetServersInfo, 201 m_openSim.NetServersInfo,
211 m_openSim.SceneManager, libraryRootFolder); 202 m_openSim.SceneManager, libraryRootFolder);
212 203
213 HGServices = ((HGCommunicationsGridMode) m_commsManager).HGServices;
214
215 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); 204 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
216 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim)); 205 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
217 if (m_openSim.userStatsURI != String.Empty) 206 if (m_openSim.userStatsURI != String.Empty)
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 7e0a4ba..ef45f73 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -69,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
69 private string m_name = "RemoteAdminPlugin"; 69 private string m_name = "RemoteAdminPlugin";
70 private string m_version = "0.0"; 70 private string m_version = "0.0";
71 71
72 //AnakinLohner 0.6.5-post-fixes
73 //guard for XmlRpc-related methods 72 //guard for XmlRpc-related methods
74 private void FailIfRemoteAdminDisabled(string requestName) 73 private void FailIfRemoteAdminDisabled(string requestName)
75 { 74 {
@@ -142,7 +141,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
142 availableMethods["admin_acl_remove"] = XmlRpcAccessListRemove; 141 availableMethods["admin_acl_remove"] = XmlRpcAccessListRemove;
143 availableMethods["admin_acl_list"] = XmlRpcAccessListList; 142 availableMethods["admin_acl_list"] = XmlRpcAccessListList;
144 143
145 // Either enable full remote functionality or just selected features 144 // Either enable full remote functionality or just selected features
146 string enabledMethods = m_config.GetString("enabled_methods", "all"); 145 string enabledMethods = m_config.GetString("enabled_methods", "all");
147 146
148 // To get this, you must explicitly specify "all" or 147 // To get this, you must explicitly specify "all" or
@@ -469,7 +468,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
469 { 468 {
470 m_log.Info("[RADMIN]: CreateRegion: new request"); 469 m_log.Info("[RADMIN]: CreateRegion: new request");
471 470
472 //AnakinLohner 0.6.5-post-fixes
473 FailIfRemoteAdminDisabled("CreateRegion"); 471 FailIfRemoteAdminDisabled("CreateRegion");
474 472
475 XmlRpcResponse response = new XmlRpcResponse(); 473 XmlRpcResponse response = new XmlRpcResponse();
@@ -477,7 +475,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
477 475
478 lock (rslock) 476 lock (rslock)
479 { 477 {
480
481 int m_regionLimit = m_config.GetInt("region_limit", 0); 478 int m_regionLimit = m_config.GetInt("region_limit", 0);
482 bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false); 479 bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false);
483 bool m_publicAccess = m_config.GetBoolean("create_region_public", true); 480 bool m_publicAccess = m_config.GetBoolean("create_region_public", true);
@@ -502,7 +499,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
502 499
503 // check whether we still have space left (iff we are using limits) 500 // check whether we still have space left (iff we are using limits)
504 if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit) 501 if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit)
505 throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", 502 throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first",
506 m_regionLimit)); 503 m_regionLimit));
507 // extract or generate region ID now 504 // extract or generate region ID now
508 Scene scene = null; 505 Scene scene = null;
@@ -561,7 +558,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
561 scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, 558 scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
562 scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY)); 559 scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
563 560
564
565 region.ExternalHostName = (string) requestData["external_address"]; 561 region.ExternalHostName = (string) requestData["external_address"];
566 562
567 string masterFirst = (string) requestData["region_master_first"]; 563 string masterFirst = (string) requestData["region_master_first"];
@@ -580,10 +576,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
580 if (masterFirst != String.Empty && masterLast != String.Empty) // User requests a master avatar 576 if (masterFirst != String.Empty && masterLast != String.Empty) // User requests a master avatar
581 { 577 {
582 // no client supplied UUID: look it up... 578 // no client supplied UUID: look it up...
583 CachedUserInfo userInfo 579 CachedUserInfo userInfo
584 = m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails( 580 = m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(
585 masterFirst, masterLast); 581 masterFirst, masterLast);
586 582
587 if (null == userInfo) 583 if (null == userInfo)
588 { 584 {
589 m_log.InfoFormat("master avatar does not exist, creating it"); 585 m_log.InfoFormat("master avatar does not exist, creating it");
@@ -636,7 +632,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
636 m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", 632 m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
637 region.RegionID, regionXmlPath); 633 region.RegionID, regionXmlPath);
638 region.SaveRegionToFile("dynamic region", regionXmlPath); 634 region.SaveRegionToFile("dynamic region", regionXmlPath);
639 } 635 }
640 else 636 else
641 { 637 {
642 region.Persistent = false; 638 region.Persistent = false;
@@ -664,7 +660,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
664 { 660 {
665 parcel.landData.Flags |= (uint) ParcelFlags.AllowVoiceChat; 661 parcel.landData.Flags |= (uint) ParcelFlags.AllowVoiceChat;
666 parcel.landData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan; 662 parcel.landData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan;
667 ((Scene)newscene).LandChannel.UpdateLandObject(parcel.landData.LocalID, parcel.landData); 663 ((Scene)newscene).LandChannel.UpdateLandObject(parcel.landData.LocalID, parcel.landData);
668 } 664 }
669 } 665 }
670 666
@@ -684,7 +680,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
684 680
685 response.Value = responseData; 681 response.Value = responseData;
686 } 682 }
687 683
688 m_log.Info("[RADMIN]: CreateRegion: request complete"); 684 m_log.Info("[RADMIN]: CreateRegion: request complete");
689 return response; 685 return response;
690 } 686 }
@@ -756,7 +752,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
756 return response; 752 return response;
757 } 753 }
758 } 754 }
759 755
760 /// <summary> 756 /// <summary>
761 /// Close a region. 757 /// Close a region.
762 /// <summary> 758 /// <summary>
@@ -798,7 +794,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
798 { 794 {
799 Hashtable requestData = (Hashtable) request.Params[0]; 795 Hashtable requestData = (Hashtable) request.Params[0];
800 checkStringParameters(request, new string[] {"password"}); 796 checkStringParameters(request, new string[] {"password"});
801 797
802 if (requestData.ContainsKey("region_id") && 798 if (requestData.ContainsKey("region_id") &&
803 !String.IsNullOrEmpty((string) requestData["region_id"])) 799 !String.IsNullOrEmpty((string) requestData["region_id"]))
804 { 800 {
@@ -899,8 +895,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
899 if (!m_app.SceneManager.TryGetScene(regionName, out scene)) 895 if (!m_app.SceneManager.TryGetScene(regionName, out scene))
900 throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); 896 throw new Exception(String.Format("region \"{0}\" does not exist", regionName));
901 897
902 // Modify access 898 // Modify access
903 scene.RegionInfo.EstateSettings.PublicAccess = 899 scene.RegionInfo.EstateSettings.PublicAccess =
904 getBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess); 900 getBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess);
905 if (scene.RegionInfo.Persistent) 901 if (scene.RegionInfo.Persistent)
906 scene.RegionInfo.EstateSettings.Save(); 902 scene.RegionInfo.EstateSettings.Save();
@@ -988,8 +984,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
988 public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request, IPEndPoint remoteClient) 984 public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request, IPEndPoint remoteClient)
989 { 985 {
990 m_log.Info("[RADMIN]: CreateUser: new request"); 986 m_log.Info("[RADMIN]: CreateUser: new request");
991 987
992 //AnakinLohner 0.6.5-post-fixes
993 FailIfRemoteAdminDisabled("CreateUser"); 988 FailIfRemoteAdminDisabled("CreateUser");
994 989
995 XmlRpcResponse response = new XmlRpcResponse(); 990 XmlRpcResponse response = new XmlRpcResponse();
@@ -1024,13 +1019,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1024 if (requestData.Contains("user_email")) 1019 if (requestData.Contains("user_email"))
1025 email = (string)requestData["user_email"]; 1020 email = (string)requestData["user_email"];
1026 1021
1027 CachedUserInfo userInfo = 1022 CachedUserInfo userInfo =
1028 m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); 1023 m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname);
1029 1024
1030 if (null != userInfo) 1025 if (null != userInfo)
1031 throw new Exception(String.Format("Avatar {0} {1} already exists", firstname, lastname)); 1026 throw new Exception(String.Format("Avatar {0} {1} already exists", firstname, lastname));
1032 1027
1033 UUID userID = 1028 UUID userID =
1034 m_app.CommunicationsManager.UserAdminService.AddUser(firstname, lastname, 1029 m_app.CommunicationsManager.UserAdminService.AddUser(firstname, lastname,
1035 passwd, email, regX, regY); 1030 passwd, email, regX, regY);
1036 1031
@@ -1101,7 +1096,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1101 { 1096 {
1102 m_log.Info("[RADMIN]: UserExists: new request"); 1097 m_log.Info("[RADMIN]: UserExists: new request");
1103 1098
1104 //AnakinLohner 0.6.5-post-fixes
1105 FailIfRemoteAdminDisabled("UserExists"); 1099 FailIfRemoteAdminDisabled("UserExists");
1106 1100
1107 XmlRpcResponse response = new XmlRpcResponse(); 1101 XmlRpcResponse response = new XmlRpcResponse();
@@ -1117,8 +1111,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1117 string firstname = (string) requestData["user_firstname"]; 1111 string firstname = (string) requestData["user_firstname"];
1118 string lastname = (string) requestData["user_lastname"]; 1112 string lastname = (string) requestData["user_lastname"];
1119 1113
1120 CachedUserInfo userInfo 1114 CachedUserInfo userInfo
1121 = m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); 1115 = m_app.CommunicationsManager.UserProfileCacheService.GetUserDetails(firstname, lastname);
1122 1116
1123 responseData["user_firstname"] = firstname; 1117 responseData["user_firstname"] = firstname;
1124 responseData["user_lastname"] = lastname; 1118 responseData["user_lastname"] = lastname;
@@ -1131,10 +1125,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1131 else 1125 else
1132 { 1126 {
1133 responseData["success"] = true; 1127 responseData["success"] = true;
1134 responseData["lastlogin"] = userInfo.UserProfile.LastLogin; 1128 responseData["lastlogin"] = userInfo.UserProfile.LastLogin;
1135 } 1129 }
1136 1130
1137
1138 response.Value = responseData; 1131 response.Value = responseData;
1139 } 1132 }
1140 catch (Exception e) 1133 catch (Exception e)
@@ -1252,7 +1245,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1252 if (requestData.ContainsKey("about_virtual_world")) 1245 if (requestData.ContainsKey("about_virtual_world"))
1253 aboutAvatar = (string)requestData["about_virtual_world"]; 1246 aboutAvatar = (string)requestData["about_virtual_world"];
1254 1247
1255 UserProfileData userProfile 1248 UserProfileData userProfile
1256 = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname); 1249 = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname);
1257 1250
1258 if (null == userProfile) 1251 if (null == userProfile)
@@ -1308,20 +1301,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1308 1301
1309 m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); 1302 m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
1310 return response; 1303 return response;
1311
1312 } 1304 }
1313 1305
1314 /// <summary> 1306 /// <summary>
1315 /// This method is called by the user-create and user-modify methods to establish 1307 /// This method is called by the user-create and user-modify methods to establish
1316 /// or change, the user's appearance. Default avatar names can be specified via 1308 /// or change, the user's appearance. Default avatar names can be specified via
1317 /// the config file, but must correspond to avatars in the default appearance 1309 /// the config file, but must correspond to avatars in the default appearance
1318 /// file, or pre-existing in the user database. 1310 /// file, or pre-existing in the user database.
1319 /// This should probably get moved into somewhere more core eventually. 1311 /// This should probably get moved into somewhere more core eventually.
1320 /// </summary> 1312 /// </summary>
1321 1313
1322 private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) 1314 private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid)
1323 { 1315 {
1324
1325 m_log.DebugFormat("[RADMIN] updateUserAppearance"); 1316 m_log.DebugFormat("[RADMIN] updateUserAppearance");
1326 1317
1327 string dmale = m_config.GetString("default_male", "Default Male"); 1318 string dmale = m_config.GetString("default_male", "Default Male");
@@ -1347,7 +1338,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1347 break; 1338 break;
1348 } 1339 }
1349 } 1340 }
1350 1341
1351 // Has an explicit model been specified? 1342 // Has an explicit model been specified?
1352 1343
1353 if (requestData.Contains("model")) 1344 if (requestData.Contains("model"))
@@ -1384,7 +1375,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1384 return; 1375 return;
1385 } 1376 }
1386 1377
1387 // Set current user's appearance. This bit is easy. The appearance structure is populated with 1378 // Set current user's appearance. This bit is easy. The appearance structure is populated with
1388 // actual asset ids, however to complete the magic we need to populate the inventory with the 1379 // actual asset ids, however to complete the magic we need to populate the inventory with the
1389 // assets in question. 1380 // assets in question.
1390 1381
@@ -1393,7 +1384,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1393 m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", 1384 m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}",
1394 userid, model); 1385 userid, model);
1395 } 1386 }
1396 1387
1397 /// <summary> 1388 /// <summary>
1398 /// This method is called by updateAvatarAppearance once any specified model has been 1389 /// This method is called by updateAvatarAppearance once any specified model has been
1399 /// ratified, or an appropriate default value has been adopted. The intended prototype 1390 /// ratified, or an appropriate default value has been adopted. The intended prototype
@@ -1402,19 +1393,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1402 1393
1403 private void establishAppearance(UUID dest, UUID srca) 1394 private void establishAppearance(UUID dest, UUID srca)
1404 { 1395 {
1405
1406 m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca); 1396 m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca);
1407 1397
1408 AvatarAppearance ava = m_app.CommunicationsManager.AvatarService.GetUserAppearance(srca); 1398 AvatarAppearance ava = m_app.CommunicationsManager.AvatarService.GetUserAppearance(srca);
1409 1399
1410 // If the model has no associated appearance we're done. 1400 // If the model has no associated appearance we're done.
1411 1401
1412 // if (ava == null) 1402 // if (ava == null)
1413 // { 1403 // {
1414 // return new AvatarAppearance(); 1404 // return new AvatarAppearance();
1415 // } 1405 // }
1416 1406
1417 if (ava == null) 1407 if (ava == null)
1418 return; 1408 return;
1419 1409
1420 UICallback sic = new UICallback(); 1410 UICallback sic = new UICallback();
@@ -1423,7 +1413,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1423 1413
1424 try 1414 try
1425 { 1415 {
1426
1427 Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>(); 1416 Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>();
1428 1417
1429 iserv.GetUserInventory(dest, dic.callback); 1418 iserv.GetUserInventory(dest, dic.callback);
@@ -1434,7 +1423,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1434 1423
1435 if (sic.OK && dic.OK) 1424 if (sic.OK && dic.OK)
1436 { 1425 {
1437
1438 InventoryFolderImpl efolder; 1426 InventoryFolderImpl efolder;
1439 InventoryFolderImpl srcf = sic.root.FindFolderForType(5); 1427 InventoryFolderImpl srcf = sic.root.FindFolderForType(5);
1440 InventoryFolderImpl dstf = dic.root.FindFolderForType(5); 1428 InventoryFolderImpl dstf = dic.root.FindFolderForType(5);
@@ -1460,7 +1448,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1460 if (item.Folder == folder.ID) 1448 if (item.Folder == folder.ID)
1461 { 1449 {
1462 InventoryItemBase dsti = new InventoryItemBase(); 1450 InventoryItemBase dsti = new InventoryItemBase();
1463 dsti.ID = UUID.Random(); 1451 dsti.ID = UUID.Random();
1464 dsti.Name = item.Name; 1452 dsti.Name = item.Name;
1465 dsti.Description = item.Description; 1453 dsti.Description = item.Description;
1466 dsti.InvType = item.InvType; 1454 dsti.InvType = item.InvType;
@@ -1494,7 +1482,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1494 ava.SetWearable(i, dw); 1482 ava.SetWearable(i, dw);
1495 } 1483 }
1496 } 1484 }
1497
1498 } 1485 }
1499 else 1486 else
1500 { 1487 {
@@ -1502,7 +1489,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1502 } 1489 }
1503 1490
1504 m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava); 1491 m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava);
1505
1506 } 1492 }
1507 catch (Exception e) 1493 catch (Exception e)
1508 { 1494 {
@@ -1510,16 +1496,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1510 dest, e.Message); 1496 dest, e.Message);
1511 return; 1497 return;
1512 } 1498 }
1513
1514 return;
1515 1499
1500 return;
1516 } 1501 }
1517 1502
1518 ///<summary> 1503 ///<summary>
1519 /// This method is called if a given model avatar name can not be found. If the external 1504 /// This method is called if a given model avatar name can not be found. If the external
1520 /// file has already been loaded once, then control returns immediately. If not, then it 1505 /// file has already been loaded once, then control returns immediately. If not, then it
1521 /// looks for a default appearance file. This file contains XML definitions of zero or more named 1506 /// looks for a default appearance file. This file contains XML definitions of zero or more named
1522 /// avatars, each avatar can specify zero or more "outfits". Each outfit is a collection 1507 /// avatars, each avatar can specify zero or more "outfits". Each outfit is a collection
1523 /// of items that together, define a particular ensemble for the avatar. Each avatar should 1508 /// of items that together, define a particular ensemble for the avatar. Each avatar should
1524 /// indicate which outfit is the default, and this outfit will be automatically worn. The 1509 /// indicate which outfit is the default, and this outfit will be automatically worn. The
1525 /// other outfits are provided to allow "real" avatars a way to easily change their outfits. 1510 /// other outfits are provided to allow "real" avatars a way to easily change their outfits.
@@ -1527,7 +1512,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1527 1512
1528 private bool createDefaultAvatars() 1513 private bool createDefaultAvatars()
1529 { 1514 {
1530
1531 // Only load once 1515 // Only load once
1532 1516
1533 if (daload) 1517 if (daload)
@@ -1543,10 +1527,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1543 1527
1544 try 1528 try
1545 { 1529 {
1546
1547 string dafn = null; 1530 string dafn = null;
1548 1531
1549 //AnakinLohner 0.6.5-post-fixes
1550 //m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini 1532 //m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini
1551 if (m_config != null) 1533 if (m_config != null)
1552 { 1534 {
@@ -1555,7 +1537,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1555 1537
1556 if (File.Exists(dafn)) 1538 if (File.Exists(dafn))
1557 { 1539 {
1558
1559 XmlDocument doc = new XmlDocument(); 1540 XmlDocument doc = new XmlDocument();
1560 string name = "*unknown*"; 1541 string name = "*unknown*";
1561 string email = "anon@anon"; 1542 string email = "anon@anon";
@@ -1630,12 +1611,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1630 } 1611 }
1631 1612
1632 m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID); 1613 m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID);
1633 include = true; 1614 include = true;
1634 } 1615 }
1635 catch (Exception e) 1616 catch (Exception e)
1636 { 1617 {
1637 m_log.DebugFormat("[RADMIN] Error creating user {0} : {1}", name, e.Message); 1618 m_log.DebugFormat("[RADMIN] Error creating user {0} : {1}", name, e.Message);
1638 include = false; 1619 include = false;
1639 } 1620 }
1640 1621
1641 // OK, User has been created OK, now we can install the inventory. 1622 // OK, User has been created OK, now we can install the inventory.
@@ -1654,7 +1635,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1654 { 1635 {
1655 mava = new AvatarAppearance(); 1636 mava = new AvatarAppearance();
1656 } 1637 }
1657 1638
1658 { 1639 {
1659 AvatarWearable[] wearables = mava.Wearables; 1640 AvatarWearable[] wearables = mava.Wearables;
1660 for (int i=0; i<wearables.Length; i++) 1641 for (int i=0; i<wearables.Length; i++)
@@ -1670,8 +1651,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1670 if (uic.OK) 1651 if (uic.OK)
1671 try 1652 try
1672 { 1653 {
1673 1654 m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory",
1674 m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory",
1675 uic.folders.Count, uic.items.Count); 1655 uic.folders.Count, uic.items.Count);
1676 1656
1677 InventoryFolderImpl cfolder = uic.root.FindFolderForType(5); 1657 InventoryFolderImpl cfolder = uic.root.FindFolderForType(5);
@@ -1699,7 +1679,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1699 1679
1700 foreach (XmlElement outfit in outfits) 1680 foreach (XmlElement outfit in outfits)
1701 { 1681 {
1702
1703 m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}", 1682 m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}",
1704 GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?")); 1683 GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?"));
1705 1684
@@ -1707,7 +1686,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1707 select = (GetStringAttribute(outfit,"default","no") == "yes"); 1686 select = (GetStringAttribute(outfit,"default","no") == "yes");
1708 efolder = null; 1687 efolder = null;
1709 1688
1710 // If the folder already exists, re-use it. The defaults may 1689 // If the folder already exists, re-use it. The defaults may
1711 // change over time. Augment only. 1690 // change over time. Augment only.
1712 foreach (InventoryFolderImpl folder in uic.folders) 1691 foreach (InventoryFolderImpl folder in uic.folders)
1713 { 1692 {
@@ -1756,10 +1735,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1756 1735
1757 InventoryItemBase iitem = null; 1736 InventoryItemBase iitem = null;
1758 1737
1759 if ((iitem = efolder.FindAsset(assetid)) == null) 1738 if ((iitem = efolder.FindAsset(assetid)) == null)
1760 { 1739 {
1761 iitem = new InventoryItemBase(); 1740 iitem = new InventoryItemBase();
1762 iitem.ID = UUID.Random(); 1741 iitem.ID = UUID.Random();
1763 iitem.Name = GetStringAttribute(item,"name",""); 1742 iitem.Name = GetStringAttribute(item,"name","");
1764 iitem.Description = GetStringAttribute(item,"desc",""); 1743 iitem.Description = GetStringAttribute(item,"desc","");
1765 iitem.InvType = GetIntegerAttribute(item,"invtype",-1); 1744 iitem.InvType = GetIntegerAttribute(item,"invtype",-1);
@@ -1820,9 +1799,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1820 } 1799 }
1821 1800
1822 return true; 1801 return true;
1823
1824 } 1802 }
1825 1803
1826 /// <summary> 1804 /// <summary>
1827 /// Load an OAR file into a region.. 1805 /// Load an OAR file into a region..
1828 /// <summary> 1806 /// <summary>
@@ -1859,9 +1837,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1859 { 1837 {
1860 m_log.Info("[RADMIN]: Received Load OAR Administrator Request"); 1838 m_log.Info("[RADMIN]: Received Load OAR Administrator Request");
1861 1839
1862 //AnakinLohner 0.6.5-post-fixes
1863 FailIfRemoteAdminDisabled("Load OAR"); 1840 FailIfRemoteAdminDisabled("Load OAR");
1864 1841
1865 XmlRpcResponse response = new XmlRpcResponse(); 1842 XmlRpcResponse response = new XmlRpcResponse();
1866 Hashtable responseData = new Hashtable(); 1843 Hashtable responseData = new Hashtable();
1867 1844
@@ -1962,9 +1939,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1962 { 1939 {
1963 m_log.Info("[RADMIN]: Received Save OAR Administrator Request"); 1940 m_log.Info("[RADMIN]: Received Save OAR Administrator Request");
1964 1941
1965 //AnakinLohner 0.6.5-post-fixes
1966 FailIfRemoteAdminDisabled("Save OAR"); 1942 FailIfRemoteAdminDisabled("Save OAR");
1967 1943
1968 XmlRpcResponse response = new XmlRpcResponse(); 1944 XmlRpcResponse response = new XmlRpcResponse();
1969 Hashtable responseData = new Hashtable(); 1945 Hashtable responseData = new Hashtable();
1970 1946
@@ -2003,7 +1979,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2003 1979
2004 IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); 1980 IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
2005 1981
2006
2007 if (archiver != null) 1982 if (archiver != null)
2008 { 1983 {
2009 scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; 1984 scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted;
@@ -2014,11 +1989,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2014 else 1989 else
2015 throw new Exception("Archiver module not present for scene"); 1990 throw new Exception("Archiver module not present for scene");
2016 1991
2017
2018 responseData["saved"] = true; 1992 responseData["saved"] = true;
2019 1993
2020 response.Value = responseData; 1994 response.Value = responseData;
2021
2022 } 1995 }
2023 catch (Exception e) 1996 catch (Exception e)
2024 { 1997 {
@@ -2045,7 +2018,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2045 { 2018 {
2046 m_log.Info("[RADMIN]: Received Load XML Administrator Request"); 2019 m_log.Info("[RADMIN]: Received Load XML Administrator Request");
2047 2020
2048 //AnakinLohner 0.6.5-post-fixes
2049 FailIfRemoteAdminDisabled("Load XML"); 2021 FailIfRemoteAdminDisabled("Load XML");
2050 2022
2051 XmlRpcResponse response = new XmlRpcResponse(); 2023 XmlRpcResponse response = new XmlRpcResponse();
@@ -2129,12 +2101,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2129 } 2101 }
2130 } 2102 }
2131 2103
2132
2133 public XmlRpcResponse XmlRpcSaveXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient) 2104 public XmlRpcResponse XmlRpcSaveXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient)
2134 { 2105 {
2135 m_log.Info("[RADMIN]: Received Save XML Administrator Request"); 2106 m_log.Info("[RADMIN]: Received Save XML Administrator Request");
2136 2107
2137 //AnakinLohner 0.6.5-post-fixes
2138 FailIfRemoteAdminDisabled("Save XML"); 2108 FailIfRemoteAdminDisabled("Save XML");
2139 2109
2140 XmlRpcResponse response = new XmlRpcResponse(); 2110 XmlRpcResponse response = new XmlRpcResponse();
@@ -2220,7 +2190,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2220 { 2190 {
2221 m_log.Info("[RADMIN]: Received Query XML Administrator Request"); 2191 m_log.Info("[RADMIN]: Received Query XML Administrator Request");
2222 2192
2223 //AnakinLohner 0.6.5-post-fixes
2224 FailIfRemoteAdminDisabled("Query XML"); 2193 FailIfRemoteAdminDisabled("Query XML");
2225 2194
2226 XmlRpcResponse response = new XmlRpcResponse(); 2195 XmlRpcResponse response = new XmlRpcResponse();
@@ -2255,9 +2224,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2255 else throw new Exception("neither region_name nor region_uuid given"); 2224 else throw new Exception("neither region_name nor region_uuid given");
2256 2225
2257 Scene s = m_app.SceneManager.CurrentScene; 2226 Scene s = m_app.SceneManager.CurrentScene;
2258
2259 int health = s.GetHealth(); 2227 int health = s.GetHealth();
2260
2261 responseData["health"] = health; 2228 responseData["health"] = health;
2262 2229
2263 response.Value = responseData; 2230 response.Value = responseData;
@@ -2280,7 +2247,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2280 { 2247 {
2281 m_log.Info("[RADMIN]: Received Command XML Administrator Request"); 2248 m_log.Info("[RADMIN]: Received Command XML Administrator Request");
2282 2249
2283 //AnakinLohner 0.6.5-post-fixes
2284 FailIfRemoteAdminDisabled("Command XML"); 2250 FailIfRemoteAdminDisabled("Command XML");
2285 2251
2286 XmlRpcResponse response = new XmlRpcResponse(); 2252 XmlRpcResponse response = new XmlRpcResponse();
@@ -2320,12 +2286,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2320 2286
2321 public XmlRpcResponse XmlRpcAccessListClear(XmlRpcRequest request, IPEndPoint remoteClient) 2287 public XmlRpcResponse XmlRpcAccessListClear(XmlRpcRequest request, IPEndPoint remoteClient)
2322 { 2288 {
2323
2324 m_log.Info("[RADMIN]: Received Access List Clear Request"); 2289 m_log.Info("[RADMIN]: Received Access List Clear Request");
2325 2290
2326 //AnakinLohner 0.6.5-post-fixes
2327 FailIfRemoteAdminDisabled("Access List Clear"); 2291 FailIfRemoteAdminDisabled("Access List Clear");
2328 2292
2329 XmlRpcResponse response = new XmlRpcResponse(); 2293 XmlRpcResponse response = new XmlRpcResponse();
2330 Hashtable responseData = new Hashtable(); 2294 Hashtable responseData = new Hashtable();
2331 2295
@@ -2360,7 +2324,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2360 s.RegionInfo.EstateSettings.EstateAccess = new UUID[]{}; 2324 s.RegionInfo.EstateSettings.EstateAccess = new UUID[]{};
2361 if (s.RegionInfo.Persistent) 2325 if (s.RegionInfo.Persistent)
2362 s.RegionInfo.EstateSettings.Save(); 2326 s.RegionInfo.EstateSettings.Save();
2363
2364 } 2327 }
2365 catch (Exception e) 2328 catch (Exception e)
2366 { 2329 {
@@ -2368,7 +2331,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2368 2331
2369 responseData["success"] = false; 2332 responseData["success"] = false;
2370 responseData["error"] = e.Message; 2333 responseData["error"] = e.Message;
2371
2372 } 2334 }
2373 finally 2335 finally
2374 { 2336 {
@@ -2381,12 +2343,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2381 2343
2382 public XmlRpcResponse XmlRpcAccessListAdd(XmlRpcRequest request, IPEndPoint remoteClient) 2344 public XmlRpcResponse XmlRpcAccessListAdd(XmlRpcRequest request, IPEndPoint remoteClient)
2383 { 2345 {
2384
2385 m_log.Info("[RADMIN]: Received Access List Add Request"); 2346 m_log.Info("[RADMIN]: Received Access List Add Request");
2386 2347
2387 //AnakinLohner 0.6.5-post-fixes
2388 FailIfRemoteAdminDisabled("Access List Add"); 2348 FailIfRemoteAdminDisabled("Access List Add");
2389 2349
2390 XmlRpcResponse response = new XmlRpcResponse(); 2350 XmlRpcResponse response = new XmlRpcResponse();
2391 Hashtable responseData = new Hashtable(); 2351 Hashtable responseData = new Hashtable();
2392 2352
@@ -2419,7 +2379,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2419 2379
2420 int addk = 0; 2380 int addk = 0;
2421 2381
2422 if (requestData.Contains("users")) 2382 if (requestData.Contains("users"))
2423 { 2383 {
2424 UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService; 2384 UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService;
2425 Scene s = m_app.SceneManager.CurrentScene; 2385 Scene s = m_app.SceneManager.CurrentScene;
@@ -2450,7 +2410,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2450 } 2410 }
2451 2411
2452 responseData["added"] = addk; 2412 responseData["added"] = addk;
2453
2454 } 2413 }
2455 catch (Exception e) 2414 catch (Exception e)
2456 { 2415 {
@@ -2458,7 +2417,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2458 2417
2459 responseData["success"] = false; 2418 responseData["success"] = false;
2460 responseData["error"] = e.Message; 2419 responseData["error"] = e.Message;
2461
2462 } 2420 }
2463 finally 2421 finally
2464 { 2422 {
@@ -2471,12 +2429,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2471 2429
2472 public XmlRpcResponse XmlRpcAccessListRemove(XmlRpcRequest request, IPEndPoint remoteClient) 2430 public XmlRpcResponse XmlRpcAccessListRemove(XmlRpcRequest request, IPEndPoint remoteClient)
2473 { 2431 {
2474
2475 m_log.Info("[RADMIN]: Received Access List Remove Request"); 2432 m_log.Info("[RADMIN]: Received Access List Remove Request");
2476 2433
2477 //AnakinLohner 0.6.5-post-fixes
2478 FailIfRemoteAdminDisabled("Access List Remove"); 2434 FailIfRemoteAdminDisabled("Access List Remove");
2479 2435
2480 XmlRpcResponse response = new XmlRpcResponse(); 2436 XmlRpcResponse response = new XmlRpcResponse();
2481 Hashtable responseData = new Hashtable(); 2437 Hashtable responseData = new Hashtable();
2482 2438
@@ -2509,7 +2465,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2509 2465
2510 int remk = 0; 2466 int remk = 0;
2511 2467
2512 if (requestData.Contains("users")) 2468 if (requestData.Contains("users"))
2513 { 2469 {
2514 UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService; 2470 UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService;
2515 Scene s = m_app.SceneManager.CurrentScene; 2471 Scene s = m_app.SceneManager.CurrentScene;
@@ -2539,7 +2495,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2539 } 2495 }
2540 2496
2541 responseData["removed"] = remk; 2497 responseData["removed"] = remk;
2542
2543 } 2498 }
2544 catch (Exception e) 2499 catch (Exception e)
2545 { 2500 {
@@ -2547,7 +2502,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2547 2502
2548 responseData["success"] = false; 2503 responseData["success"] = false;
2549 responseData["error"] = e.Message; 2504 responseData["error"] = e.Message;
2550
2551 } 2505 }
2552 finally 2506 finally
2553 { 2507 {
@@ -2560,12 +2514,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2560 2514
2561 public XmlRpcResponse XmlRpcAccessListList(XmlRpcRequest request, IPEndPoint remoteClient) 2515 public XmlRpcResponse XmlRpcAccessListList(XmlRpcRequest request, IPEndPoint remoteClient)
2562 { 2516 {
2563
2564 m_log.Info("[RADMIN]: Received Access List List Request"); 2517 m_log.Info("[RADMIN]: Received Access List List Request");
2565 2518
2566 //AnakinLohner 0.6.5-post-fixes
2567 FailIfRemoteAdminDisabled("Access List List"); 2519 FailIfRemoteAdminDisabled("Access List List");
2568 2520
2569 XmlRpcResponse response = new XmlRpcResponse(); 2521 XmlRpcResponse response = new XmlRpcResponse();
2570 Hashtable responseData = new Hashtable(); 2522 Hashtable responseData = new Hashtable();
2571 2523
@@ -2608,9 +2560,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2608 users[user.ToString()] = udata.UserProfile.Name; 2560 users[user.ToString()] = udata.UserProfile.Name;
2609 } 2561 }
2610 } 2562 }
2611
2612 responseData["users"] = users;
2613 2563
2564 responseData["users"] = users;
2614 } 2565 }
2615 catch (Exception e) 2566 catch (Exception e)
2616 { 2567 {
@@ -2618,7 +2569,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2618 2569
2619 responseData["success"] = false; 2570 responseData["success"] = false;
2620 responseData["error"] = e.Message; 2571 responseData["error"] = e.Message;
2621
2622 } 2572 }
2623 finally 2573 finally
2624 { 2574 {
@@ -2695,12 +2645,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2695 public void Dispose() 2645 public void Dispose()
2696 { 2646 {
2697 } 2647 }
2698
2699 } 2648 }
2700 2649
2701 class UICallback 2650 class UICallback
2702 { 2651 {
2703
2704 private Object uilock = new Object(); 2652 private Object uilock = new Object();
2705 internal InventoryFolderImpl root = null; 2653 internal InventoryFolderImpl root = null;
2706 internal List<InventoryFolderImpl> folders; 2654 internal List<InventoryFolderImpl> folders;
@@ -2720,7 +2668,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2720 2668
2721 public void GetInventory() 2669 public void GetInventory()
2722 { 2670 {
2723
2724 Dictionary<UUID, InventoryFolderImpl> fmap = new Dictionary<UUID, InventoryFolderImpl>(); 2671 Dictionary<UUID, InventoryFolderImpl> fmap = new Dictionary<UUID, InventoryFolderImpl>();
2725 2672
2726 if (OK == false) 2673 if (OK == false)
@@ -2729,7 +2676,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2729 { 2676 {
2730 if (OK == false) 2677 if (OK == false)
2731 System.Threading.Monitor.Wait(uilock); 2678 System.Threading.Monitor.Wait(uilock);
2732 } 2679 }
2733 } 2680 }
2734 2681
2735 // Got the inventory OK. So now merge the content of the default appearance 2682 // Got the inventory OK. So now merge the content of the default appearance
@@ -2774,8 +2721,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2774 { 2721 {
2775 fmap[item.Folder].Items.Add(item.ID, item); 2722 fmap[item.Folder].Items.Add(item.ID, item);
2776 } 2723 }
2777
2778 } 2724 }
2779 } 2725 }
2780
2781} 2726}
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
index 13f6426..db62d52 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
@@ -207,7 +207,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
207 // This plugin will only be enabled if the broader 207 // This plugin will only be enabled if the broader
208 // REST plugin mechanism is enabled. 208 // REST plugin mechanism is enabled.
209 209
210 Rest.Log.InfoFormat("{0} Plugin is initializing", MsgId); 210 //Rest.Log.InfoFormat("{0} Plugin is initializing", MsgId);
211 211
212 base.Initialise(openSim); 212 base.Initialise(openSim);
213 213
@@ -216,7 +216,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
216 216
217 if (!IsEnabled) 217 if (!IsEnabled)
218 { 218 {
219 Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId); 219 //Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId);
220 return; 220 return;
221 } 221 }
222 222
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
index a407b9e..9c90a7e 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs
@@ -218,7 +218,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
218 httpResponse.ContentType = "text/xml"; 218 httpResponse.ContentType = "text/xml";
219 219
220 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>(); 220 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
221 if (serialiser != null) 221 if (serialiser != null)
222 serialiser.SavePrimsToXml2(scene, new StreamWriter(httpResponse.OutputStream), min, max); 222 serialiser.SavePrimsToXml2(scene, new StreamWriter(httpResponse.OutputStream), min, max);
223 223
224 return ""; 224 return "";
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs
index f790c5e..02ef588 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs
@@ -68,9 +68,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
68 base.Initialise(openSim); 68 base.Initialise(openSim);
69 if (!IsEnabled) 69 if (!IsEnabled)
70 { 70 {
71 m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID); 71 //m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID);
72 return; 72 return;
73 } 73 }
74
74 m_log.InfoFormat("{0} REST region plugin enabled", MsgID); 75 m_log.InfoFormat("{0} REST region plugin enabled", MsgID);
75 76
76 // add REST method handlers 77 // add REST method handlers
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
index fd23384..ff1502a 100644
--- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
+++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
@@ -216,7 +216,7 @@ namespace OpenSim.ApplicationPlugins.Rest
216 216
217 if (!_config.GetBoolean("enabled", false)) 217 if (!_config.GetBoolean("enabled", false))
218 { 218 {
219 m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID); 219 //m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID);
220 return; 220 return;
221 } 221 }
222 222
diff --git a/OpenSim/Client/Linden/LLProxyLoginModule.cs b/OpenSim/Client/Linden/LLProxyLoginModule.cs
index f55d9fc..ccd38d4 100644
--- a/OpenSim/Client/Linden/LLProxyLoginModule.cs
+++ b/OpenSim/Client/Linden/LLProxyLoginModule.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Client.Linden
58 { 58 {
59 if (m_firstScene != null) 59 if (m_firstScene != null)
60 { 60 {
61 return m_firstScene.CommsManager.GridService.RegionLoginsEnabled; 61 return m_firstScene.SceneGridService.RegionLoginsEnabled;
62 } 62 }
63 else 63 else
64 { 64 {
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
index 4a31e95..fb0aaa5 100644
--- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
+++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Client.Linden
62 { 62 {
63 if (m_firstScene != null) 63 if (m_firstScene != null)
64 { 64 {
65 return m_firstScene.CommsManager.GridService.RegionLoginsEnabled; 65 return m_firstScene.SceneGridService.RegionLoginsEnabled;
66 } 66 }
67 else 67 else
68 { 68 {
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 180f5e0..e901ff6 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -304,7 +304,7 @@ namespace OpenSim.Client.MXP.ClientStack
304 String typeName = ToOmType(primShape.PCode); 304 String typeName = ToOmType(primShape.PCode);
305 m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName); 305 m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName);
306 306
307 PerceptionEventMessage pe = new PerceptionEventMessage(); 307 PerceptionEventMessage pe = new PerceptionEventMessage();
308 pe.ObjectFragment.ObjectId = objectID.Guid; 308 pe.ObjectFragment.ObjectId = objectID.Guid;
309 309
310 pe.ObjectFragment.ParentObjectId = Guid.Empty; 310 pe.ObjectFragment.ParentObjectId = Guid.Empty;
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 71dd525..7a607ab 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -39,13 +39,15 @@ namespace OpenSim.Data
39 public string RegionName; 39 public string RegionName;
40 public int posX; 40 public int posX;
41 public int posY; 41 public int posY;
42 public int sizeX;
43 public int sizeY;
42 public Dictionary<string, object> Data; 44 public Dictionary<string, object> Data;
43 } 45 }
44 46
45 /// <summary> 47 /// <summary>
46 /// An interface for connecting to the authentication datastore 48 /// An interface for connecting to the authentication datastore
47 /// </summary> 49 /// </summary>
48 public interface IRegionData 50 public interface IRegionData
49 { 51 {
50 RegionData Get(UUID regionID, UUID ScopeID); 52 RegionData Get(UUID regionID, UUID ScopeID);
51 List<RegionData> Get(string regionName, UUID ScopeID); 53 List<RegionData> Get(string regionName, UUID ScopeID);
@@ -57,5 +59,6 @@ namespace OpenSim.Data
57 bool SetDataItem(UUID principalID, string item, string value); 59 bool SetDataItem(UUID principalID, string item, string value);
58 60
59 bool Delete(UUID regionID); 61 bool Delete(UUID regionID);
62
60 } 63 }
61} 64}
diff --git a/OpenSim/Data/IUserData.cs b/OpenSim/Data/IUserData.cs
index ee69366..e9a1e81 100644
--- a/OpenSim/Data/IUserData.cs
+++ b/OpenSim/Data/IUserData.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Data
54 54
55 /// <summary> 55 /// <summary>
56 /// Get a user from a given uri. 56 /// Get a user from a given uri.
57 /// </summary> 57 /// </summary>
58 /// <param name="uri"></param> 58 /// <param name="uri"></param>
59 /// <returns>The user data profile. Null if no user is found.</returns> 59 /// <returns>The user data profile. Null if no user is found.</returns>
60 UserProfileData GetUserByUri(Uri uri); 60 UserProfileData GetUserByUri(Uri uri);
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
index d193cf5..25f7cf0 100644
--- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
@@ -175,7 +175,7 @@ namespace OpenSim.Data.MSSQL
175 (@id, @name, @description, @assetType, @local, 175 (@id, @name, @description, @assetType, @local,
176 @temporary, @create_time, @access_time, @data)"; 176 @temporary, @create_time, @access_time, @data)";
177 177
178 string assetName = asset.Name; 178 string assetName = asset.Name;
179 if (asset.Name.Length > 64) 179 if (asset.Name.Length > 64)
180 { 180 {
181 assetName = asset.Name.Substring(0, 64); 181 assetName = asset.Name.Substring(0, 64);
@@ -223,7 +223,7 @@ namespace OpenSim.Data.MSSQL
223 local = @local, temporary = @temporary, data = @data 223 local = @local, temporary = @temporary, data = @data
224 WHERE id = @keyId;"; 224 WHERE id = @keyId;";
225 225
226 string assetName = asset.Name; 226 string assetName = asset.Name;
227 if (asset.Name.Length > 64) 227 if (asset.Name.Length > 64)
228 { 228 {
229 assetName = asset.Name.Substring(0, 64); 229 assetName = asset.Name.Substring(0, 64);
diff --git a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
index 78fc22c..099faea 100644
--- a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
@@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL
135 135
136 insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm); 136 insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm);
137 insertBuilder.Append(String.Join("', '", fields)); 137 insertBuilder.Append(String.Join("', '", fields));
138 insertBuilder.Append("') values ( @principalID, @"); 138 insertBuilder.Append("') values (@principalID, @");
139 insertBuilder.Append(String.Join(", @", fields)); 139 insertBuilder.Append(String.Join(", @", fields));
140 insertBuilder.Append(")"); 140 insertBuilder.Append(")");
141 141
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index 27a4e70..1482184 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -428,7 +428,7 @@ namespace OpenSim.Data.MSSQL
428 @inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType, 428 @inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType,
429 @creationDate, @groupID, @groupOwned, @flags)"; 429 @creationDate, @groupID, @groupOwned, @flags)";
430 430
431 string itemName = item.Name; 431 string itemName = item.Name;
432 if (item.Name.Length > 64) 432 if (item.Name.Length > 64)
433 { 433 {
434 itemName = item.Name.Substring(0, 64); 434 itemName = item.Name.Substring(0, 64);
@@ -529,7 +529,7 @@ namespace OpenSim.Data.MSSQL
529 { 529 {
530 itemDesc = item.Description.Substring(0, 128); 530 itemDesc = item.Description.Substring(0, 128);
531 m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length.ToString() + " to " + itemDesc.Length.ToString() + " characters on update"); 531 m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length.ToString() + " to " + itemDesc.Length.ToString() + " characters on update");
532 } 532 }
533 533
534 using (AutoClosingSqlCommand command = database.Query(sql)) 534 using (AutoClosingSqlCommand command = database.Query(sql))
535 { 535 {
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index adedcce..e26a830 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MSSQL
146 sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID); 146 sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID);
147 147
148 sceneObjectPart.UUID = groupID; 148 sceneObjectPart.UUID = groupID;
149 } 149 }
150 150
151 grp = new SceneObjectGroup(sceneObjectPart); 151 grp = new SceneObjectGroup(sceneObjectPart);
152 } 152 }
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
index 1520888..38be9f4 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Data.MSSQL
52 conn.Open(); 52 conn.Open();
53 Migration m = new Migration(conn, GetType().Assembly, "UserStore"); 53 Migration m = new Migration(conn, GetType().Assembly, "UserStore");
54 m.Update(); 54 m.Update();
55 } 55 }
56 } 56 }
57 57
58 public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query) 58 public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query)
@@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL
152 StringBuilder insertBuilder = new StringBuilder(); 152 StringBuilder insertBuilder = new StringBuilder();
153 insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm); 153 insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm);
154 insertBuilder.Append(String.Join("', '", fields)); 154 insertBuilder.Append(String.Join("', '", fields));
155 insertBuilder.Append("') values ( @principalID, @scopeID, @"); 155 insertBuilder.Append("') values (@principalID, @scopeID, @");
156 insertBuilder.Append(String.Join(", @", fields)); 156 insertBuilder.Append(String.Join(", @", fields));
157 insertBuilder.Append(")"); 157 insertBuilder.Append(")");
158 158
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs
index 6efb89d..3ef1053 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs
@@ -1146,7 +1146,7 @@ ELSE
1146 if (reader.IsDBNull(reader.GetOrdinal("homeRegionID"))) 1146 if (reader.IsDBNull(reader.GetOrdinal("homeRegionID")))
1147 retval.HomeRegionID = UUID.Zero; 1147 retval.HomeRegionID = UUID.Zero;
1148 else 1148 else
1149 retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]); 1149 retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]);
1150 1150
1151 retval.Created = Convert.ToInt32(reader["created"].ToString()); 1151 retval.Created = Convert.ToInt32(reader["created"].ToString());
1152 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); 1152 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
@@ -1200,7 +1200,7 @@ ELSE
1200 if (reader.IsDBNull(reader.GetOrdinal("partner"))) 1200 if (reader.IsDBNull(reader.GetOrdinal("partner")))
1201 retval.Partner = UUID.Zero; 1201 retval.Partner = UUID.Zero;
1202 else 1202 else
1203 retval.Partner = new UUID((Guid)reader["partner"]); 1203 retval.Partner = new UUID((Guid)reader["partner"]);
1204 } 1204 }
1205 else 1205 else
1206 { 1206 {
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 66c34fe..0502b2b 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -204,7 +204,7 @@ namespace OpenSim.Data.MySQL
204 "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", 204 "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)",
205 _dbConnection.Connection); 205 _dbConnection.Connection);
206 206
207 string assetName = asset.Name; 207 string assetName = asset.Name;
208 if (asset.Name.Length > 64) 208 if (asset.Name.Length > 64)
209 { 209 {
210 assetName = asset.Name.Substring(0, 64); 210 assetName = asset.Name.Substring(0, 64);
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index afd59bd..e508b52 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL
127 { 127 {
128 string insert = "insert into `" + m_Realm + "` (`UUID`, `" + 128 string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
129 String.Join("`, `", fields) + 129 String.Join("`, `", fields) +
130 "`) values ( ?principalID, ?" + String.Join(", ?", fields) + ")"; 130 "`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
131 131
132 cmd.CommandText = insert; 132 cmd.CommandText = insert;
133 133
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 4521a0f..0eecf06 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -325,10 +325,10 @@ namespace OpenSim.Data.MySQL
325 UUID GroupID = UUID.Zero; 325 UUID GroupID = UUID.Zero;
326 UUID.TryParse((string)reader["avatarID"], out Owner); 326 UUID.TryParse((string)reader["avatarID"], out Owner);
327 UUID.TryParse((string)reader["groupID"], out GroupID); 327 UUID.TryParse((string)reader["groupID"], out GroupID);
328 item.Owner = Owner; 328 item.Owner = Owner;
329 item.GroupID = GroupID; 329 item.GroupID = GroupID;
330 330
331 // Rest of the parsing. If these UUID's fail, we're dead anyway 331 // Rest of the parsing. If these UUID's fail, we're dead anyway
332 item.ID = new UUID((string) reader["inventoryID"]); 332 item.ID = new UUID((string) reader["inventoryID"]);
333 item.AssetID = new UUID((string) reader["assetID"]); 333 item.AssetID = new UUID((string) reader["assetID"]);
334 item.AssetType = (int) reader["assetType"]; 334 item.AssetType = (int) reader["assetType"];
@@ -472,7 +472,7 @@ namespace OpenSim.Data.MySQL
472 + ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate" 472 + ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate"
473 + ", ?groupID, ?groupOwned, ?flags)"; 473 + ", ?groupID, ?groupOwned, ?flags)";
474 474
475 string itemName = item.Name; 475 string itemName = item.Name;
476 if (item.Name.Length > 64) 476 if (item.Name.Length > 64)
477 { 477 {
478 itemName = item.Name.Substring(0, 64); 478 itemName = item.Name.Substring(0, 64);
@@ -484,7 +484,7 @@ namespace OpenSim.Data.MySQL
484 { 484 {
485 itemDesc = item.Description.Substring(0, 128); 485 itemDesc = item.Description.Substring(0, 128);
486 m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length + " to " + itemDesc.Length + " characters on add item"); 486 m_log.Warn("[INVENTORY DB]: Description field truncated from " + item.Description.Length + " to " + itemDesc.Length + " characters on add item");
487 } 487 }
488 488
489 try 489 try
490 { 490 {
@@ -590,12 +590,12 @@ namespace OpenSim.Data.MySQL
590 "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES "; 590 "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES ";
591 sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)"; 591 sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)";
592 592
593 string folderName = folder.Name; 593 string folderName = folder.Name;
594 if (folderName.Length > 64) 594 if (folderName.Length > 64)
595 { 595 {
596 folderName = folderName.Substring(0, 64); 596 folderName = folderName.Substring(0, 64);
597 m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder"); 597 m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder");
598 } 598 }
599 599
600 database.CheckConnection(); 600 database.CheckConnection();
601 601
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 4a16a70..c2dd788 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -464,7 +464,7 @@ namespace OpenSim.Data.MySQL
464 prim.Name, prim.UUID, prim.GroupPosition, groupID); 464 prim.Name, prim.UUID, prim.GroupPosition, groupID);
465 465
466 prim.UUID = groupID; 466 prim.UUID = groupID;
467 } 467 }
468 468
469 grp = new SceneObjectGroup(prim); 469 grp = new SceneObjectGroup(prim);
470 } 470 }
@@ -533,7 +533,7 @@ namespace OpenSim.Data.MySQL
533 /// <summary> 533 /// <summary>
534 /// Load in a prim's persisted inventory. 534 /// Load in a prim's persisted inventory.
535 /// </summary> 535 /// </summary>
536 /// <param name="prim">The prim</param> 536 /// <param name="prim">The prim</param>
537 private void LoadItems(SceneObjectPart prim) 537 private void LoadItems(SceneObjectPart prim)
538 { 538 {
539 lock (m_Connection) 539 lock (m_Connection)
@@ -773,7 +773,7 @@ namespace OpenSim.Data.MySQL
773 "use_estate_sun, fixed_sun, sun_position, " + 773 "use_estate_sun, fixed_sun, sun_position, " +
774 "covenant, Sandbox, sunvectorx, sunvectory, " + 774 "covenant, Sandbox, sunvectorx, sunvectory, " +
775 "sunvectorz, loaded_creation_datetime, " + 775 "sunvectorz, loaded_creation_datetime, " +
776 "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + 776 "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " +
777 "?BlockFly, ?AllowDamage, ?RestrictPushing, " + 777 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
778 "?AllowLandResell, ?AllowLandJoinDivide, " + 778 "?AllowLandResell, ?AllowLandJoinDivide, " +
779 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + 779 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index ced26a4..06ef624 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL
39 { 39 {
40 private string m_Realm; 40 private string m_Realm;
41 private List<string> m_ColumnNames = null; 41 private List<string> m_ColumnNames = null;
42 private int m_LastExpire = 0; 42// private int m_LastExpire = 0;
43 43
44 public MySqlRegionData(string connectionString, string realm) 44 public MySqlRegionData(string connectionString, string realm)
45 : base(connectionString) 45 : base(connectionString)
@@ -77,7 +77,7 @@ namespace OpenSim.Data.MySQL
77 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 77 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
78 78
79 List<RegionData> ret = RunCommand(cmd); 79 List<RegionData> ret = RunCommand(cmd);
80 if (ret == null) 80 if (ret.Count == 0)
81 return null; 81 return null;
82 82
83 return ret[0]; 83 return ret[0];
@@ -95,7 +95,7 @@ namespace OpenSim.Data.MySQL
95 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 95 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
96 96
97 List<RegionData> ret = RunCommand(cmd); 97 List<RegionData> ret = RunCommand(cmd);
98 if (ret == null) 98 if (ret.Count == 0)
99 return null; 99 return null;
100 100
101 return ret[0]; 101 return ret[0];
@@ -138,6 +138,8 @@ namespace OpenSim.Data.MySQL
138 ret.RegionName = result["regionName"].ToString(); 138 ret.RegionName = result["regionName"].ToString();
139 ret.posX = Convert.ToInt32(result["locX"]); 139 ret.posX = Convert.ToInt32(result["locX"]);
140 ret.posY = Convert.ToInt32(result["locY"]); 140 ret.posY = Convert.ToInt32(result["locY"]);
141 ret.sizeX = Convert.ToInt32(result["sizeX"]);
142 ret.sizeY = Convert.ToInt32(result["sizeY"]);
141 143
142 if (m_ColumnNames == null) 144 if (m_ColumnNames == null)
143 { 145 {
@@ -170,10 +172,7 @@ namespace OpenSim.Data.MySQL
170 result.Close(); 172 result.Close();
171 CloseReaderCommand(cmd); 173 CloseReaderCommand(cmd);
172 174
173 if (retList.Count > 0) 175 return retList;
174 return retList;
175
176 return null;
177 } 176 }
178 177
179 public bool Store(RegionData data) 178 public bool Store(RegionData data)
@@ -188,21 +187,25 @@ namespace OpenSim.Data.MySQL
188 data.Data.Remove("posX"); 187 data.Data.Remove("posX");
189 if (data.Data.ContainsKey("posY")) 188 if (data.Data.ContainsKey("posY"))
190 data.Data.Remove("posY"); 189 data.Data.Remove("posY");
190 if (data.Data.ContainsKey("sizeX"))
191 data.Data.Remove("sizeX");
192 if (data.Data.ContainsKey("sizeY"))
193 data.Data.Remove("sizeY");
194 if (data.Data.ContainsKey("locX"))
195 data.Data.Remove("locX");
196 if (data.Data.ContainsKey("locY"))
197 data.Data.Remove("locY");
191 198
192 string[] fields = new List<string>(data.Data.Keys).ToArray(); 199 string[] fields = new List<string>(data.Data.Keys).ToArray();
193 200
194 MySqlCommand cmd = new MySqlCommand(); 201 MySqlCommand cmd = new MySqlCommand();
195 202
196 string update = "update `"+m_Realm+"` set "; 203 string update = "update `"+m_Realm+"` set locX=?posX, locY=?posY, sizeX=?sizeX, sizeY=?sizeY";
197 bool first = true;
198 foreach (string field in fields) 204 foreach (string field in fields)
199 { 205 {
200 if (!first) 206 update += ", ";
201 update += ", ";
202 update += "`" + field + "` = ?"+field; 207 update += "`" + field + "` = ?"+field;
203 208
204 first = false;
205
206 cmd.Parameters.AddWithValue("?"+field, data.Data[field]); 209 cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
207 } 210 }
208 211
@@ -213,13 +216,18 @@ namespace OpenSim.Data.MySQL
213 216
214 cmd.CommandText = update; 217 cmd.CommandText = update;
215 cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString()); 218 cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString());
219 cmd.Parameters.AddWithValue("?regionName", data.RegionName);
216 cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); 220 cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString());
221 cmd.Parameters.AddWithValue("?posX", data.posX.ToString());
222 cmd.Parameters.AddWithValue("?posY", data.posY.ToString());
223 cmd.Parameters.AddWithValue("?sizeX", data.sizeX.ToString());
224 cmd.Parameters.AddWithValue("?sizeY", data.sizeY.ToString());
217 225
218 if (ExecuteNonQuery(cmd) < 1) 226 if (ExecuteNonQuery(cmd) < 1)
219 { 227 {
220 string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `" + 228 string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `locX`, `locY`, `sizeX`, `sizeY`, `regionName`, `" +
221 String.Join("`, `", fields) + 229 String.Join("`, `", fields) +
222 "`) values ( ?regionID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; 230 "`) values ( ?regionID, ?scopeID, ?posX, ?posY, ?sizeX, ?sizeY, ?regionName, ?" + String.Join(", ?", fields) + ")";
223 231
224 cmd.CommandText = insert; 232 cmd.CommandText = insert;
225 233
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index 39d60ca..d48144d 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL
39 { 39 {
40 private string m_Realm; 40 private string m_Realm;
41 private List<string> m_ColumnNames = null; 41 private List<string> m_ColumnNames = null;
42 private int m_LastExpire = 0; 42// private int m_LastExpire = 0;
43 43
44 public MySqlUserAccountData(string connectionString, string realm) 44 public MySqlUserAccountData(string connectionString, string realm)
45 : base(connectionString) 45 : base(connectionString)
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL
146 { 146 {
147 string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + 147 string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" +
148 String.Join("`, `", fields) + 148 String.Join("`, `", fields) +
149 "`) values ( ?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; 149 "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")";
150 150
151 cmd.CommandText = insert; 151 cmd.CommandText = insert;
152 152
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 537ef6c..04f872f 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -632,7 +632,7 @@ namespace OpenSim.Data.MySQL
632 UUID zero = UUID.Zero; 632 UUID zero = UUID.Zero;
633 if (user.ID == zero) 633 if (user.ID == zero)
634 { 634 {
635 return; 635 return;
636 } 636 }
637 MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile"); 637 MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile");
638 638
@@ -666,7 +666,7 @@ namespace OpenSim.Data.MySQL
666 { 666 {
667 UUID zero = UUID.Zero; 667 UUID zero = UUID.Zero;
668 if (agent.ProfileID == zero || agent.SessionID == zero) 668 if (agent.ProfileID == zero || agent.SessionID == zero)
669 return; 669 return;
670 670
671 MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent"); 671 MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent");
672 try 672 try
diff --git a/OpenSim/Data/MySQL/Resources/004_GridStore.sql b/OpenSim/Data/MySQL/Resources/004_GridStore.sql
new file mode 100644
index 0000000..2238a88
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/004_GridStore.sql
@@ -0,0 +1,6 @@
1BEGIN;
2
3ALTER TABLE regions add column sizeX integer not null default 0;
4ALTER TABLE regions add column sizeY integer not null default 0;
5
6COMMIT;
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs
index 7c5cf33..2e7081e 100644
--- a/OpenSim/Data/NHibernate/NHibernateManager.cs
+++ b/OpenSim/Data/NHibernate/NHibernateManager.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Data.NHibernate
155 m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id); 155 m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id);
156 } 156 }
157 return obj; 157 return obj;
158 } 158 }
159 } 159 }
160 160
161 /// <summary> 161 /// <summary>
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs
index 73b630f..1b0c4c9 100644
--- a/OpenSim/Data/NHibernate/NHibernateUserData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Data.NHibernate
86 m_log.InfoFormat("[NHIBERNATE] GetUserByUUID: {0} ", uuid); 86 m_log.InfoFormat("[NHIBERNATE] GetUserByUUID: {0} ", uuid);
87 87
88 user = (UserProfileData)manager.Get(typeof(UserProfileData), uuid); 88 user = (UserProfileData)manager.Get(typeof(UserProfileData), uuid);
89 if (user != null) 89 if (user != null)
90 { 90 {
91 UserAgentData agent = GetAgentByUUID(uuid); 91 UserAgentData agent = GetAgentByUUID(uuid);
92 if (agent != null) 92 if (agent != null)
@@ -245,7 +245,7 @@ namespace OpenSim.Data.NHibernate
245 UserProfileData user=GetUserByUUID(agentID); 245 UserProfileData user=GetUserByUUID(agentID);
246 user.WebLoginKey = webLoginKey; 246 user.WebLoginKey = webLoginKey;
247 UpdateUserProfile(user); 247 UpdateUserProfile(user);
248 return; 248 return;
249 } 249 }
250 250
251 public override void AddNewUserFriend(UUID ownerId, UUID friendId, uint perms) 251 public override void AddNewUserFriend(UUID ownerId, UUID friendId, uint perms)
@@ -258,7 +258,7 @@ namespace OpenSim.Data.NHibernate
258 { 258 {
259 manager.Insert(new UserFriend(UUID.Random(), friendId, ownerId, perms)); 259 manager.Insert(new UserFriend(UUID.Random(), friendId, ownerId, perms));
260 } 260 }
261 return; 261 return;
262 } 262 }
263 263
264 private bool FriendRelationExists(UUID ownerId, UUID friendId) 264 private bool FriendRelationExists(UUID ownerId, UUID friendId)
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index 588b8ac..e8263ea 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -40,13 +40,14 @@ namespace OpenSim.Data.Null
40 40
41 public NullRegionData(string connectionString, string realm) 41 public NullRegionData(string connectionString, string realm)
42 { 42 {
43 //Console.WriteLine("[XXX] NullRegionData constructor");
43 } 44 }
44 45
45 public List<RegionData> Get(string regionName, UUID scopeID) 46 public List<RegionData> Get(string regionName, UUID scopeID)
46 { 47 {
47 List<RegionData> ret = new List<RegionData>(); 48 List<RegionData> ret = new List<RegionData>();
48 49
49 foreach(RegionData r in m_regionData.Values) 50 foreach (RegionData r in m_regionData.Values)
50 { 51 {
51 if (regionName.Contains("%")) 52 if (regionName.Contains("%"))
52 { 53 {
@@ -70,7 +71,7 @@ namespace OpenSim.Data.Null
70 { 71 {
71 List<RegionData> ret = new List<RegionData>(); 72 List<RegionData> ret = new List<RegionData>();
72 73
73 foreach(RegionData r in m_regionData.Values) 74 foreach (RegionData r in m_regionData.Values)
74 { 75 {
75 if (r.posX == posX && r.posY == posY) 76 if (r.posX == posX && r.posY == posY)
76 ret.Add(r); 77 ret.Add(r);
@@ -94,16 +95,13 @@ namespace OpenSim.Data.Null
94 { 95 {
95 List<RegionData> ret = new List<RegionData>(); 96 List<RegionData> ret = new List<RegionData>();
96 97
97 foreach(RegionData r in m_regionData.Values) 98 foreach (RegionData r in m_regionData.Values)
98 { 99 {
99 if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) 100 if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY)
100 ret.Add(r); 101 ret.Add(r);
101 } 102 }
102 103
103 if (ret.Count > 0) 104 return ret;
104 return ret;
105
106 return null;
107 } 105 }
108 106
109 public bool Store(RegionData data) 107 public bool Store(RegionData data)
diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs
index 1d96631..86d7f6b 100644
--- a/OpenSim/Data/RegionProfileData.cs
+++ b/OpenSim/Data/RegionProfileData.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Data
137 public uint maturity; 137 public uint maturity;
138 138
139 139
140 //Data Wrappers 140 //Data Wrappers
141 public string RegionName 141 public string RegionName
142 { 142 {
143 get { return regionName; } 143 get { return regionName; }
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 3831467..49275cb 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Data.SQLite
124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); 124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
125 if (ExistsAsset(asset.FullID)) 125 if (ExistsAsset(asset.FullID))
126 { 126 {
127 LogAssetLoad(asset); 127 //LogAssetLoad(asset);
128 128
129 lock (this) 129 lock (this)
130 { 130 {
@@ -173,7 +173,7 @@ namespace OpenSim.Data.SQLite
173 173
174 int assetLength = (asset.Data != null) ? asset.Data.Length : 0; 174 int assetLength = (asset.Data != null) ? asset.Data.Length : 0;
175 175
176 m_log.Info("[ASSET DB]: " + 176 m_log.Debug("[ASSET DB]: " +
177 string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)", 177 string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)",
178 asset.FullID, asset.Name, asset.Description, asset.Type, 178 asset.FullID, asset.Name, asset.Description, asset.Type,
179 temporary, local, assetLength)); 179 temporary, local, assetLength));
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index ea076fe..d22a3ec 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -496,7 +496,7 @@ namespace OpenSim.Data.SQLite
496 { 496 {
497 //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); 497 //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
498 498
499 DataTable dbItems = ds.Tables["primitems"]; 499 DataTable dbItems = ds.Tables["primitems"];
500 String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); 500 String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
501 DataRow[] dbItemRows = dbItems.Select(sql); 501 DataRow[] dbItemRows = dbItems.Select(sql);
502 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); 502 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs
index c66ab7c..97990e1 100644
--- a/OpenSim/Data/Tests/BasicRegionTest.cs
+++ b/OpenSim/Data/Tests/BasicRegionTest.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests
60 public UUID item2; 60 public UUID item2;
61 public UUID item3; 61 public UUID item3;
62 62
63 public static Random random; 63 public static Random random;
64 64
65 public string itemname1 = "item1"; 65 public string itemname1 = "item1";
66 66
@@ -173,7 +173,7 @@ namespace OpenSim.Data.Tests
173 UUID tmp0 = UUID.Random(); 173 UUID tmp0 = UUID.Random();
174 UUID tmp1 = UUID.Random(); 174 UUID tmp1 = UUID.Random();
175 UUID tmp2 = UUID.Random(); 175 UUID tmp2 = UUID.Random();
176 UUID tmp3 = UUID.Random(); 176 UUID tmp3 = UUID.Random();
177 UUID newregion = UUID.Random(); 177 UUID newregion = UUID.Random();
178 SceneObjectPart p1 = NewSOP("SoP 1",tmp1); 178 SceneObjectPart p1 = NewSOP("SoP 1",tmp1);
179 SceneObjectPart p2 = NewSOP("SoP 2",tmp2); 179 SceneObjectPart p2 = NewSOP("SoP 2",tmp2);
@@ -224,7 +224,7 @@ namespace OpenSim.Data.Tests
224 random.NextBytes(partsys); 224 random.NextBytes(partsys);
225 DateTime expires = new DateTime(2008, 12, 20); 225 DateTime expires = new DateTime(2008, 12, 20);
226 DateTime rezzed = new DateTime(2009, 07, 15); 226 DateTime rezzed = new DateTime(2009, 07, 15);
227 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); 227 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
228 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); 228 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
229 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); 229 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
230 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); 230 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
@@ -261,7 +261,7 @@ namespace OpenSim.Data.Tests
261 sop.Shape = pbshap; 261 sop.Shape = pbshap;
262 sop.GroupPosition = groupos; 262 sop.GroupPosition = groupos;
263 sop.RotationOffset = rotoff; 263 sop.RotationOffset = rotoff;
264 sop.CreatorID = creator; 264 sop.CreatorID = creator;
265 sop.InventorySerial = iserial; 265 sop.InventorySerial = iserial;
266 sop.TaskInventory = dic; 266 sop.TaskInventory = dic;
267 sop.ObjectFlags = objf; 267 sop.ObjectFlags = objf;
@@ -306,7 +306,7 @@ namespace OpenSim.Data.Tests
306 Assert.That(expires,Is.EqualTo(sop.Expires), "Assert.That(expires,Is.EqualTo(sop.Expires))"); 306 Assert.That(expires,Is.EqualTo(sop.Expires), "Assert.That(expires,Is.EqualTo(sop.Expires))");
307 Assert.That(rezzed,Is.EqualTo(sop.Rezzed), "Assert.That(rezzed,Is.EqualTo(sop.Rezzed))"); 307 Assert.That(rezzed,Is.EqualTo(sop.Rezzed), "Assert.That(rezzed,Is.EqualTo(sop.Rezzed))");
308 Assert.That(offset,Is.EqualTo(sop.OffsetPosition), "Assert.That(offset,Is.EqualTo(sop.OffsetPosition))"); 308 Assert.That(offset,Is.EqualTo(sop.OffsetPosition), "Assert.That(offset,Is.EqualTo(sop.OffsetPosition))");
309 Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))"); 309 Assert.That(velocity,Is.EqualTo(sop.Velocity), "Assert.That(velocity,Is.EqualTo(sop.Velocity))");
310 Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity), "Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity))"); 310 Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity), "Assert.That(angvelo,Is.EqualTo(sop.AngularVelocity))");
311 Assert.That(accel,Is.EqualTo(sop.Acceleration), "Assert.That(accel,Is.EqualTo(sop.Acceleration))"); 311 Assert.That(accel,Is.EqualTo(sop.Acceleration), "Assert.That(accel,Is.EqualTo(sop.Acceleration))");
312 Assert.That(description,Is.EqualTo(sop.Description), "Assert.That(description,Is.EqualTo(sop.Description))"); 312 Assert.That(description,Is.EqualTo(sop.Description), "Assert.That(description,Is.EqualTo(sop.Description))");
@@ -319,7 +319,7 @@ namespace OpenSim.Data.Tests
319 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); 319 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))");
320 Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); 320 Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))");
321 321
322 // This is necessary or object will not be inserted in DB 322 // This is necessary or object will not be inserted in DB
323 sop.ObjectFlags = 0; 323 sop.ObjectFlags = 0;
324 324
325 SceneObjectGroup sog = new SceneObjectGroup(sop); 325 SceneObjectGroup sog = new SceneObjectGroup(sop);
@@ -332,11 +332,11 @@ namespace OpenSim.Data.Tests
332 // Makes sure there are no double insertions: 332 // Makes sure there are no double insertions:
333 db.StoreObject(sog,region3); 333 db.StoreObject(sog,region3);
334 sogs = db.LoadObjects(region3); 334 sogs = db.LoadObjects(region3);
335 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); 335 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
336 336
337 337
338 // Tests if the parameters were inserted correctly 338 // Tests if the parameters were inserted correctly
339 SceneObjectPart p = sogs[0].RootPart; 339 SceneObjectPart p = sogs[0].RootPart;
340 Assert.That(regionh,Is.EqualTo(p.RegionHandle), "Assert.That(regionh,Is.EqualTo(p.RegionHandle))"); 340 Assert.That(regionh,Is.EqualTo(p.RegionHandle), "Assert.That(regionh,Is.EqualTo(p.RegionHandle))");
341 //Assert.That(localid,Is.EqualTo(p.LocalId), "Assert.That(localid,Is.EqualTo(p.LocalId))"); 341 //Assert.That(localid,Is.EqualTo(p.LocalId), "Assert.That(localid,Is.EqualTo(p.LocalId))");
342 Assert.That(groupos,Is.EqualTo(p.GroupPosition), "Assert.That(groupos,Is.EqualTo(p.GroupPosition))"); 342 Assert.That(groupos,Is.EqualTo(p.GroupPosition), "Assert.That(groupos,Is.EqualTo(p.GroupPosition))");
@@ -402,7 +402,7 @@ namespace OpenSim.Data.Tests
402 random.NextBytes(partsys); 402 random.NextBytes(partsys);
403 DateTime expires = new DateTime(2010, 12, 20); 403 DateTime expires = new DateTime(2010, 12, 20);
404 DateTime rezzed = new DateTime(2005, 07, 15); 404 DateTime rezzed = new DateTime(2005, 07, 15);
405 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); 405 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
406 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); 406 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
407 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); 407 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
408 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); 408 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
@@ -418,7 +418,7 @@ namespace OpenSim.Data.Tests
418 PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); 418 PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
419 pbshap = PrimitiveBaseShape.Default; 419 pbshap = PrimitiveBaseShape.Default;
420 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); 420 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
421 byte updatef = (byte) random.Next(127); 421 byte updatef = (byte) random.Next(127);
422 422
423 // Updates the region with new values 423 // Updates the region with new values
424 SceneObjectGroup sog2 = FindSOG("Adam West", region3); 424 SceneObjectGroup sog2 = FindSOG("Adam West", region3);
@@ -427,7 +427,7 @@ namespace OpenSim.Data.Tests
427 sog2.RootPart.Shape = pbshap; 427 sog2.RootPart.Shape = pbshap;
428 sog2.RootPart.GroupPosition = groupos; 428 sog2.RootPart.GroupPosition = groupos;
429 sog2.RootPart.RotationOffset = rotoff; 429 sog2.RootPart.RotationOffset = rotoff;
430 sog2.RootPart.CreatorID = creator; 430 sog2.RootPart.CreatorID = creator;
431 sog2.RootPart.TaskInventory = dic; 431 sog2.RootPart.TaskInventory = dic;
432 sog2.RootPart.Name = name; 432 sog2.RootPart.Name = name;
433 sog2.RootPart.Material = material; 433 sog2.RootPart.Material = material;
@@ -492,12 +492,12 @@ namespace OpenSim.Data.Tests
492 { 492 {
493 UUID tmp = UUID.Random(); 493 UUID tmp = UUID.Random();
494 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); 494 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp);
495 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next()); 495 Vector3 groupos = new Vector3(random.Next(),random.Next(),random.Next());
496 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next()); 496 Vector3 offset = new Vector3(random.Next(),random.Next(),random.Next());
497 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next()); 497 Quaternion rotoff = new Quaternion(random.Next(),random.Next(),random.Next(),random.Next());
498 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); 498 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
499 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); 499 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next());
500 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); 500 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next());
501 501
502 sop.GroupPosition = groupos; 502 sop.GroupPosition = groupos;
503 sop.RotationOffset = rotoff; 503 sop.RotationOffset = rotoff;
@@ -648,7 +648,7 @@ namespace OpenSim.Data.Tests
648 { 648 {
649 InventoryItemBase i = new InventoryItemBase(); 649 InventoryItemBase i = new InventoryItemBase();
650 UUID id = UUID.Random(); 650 UUID id = UUID.Random();
651 i.ID = id; 651 i.ID = id;
652 UUID folder = UUID.Random(); 652 UUID folder = UUID.Random();
653 i.Folder = folder; 653 i.Folder = folder;
654 UUID owner = UUID.Random(); 654 UUID owner = UUID.Random();
@@ -666,13 +666,13 @@ namespace OpenSim.Data.Tests
666 i.NextPermissions = nextperm; 666 i.NextPermissions = nextperm;
667 uint curperm = (uint) random.Next(); 667 uint curperm = (uint) random.Next();
668 i.CurrentPermissions = curperm; 668 i.CurrentPermissions = curperm;
669 uint baseperm = (uint) random.Next(); 669 uint baseperm = (uint) random.Next();
670 i.BasePermissions = baseperm; 670 i.BasePermissions = baseperm;
671 uint eoperm = (uint) random.Next(); 671 uint eoperm = (uint) random.Next();
672 i.EveryOnePermissions = eoperm; 672 i.EveryOnePermissions = eoperm;
673 int assettype = random.Next(); 673 int assettype = random.Next();
674 i.AssetType = assettype; 674 i.AssetType = assettype;
675 UUID groupid = UUID.Random(); 675 UUID groupid = UUID.Random();
676 i.GroupID = groupid; 676 i.GroupID = groupid;
677 bool groupown = true; 677 bool groupown = true;
678 i.GroupOwned = groupown; 678 i.GroupOwned = groupown;
@@ -1010,7 +1010,7 @@ namespace OpenSim.Data.Tests
1010 1010
1011 private SceneObjectPart NewSOP(string name, UUID uuid) 1011 private SceneObjectPart NewSOP(string name, UUID uuid)
1012 { 1012 {
1013 SceneObjectPart sop = new SceneObjectPart(); 1013 SceneObjectPart sop = new SceneObjectPart();
1014 sop.Name = name; 1014 sop.Name = name;
1015 sop.Description = name; 1015 sop.Description = name;
1016 sop.Text = RandomName(); 1016 sop.Text = RandomName();
@@ -1042,12 +1042,12 @@ namespace OpenSim.Data.Tests
1042 int size = random.Next(5,12); 1042 int size = random.Next(5,12);
1043 char ch ; 1043 char ch ;
1044 for (int i=0; i<size; i++) 1044 for (int i=0; i<size; i++)
1045 { 1045 {
1046 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; 1046 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
1047 name.Append(ch); 1047 name.Append(ch);
1048 } 1048 }
1049 return name.ToString(); 1049 return name.ToString();
1050 } 1050 }
1051// private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name) 1051// private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name)
1052// { 1052// {
1053// InventoryFolderBase f = new InventoryFolderBase(); 1053// InventoryFolderBase f = new InventoryFolderBase();
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs
index f9feb9b..1f472a5 100644
--- a/OpenSim/Data/Tests/BasicUserTest.cs
+++ b/OpenSim/Data/Tests/BasicUserTest.cs
@@ -152,7 +152,7 @@ namespace OpenSim.Data.Tests
152 u1.FirstName = "Ugly"; 152 u1.FirstName = "Ugly";
153 153
154 db.UpdateUserProfile(u1); 154 db.UpdateUserProfile(u1);
155 Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))"); 155 Assert.That("Ugly",Is.EqualTo(u1.FirstName), "Assert.That(\"Ugly\",Is.EqualTo(u1.FirstName))");
156 } 156 }
157 157
158 [Test] 158 [Test]
@@ -174,7 +174,7 @@ namespace OpenSim.Data.Tests
174 db.AddNewUserProfile(u4); 174 db.AddNewUserProfile(u4);
175 Assert.That(db.GetUserByUUID(zero),Is.Null); 175 Assert.That(db.GetUserByUUID(zero),Is.Null);
176 Assert.That(db.GetUserByUUID(user4),Is.Null); 176 Assert.That(db.GetUserByUUID(user4),Is.Null);
177 } 177 }
178 178
179 [Test] 179 [Test]
180 public void T015_UserPersistency() 180 public void T015_UserPersistency()
@@ -218,7 +218,7 @@ namespace OpenSim.Data.Tests
218 218
219 //HomeRegionX and HomeRegionY must only use 24 bits 219 //HomeRegionX and HomeRegionY must only use 24 bits
220 homeregx = ((homeregx << 8) >> 8); 220 homeregx = ((homeregx << 8) >> 8);
221 homeregy = ((homeregy << 8) >> 8); 221 homeregy = ((homeregy << 8) >> 8);
222 222
223 u.ID = id; 223 u.ID = id;
224 u.WebLoginKey = webloginkey; 224 u.WebLoginKey = webloginkey;
@@ -299,7 +299,7 @@ namespace OpenSim.Data.Tests
299 uint homeregx = (uint) random.Next(); 299 uint homeregx = (uint) random.Next();
300 uint homeregy = (uint) random.Next(); 300 uint homeregy = (uint) random.Next();
301 Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); 301 Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5));
302 Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); 302 Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5));
303 int created = random.Next(); 303 int created = random.Next();
304 int lastlogin = random.Next(); 304 int lastlogin = random.Next();
305 string userinvuri = RandomName(); 305 string userinvuri = RandomName();
@@ -359,7 +359,7 @@ namespace OpenSim.Data.Tests
359 Assert.That(email,Is.EqualTo(u1a.Email), "Assert.That(email,Is.EqualTo(u1a.Email))"); 359 Assert.That(email,Is.EqualTo(u1a.Email), "Assert.That(email,Is.EqualTo(u1a.Email))");
360 Assert.That(passhash,Is.EqualTo(u1a.PasswordHash), "Assert.That(passhash,Is.EqualTo(u1a.PasswordHash))"); 360 Assert.That(passhash,Is.EqualTo(u1a.PasswordHash), "Assert.That(passhash,Is.EqualTo(u1a.PasswordHash))");
361 Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt), "Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt))"); 361 Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt), "Assert.That(passsalt,Is.EqualTo(u1a.PasswordSalt))");
362 Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); 362 Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))");
363 Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX), "Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX))"); 363 Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX), "Assert.That(homeregx,Is.EqualTo(u1a.HomeRegionX))");
364 Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY), "Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY))"); 364 Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY), "Assert.That(homeregy,Is.EqualTo(u1a.HomeRegionY))");
365 Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))"); 365 Assert.That(homereg,Is.EqualTo(u1a.HomeRegion), "Assert.That(homereg,Is.EqualTo(u1a.HomeRegion))");
@@ -426,7 +426,7 @@ namespace OpenSim.Data.Tests
426 UserAgentData a2 = db.GetAgentByName(fname2,lname2); 426 UserAgentData a2 = db.GetAgentByName(fname2,lname2);
427 UserAgentData a3 = db.GetAgentByName(name3); 427 UserAgentData a3 = db.GetAgentByName(name3);
428 Assert.That(user2,Is.EqualTo(a2.ProfileID), "Assert.That(user2,Is.EqualTo(a2.ProfileID))"); 428 Assert.That(user2,Is.EqualTo(a2.ProfileID), "Assert.That(user2,Is.EqualTo(a2.ProfileID))");
429 Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))"); 429 Assert.That(user3,Is.EqualTo(a3.ProfileID), "Assert.That(user3,Is.EqualTo(a3.ProfileID))");
430 } 430 }
431 431
432 [Test] 432 [Test]
@@ -501,11 +501,11 @@ namespace OpenSim.Data.Tests
501 db.AddNewUserFriend(user1,user3, 2); 501 db.AddNewUserFriend(user1,user3, 2);
502 db.AddNewUserFriend(user1,user2, 4); 502 db.AddNewUserFriend(user1,user2, 4);
503 List<FriendListItem> fl1 = db.GetUserFriendList(user1); 503 List<FriendListItem> fl1 = db.GetUserFriendList(user1);
504 Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))"); 504 Assert.That(fl1.Count,Is.EqualTo(2), "Assert.That(fl1.Count,Is.EqualTo(2))");
505 perms.Add(user2,1); 505 perms.Add(user2,1);
506 perms.Add(user3,2); 506 perms.Add(user3,2);
507 for (int i = 0; i < fl1.Count; i++) 507 for (int i = 0; i < fl1.Count; i++)
508 { 508 {
509 Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner), "Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner))"); 509 Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner), "Assert.That(user1,Is.EqualTo(fl1[i].FriendListOwner))");
510 friends.Add(fl1[i].Friend,1); 510 friends.Add(fl1[i].Friend,1);
511 temp = perms[fl1[i].Friend]; 511 temp = perms[fl1[i].Friend];
@@ -544,7 +544,7 @@ namespace OpenSim.Data.Tests
544 db.UpdateUserFriendPerms(user1, user3, 4); 544 db.UpdateUserFriendPerms(user1, user3, 4);
545 545
546 fl1 = db.GetUserFriendList(user1); 546 fl1 = db.GetUserFriendList(user1);
547 Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))"); 547 Assert.That(fl1[0].FriendPerms,Is.EqualTo(4), "Assert.That(fl1[0].FriendPerms,Is.EqualTo(4))");
548 } 548 }
549 549
550 [Test] 550 [Test]
@@ -560,7 +560,7 @@ namespace OpenSim.Data.Tests
560 [Test] 560 [Test]
561 public void T041_UserAppearancePersistency() 561 public void T041_UserAppearancePersistency()
562 { 562 {
563 AvatarAppearance appear = new AvatarAppearance(); 563 AvatarAppearance appear = new AvatarAppearance();
564 UUID owner = UUID.Random(); 564 UUID owner = UUID.Random();
565 int serial = random.Next(); 565 int serial = random.Next();
566 byte[] visualp = new byte[218]; 566 byte[] visualp = new byte[218];
@@ -698,7 +698,7 @@ namespace OpenSim.Data.Tests
698 int size = random.Next(5,12); 698 int size = random.Next(5,12);
699 char ch ; 699 char ch ;
700 for (int i=0; i<size; i++) 700 for (int i=0; i<size; i++)
701 { 701 {
702 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; 702 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
703 name.Append(ch); 703 name.Append(ch);
704 } 704 }
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs
index 84926f2..3d370da 100644
--- a/OpenSim/Data/UserDataBase.cs
+++ b/OpenSim/Data/UserDataBase.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Data
43 public abstract UserAgentData GetAgentByUUID(UUID user); 43 public abstract UserAgentData GetAgentByUUID(UUID user);
44 public abstract UserAgentData GetAgentByName(string name); 44 public abstract UserAgentData GetAgentByName(string name);
45 public abstract UserAgentData GetAgentByName(string fname, string lname); 45 public abstract UserAgentData GetAgentByName(string fname, string lname);
46 public UserProfileData GetUserByUri(Uri uri) { return null; } 46 public UserProfileData GetUserByUri(Uri uri) { return null; }
47 public abstract void StoreWebLoginKey(UUID agentID, UUID webLoginKey); 47 public abstract void StoreWebLoginKey(UUID agentID, UUID webLoginKey);
48 public abstract void AddNewUserProfile(UserProfileData user); 48 public abstract void AddNewUserProfile(UserProfileData user);
49 49
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 5071594..4a5253c 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Framework
59 59
60 // Body 60 // Body
61 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); 61 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
62 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); 62 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
63 63
64 // Skin 64 // Skin
65 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); 65 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index 46dbd3d..0334e4b 100644
--- a/OpenSim/Framework/Capabilities/CapsUtil.cs
+++ b/OpenSim/Framework/Capabilities/CapsUtil.cs
@@ -28,7 +28,7 @@
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Framework.Capabilities 30namespace OpenSim.Framework.Capabilities
31{ 31{
32 /// <summary> 32 /// <summary>
33 /// Capabilities utility methods 33 /// Capabilities utility methods
34 /// </summary> 34 /// </summary>
diff --git a/OpenSim/Framework/Client/IClientIM.cs b/OpenSim/Framework/Client/IClientIM.cs
index 81b1d9e..3df86d0 100644
--- a/OpenSim/Framework/Client/IClientIM.cs
+++ b/OpenSim/Framework/Client/IClientIM.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Client
57 // Porting Guide from old IM 57 // Porting Guide from old IM
58 // SendIM(...) 58 // SendIM(...)
59 // Loses FromAgentSession - this should be added by implementers manually. 59 // Loses FromAgentSession - this should be added by implementers manually.
60 // 60 //
61 61
62 public interface IClientIM 62 public interface IClientIM
63 { 63 {
diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs
index db532e0..094a3ff 100644
--- a/OpenSim/Framework/ClientManager.cs
+++ b/OpenSim/Framework/ClientManager.cs
@@ -177,9 +177,9 @@ namespace OpenSim.Framework
177 } 177 }
178 178
179 public void ViewerEffectHandler(IClientAPI sender, List<ViewerEffectEventHandlerArg> args) 179 public void ViewerEffectHandler(IClientAPI sender, List<ViewerEffectEventHandlerArg> args)
180 { 180 {
181 // TODO: don't create new blocks if recycling an old packet 181 // TODO: don't create new blocks if recycling an old packet
182 List<ViewerEffectPacket.EffectBlock> effectBlock = new List<ViewerEffectPacket.EffectBlock>(); 182 List<ViewerEffectPacket.EffectBlock> effectBlock = new List<ViewerEffectPacket.EffectBlock>();
183 for (int i = 0; i < args.Count; i++) 183 for (int i = 0; i < args.Count; i++)
184 { 184 {
185 ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock(); 185 ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock();
diff --git a/OpenSim/Framework/CnmMemoryCache.cs b/OpenSim/Framework/CnmMemoryCache.cs
index db91801..92af331 100644
--- a/OpenSim/Framework/CnmMemoryCache.cs
+++ b/OpenSim/Framework/CnmMemoryCache.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Framework
70 70
71 /// <summary> 71 /// <summary>
72 /// How many operations between time checks. 72 /// How many operations between time checks.
73 /// </summary> 73 /// </summary>
74 private const int DefaultOperationsBetweenTimeChecks = 40; 74 private const int DefaultOperationsBetweenTimeChecks = 40;
75 75
76 /// <summary> 76 /// <summary>
@@ -168,7 +168,7 @@ namespace OpenSim.Framework
168 private int m_version; 168 private int m_version;
169 169
170 /// <summary> 170 /// <summary>
171 /// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class. 171 /// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class.
172 /// </summary> 172 /// </summary>
173 public CnmMemoryCache() 173 public CnmMemoryCache()
174 : this(DefaultMaxSize) 174 : this(DefaultMaxSize)
@@ -277,7 +277,7 @@ namespace OpenSim.Framework
277 /// </param> 277 /// </param>
278 protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size) 278 protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size)
279 { 279 {
280 // Add to newest generation 280 // Add to newest generation
281 if (!m_newGeneration.Set(bucketIndex, key, value, size)) 281 if (!m_newGeneration.Set(bucketIndex, key, value, size))
282 { 282 {
283 // Failed to add new generation 283 // Failed to add new generation
@@ -311,7 +311,7 @@ namespace OpenSim.Framework
311 /// Bucket index is remainder when element key's hash value is divided by bucket count. 311 /// Bucket index is remainder when element key's hash value is divided by bucket count.
312 /// </para> 312 /// </para>
313 /// <para> 313 /// <para>
314 /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2. 314 /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2.
315 /// </para> 315 /// </para>
316 /// </remarks> 316 /// </remarks>
317 protected virtual int GetBucketIndex(TKey key) 317 protected virtual int GetBucketIndex(TKey key)
@@ -367,7 +367,7 @@ namespace OpenSim.Framework
367 /// </summary> 367 /// </summary>
368 private void RecycleGenerations() 368 private void RecycleGenerations()
369 { 369 {
370 // Rotate old generation to new generation, new generation to old generation 370 // Rotate old generation to new generation, new generation to old generation
371 IGeneration temp = m_newGeneration; 371 IGeneration temp = m_newGeneration;
372 m_newGeneration = m_oldGeneration; 372 m_newGeneration = m_oldGeneration;
373 m_newGeneration.Clear(); 373 m_newGeneration.Clear();
@@ -522,7 +522,7 @@ namespace OpenSim.Framework
522 /// <summary> 522 /// <summary>
523 /// Index of first element's in element chain. 523 /// Index of first element's in element chain.
524 /// </summary> 524 /// </summary>
525 /// <value> 525 /// <value>
526 /// -1 if there is no element in bucket; otherwise first element's index in the element chain. 526 /// -1 if there is no element in bucket; otherwise first element's index in the element chain.
527 /// </value> 527 /// </value>
528 /// <remarks> 528 /// <remarks>
@@ -692,7 +692,7 @@ namespace OpenSim.Framework
692 /// </summary> 692 /// </summary>
693 /// <value> 693 /// <value>
694 /// 0 if element is free; otherwise larger than 0. 694 /// 0 if element is free; otherwise larger than 0.
695 /// </value> 695 /// </value>
696 public long Size; 696 public long Size;
697 697
698 /// <summary> 698 /// <summary>
@@ -771,7 +771,7 @@ namespace OpenSim.Framework
771 /// </returns> 771 /// </returns>
772 /// <exception cref="InvalidOperationException"> 772 /// <exception cref="InvalidOperationException">
773 /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called. 773 /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called.
774 /// </exception> 774 /// </exception>
775 public KeyValuePair<TKey, TValue> Current 775 public KeyValuePair<TKey, TValue> Current
776 { 776 {
777 get 777 get
@@ -1405,10 +1405,10 @@ namespace OpenSim.Framework
1405 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 1405 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
1406 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 1406 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
1407 /// </para> 1407 /// </para>
1408 /// </remarks> 1408 /// </remarks>
1409 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> 1409 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
1410 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> 1410 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
1411 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 1411 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
1412 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 1412 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
1413 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> 1413 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
1414 public bool IsSizeLimited 1414 public bool IsSizeLimited
@@ -1438,7 +1438,7 @@ namespace OpenSim.Framework
1438 } 1438 }
1439 1439
1440 /// <summary> 1440 /// <summary>
1441 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time. 1441 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
1442 /// </summary> 1442 /// </summary>
1443 /// <value> 1443 /// <value>
1444 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements; 1444 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@@ -1449,7 +1449,7 @@ namespace OpenSim.Framework
1449 /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from 1449 /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from
1450 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may 1450 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
1451 /// stay longer in cache. 1451 /// stay longer in cache.
1452 /// </remarks> 1452 /// </remarks>
1453 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> 1453 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
1454 /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/> 1454 /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/>
1455 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 1455 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
@@ -1503,7 +1503,7 @@ namespace OpenSim.Framework
1503 /// <seealso cref="ICnmCache{TKey,TValue}.Set"/> 1503 /// <seealso cref="ICnmCache{TKey,TValue}.Set"/>
1504 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> 1504 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
1505 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> 1505 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
1506 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 1506 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
1507 public long MaxElementSize 1507 public long MaxElementSize
1508 { 1508 {
1509 get { return m_maxElementSize; } 1509 get { return m_maxElementSize; }
@@ -1517,7 +1517,7 @@ namespace OpenSim.Framework
1517 /// <value> 1517 /// <value>
1518 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>. 1518 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
1519 /// </value> 1519 /// </value>
1520 /// <remarks> 1520 /// <remarks>
1521 /// <para> 1521 /// <para>
1522 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. 1522 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
1523 /// </para> 1523 /// </para>
@@ -1562,10 +1562,10 @@ namespace OpenSim.Framework
1562 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 1562 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
1563 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 1563 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
1564 /// </para> 1564 /// </para>
1565 /// </remarks> 1565 /// </remarks>
1566 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> 1566 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
1567 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> 1567 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
1568 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 1568 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
1569 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 1569 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
1570 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> 1570 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
1571 public long Size 1571 public long Size
@@ -1576,9 +1576,9 @@ namespace OpenSim.Framework
1576 /// <summary> 1576 /// <summary>
1577 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 1577 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
1578 /// </summary> 1578 /// </summary>
1579 /// <value> 1579 /// <value>
1580 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 1580 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
1581 /// </value> 1581 /// </value>
1582 /// <remarks> 1582 /// <remarks>
1583 /// <para> 1583 /// <para>
1584 /// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/> 1584 /// 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
1630 /// </para> 1630 /// </para>
1631 /// <para> 1631 /// <para>
1632 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements 1632 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
1633 /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache. 1633 /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
1634 /// </para> 1634 /// </para>
1635 /// </remarks> 1635 /// </remarks>
1636 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> 1636 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
@@ -1810,7 +1810,7 @@ namespace OpenSim.Framework
1810 /// </summary> 1810 /// </summary>
1811 /// <returns> 1811 /// <returns>
1812 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with 1812 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
1813 /// the specified key; otherwise, <see langword="false"/>. 1813 /// the specified key; otherwise, <see langword="false"/>.
1814 /// </returns> 1814 /// </returns>
1815 /// <param name="key"> 1815 /// <param name="key">
1816 /// The key whose <paramref name="value"/> to get. 1816 /// The key whose <paramref name="value"/> to get.
diff --git a/OpenSim/Framework/CnmSynchronizedCache.cs b/OpenSim/Framework/CnmSynchronizedCache.cs
index c09900e..2bafbe9 100644
--- a/OpenSim/Framework/CnmSynchronizedCache.cs
+++ b/OpenSim/Framework/CnmSynchronizedCache.cs
@@ -142,7 +142,7 @@ namespace OpenSim.Framework
142 /// </returns> 142 /// </returns>
143 /// <exception cref="InvalidOperationException"> 143 /// <exception cref="InvalidOperationException">
144 /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called. 144 /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called.
145 /// </exception> 145 /// </exception>
146 public KeyValuePair<TKey, TValue> Current 146 public KeyValuePair<TKey, TValue> Current
147 { 147 {
148 get { return m_enumerator.Current; } 148 get { return m_enumerator.Current; }
@@ -327,10 +327,10 @@ namespace OpenSim.Framework
327 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 327 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
328 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 328 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
329 /// </para> 329 /// </para>
330 /// </remarks> 330 /// </remarks>
331 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> 331 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
332 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> 332 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
333 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 333 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
334 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 334 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
335 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> 335 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
336 public bool IsSizeLimited 336 public bool IsSizeLimited
@@ -366,7 +366,7 @@ namespace OpenSim.Framework
366 } 366 }
367 367
368 /// <summary> 368 /// <summary>
369 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time. 369 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
370 /// </summary> 370 /// </summary>
371 /// <value> 371 /// <value>
372 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements; 372 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@@ -377,7 +377,7 @@ namespace OpenSim.Framework
377 /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from 377 /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from
378 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may 378 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
379 /// stay longer in cache. 379 /// stay longer in cache.
380 /// </remarks> 380 /// </remarks>
381 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> 381 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
382 /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/> 382 /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/>
383 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 383 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
@@ -440,7 +440,7 @@ namespace OpenSim.Framework
440 /// <seealso cref="ICnmCache{TKey,TValue}.Set"/> 440 /// <seealso cref="ICnmCache{TKey,TValue}.Set"/>
441 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> 441 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
442 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> 442 /// <seealso cref="ICnmCache{TKey,TValue}.Size"/>
443 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 443 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
444 public long MaxElementSize 444 public long MaxElementSize
445 { 445 {
446 get 446 get
@@ -458,7 +458,7 @@ namespace OpenSim.Framework
458 /// <value> 458 /// <value>
459 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>. 459 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
460 /// </value> 460 /// </value>
461 /// <remarks> 461 /// <remarks>
462 /// <para> 462 /// <para>
463 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. 463 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
464 /// </para> 464 /// </para>
@@ -507,10 +507,10 @@ namespace OpenSim.Framework
507 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 507 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
508 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 508 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
509 /// </para> 509 /// </para>
510 /// </remarks> 510 /// </remarks>
511 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> 511 /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/>
512 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> 512 /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/>
513 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> 513 /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/>
514 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> 514 /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/>
515 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> 515 /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/>
516 public long Size 516 public long Size
@@ -527,9 +527,9 @@ namespace OpenSim.Framework
527 /// <summary> 527 /// <summary>
528 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 528 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
529 /// </summary> 529 /// </summary>
530 /// <value> 530 /// <value>
531 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 531 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
532 /// </value> 532 /// </value>
533 /// <remarks> 533 /// <remarks>
534 /// <para> 534 /// <para>
535 /// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/> 535 /// 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
584 /// </para> 584 /// </para>
585 /// <para> 585 /// <para>
586 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements 586 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
587 /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache. 587 /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache.
588 /// </para> 588 /// </para>
589 /// </remarks> 589 /// </remarks>
590 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> 590 /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/>
@@ -704,7 +704,7 @@ namespace OpenSim.Framework
704 /// </summary> 704 /// </summary>
705 /// <returns> 705 /// <returns>
706 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with 706 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
707 /// the specified key; otherwise, <see langword="false"/>. 707 /// the specified key; otherwise, <see langword="false"/>.
708 /// </returns> 708 /// </returns>
709 /// <param name="key"> 709 /// <param name="key">
710 /// The key whose <paramref name="value"/> to get. 710 /// The key whose <paramref name="value"/> to get.
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 238810a..aa71536 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Cache
55 /// Stores user profile and inventory data received from backend services for a particular user. 55 /// Stores user profile and inventory data received from backend services for a particular user.
56 /// </summary> 56 /// </summary>
57 public class CachedUserInfo 57 public class CachedUserInfo
58 { 58 {
59 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 59 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
60 60
61 //// <value> 61 //// <value>
@@ -190,7 +190,7 @@ namespace OpenSim.Framework.Communications.Cache
190 resolvedFolders.Add(folder); 190 resolvedFolders.Add(folder);
191 resolvedFolderDictionary[folder.ID] = folder; 191 resolvedFolderDictionary[folder.ID] = folder;
192 parentFolder.AddChildFolder(folder); 192 parentFolder.AddChildFolder(folder);
193 } 193 }
194 } 194 }
195 } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) 195 } // foreach (folder in pendingCategorizationFolders[parentFolder.ID])
196 196
@@ -219,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache
219 /// <summary> 219 /// <summary>
220 /// Fetch inventory for this user. 220 /// Fetch inventory for this user.
221 /// </summary> 221 /// </summary>
222 /// This has to be executed as a separate step once user information is retreived. 222 /// This has to be executed as a separate step once user information is retreived.
223 /// This will occur synchronously if the inventory service is in the same process as this class, and 223 /// This will occur synchronously if the inventory service is in the same process as this class, and
224 /// asynchronously otherwise. 224 /// asynchronously otherwise.
225 public void FetchInventory() 225 public void FetchInventory()
@@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Cache
422 /// 422 ///
423 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE 423 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
424 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, 424 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
425 /// and needs to be changed. 425 /// and needs to be changed.
426 /// 426 ///
427 /// <param name="folderID"></param> 427 /// <param name="folderID"></param>
428 /// <param name="type"></param> 428 /// <param name="type"></param>
@@ -500,7 +500,7 @@ namespace OpenSim.Framework.Communications.Cache
500 InventoryFolderImpl oldParentFolder = RootFolder.FindFolder(folder.ParentID); 500 InventoryFolderImpl oldParentFolder = RootFolder.FindFolder(folder.ParentID);
501 501
502 if (oldParentFolder != null) 502 if (oldParentFolder != null)
503 { 503 {
504 oldParentFolder.RemoveChildFolder(folderID); 504 oldParentFolder.RemoveChildFolder(folderID);
505 parentFolder.AddChildFolder(folder); 505 parentFolder.AddChildFolder(folder);
506 } 506 }
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 7f1c7e9..9e12d948 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
60 /// User profiles indexed by name 60 /// User profiles indexed by name
61 /// </summary> 61 /// </summary>
62 private readonly Dictionary<string, CachedUserInfo> m_userProfilesByName 62 private readonly Dictionary<string, CachedUserInfo> m_userProfilesByName
63 = new Dictionary<string, CachedUserInfo>(); 63 = new Dictionary<string, CachedUserInfo>();
64 64
65 /// <summary> 65 /// <summary>
66 /// The root library folder. 66 /// The root library folder.
@@ -123,35 +123,35 @@ namespace OpenSim.Framework.Communications.Cache
123 /// <summary> 123 /// <summary>
124 /// Get details of the given user. 124 /// Get details of the given user.
125 /// </summary> 125 /// </summary>
126 /// If the user isn't in cache then the user is requested from the profile service. 126 /// If the user isn't in cache then the user is requested from the profile service.
127 /// <param name="userID"></param> 127 /// <param name="userID"></param>
128 /// <returns>null if no user details are found</returns> 128 /// <returns>null if no user details are found</returns>
129 public CachedUserInfo GetUserDetails(string fname, string lname) 129 public CachedUserInfo GetUserDetails(string fname, string lname)
130 { 130 {
131 lock (m_userProfilesByName) 131 lock (m_userProfilesByName)
132 { 132 {
133 CachedUserInfo userInfo; 133 CachedUserInfo userInfo;
134 134
135 if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) 135 if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo))
136 { 136 {
137 return userInfo; 137 return userInfo;
138 } 138 }
139 else 139 else
140 { 140 {
141 UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); 141 UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname);
142 142
143 if (userProfile != null) 143 if (userProfile != null)
144 return AddToCaches(userProfile); 144 return AddToCaches(userProfile);
145 else 145 else
146 return null; 146 return null;
147 } 147 }
148 } 148 }
149 } 149 }
150 150
151 /// <summary> 151 /// <summary>
152 /// Get details of the given user. 152 /// Get details of the given user.
153 /// </summary> 153 /// </summary>
154 /// If the user isn't in cache then the user is requested from the profile service. 154 /// If the user isn't in cache then the user is requested from the profile service.
155 /// <param name="userID"></param> 155 /// <param name="userID"></param>
156 /// <returns>null if no user details are found</returns> 156 /// <returns>null if no user details are found</returns>
157 public CachedUserInfo GetUserDetails(UUID userID) 157 public CachedUserInfo GetUserDetails(UUID userID)
@@ -185,20 +185,20 @@ namespace OpenSim.Framework.Communications.Cache
185 // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via 185 // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via
186 // returning a read only class from the cache). 186 // returning a read only class from the cache).
187// public bool StoreProfile(UserProfileData userProfile) 187// public bool StoreProfile(UserProfileData userProfile)
188// { 188// {
189// lock (m_userProfilesById) 189// lock (m_userProfilesById)
190// { 190// {
191// CachedUserInfo userInfo = GetUserDetails(userProfile.ID); 191// CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
192// 192//
193// if (userInfo != null) 193// if (userInfo != null)
194// { 194// {
195// userInfo.m_userProfile = userProfile; 195// userInfo.m_userProfile = userProfile;
196// m_commsManager.UserService.UpdateUserProfile(userProfile); 196// m_commsManager.UserService.UpdateUserProfile(userProfile);
197// 197//
198// return true; 198// return true;
199// } 199// }
200// } 200// }
201// 201//
202// return false; 202// return false;
203// } 203// }
204 204
@@ -220,7 +220,7 @@ namespace OpenSim.Framework.Communications.Cache
220 } 220 }
221 } 221 }
222 222
223 return createdUserInfo; 223 return createdUserInfo;
224 } 224 }
225 225
226 /// <summary> 226 /// <summary>
@@ -234,7 +234,7 @@ namespace OpenSim.Framework.Communications.Cache
234 { 234 {
235 if (m_userProfilesById.ContainsKey(userId)) 235 if (m_userProfilesById.ContainsKey(userId))
236 { 236 {
237 CachedUserInfo userInfo = m_userProfilesById[userId]; 237 CachedUserInfo userInfo = m_userProfilesById[userId];
238 m_userProfilesById.Remove(userId); 238 m_userProfilesById.Remove(userId);
239 239
240 lock (m_userProfilesByName) 240 lock (m_userProfilesByName)
@@ -244,7 +244,7 @@ namespace OpenSim.Framework.Communications.Cache
244 244
245 return true; 245 return true;
246 } 246 }
247 } 247 }
248 248
249 return false; 249 return false;
250 } 250 }
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs
index 73e2db0..3419ce2 100644
--- a/OpenSim/Framework/Communications/Clients/RegionClient.cs
+++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs
@@ -35,6 +35,8 @@ using System.Text;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
37 37
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39
38using log4net; 40using log4net;
39 41
40namespace OpenSim.Framework.Communications.Clients 42namespace OpenSim.Framework.Communications.Clients
@@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Clients
43 { 45 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 47
46 public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason) 48 public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, out string reason)
47 { 49 {
48 reason = String.Empty; 50 reason = String.Empty;
49 51
@@ -166,7 +168,7 @@ namespace OpenSim.Framework.Communications.Clients
166 168
167 } 169 }
168 170
169 public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData) 171 public bool DoChildAgentUpdateCall(GridRegion region, IAgentData cAgentData)
170 { 172 {
171 // Eventually, we want to use a caps url instead of the agentID 173 // Eventually, we want to use a caps url instead of the agentID
172 string uri = string.Empty; 174 string uri = string.Empty;
@@ -260,7 +262,7 @@ namespace OpenSim.Framework.Communications.Clients
260 return true; 262 return true;
261 } 263 }
262 264
263 public bool DoRetrieveRootAgentCall(RegionInfo region, UUID id, out IAgentData agent) 265 public bool DoRetrieveRootAgentCall(GridRegion region, UUID id, out IAgentData agent)
264 { 266 {
265 agent = null; 267 agent = null;
266 // Eventually, we want to use a caps url instead of the agentID 268 // Eventually, we want to use a caps url instead of the agentID
@@ -348,7 +350,7 @@ namespace OpenSim.Framework.Communications.Clients
348 } 350 }
349 351
350 352
351 public bool DoCloseAgentCall(RegionInfo region, UUID id) 353 public bool DoCloseAgentCall(GridRegion region, UUID id)
352 { 354 {
353 string uri = string.Empty; 355 string uri = string.Empty;
354 try 356 try
@@ -391,7 +393,7 @@ namespace OpenSim.Framework.Communications.Clients
391 return true; 393 return true;
392 } 394 }
393 395
394 public bool DoCreateObjectCall(RegionInfo region, ISceneObject sog, string sogXml2, bool allowScriptCrossing) 396 public bool DoCreateObjectCall(GridRegion region, ISceneObject sog, string sogXml2, bool allowScriptCrossing)
395 { 397 {
396 ulong regionHandle = GetRegionHandle(region.RegionHandle); 398 ulong regionHandle = GetRegionHandle(region.RegionHandle);
397 string uri 399 string uri
@@ -474,7 +476,7 @@ namespace OpenSim.Framework.Communications.Clients
474 476
475 } 477 }
476 478
477 public bool DoCreateObjectCall(RegionInfo region, UUID userID, UUID itemID) 479 public bool DoCreateObjectCall(GridRegion region, UUID userID, UUID itemID)
478 { 480 {
479 ulong regionHandle = GetRegionHandle(region.RegionHandle); 481 ulong regionHandle = GetRegionHandle(region.RegionHandle);
480 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/"; 482 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/";
@@ -646,7 +648,7 @@ namespace OpenSim.Framework.Communications.Clients
646 return false; 648 return false;
647 } 649 }
648 650
649 public virtual void SendUserInformation(RegionInfo regInfo, AgentCircuitData aCircuit) 651 public virtual void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit)
650 { 652 {
651 } 653 }
652 654
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index e9a6adb..2410f31 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -59,11 +59,6 @@ namespace OpenSim.Framework.Communications
59 } 59 }
60 protected IMessagingService m_messageService; 60 protected IMessagingService m_messageService;
61 61
62 public IGridServices GridService
63 {
64 get { return m_gridService; }
65 }
66 protected IGridServices m_gridService;
67 62
68 public UserProfileCacheService UserProfileCacheService 63 public UserProfileCacheService UserProfileCacheService
69 { 64 {
@@ -95,8 +90,8 @@ namespace OpenSim.Framework.Communications
95 public IUserAdminService UserAdminService 90 public IUserAdminService UserAdminService
96 { 91 {
97 get { return m_userAdminService; } 92 get { return m_userAdminService; }
98 } 93 }
99 protected IUserAdminService m_userAdminService; 94 protected IUserAdminService m_userAdminService;
100 95
101 /// <summary> 96 /// <summary>
102 /// Constructor 97 /// Constructor
diff --git a/OpenSim/Framework/Communications/IAvatarService.cs b/OpenSim/Framework/Communications/IAvatarService.cs
index 4afc58f..760aa62 100644
--- a/OpenSim/Framework/Communications/IAvatarService.cs
+++ b/OpenSim/Framework/Communications/IAvatarService.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications
42 /// Update avatar appearance information 42 /// Update avatar appearance information
43 /// </summary> 43 /// </summary>
44 /// <param name="user"></param> 44 /// <param name="user"></param>
45 /// <param name="appearance"></param> 45 /// <param name="appearance"></param>
46 void UpdateUserAppearance(UUID user, AvatarAppearance appearance); 46 void UpdateUserAppearance(UUID user, AvatarAppearance appearance);
47 } 47 }
48} 48}
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
deleted file mode 100644
index 6365919..0000000
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using OpenMetaverse;
30
31namespace OpenSim.Framework.Communications
32{
33 public interface IGridServices
34 {
35 string gdebugRegionName { get; set; }
36
37 /// <summary>
38 /// If true, then regions will accept logins from the user service. If false, then they will not.
39 /// </summary>
40 bool RegionLoginsEnabled { get; set; }
41
42 /// <summary>
43 /// Register a region with the grid service.
44 /// </summary>
45 /// <param name="regionInfos"> </param>
46 /// <returns></returns>
47 /// <exception cref="System.Exception">Thrown if region registration failed</exception>
48 RegionCommsListener RegisterRegion(RegionInfo regionInfos);
49
50 /// <summary>
51 /// Deregister a region with the grid service.
52 /// </summary>
53 /// <param name="regionInfo"></param>
54 /// <returns></returns>
55 /// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
56 bool DeregisterRegion(RegionInfo regionInfo);
57
58 /// <summary>
59 /// Get information about the regions neighbouring the given co-ordinates.
60 /// </summary>
61 /// <param name="x"></param>
62 /// <param name="y"></param>
63 /// <returns></returns>
64 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
65
66 RegionInfo RequestNeighbourInfo(ulong regionHandle);
67 RegionInfo RequestNeighbourInfo(UUID regionID);
68 RegionInfo RequestNeighbourInfo(string name);
69 RegionInfo RequestNeighbourInfo(string host, uint port);
70
71 RegionInfo RequestClosestRegion(string regionName);
72 Dictionary<string, string> GetGridSettings();
73 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
74 // not complete yet, only contains the fields needed for ParcelInfoReqeust
75 LandData RequestLandData(ulong regionHandle, uint x, uint y);
76
77 /// <summary>
78 /// Get information about regions starting with the provided name.
79 /// </summary>
80 /// <param name="name">
81 /// The name to match against.
82 /// </param>
83 /// <param name="maxNumber">
84 /// The maximum number of results to return.
85 /// </param>
86 /// <returns>
87 /// A list of <see cref="RegionInfo"/>s of regions with matching name. If the
88 /// grid-server couldn't be contacted or returned an error, return null.
89 /// </returns>
90 List<RegionInfo> RequestNamedRegions(string name, int maxNumber);
91 }
92}
diff --git a/OpenSim/Framework/Communications/IUserAdminService.cs b/OpenSim/Framework/Communications/IUserAdminService.cs
index 15b989d..423b49b 100644
--- a/OpenSim/Framework/Communications/IUserAdminService.cs
+++ b/OpenSim/Framework/Communications/IUserAdminService.cs
@@ -66,6 +66,6 @@ namespace OpenSim.Framework.Communications
66 /// <param name="lastName"></param> 66 /// <param name="lastName"></param>
67 /// <param name="newPassword"></param> 67 /// <param name="newPassword"></param>
68 /// <returns>true if the update was successful, false otherwise</returns> 68 /// <returns>true if the update was successful, false otherwise</returns>
69 bool ResetUserPassword(string firstName, string lastName, string newPassword); 69 bool ResetUserPassword(string firstName, string lastName, string newPassword);
70 } 70 }
71} 71}
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index 725225d..dfa059d 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -128,18 +128,30 @@ namespace OpenSim.Framework.Communications
128 /// 128 ///
129 /// <param name="friendlistowner">The agent for whom we're retreiving the friends Data.</param> 129 /// <param name="friendlistowner">The agent for whom we're retreiving the friends Data.</param>
130 /// <returns> 130 /// <returns>
131 /// A List of FriendListItems that contains info about the user's friends. 131 /// A List of FriendListItems that contains info about the user's friends.
132 /// Always returns a list even if the user has no friends 132 /// Always returns a list even if the user has no friends
133 /// </returns> 133 /// </returns>
134 List<FriendListItem> GetUserFriendList(UUID friendlistowner); 134 List<FriendListItem> GetUserFriendList(UUID friendlistowner);
135 135
136 // This probably shouldn't be here, it belongs to IAuthentication 136 // This probably shouldn't be here, it belongs to IAuthentication
137 // But since Scenes only have IUserService references, I'm placing it here for now. 137 // But since Scenes only have IUserService references, I'm placing it here for now.
138 bool VerifySession(UUID userID, UUID sessionID); 138 bool VerifySession(UUID userID, UUID sessionID);
139 139
140 /// <summary>
141 /// Authenticate a user by their password.
142 /// </summary>
143 ///
144 /// This is used by callers outside the login process that want to
145 /// verify a user who has given their password.
146 ///
147 /// This should probably also be in IAuthentication but is here for the same reasons as VerifySession() is
148 ///
149 /// <param name="userID"></param>
150 /// <param name="password"></param>
151 /// <returns></returns>
152 bool AuthenticateUserByPassword(UUID userID, string password);
140 153
141 // Temporary Hack until we move everything to the new service model 154 // Temporary Hack until we move everything to the new service model
142 void SetInventoryService(IInventoryService invService); 155 void SetInventoryService(IInventoryService invService);
143
144 } 156 }
145} 157}
diff --git a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
index 98d0e0f..e96c5e8 100644
--- a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
+++ b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Osp
47 47
48 public string Name { get { return "OspInventoryWrapperPlugin"; } } 48 public string Name { get { return "OspInventoryWrapperPlugin"; } }
49 public string Version { get { return "0.1"; } } 49 public string Version { get { return "0.1"; } }
50 public void Initialise() {} 50 public void Initialise() {}
51 public void Initialise(string connect) {} 51 public void Initialise(string connect) {}
52 public void Dispose() {} 52 public void Dispose() {}
53 53
@@ -80,9 +80,9 @@ namespace OpenSim.Framework.Communications.Osp
80 } 80 }
81 81
82 protected InventoryItemBase PostProcessItem(InventoryItemBase item) 82 protected InventoryItemBase PostProcessItem(InventoryItemBase item)
83 { 83 {
84 item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); 84 item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_commsManager);
85 return item; 85 return item;
86 } 86 }
87 87
88 public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); } 88 public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); }
diff --git a/OpenSim/Framework/Communications/Osp/OspResolver.cs b/OpenSim/Framework/Communications/Osp/OspResolver.cs
index e98317a..32f0efc 100644
--- a/OpenSim/Framework/Communications/Osp/OspResolver.cs
+++ b/OpenSim/Framework/Communications/Osp/OspResolver.cs
@@ -33,13 +33,13 @@ using OpenSim.Framework;
33using OpenSim.Framework.Communications.Cache; 33using OpenSim.Framework.Communications.Cache;
34 34
35namespace OpenSim.Framework.Communications.Osp 35namespace OpenSim.Framework.Communications.Osp
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for 38 /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for
39 /// identifying user profiles or supplying a simple name if no profile is available. 39 /// identifying user profiles or supplying a simple name if no profile is available.
40 /// </summary> 40 /// </summary>
41 public class OspResolver 41 public class OspResolver
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 public const string OSPA_PREFIX = "ospa:"; 45 public const string OSPA_PREFIX = "ospa:";
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Communications.Osp
73 { 73 {
74 return 74 return
75 OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName; 75 OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
76 } 76 }
77 77
78 /// <summary> 78 /// <summary>
79 /// Resolve an osp string into the most suitable internal OpenSim identifier. 79 /// Resolve an osp string into the most suitable internal OpenSim identifier.
@@ -89,13 +89,13 @@ namespace OpenSim.Framework.Communications.Osp
89 /// is returned. 89 /// is returned.
90 /// </returns> 90 /// </returns>
91 public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager) 91 public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager)
92 { 92 {
93 if (!ospa.StartsWith(OSPA_PREFIX)) 93 if (!ospa.StartsWith(OSPA_PREFIX))
94 return UUID.Zero; 94 return UUID.Zero;
95 95
96 m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa); 96 m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
97 97
98 string ospaMeat = ospa.Substring(OSPA_PREFIX.Length); 98 string ospaMeat = ospa.Substring(OSPA_PREFIX.Length);
99 string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY); 99 string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY);
100 100
101 foreach (string tuple in ospaTuples) 101 foreach (string tuple in ospaTuples)
@@ -162,7 +162,7 @@ namespace OpenSim.Framework.Communications.Osp
162 tempUserProfile.ID = HashName(tempUserProfile.Name); 162 tempUserProfile.ID = HashName(tempUserProfile.Name);
163 163
164 m_log.DebugFormat( 164 m_log.DebugFormat(
165 "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); 165 "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID);
166 commsManager.UserService.AddTemporaryUserProfile(tempUserProfile); 166 commsManager.UserService.AddTemporaryUserProfile(tempUserProfile);
167 167
168 return tempUserProfile.ID; 168 return tempUserProfile.ID;
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs
index bf59f8e..922cd49 100644
--- a/OpenSim/Framework/Communications/Services/LoginService.cs
+++ b/OpenSim/Framework/Communications/Services/LoginService.cs
@@ -1072,7 +1072,7 @@ namespace OpenSim.Framework.Communications.Services
1072 /// <param name="user"></param> 1072 /// <param name="user"></param>
1073 /// <param name="response"></param> 1073 /// <param name="response"></param>
1074 /// <param name="remoteClient"></param> 1074 /// <param name="remoteClient"></param>
1075 /// <returns>true if the region was successfully contacted, false otherwise</returns> 1075 /// <returns>true if the region was successfully contacted, false otherwise</returns>
1076 protected abstract bool PrepareLoginToRegion( 1076 protected abstract bool PrepareLoginToRegion(
1077 RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client); 1077 RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client);
1078 1078
@@ -1221,11 +1221,13 @@ namespace OpenSim.Framework.Communications.Services
1221 { 1221 {
1222 return Util.CreateUnknownUserErrorResponse(); 1222 return Util.CreateUnknownUserErrorResponse();
1223 } 1223 }
1224
1224 UUID.TryParse((string)requestData["session_id"], out guess_sid); 1225 UUID.TryParse((string)requestData["session_id"], out guess_sid);
1225 if (guess_sid == UUID.Zero) 1226 if (guess_sid == UUID.Zero)
1226 { 1227 {
1227 return Util.CreateUnknownUserErrorResponse(); 1228 return Util.CreateUnknownUserErrorResponse();
1228 } 1229 }
1230
1229 if (m_userManager.VerifySession(guess_aid, guess_sid)) 1231 if (m_userManager.VerifySession(guess_aid, guess_sid))
1230 { 1232 {
1231 authed = "TRUE"; 1233 authed = "TRUE";
@@ -1243,6 +1245,5 @@ namespace OpenSim.Framework.Communications.Services
1243 response.Value = responseData; 1245 response.Value = responseData;
1244 return response; 1246 return response;
1245 } 1247 }
1246
1247 } 1248 }
1248} 1249} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
index 43f1440..2413055 100644
--- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
+++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
@@ -33,9 +33,9 @@ using OpenMetaverse;
33using OpenSim.Data; 33using OpenSim.Data;
34 34
35namespace OpenSim.Framework.Communications 35namespace OpenSim.Framework.Communications
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Plugin for managing temporary user profiles. 38 /// Plugin for managing temporary user profiles.
39 /// </summary> 39 /// </summary>
40 public class TemporaryUserProfilePlugin : IUserDataPlugin 40 public class TemporaryUserProfilePlugin : IUserDataPlugin
41 { 41 {
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications
45 45
46 public string Name { get { return "TemporaryUserProfilePlugin"; } } 46 public string Name { get { return "TemporaryUserProfilePlugin"; } }
47 public string Version { get { return "0.1"; } } 47 public string Version { get { return "0.1"; } }
48 public void Initialise() {} 48 public void Initialise() {}
49 public void Initialise(string connect) {} 49 public void Initialise(string connect) {}
50 public void Dispose() {} 50 public void Dispose() {}
51 51
diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
index ac0dc6d..caaebd7 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
@@ -149,6 +149,11 @@ namespace OpenSim.Framework.Communications.Tests
149 { 149 {
150 throw new NotImplementedException(); 150 throw new NotImplementedException();
151 } 151 }
152
153 public virtual bool AuthenticateUserByPassword(UUID userID, string password)
154 {
155 throw new NotImplementedException();
156 }
152 } 157 }
153 } 158 }
154} 159}
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index e5d8895..830c877 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Framework.Communications.Tests
133 133
134 timedOut = true; 134 timedOut = true;
135 lock (this) 135 lock (this)
136 { 136 {
137 UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 137 UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
138 Monitor.Wait(this, 60000); 138 Monitor.Wait(this, 60000);
139 } 139 }
@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Tests
150 CachedUserInfo userInfo; 150 CachedUserInfo userInfo;
151 151
152 lock (this) 152 lock (this)
153 { 153 {
154 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 154 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
155 Monitor.Wait(this, 60000); 155 Monitor.Wait(this, 60000);
156 } 156 }
@@ -171,7 +171,7 @@ namespace OpenSim.Framework.Communications.Tests
171 CachedUserInfo userInfo; 171 CachedUserInfo userInfo;
172 172
173 lock (this) 173 lock (this)
174 { 174 {
175 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 175 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
176 Monitor.Wait(this, 60000); 176 Monitor.Wait(this, 60000);
177 } 177 }
@@ -206,7 +206,7 @@ namespace OpenSim.Framework.Communications.Tests
206 CachedUserInfo userInfo; 206 CachedUserInfo userInfo;
207 207
208 lock (this) 208 lock (this)
209 { 209 {
210 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 210 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
211 Monitor.Wait(this, 60000); 211 Monitor.Wait(this, 60000);
212 } 212 }
@@ -271,7 +271,7 @@ namespace OpenSim.Framework.Communications.Tests
271 CachedUserInfo userInfo; 271 CachedUserInfo userInfo;
272 272
273 lock (this) 273 lock (this)
274 { 274 {
275 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 275 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
276 Monitor.Wait(this, 60000); 276 Monitor.Wait(this, 60000);
277 } 277 }
@@ -311,7 +311,7 @@ namespace OpenSim.Framework.Communications.Tests
311 CachedUserInfo userInfo; 311 CachedUserInfo userInfo;
312 312
313 lock (this) 313 lock (this)
314 { 314 {
315 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); 315 userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived);
316 Monitor.Wait(this, 60000); 316 Monitor.Wait(this, 60000);
317 } 317 }
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index 0a9d2ae..e891d9c 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -318,7 +318,7 @@ namespace OpenSim.Framework.Communications.Tests
318 { 318 {
319 TestHelper.InMethod(); 319 TestHelper.InMethod();
320 320
321 //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()"); 321 //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
322 //log4net.Config.XmlConfigurator.Configure(); 322 //log4net.Config.XmlConfigurator.Configure();
323 323
324 string error_already_logged = "You appear to be already logged in. " + 324 string error_already_logged = "You appear to be already logged in. " +
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 58174a0..bf4f331 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -44,7 +44,8 @@ namespace OpenSim.Framework.Communications
44 /// <summary> 44 /// <summary>
45 /// Base class for user management (create, read, etc) 45 /// Base class for user management (create, read, etc)
46 /// </summary> 46 /// </summary>
47 public abstract class UserManagerBase : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication 47 public abstract class UserManagerBase
48 : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication
48 { 49 {
49 private static readonly ILog m_log 50 private static readonly ILog m_log
50 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -649,15 +650,17 @@ namespace OpenSim.Framework.Communications
649 public virtual UUID AddUser( 650 public virtual UUID AddUser(
650 string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) 651 string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID)
651 { 652 {
652 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
653 653
654 UserProfileData user = new UserProfileData(); 654 UserProfileData user = new UserProfileData();
655
656 user.PasswordSalt = Util.Md5Hash(UUID.Random().ToString());
657 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + user.PasswordSalt);
658
655 user.HomeLocation = new Vector3(128, 128, 100); 659 user.HomeLocation = new Vector3(128, 128, 100);
656 user.ID = SetUUID; 660 user.ID = SetUUID;
657 user.FirstName = firstName; 661 user.FirstName = firstName;
658 user.SurName = lastName; 662 user.SurName = lastName;
659 user.PasswordHash = md5PasswdHash; 663 user.PasswordHash = md5PasswdHash;
660 user.PasswordSalt = String.Empty;
661 user.Created = Util.UnixTimeSinceEpoch(); 664 user.Created = Util.UnixTimeSinceEpoch();
662 user.HomeLookAt = new Vector3(100, 100, 100); 665 user.HomeLookAt = new Vector3(100, 100, 100);
663 user.HomeRegionX = regX; 666 user.HomeRegionX = regX;
@@ -891,7 +894,10 @@ namespace OpenSim.Framework.Communications
891 894
892 if (userProfile != null && userProfile.CurrentAgent != null) 895 if (userProfile != null && userProfile.CurrentAgent != null)
893 { 896 {
894 m_log.DebugFormat("[USER AUTH]: Verifying session {0} for {1}; current session {2}", sessionID, userID, userProfile.CurrentAgent.SessionID); 897 m_log.DebugFormat(
898 "[USER AUTH]: Verifying session {0} for {1}; current session {2}",
899 sessionID, userID, userProfile.CurrentAgent.SessionID);
900
895 if (userProfile.CurrentAgent.SessionID == sessionID) 901 if (userProfile.CurrentAgent.SessionID == sessionID)
896 { 902 {
897 return true; 903 return true;
@@ -901,6 +907,26 @@ namespace OpenSim.Framework.Communications
901 return false; 907 return false;
902 } 908 }
903 909
910 public virtual bool AuthenticateUserByPassword(UUID userID, string password)
911 {
912// m_log.DebugFormat("[USER AUTH]: Authenticating user {0} given password {1}", userID, password);
913
914 UserProfileData userProfile = GetUserProfile(userID);
915
916 if (null == userProfile)
917 return false;
918
919 string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt);
920
921// m_log.DebugFormat(
922// "[USER AUTH]: Submitted hash {0}, stored hash {1}", md5PasswordHash, userProfile.PasswordHash);
923
924 if (md5PasswordHash == userProfile.PasswordHash)
925 return true;
926 else
927 return false;
928 }
929
904 #endregion 930 #endregion
905 } 931 }
906} 932}
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index 06136ff..9671bc2 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Framework.Console
88 /// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param> 88 /// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param>
89 /// <returns></returns> 89 /// <returns></returns>
90 public List<string> GetHelp(string[] cmd) 90 public List<string> GetHelp(string[] cmd)
91 { 91 {
92 List<string> help = new List<string>(); 92 List<string> help = new List<string>();
93 List<string> helpParts = new List<string>(cmd); 93 List<string> helpParts = new List<string>(cmd);
94 94
@@ -115,7 +115,7 @@ namespace OpenSim.Framework.Console
115 /// <param name="helpParts"></param> 115 /// <param name="helpParts"></param>
116 /// <returns></returns> 116 /// <returns></returns>
117 private List<string> CollectHelp(List<string> helpParts) 117 private List<string> CollectHelp(List<string> helpParts)
118 { 118 {
119 string originalHelpRequest = string.Join(" ", helpParts.ToArray()); 119 string originalHelpRequest = string.Join(" ", helpParts.ToArray());
120 List<string> help = new List<string>(); 120 List<string> help = new List<string>();
121 121
@@ -132,7 +132,7 @@ namespace OpenSim.Framework.Console
132 if (dict[helpPart] is Dictionary<string, Object>) 132 if (dict[helpPart] is Dictionary<string, Object>)
133 dict = (Dictionary<string, object>)dict[helpPart]; 133 dict = (Dictionary<string, object>)dict[helpPart];
134 134
135 helpParts.RemoveAt(0); 135 helpParts.RemoveAt(0);
136 } 136 }
137 137
138 // There was a command for the given help string 138 // There was a command for the given help string
@@ -149,7 +149,7 @@ namespace OpenSim.Framework.Console
149 } 149 }
150 150
151 return help; 151 return help;
152 } 152 }
153 153
154 private List<string> CollectHelp(Dictionary<string, object> dict) 154 private List<string> CollectHelp(Dictionary<string, object> dict)
155 { 155 {
@@ -180,7 +180,7 @@ namespace OpenSim.Framework.Console
180 /// <param name="longhelp"></param> 180 /// <param name="longhelp"></param>
181 /// <param name="fn"></param> 181 /// <param name="fn"></param>
182 public void AddCommand(string module, bool shared, string command, 182 public void AddCommand(string module, bool shared, string command,
183 string help, string longhelp, CommandDelegate fn) 183 string help, string longhelp, CommandDelegate fn)
184 { 184 {
185 AddCommand(module, shared, command, help, longhelp, 185 AddCommand(module, shared, command, help, longhelp,
186 String.Empty, fn); 186 String.Empty, fn);
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 67bff4c..c27072c 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -197,8 +197,8 @@ namespace OpenSim.Framework.Console
197 197
198 string uri = "/ReadResponses/" + sessionID.ToString() + "/"; 198 string uri = "/ReadResponses/" + sessionID.ToString() + "/";
199 199
200 m_Server.AddPollServiceHTTPHandler(uri, HandleHttpCloseSession, 200 m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll,
201 new PollServiceEventArgs(HasEvents, GetEvents, NoEvents, 201 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents,
202 sessionID)); 202 sessionID));
203 203
204 XmlDocument xmldoc = new XmlDocument(); 204 XmlDocument xmldoc = new XmlDocument();
@@ -230,6 +230,11 @@ namespace OpenSim.Framework.Console
230 return reply; 230 return reply;
231 } 231 }
232 232
233 private Hashtable HandleHttpPoll(Hashtable request)
234 {
235 return new Hashtable();
236 }
237
233 private Hashtable HandleHttpCloseSession(Hashtable request) 238 private Hashtable HandleHttpCloseSession(Hashtable request)
234 { 239 {
235 DoExpire(); 240 DoExpire();
@@ -365,7 +370,7 @@ namespace OpenSim.Framework.Console
365 } 370 }
366 } 371 }
367 372
368 private bool HasEvents(UUID sessionID) 373 private bool HasEvents(UUID RequestID, UUID sessionID)
369 { 374 {
370 ConsoleConnection c = null; 375 ConsoleConnection c = null;
371 376
@@ -381,19 +386,19 @@ namespace OpenSim.Framework.Console
381 return false; 386 return false;
382 } 387 }
383 388
384 private Hashtable GetEvents(UUID sessionID, string request) 389 private Hashtable GetEvents(UUID RequestID, UUID sessionID, string request)
385 { 390 {
386 ConsoleConnection c = null; 391 ConsoleConnection c = null;
387 392
388 lock (m_Connections) 393 lock (m_Connections)
389 { 394 {
390 if (!m_Connections.ContainsKey(sessionID)) 395 if (!m_Connections.ContainsKey(sessionID))
391 return NoEvents(); 396 return NoEvents(RequestID, UUID.Zero);
392 c = m_Connections[sessionID]; 397 c = m_Connections[sessionID];
393 } 398 }
394 c.last = System.Environment.TickCount; 399 c.last = System.Environment.TickCount;
395 if (c.lastLineSeen >= m_LineNumber) 400 if (c.lastLineSeen >= m_LineNumber)
396 return NoEvents(); 401 return NoEvents(RequestID, UUID.Zero);
397 402
398 Hashtable result = new Hashtable(); 403 Hashtable result = new Hashtable();
399 404
@@ -435,7 +440,7 @@ namespace OpenSim.Framework.Console
435 return result; 440 return result;
436 } 441 }
437 442
438 private Hashtable NoEvents() 443 private Hashtable NoEvents(UUID RequestID, UUID id)
439 { 444 {
440 Hashtable result = new Hashtable(); 445 Hashtable result = new Hashtable();
441 446
diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs
index 9aa5d03..3a43a14 100644
--- a/OpenSim/Framework/GridConfig.cs
+++ b/OpenSim/Framework/GridConfig.cs
@@ -90,13 +90,13 @@ namespace OpenSim.Framework
90 90
91 m_configMember.addConfigurationOption("allow_forceful_banlines", 91 m_configMember.addConfigurationOption("allow_forceful_banlines",
92 ConfigurationOption.ConfigurationTypes.TYPE_STRING, 92 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
93 "Allow Forceful Banlines", "TRUE", true); 93 "Allow Forceful Banlines", "TRUE", true);
94 94
95 m_configMember.addConfigurationOption("allow_region_registration", 95 m_configMember.addConfigurationOption("allow_region_registration",
96 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, 96 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
97 "Allow regions to register immediately upon grid server startup? true/false", 97 "Allow regions to register immediately upon grid server startup? true/false",
98 "True", 98 "True",
99 false); 99 false);
100 m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 100 m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
101 "Remote console access user name [Default: disabled]", "", false); 101 "Remote console access user name [Default: disabled]", "", false);
102 102
@@ -147,7 +147,7 @@ namespace OpenSim.Framework
147 break; 147 break;
148 case "allow_region_registration": 148 case "allow_region_registration":
149 AllowRegionRegistration = (bool)configuration_result; 149 AllowRegionRegistration = (bool)configuration_result;
150 break; 150 break;
151 case "console_user": 151 case "console_user":
152 ConsoleUser = (string)configuration_result; 152 ConsoleUser = (string)configuration_result;
153 break; 153 break;
diff --git a/OpenSim/Framework/IAssetCache.cs b/OpenSim/Framework/IAssetCache.cs
index 751fdd5..654180d 100644
--- a/OpenSim/Framework/IAssetCache.cs
+++ b/OpenSim/Framework/IAssetCache.cs
@@ -34,23 +34,23 @@ namespace OpenSim.Framework
34 34
35 /// <summary> 35 /// <summary>
36 /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested. 36 /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested.
37 /// </summary> 37 /// </summary>
38 public interface IAssetCache : IPlugin 38 public interface IAssetCache : IPlugin
39 { 39 {
40 /// <value> 40 /// <value>
41 /// The 'server' from which assets can be requested and to which assets are persisted. 41 /// The 'server' from which assets can be requested and to which assets are persisted.
42 /// </value> 42 /// </value>
43 43
44 void Initialise(ConfigSettings cs); 44 void Initialise(ConfigSettings cs);
45 45
46 /// <summary> 46 /// <summary>
47 /// Report statistical data to the log. 47 /// Report statistical data to the log.
48 /// </summary> 48 /// </summary>
49 void ShowState(); 49 void ShowState();
50 50
51 /// <summary> 51 /// <summary>
52 /// Clear the asset cache. 52 /// Clear the asset cache.
53 /// </summary> 53 /// </summary>
54 void Clear(); 54 void Clear();
55 55
56 /// <summary> 56 /// <summary>
@@ -58,7 +58,7 @@ namespace OpenSim.Framework
58 /// </summary> 58 /// </summary>
59 /// <param name="assetId"></param> 59 /// <param name="assetId"></param>
60 /// <param name="asset"></param> 60 /// <param name="asset"></param>
61 /// <returns>true if the asset was in the cache, false if it was not</returns> 61 /// <returns>true if the asset was in the cache, false if it was not</returns>
62 bool TryGetCachedAsset(UUID assetID, out AssetBase asset); 62 bool TryGetCachedAsset(UUID assetID, out AssetBase asset);
63 63
64 /// <summary> 64 /// <summary>
@@ -69,7 +69,7 @@ namespace OpenSim.Framework
69 /// <param name="isTexture"></param> 69 /// <param name="isTexture"></param>
70 /// A callback invoked when the asset has either been found or not found. 70 /// A callback invoked when the asset has either been found or not found.
71 /// If the asset was found this is called with the asset UUID and the asset data 71 /// If the asset was found this is called with the asset UUID and the asset data
72 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param> 72 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param>
73 void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture); 73 void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture);
74 74
75 /// <summary> 75 /// <summary>
@@ -84,13 +84,13 @@ namespace OpenSim.Framework
84 /// 84 ///
85 /// <param name="assetID"></param> 85 /// <param name="assetID"></param>
86 /// <param name="isTexture"></param> 86 /// <param name="isTexture"></param>
87 /// <returns>null if the asset could not be retrieved</returns> 87 /// <returns>null if the asset could not be retrieved</returns>
88 AssetBase GetAsset(UUID assetID, bool isTexture); 88 AssetBase GetAsset(UUID assetID, bool isTexture);
89 89
90 /// <summary> 90 /// <summary>
91 /// Add an asset to both the persistent store and the cache. 91 /// Add an asset to both the persistent store and the cache.
92 /// </summary> 92 /// </summary>
93 /// <param name="asset"></param> 93 /// <param name="asset"></param>
94 void AddAsset(AssetBase asset); 94 void AddAsset(AssetBase asset);
95 95
96 /// <summary> 96 /// <summary>
@@ -100,14 +100,14 @@ namespace OpenSim.Framework
100 /// of the asset cache. This is needed because the osdynamic 100 /// of the asset cache. This is needed because the osdynamic
101 /// texture code grows the asset cache without bounds. The 101 /// texture code grows the asset cache without bounds. The
102 /// real solution here is a much better cache archicture, but 102 /// real solution here is a much better cache archicture, but
103 /// this is a stop gap measure until we have such a thing. 103 /// this is a stop gap measure until we have such a thing.
104 void ExpireAsset(UUID assetID); 104 void ExpireAsset(UUID assetID);
105 105
106 /// <summary> 106 /// <summary>
107 /// Handle an asset request from the client. The result will be sent back asynchronously. 107 /// Handle an asset request from the client. The result will be sent back asynchronously.
108 /// </summary> 108 /// </summary>
109 /// <param name="userInfo"></param> 109 /// <param name="userInfo"></param>
110 /// <param name="transferRequest"></param> 110 /// <param name="transferRequest"></param>
111 void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest); 111 void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest);
112 } 112 }
113 113
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 91a5d5c..d3bd9e7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -810,7 +810,7 @@ namespace OpenSim.Framework
810 /// </summary> 810 /// </summary>
811 void Start(); 811 void Start();
812 812
813 void Stop(); 813 void Stop();
814 814
815 // void ActivateGesture(UUID assetId, UUID gestureId); 815 // void ActivateGesture(UUID assetId, UUID gestureId);
816 816
@@ -824,7 +824,7 @@ namespace OpenSim.Framework
824 /// </summary> 824 /// </summary>
825 /// <param name="agentID">The id of the agent associated with the appearance</param> 825 /// <param name="agentID">The id of the agent associated with the appearance</param>
826 /// <param name="visualParams"></param> 826 /// <param name="visualParams"></param>
827 /// <param name="textureEntry"></param> 827 /// <param name="textureEntry"></param>
828 void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry); 828 void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry);
829 829
830 void SendStartPingCheck(byte seq); 830 void SendStartPingCheck(byte seq);
@@ -833,7 +833,7 @@ namespace OpenSim.Framework
833 /// Tell the client that an object has been deleted 833 /// Tell the client that an object has been deleted
834 /// </summary> 834 /// </summary>
835 /// <param name="regionHandle"></param> 835 /// <param name="regionHandle"></param>
836 /// <param name="localID"></param> 836 /// <param name="localID"></param>
837 void SendKillObject(ulong regionHandle, uint localID); 837 void SendKillObject(ulong regionHandle, uint localID);
838 838
839 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); 839 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
diff --git a/OpenSim/Framework/ICnmCache.cs b/OpenSim/Framework/ICnmCache.cs
index a1ac322..27b9c56 100644
--- a/OpenSim/Framework/ICnmCache.cs
+++ b/OpenSim/Framework/ICnmCache.cs
@@ -180,16 +180,16 @@ namespace OpenSim.Framework
180 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 180 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
181 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 181 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
182 /// </para> 182 /// </para>
183 /// </remarks> 183 /// </remarks>
184 /// <seealso cref="MaxElementSize"/> 184 /// <seealso cref="MaxElementSize"/>
185 /// <seealso cref="Size"/> 185 /// <seealso cref="Size"/>
186 /// <seealso cref="MaxSize"/> 186 /// <seealso cref="MaxSize"/>
187 /// <seealso cref="IsCountLimited"/> 187 /// <seealso cref="IsCountLimited"/>
188 /// <seealso cref="IsTimeLimited"/> 188 /// <seealso cref="IsTimeLimited"/>
189 bool IsSizeLimited { get; } 189 bool IsSizeLimited { get; }
190 190
191 /// <summary> 191 /// <summary>
192 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time. 192 /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time.
193 /// </summary> 193 /// </summary>
194 /// <value> 194 /// <value>
195 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements; 195 /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements;
@@ -200,7 +200,7 @@ namespace OpenSim.Framework
200 /// or <see cref="TryGetValue"/> methods in <see cref="ExpirationTime"/> , then element is automatically removed from 200 /// or <see cref="TryGetValue"/> methods in <see cref="ExpirationTime"/> , then element is automatically removed from
201 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may 201 /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may
202 /// stay longer in cache. 202 /// stay longer in cache.
203 /// </remarks> 203 /// </remarks>
204 /// <seealso cref="ExpirationTime"/> 204 /// <seealso cref="ExpirationTime"/>
205 /// <seealso cref="PurgeExpired"/> 205 /// <seealso cref="PurgeExpired"/>
206 /// <seealso cref="IsCountLimited"/> 206 /// <seealso cref="IsCountLimited"/>
@@ -237,7 +237,7 @@ namespace OpenSim.Framework
237 /// <seealso cref="Set"/> 237 /// <seealso cref="Set"/>
238 /// <seealso cref="IsSizeLimited"/> 238 /// <seealso cref="IsSizeLimited"/>
239 /// <seealso cref="Size"/> 239 /// <seealso cref="Size"/>
240 /// <seealso cref="MaxSize"/> 240 /// <seealso cref="MaxSize"/>
241 long MaxElementSize { get; } 241 long MaxElementSize { get; }
242 242
243 /// <summary> 243 /// <summary>
@@ -246,7 +246,7 @@ namespace OpenSim.Framework
246 /// <value> 246 /// <value>
247 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>. 247 /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>.
248 /// </value> 248 /// </value>
249 /// <remarks> 249 /// <remarks>
250 /// <para> 250 /// <para>
251 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. 251 /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure.
252 /// </para> 252 /// </para>
@@ -278,10 +278,10 @@ namespace OpenSim.Framework
278 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, 278 /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements,
279 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. 279 /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element.
280 /// </para> 280 /// </para>
281 /// </remarks> 281 /// </remarks>
282 /// <seealso cref="MaxElementSize"/> 282 /// <seealso cref="MaxElementSize"/>
283 /// <seealso cref="IsSizeLimited"/> 283 /// <seealso cref="IsSizeLimited"/>
284 /// <seealso cref="MaxSize"/> 284 /// <seealso cref="MaxSize"/>
285 /// <seealso cref="IsCountLimited"/> 285 /// <seealso cref="IsCountLimited"/>
286 /// <seealso cref="ExpirationTime"/> 286 /// <seealso cref="ExpirationTime"/>
287 long Size { get; } 287 long Size { get; }
@@ -289,9 +289,9 @@ namespace OpenSim.Framework
289 /// <summary> 289 /// <summary>
290 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 290 /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
291 /// </summary> 291 /// </summary>
292 /// <value> 292 /// <value>
293 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. 293 /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>.
294 /// </value> 294 /// </value>
295 /// <remarks> 295 /// <remarks>
296 /// <para> 296 /// <para>
297 /// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/> 297 /// 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
322 /// </para> 322 /// </para>
323 /// <para> 323 /// <para>
324 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements 324 /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements
325 /// may stay longer than <see cref="ExpirationTime"/> in the cache. 325 /// may stay longer than <see cref="ExpirationTime"/> in the cache.
326 /// </para> 326 /// </para>
327 /// </remarks> 327 /// </remarks>
328 /// <seealso cref="IsTimeLimited"/> 328 /// <seealso cref="IsTimeLimited"/>
@@ -418,7 +418,7 @@ namespace OpenSim.Framework
418 /// </summary> 418 /// </summary>
419 /// <returns> 419 /// <returns>
420 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with 420 /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with
421 /// the specified key; otherwise, <see langword="false"/>. 421 /// the specified key; otherwise, <see langword="false"/>.
422 /// </returns> 422 /// </returns>
423 /// <param name="key"> 423 /// <param name="key">
424 /// The key whose <paramref name="value"/> to get. 424 /// The key whose <paramref name="value"/> to get.
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs
index ba4c616..307c6bc 100644
--- a/OpenSim/Framework/IRegionCommsListener.cs
+++ b/OpenSim/Framework/IRegionCommsListener.cs
@@ -46,8 +46,6 @@ namespace OpenSim.Framework
46 46
47 public delegate bool CloseAgentConnection(UUID agentID); 47 public delegate bool CloseAgentConnection(UUID agentID);
48 48
49 public delegate bool RegionUp(RegionInfo region);
50
51 public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData); 49 public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData);
52 50
53 public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message); 51 public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message);
@@ -65,7 +63,6 @@ namespace OpenSim.Framework
65 event AcknowledgePrimCross OnAcknowledgePrimCrossed; 63 event AcknowledgePrimCross OnAcknowledgePrimCrossed;
66 event UpdateNeighbours OnNeighboursUpdate; 64 event UpdateNeighbours OnNeighboursUpdate;
67 event CloseAgentConnection OnCloseAgentConnection; 65 event CloseAgentConnection OnCloseAgentConnection;
68 event RegionUp OnRegionUp;
69 event ChildAgentUpdate OnChildAgentUpdate; 66 event ChildAgentUpdate OnChildAgentUpdate;
70 event LogOffUser OnLogOffUser; 67 event LogOffUser OnLogOffUser;
71 event GetLandData OnGetLandData; 68 event GetLandData OnGetLandData;
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 2e2c703..489653f 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Framework
55 GodTakeCopy = 5, 55 GodTakeCopy = 5,
56 Delete = 6, 56 Delete = 6,
57 Return = 9 57 Return = 9
58 }; 58 };
59 59
60 public interface IScene 60 public interface IScene
61 { 61 {
@@ -74,7 +74,7 @@ namespace OpenSim.Framework
74 void CloseAllAgents(uint circuitcode); 74 void CloseAllAgents(uint circuitcode);
75 75
76 void Restart(int seconds); 76 void Restart(int seconds);
77 bool OtherRegionUp(RegionInfo thisRegion); 77 //RegionInfo OtherRegionUp(RegionInfo thisRegion);
78 78
79 string GetSimulatorVersion(); 79 string GetSimulatorVersion();
80 80
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs
index db19527..4fc3e01 100644
--- a/OpenSim/Framework/ISceneObject.cs
+++ b/OpenSim/Framework/ISceneObject.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Framework
32{ 32{
33 public interface ISceneObject 33 public interface ISceneObject
34 { 34 {
35 UUID UUID { get; } 35 UUID UUID { get; }
36 ISceneObject CloneForNewScene(); 36 ISceneObject CloneForNewScene();
37 string ToXml2(); 37 string ToXml2();
38 string ExtraToXmlString(); 38 string ExtraToXmlString();
diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs
index 3eef6f6..a12183c 100644
--- a/OpenSim/Framework/InventoryFolderBase.cs
+++ b/OpenSim/Framework/InventoryFolderBase.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Framework
89 ID = id; 89 ID = id;
90 Name = name; 90 Name = name;
91 Owner = owner; 91 Owner = owner;
92 ParentID = parent; 92 ParentID = parent;
93 } 93 }
94 94
95 public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) 95 public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version)
diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs
index 00462f9..29c7682 100644
--- a/OpenSim/Framework/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/InventoryFolderImpl.cs
@@ -304,7 +304,7 @@ namespace OpenSim.Framework
304 304
305 /// <summary> 305 /// <summary>
306 /// Find a folder given a PATH_DELIMITER delimited path starting from this folder 306 /// Find a folder given a PATH_DELIMITER delimited path starting from this folder
307 /// </summary> 307 /// </summary>
308 /// 308 ///
309 /// This method does not handle paths that contain multiple delimitors 309 /// This method does not handle paths that contain multiple delimitors
310 /// 310 ///
@@ -314,7 +314,7 @@ namespace OpenSim.Framework
314 /// FIXME: Delimitors which occur in names themselves are not currently escapable. 314 /// FIXME: Delimitors which occur in names themselves are not currently escapable.
315 /// 315 ///
316 /// <param name="path"> 316 /// <param name="path">
317 /// The path to the required folder. 317 /// The path to the required folder.
318 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. 318 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
319 /// </param> 319 /// </param>
320 /// <returns>null if the folder is not found</returns> 320 /// <returns>null if the folder is not found</returns>
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index 7150c82..aeb01e2 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -34,10 +34,10 @@ namespace OpenSim.Framework
34 /// Inventory Item - contains all the properties associated with an individual inventory piece. 34 /// Inventory Item - contains all the properties associated with an individual inventory piece.
35 /// </summary> 35 /// </summary>
36 public class InventoryItemBase : InventoryNodeBase, ICloneable 36 public class InventoryItemBase : InventoryNodeBase, ICloneable
37 { 37 {
38 /// <value> 38 /// <value>
39 /// The inventory type of the item. This is slightly different from the asset type in some situations. 39 /// The inventory type of the item. This is slightly different from the asset type in some situations.
40 /// </value> 40 /// </value>
41 public int InvType 41 public int InvType
42 { 42 {
43 get 43 get
@@ -54,7 +54,7 @@ namespace OpenSim.Framework
54 54
55 /// <value> 55 /// <value>
56 /// The folder this item is contained in 56 /// The folder this item is contained in
57 /// </value> 57 /// </value>
58 public UUID Folder 58 public UUID Folder
59 { 59 {
60 get 60 get
@@ -71,7 +71,7 @@ namespace OpenSim.Framework
71 71
72 /// <value> 72 /// <value>
73 /// The creator of this item 73 /// The creator of this item
74 /// </value> 74 /// </value>
75 public string CreatorId 75 public string CreatorId
76 { 76 {
77 get 77 get
@@ -114,7 +114,7 @@ namespace OpenSim.Framework
114 { 114 {
115 m_creatorIdAsUuid = value; 115 m_creatorIdAsUuid = value;
116 } 116 }
117 } 117 }
118 protected UUID m_creatorIdAsUuid = UUID.Zero; 118 protected UUID m_creatorIdAsUuid = UUID.Zero;
119 119
120 /// <value> 120 /// <value>
@@ -130,13 +130,13 @@ namespace OpenSim.Framework
130 set 130 set
131 { 131 {
132 m_description = value; 132 m_description = value;
133 } 133 }
134 } 134 }
135 protected string m_description = String.Empty; 135 protected string m_description = String.Empty;
136 136
137 /// <value> 137 /// <value>
138 /// 138 ///
139 /// </value> 139 /// </value>
140 public uint NextPermissions 140 public uint NextPermissions
141 { 141 {
142 get 142 get
@@ -153,7 +153,7 @@ namespace OpenSim.Framework
153 153
154 /// <value> 154 /// <value>
155 /// A mask containing permissions for the current owner (cannot be enforced) 155 /// A mask containing permissions for the current owner (cannot be enforced)
156 /// </value> 156 /// </value>
157 public uint CurrentPermissions 157 public uint CurrentPermissions
158 { 158 {
159 get 159 get
@@ -170,7 +170,7 @@ namespace OpenSim.Framework
170 170
171 /// <value> 171 /// <value>
172 /// 172 ///
173 /// </value> 173 /// </value>
174 public uint BasePermissions 174 public uint BasePermissions
175 { 175 {
176 get 176 get
@@ -187,7 +187,7 @@ namespace OpenSim.Framework
187 187
188 /// <value> 188 /// <value>
189 /// 189 ///
190 /// </value> 190 /// </value>
191 public uint EveryOnePermissions 191 public uint EveryOnePermissions
192 { 192 {
193 get 193 get
@@ -204,7 +204,7 @@ namespace OpenSim.Framework
204 204
205 /// <value> 205 /// <value>
206 /// 206 ///
207 /// </value> 207 /// </value>
208 public uint GroupPermissions 208 public uint GroupPermissions
209 { 209 {
210 get 210 get
@@ -221,7 +221,7 @@ namespace OpenSim.Framework
221 221
222 /// <value> 222 /// <value>
223 /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) 223 /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
224 /// </value> 224 /// </value>
225 public int AssetType 225 public int AssetType
226 { 226 {
227 get 227 get
@@ -238,7 +238,7 @@ namespace OpenSim.Framework
238 238
239 /// <value> 239 /// <value>
240 /// The UUID of the associated asset on the asset server 240 /// The UUID of the associated asset on the asset server
241 /// </value> 241 /// </value>
242 public UUID AssetID 242 public UUID AssetID
243 { 243 {
244 get 244 get
@@ -255,7 +255,7 @@ namespace OpenSim.Framework
255 255
256 /// <value> 256 /// <value>
257 /// 257 ///
258 /// </value> 258 /// </value>
259 public UUID GroupID 259 public UUID GroupID
260 { 260 {
261 get 261 get
@@ -272,13 +272,13 @@ namespace OpenSim.Framework
272 272
273 /// <value> 273 /// <value>
274 /// 274 ///
275 /// </value> 275 /// </value>
276 public bool GroupOwned 276 public bool GroupOwned
277 { 277 {
278 get 278 get
279 { 279 {
280 return m_groupOwned; 280 return m_groupOwned;
281 } 281 }
282 282
283 set 283 set
284 { 284 {
@@ -289,7 +289,7 @@ namespace OpenSim.Framework
289 289
290 /// <value> 290 /// <value>
291 /// 291 ///
292 /// </value> 292 /// </value>
293 public int SalePrice 293 public int SalePrice
294 { 294 {
295 get 295 get
@@ -306,7 +306,7 @@ namespace OpenSim.Framework
306 306
307 /// <value> 307 /// <value>
308 /// 308 ///
309 /// </value> 309 /// </value>
310 public byte SaleType 310 public byte SaleType
311 { 311 {
312 get 312 get
@@ -323,7 +323,7 @@ namespace OpenSim.Framework
323 323
324 /// <value> 324 /// <value>
325 /// 325 ///
326 /// </value> 326 /// </value>
327 public uint Flags 327 public uint Flags
328 { 328 {
329 get 329 get
@@ -340,7 +340,7 @@ namespace OpenSim.Framework
340 340
341 /// <value> 341 /// <value>
342 /// 342 ///
343 /// </value> 343 /// </value>
344 public int CreationDate 344 public int CreationDate
345 { 345 {
346 get 346 get
diff --git a/OpenSim/Framework/InventoryNodeBase.cs b/OpenSim/Framework/InventoryNodeBase.cs
index f49cce1..31c3fd1 100644
--- a/OpenSim/Framework/InventoryNodeBase.cs
+++ b/OpenSim/Framework/InventoryNodeBase.cs
@@ -31,12 +31,12 @@ namespace OpenSim.Framework
31{ 31{
32 /// <summary> 32 /// <summary>
33 /// Common base class for inventory nodes of different types (files, folders, etc.) 33 /// Common base class for inventory nodes of different types (files, folders, etc.)
34 /// </summary> 34 /// </summary>
35 public class InventoryNodeBase 35 public class InventoryNodeBase
36 { 36 {
37 /// <summary> 37 /// <summary>
38 /// The name of the node (64 characters or less) 38 /// The name of the node (64 characters or less)
39 /// </summary> 39 /// </summary>
40 public virtual string Name 40 public virtual string Name
41 { 41 {
42 get { return m_name; } 42 get { return m_name; }
@@ -51,17 +51,17 @@ namespace OpenSim.Framework
51 { 51 {
52 get { return m_id; } 52 get { return m_id; }
53 set { m_id = value; } 53 set { m_id = value; }
54 } 54 }
55 private UUID m_id; 55 private UUID m_id;
56 56
57 /// <summary> 57 /// <summary>
58 /// The agent who's inventory this is contained by 58 /// The agent who's inventory this is contained by
59 /// </summary> 59 /// </summary>
60 public virtual UUID Owner 60 public virtual UUID Owner
61 { 61 {
62 get { return m_owner; } 62 get { return m_owner; }
63 set { m_owner = value; } 63 set { m_owner = value; }
64 } 64 }
65 private UUID m_owner; 65 private UUID m_owner;
66 } 66 }
67} 67}
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index 3b00af3..f720222 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Framework
32{ 32{
33 public class NetworkServersInfo 33 public class NetworkServersInfo
34 { 34 {
35 public string AssetSendKey = String.Empty; 35 public string AssetSendKey = String.Empty;
36 public string AssetURL = "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/"; 36 public string AssetURL = "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/";
37 37
38 public string GridRecvKey = String.Empty; 38 public string GridRecvKey = String.Empty;
@@ -102,8 +102,7 @@ namespace OpenSim.Framework
102 ConfigSettings.DefaultInventoryServerHttpPort.ToString()); 102 ConfigSettings.DefaultInventoryServerHttpPort.ToString());
103 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); 103 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
104 104
105 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", 105 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty);
106 "http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort);
107 } 106 }
108 } 107 }
109} 108}
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 016c78c..90200d6 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -47,7 +47,6 @@ namespace OpenSim.Framework
47 private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser 47 private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
48 private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; 48 private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
49 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; 49 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
50 private RegionUp handlerRegionUp = null; // OnRegionUp;
51 private LogOffUser handlerLogOffUser = null; 50 private LogOffUser handlerLogOffUser = null;
52 private GetLandData handlerGetLandData = null; 51 private GetLandData handlerGetLandData = null;
53 52
@@ -62,7 +61,6 @@ namespace OpenSim.Framework
62 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; 61 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
63 public event AcknowledgePrimCross OnAcknowledgePrimCrossed; 62 public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
64 public event CloseAgentConnection OnCloseAgentConnection; 63 public event CloseAgentConnection OnCloseAgentConnection;
65 public event RegionUp OnRegionUp;
66 public event ChildAgentUpdate OnChildAgentUpdate; 64 public event ChildAgentUpdate OnChildAgentUpdate;
67 public event LogOffUser OnLogOffUser; 65 public event LogOffUser OnLogOffUser;
68 public event GetLandData OnGetLandData; 66 public event GetLandData OnGetLandData;
@@ -108,17 +106,6 @@ namespace OpenSim.Framework
108 return false; 106 return false;
109 } 107 }
110 108
111 public virtual bool TriggerRegionUp(RegionInfo region)
112 {
113 handlerRegionUp = OnRegionUp;
114 if (handlerRegionUp != null)
115 {
116 handlerRegionUp(region);
117 return true;
118 }
119 return false;
120 }
121
122 public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData) 109 public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
123 { 110 {
124 handlerChildAgentUpdate = OnChildAgentUpdate; 111 handlerChildAgentUpdate = OnChildAgentUpdate;
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 3896a6e..d3a5357 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Net; 30using System.Net;
30using System.Net.Sockets; 31using System.Net.Sockets;
31using System.Xml; 32using System.Xml;
@@ -63,6 +64,13 @@ namespace OpenSim.Framework
63 } 64 }
64 protected string m_serverURI; 65 protected string m_serverURI;
65 66
67 public string RegionName
68 {
69 get { return m_regionName; }
70 set { m_regionName = value; }
71 }
72 protected string m_regionName = String.Empty;
73
66 protected bool Allow_Alternate_Ports; 74 protected bool Allow_Alternate_Ports;
67 public bool m_allow_alternate_ports; 75 public bool m_allow_alternate_ports;
68 protected string m_externalHostName; 76 protected string m_externalHostName;
@@ -100,6 +108,7 @@ namespace OpenSim.Framework
100 108
101 public SimpleRegionInfo(RegionInfo ConvertFrom) 109 public SimpleRegionInfo(RegionInfo ConvertFrom)
102 { 110 {
111 m_regionName = ConvertFrom.RegionName;
103 m_regionLocX = ConvertFrom.RegionLocX; 112 m_regionLocX = ConvertFrom.RegionLocX;
104 m_regionLocY = ConvertFrom.RegionLocY; 113 m_regionLocY = ConvertFrom.RegionLocY;
105 m_internalEndPoint = ConvertFrom.InternalEndPoint; 114 m_internalEndPoint = ConvertFrom.InternalEndPoint;
@@ -197,6 +206,67 @@ namespace OpenSim.Framework
197 { 206 {
198 return m_internalEndPoint.Port; 207 return m_internalEndPoint.Port;
199 } 208 }
209
210 public Dictionary<string, object> ToKeyValuePairs()
211 {
212 Dictionary<string, object> kvp = new Dictionary<string, object>();
213 kvp["uuid"] = RegionID.ToString();
214 kvp["locX"] = RegionLocX.ToString();
215 kvp["locY"] = RegionLocY.ToString();
216 kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
217 kvp["external_port"] = ExternalEndPoint.Port.ToString();
218 kvp["external_host_name"] = ExternalHostName;
219 kvp["http_port"] = HttpPort.ToString();
220 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
221 kvp["internal_port"] = InternalEndPoint.Port.ToString();
222 kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
223 kvp["server_uri"] = ServerURI;
224
225 return kvp;
226 }
227
228 public SimpleRegionInfo(Dictionary<string, object> kvp)
229 {
230 if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null))
231 {
232 int port = 0;
233 Int32.TryParse((string)kvp["external_port"], out port);
234 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port);
235 ExternalEndPoint = ep;
236 }
237 else
238 ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
239
240 if (kvp["external_host_name"] != null)
241 ExternalHostName = (string)kvp["external_host_name"];
242
243 if (kvp["http_port"] != null)
244 {
245 UInt32 port = 0;
246 UInt32.TryParse((string)kvp["http_port"], out port);
247 HttpPort = port;
248 }
249
250 if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null))
251 {
252 int port = 0;
253 Int32.TryParse((string)kvp["internal_port"], out port);
254 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port);
255 InternalEndPoint = ep;
256 }
257 else
258 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
259
260 if (kvp["alternate_ports"] != null)
261 {
262 bool alts = false;
263 Boolean.TryParse((string)kvp["alternate_ports"], out alts);
264 m_allow_alternate_ports = alts;
265 }
266
267 if (kvp["server_uri"] != null)
268 ServerURI = (string)kvp["server_uri"];
269 }
200 } 270 }
201 271
202 public class RegionInfo : SimpleRegionInfo 272 public class RegionInfo : SimpleRegionInfo
@@ -222,7 +292,6 @@ namespace OpenSim.Framework
222 public UUID originRegionID = UUID.Zero; 292 public UUID originRegionID = UUID.Zero;
223 public string proxyUrl = ""; 293 public string proxyUrl = "";
224 public int ProxyOffset = 0; 294 public int ProxyOffset = 0;
225 public string RegionName = String.Empty;
226 public string regionSecret = UUID.Random().ToString(); 295 public string regionSecret = UUID.Random().ToString();
227 296
228 public string osSecret; 297 public string osSecret;
@@ -971,7 +1040,7 @@ namespace OpenSim.Framework
971 public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI) 1040 public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI)
972 { 1041 {
973 RegionInfo regionInfo; 1042 RegionInfo regionInfo;
974 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort); 1043 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort);
975 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName); 1044 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName);
976 regionInfo.RemotingPort = remotingPort; 1045 regionInfo.RemotingPort = remotingPort;
977 regionInfo.RemotingAddress = externalHostName; 1046 regionInfo.RemotingAddress = externalHostName;
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
new file mode 100644
index 0000000..a3bc5d1
--- /dev/null
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -0,0 +1,191 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Text;
32using System.Xml;
33using OpenMetaverse;
34using OpenSim.Framework;
35
36namespace OpenSim.Framework.Serialization.External
37{
38 /// <summary>
39 /// Serialize and deserialize LandData as an external format.
40 /// </summary>
41 public class LandDataSerializer
42 {
43 protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
44
45 /// <summary>
46 /// Reify/deserialize landData
47 /// </summary>
48 /// <param name="serializedLandData"></param>
49 /// <returns></returns>
50 /// <exception cref="System.Xml.XmlException"></exception>
51 public static LandData Deserialize(byte[] serializedLandData)
52 {
53 return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length));
54 }
55
56 /// <summary>
57 /// Reify/deserialize landData
58 /// </summary>
59 /// <param name="serializedLandData"></param>
60 /// <returns></returns>
61 /// <exception cref="System.Xml.XmlException"></exception>
62 public static LandData Deserialize(string serializedLandData)
63 {
64 LandData landData = new LandData();
65
66 StringReader sr = new StringReader(serializedLandData);
67 XmlTextReader xtr = new XmlTextReader(sr);
68
69 xtr.ReadStartElement("LandData");
70
71 landData.Area = Convert.ToInt32( xtr.ReadElementString("Area"));
72 landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID"));
73 landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID"));
74 landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category"));
75 landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate"));
76 landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice"));
77 landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID"));
78 landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID"));
79 landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned"));
80 landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap"));
81 landData.Description = xtr.ReadElementString("Description");
82 landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags"));
83 landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType"));
84 landData.Name = xtr.ReadElementString("Name");
85 landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status"));
86 landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID"));
87 landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale"));
88 landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID"));
89 landData.MediaURL = xtr.ReadElementString("MediaURL");
90 landData.MusicURL = xtr.ReadElementString("MusicURL");
91 landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID"));
92
93 landData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
94 xtr.Read();
95 if (xtr.Name != "ParcelAccessList")
96 throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name));
97
98 if (!xtr.IsEmptyElement)
99 {
100 while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
101 {
102 ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry();
103
104 xtr.ReadStartElement("ParcelAccessEntry");
105 pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID"));
106 pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time"));
107 pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
108 xtr.ReadEndElement();
109
110 landData.ParcelAccessList.Add(pae);
111 }
112 }
113 xtr.Read();
114
115 landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours"));
116 landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice"));
117 landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice"));
118 landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID"));
119 landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation"));
120 landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt"));
121 landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell"));
122 landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime"));
123
124 xtr.ReadEndElement();
125
126 xtr.Close();
127 sr.Close();
128
129 return landData;
130 }
131
132 public static string Serialize(LandData landData)
133 {
134 StringWriter sw = new StringWriter();
135 XmlTextWriter xtw = new XmlTextWriter(sw);
136 xtw.Formatting = Formatting.Indented;
137
138 xtw.WriteStartDocument();
139 xtw.WriteStartElement("LandData");
140
141 xtw.WriteElementString("Area", Convert.ToString(landData.Area));
142 xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID));
143 xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString());
144 xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category));
145 xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate));
146 xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice));
147 xtw.WriteElementString("GlobalID", landData.GlobalID.ToString());
148 xtw.WriteElementString("GroupID", landData.GroupID.ToString());
149 xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned));
150 xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap));
151 xtw.WriteElementString("Description", landData.Description);
152 xtw.WriteElementString("Flags", Convert.ToString((uint)landData.Flags));
153 xtw.WriteElementString("LandingType", Convert.ToString((byte)landData.LandingType));
154 xtw.WriteElementString("Name", landData.Name);
155 xtw.WriteElementString("Status", Convert.ToString((sbyte)landData.Status));
156 xtw.WriteElementString("LocalID", landData.LocalID.ToString());
157 xtw.WriteElementString("MediaAutoScale", Convert.ToString(landData.MediaAutoScale));
158 xtw.WriteElementString("MediaID", landData.MediaID.ToString());
159 xtw.WriteElementString("MediaURL", landData.MediaURL);
160 xtw.WriteElementString("MusicURL", landData.MusicURL);
161 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
162
163 xtw.WriteStartElement("ParcelAccessList");
164 foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList)
165 {
166 xtw.WriteStartElement("ParcelAccessEntry");
167 xtw.WriteElementString("AgentID", pal.AgentID.ToString());
168 xtw.WriteElementString("Time", pal.Time.ToString("s"));
169 xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags));
170 xtw.WriteEndElement();
171 }
172 xtw.WriteEndElement();
173
174 xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours));
175 xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice));
176 xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice));
177 xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString());
178 xtw.WriteElementString("UserLocation", landData.UserLocation.ToString());
179 xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString());
180 xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell));
181 xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime));
182
183 xtw.WriteEndElement();
184
185 xtw.Close();
186 sw.Close();
187
188 return sw.ToString();
189 }
190 }
191}
diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
index 274f41f..b5901e1 100644
--- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Framework.Serialization.External
158 settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString()); 158 settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString());
159 break; 159 break;
160 } 160 }
161 } 161 }
162 162
163 xtr.ReadEndElement(); 163 xtr.ReadEndElement();
164 xtr.ReadStartElement("Terrain"); 164 xtr.ReadStartElement("Terrain");
@@ -200,8 +200,8 @@ namespace OpenSim.Framework.Serialization.External
200 200
201 xtw.WriteStartElement("RegionSettings"); 201 xtw.WriteStartElement("RegionSettings");
202 202
203 xtw.WriteStartElement("General"); 203 xtw.WriteStartElement("General");
204 xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString()); 204 xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString());
205 xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString()); 205 xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString());
206 xtw.WriteElementString("AllowLandJoinDivide", settings.AllowLandJoinDivide.ToString()); 206 xtw.WriteElementString("AllowLandJoinDivide", settings.AllowLandJoinDivide.ToString());
207 xtw.WriteElementString("BlockFly", settings.BlockFly.ToString()); 207 xtw.WriteElementString("BlockFly", settings.BlockFly.ToString());
diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs
index eb77e65..fb269b7 100644
--- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Serialization.External
36 /// Serialize and deserialize region settings as an external format. 36 /// Serialize and deserialize region settings as an external format.
37 /// </summary> 37 /// </summary>
38 public class UserProfileSerializer 38 public class UserProfileSerializer
39 { 39 {
40 public const int MAJOR_VERSION = 0; 40 public const int MAJOR_VERSION = 0;
41 public const int MINOR_VERSION = 1; 41 public const int MINOR_VERSION = 1;
42 42
@@ -65,6 +65,6 @@ namespace OpenSim.Framework.Serialization.External
65 sw.Close(); 65 sw.Close();
66 66
67 return sw.ToString(); 67 return sw.ToString();
68 } 68 }
69 } 69 }
70} \ No newline at end of file 70} \ No newline at end of file
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
new file mode 100644
index 0000000..14e0462
--- /dev/null
+++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
@@ -0,0 +1,131 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using OpenSim.Framework;
31using OpenSim.Framework.Serialization.External;
32using OpenMetaverse;
33using OpenMetaverse.StructuredData;
34using NUnit.Framework;
35
36namespace OpenSim.Framework.Serialization.Tests
37{
38 [TestFixture]
39 public class LandDataSerializerTest
40 {
41 private LandData land;
42 private LandData landWithParcelAccessList;
43
44 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>";
45 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>";
46
47
48
49
50 [SetUp]
51 public void setup()
52 {
53 // setup LandData object
54 this.land = new LandData();
55 this.land.AABBMax = new Vector3(0, 0, 0);
56 this.land.AABBMin = new Vector3(128, 128, 128);
57 this.land.Area = 128;
58 this.land.AuctionID = 0;
59 this.land.AuthBuyerID = new UUID();
60 this.land.Category = ParcelCategory.Residential;
61 this.land.ClaimDate = 0;
62 this.land.ClaimPrice = 0;
63 this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
64 this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
65 this.land.GroupPrims = 0;
66 this.land.Description = "land data to test LandDataSerializer";
67 this.land.Flags = (uint)(ParcelFlags.AllowDamage | ParcelFlags.AllowVoiceChat);
68 this.land.LandingType = (byte)LandingType.Direct;
69 this.land.Name = "LandDataSerializerTest Land";
70 this.land.Status = ParcelStatus.Leased;
71 this.land.LocalID = 0;
72 this.land.MediaAutoScale = (byte)0x01;
73 this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
74 this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
75 this.land.OwnerID = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf");
76
77 this.landWithParcelAccessList = this.land.Copy();
78 this.landWithParcelAccessList.ParcelAccessList.Clear();
79
80 ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry();
81 pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
82 pae0.Flags = AccessList.Ban;
83 pae0.Time = new DateTime(2009, 10, 01);
84 this.landWithParcelAccessList.ParcelAccessList.Add(pae0);
85
86 ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry();
87 pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
88 pae1.Flags = AccessList.Access;
89 pae1.Time = new DateTime(2010, 10, 20);
90 this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
91 }
92
93 /// <summary>
94 /// Test the LandDataSerializer.Serialize() method
95 /// </summary>
96 [Test]
97 public void LandDataSerializerSerializeTest()
98 {
99 string serialized = LandDataSerializer.Serialize(this.land);
100 Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
101 Assert.That(serialized == LandDataSerializerTest.preSerialized,
102 "result of Serialize(LandData) does not match expected result");
103
104 string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList);
105 Assert.That(serializedWithParcelAccessList.Length > 0,
106 "Serialize(LandData) returned empty string for LandData object with ParcelAccessList");
107 Assert.That(serializedWithParcelAccessList == LandDataSerializerTest.preSerializedWithParcelAccessList,
108 "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list");
109 }
110
111 /// <summary>
112 /// Test the LandDataSerializer.Deserialize() method
113 /// </summary>
114 [Test]
115 public void TestLandDataSerializerDeserializeFromStringTest()
116 {
117 LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
118 Assert.That(reifiedLandData != null, "Deserialize(string) returned null");
119 Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
120 Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
121
122 LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList);
123 Assert.That(reifiedLandDataWithParcelAccessList != null,
124 "Deserialize(string) returned null (pre-serialized with parcel access list)");
125 Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID,
126 "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)");
127 Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name,
128 "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)");
129 }
130 }
131}
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 7a244ff..632b551 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Framework.Servers
158 m_consoleAppender.Threshold = Level.All; 158 m_consoleAppender.Threshold = Level.All;
159 159
160 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); 160 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
161 } 161 }
162 162
163 m_console.Commands.AddCommand("base", false, "quit", 163 m_console.Commands.AddCommand("base", false, "quit",
164 "quit", 164 "quit",
@@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
196 196
197 /// <summary> 197 /// <summary>
198 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing 198 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
199 /// </summary> 199 /// </summary>
200 public virtual void ShutdownSpecific() {} 200 public virtual void ShutdownSpecific() {}
201 201
202 /// <summary> 202 /// <summary>
@@ -286,7 +286,7 @@ namespace OpenSim.Framework.Servers
286 /// </summary> 286 /// </summary>
287 public virtual void Startup() 287 public virtual void Startup()
288 { 288 {
289 m_log.Info("[STARTUP]: Beginning startup processing"); 289 m_log.Info("[STARTUP]: Beginning startup processing");
290 290
291 EnhanceVersionInformation(); 291 EnhanceVersionInformation();
292 292
@@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers
301 301
302 /// <summary> 302 /// <summary>
303 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing 303 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
304 /// </summary> 304 /// </summary>
305 public virtual void Shutdown() 305 public virtual void Shutdown()
306 { 306 {
307 ShutdownSpecific(); 307 ShutdownSpecific();
@@ -367,7 +367,7 @@ namespace OpenSim.Framework.Servers
367 } 367 }
368 368
369 public virtual void HandleShow(string module, string[] cmd) 369 public virtual void HandleShow(string module, string[] cmd)
370 { 370 {
371 List<string> args = new List<string>(cmd); 371 List<string> args = new List<string>(cmd);
372 372
373 args.RemoveAt(0); 373 args.RemoveAt(0);
@@ -375,7 +375,7 @@ namespace OpenSim.Framework.Servers
375 string[] showParams = args.ToArray(); 375 string[] showParams = args.ToArray();
376 376
377 switch (showParams[0]) 377 switch (showParams[0])
378 { 378 {
379 case "info": 379 case "info":
380 Notice("Version: " + m_version); 380 Notice("Version: " + m_version);
381 Notice("Startup directory: " + m_startupDirectory); 381 Notice("Startup directory: " + m_startupDirectory);
diff --git a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
index fe69ad3..5afa110 100644
--- a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
@@ -168,7 +168,7 @@ namespace OpenSim.Framework.Servers.HttpServer
168 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e); 168 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
169 } 169 }
170 170
171 }, null); 171 }, null);
172 } 172 }
173 } 173 }
174} 174}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 771ae05..6c63c6c 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers.HttpServer
110 110
111 public BaseHttpServer(uint port, bool ssl) : this (port) 111 public BaseHttpServer(uint port, bool ssl) : this (port)
112 { 112 {
113 m_ssl = ssl; 113 m_ssl = ssl;
114 } 114 }
115 115
116 public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl) 116 public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl)
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer
156 lock (m_rpcHandlers) 156 lock (m_rpcHandlers)
157 { 157 {
158 m_rpcHandlers[method] = handler; 158 m_rpcHandlers[method] = handler;
159 m_rpcHandlersKeepAlive[method] = keepAlive; // default 159 m_rpcHandlersKeepAlive[method] = keepAlive; // default
160 } 160 }
161 161
162 return true; 162 return true;
@@ -256,13 +256,51 @@ namespace OpenSim.Framework.Servers.HttpServer
256 IHttpClientContext context = (IHttpClientContext)source; 256 IHttpClientContext context = (IHttpClientContext)source;
257 IHttpRequest request = args.Request; 257 IHttpRequest request = args.Request;
258 258
259
260 PollServiceEventArgs psEvArgs; 259 PollServiceEventArgs psEvArgs;
260
261 if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) 261 if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs))
262 { 262 {
263 263 PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request);
264 m_PollServiceManager.Enqueue(new PollServiceHttpRequest(psEvArgs, context, request)); 264
265 //DoHTTPGruntWork(psEvArgs.NoEvents(),new OSHttpResponse(new HttpResponse(context, request))); 265 if (psEvArgs.Request != null)
266 {
267 OSHttpRequest req = new OSHttpRequest(context, request);
268
269 Stream requestStream = req.InputStream;
270
271 Encoding encoding = Encoding.UTF8;
272 StreamReader reader = new StreamReader(requestStream, encoding);
273
274 string requestBody = reader.ReadToEnd();
275
276 Hashtable keysvals = new Hashtable();
277 Hashtable headervals = new Hashtable();
278
279 string[] querystringkeys = req.QueryString.AllKeys;
280 string[] rHeaders = req.Headers.AllKeys;
281
282 keysvals.Add("body", requestBody);
283 keysvals.Add("uri", req.RawUrl);
284 keysvals.Add("content-type", req.ContentType);
285 keysvals.Add("http-method", req.HttpMethod);
286
287 foreach (string queryname in querystringkeys)
288 {
289 keysvals.Add(queryname, req.QueryString[queryname]);
290 }
291
292 foreach (string headername in rHeaders)
293 {
294 headervals[headername] = req.Headers[headername];
295 }
296
297 keysvals.Add("headers",headervals);
298 keysvals.Add("querystringkeys", querystringkeys);
299
300 psEvArgs.Request(psreq.RequestID, keysvals);
301 }
302
303 m_PollServiceManager.Enqueue(psreq);
266 } 304 }
267 else 305 else
268 { 306 {
@@ -275,49 +313,17 @@ namespace OpenSim.Framework.Servers.HttpServer
275 { 313 {
276 OSHttpRequest req = new OSHttpRequest(context, request); 314 OSHttpRequest req = new OSHttpRequest(context, request);
277 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); 315 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
278 //resp.KeepAlive = req.KeepAlive;
279 //m_log.Info("[Debug BASE HTTP SERVER]: Got Request");
280 //HttpServerContextObj objstate= new HttpServerContextObj(req,resp);
281 //ThreadPool.QueueUserWorkItem(new WaitCallback(ConvertIHttpClientContextToOSHttp), (object)objstate);
282 HandleRequest(req, resp); 316 HandleRequest(req, resp);
283 } 317 }
284 318
285 public void ConvertIHttpClientContextToOSHttp(object stateinfo) 319 public void ConvertIHttpClientContextToOSHttp(object stateinfo)
286 { 320 {
287 HttpServerContextObj objstate = (HttpServerContextObj)stateinfo; 321 HttpServerContextObj objstate = (HttpServerContextObj)stateinfo;
288 //OSHttpRequest request = new OSHttpRequest(objstate.context,objstate.req);
289 //OSHttpResponse resp = new OSHttpResponse(new HttpServer.HttpResponse(objstate.context, objstate.req));
290 322
291 OSHttpRequest request = objstate.oreq; 323 OSHttpRequest request = objstate.oreq;
292 OSHttpResponse resp = objstate.oresp; 324 OSHttpResponse resp = objstate.oresp;
293 //OSHttpResponse resp = new OSHttpResponse(new HttpServer.HttpResponse(objstate.context, objstate.req));
294 325
295 /* 326 HandleRequest(request,resp);
296 request.AcceptTypes = objstate.req.AcceptTypes;
297 request.ContentLength = (long)objstate.req.ContentLength;
298 request.Headers = objstate.req.Headers;
299 request.HttpMethod = objstate.req.Method;
300 request.InputStream = objstate.req.Body;
301 foreach (string str in request.Headers)
302 {
303 if (str.ToLower().Contains("content-type: "))
304 {
305 request.ContentType = str.Substring(13, str.Length - 13);
306 break;
307 }
308 }
309 //request.KeepAlive = objstate.req.
310 foreach (HttpServer.HttpInput httpinput in objstate.req.QueryString)
311 {
312 request.QueryString.Add(httpinput.Name, httpinput[httpinput.Name]);
313 }
314
315 //request.Query = objstate.req.//objstate.req.QueryString;
316 //foreach (
317 //request.QueryString = objstate.req.QueryString;
318
319 */
320 HandleRequest(request,resp);
321 } 327 }
322 328
323 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 329 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
@@ -332,6 +338,7 @@ namespace OpenSim.Framework.Servers.HttpServer
332 // probability event; if a request is matched it is normally expected to be 338 // probability event; if a request is matched it is normally expected to be
333 // handled 339 // handled
334 //m_log.Debug("[BASE HTTP SERVER]: Handling Request" + request.RawUrl); 340 //m_log.Debug("[BASE HTTP SERVER]: Handling Request" + request.RawUrl);
341
335 IHttpAgentHandler agentHandler; 342 IHttpAgentHandler agentHandler;
336 343
337 if (TryGetAgentHandler(request, response, out agentHandler)) 344 if (TryGetAgentHandler(request, response, out agentHandler))
@@ -342,10 +349,11 @@ namespace OpenSim.Framework.Servers.HttpServer
342 } 349 }
343 } 350 }
344 351
345 IRequestHandler requestHandler;
346 //response.KeepAlive = true; 352 //response.KeepAlive = true;
347 response.SendChunked = false; 353 response.SendChunked = false;
348 354
355 IRequestHandler requestHandler;
356
349 string path = request.RawUrl; 357 string path = request.RawUrl;
350 string handlerKey = GetHandlerKey(request.HttpMethod, path); 358 string handlerKey = GetHandlerKey(request.HttpMethod, path);
351 359
@@ -359,6 +367,7 @@ namespace OpenSim.Framework.Servers.HttpServer
359 367
360 response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. 368 response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type.
361 369
370
362 if (requestHandler is IStreamedRequestHandler) 371 if (requestHandler is IStreamedRequestHandler)
363 { 372 {
364 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; 373 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
@@ -404,6 +413,7 @@ namespace OpenSim.Framework.Servers.HttpServer
404 // } 413 // }
405 414
406 keysvals.Add("requestbody", requestBody); 415 keysvals.Add("requestbody", requestBody);
416 keysvals.Add("headers",headervals);
407 if (keysvals.Contains("method")) 417 if (keysvals.Contains("method"))
408 { 418 {
409 //m_log.Warn("[HTTP]: Contains Method"); 419 //m_log.Warn("[HTTP]: Contains Method");
@@ -702,7 +712,7 @@ namespace OpenSim.Framework.Servers.HttpServer
702 lock (m_rpcHandlers) 712 lock (m_rpcHandlers)
703 { 713 {
704 methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method); 714 methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method);
705 } 715 }
706 716
707 if (methodWasFound) 717 if (methodWasFound)
708 { 718 {
@@ -726,8 +736,11 @@ namespace OpenSim.Framework.Servers.HttpServer
726 else 736 else
727 { 737 {
728 xmlRpcResponse = new XmlRpcResponse(); 738 xmlRpcResponse = new XmlRpcResponse();
739
729 // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php 740 // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
730 xmlRpcResponse.SetFault(-32601, String.Format("Requested method [{0}] not found", methodName)); 741 xmlRpcResponse.SetFault(
742 XmlRpcErrorCodes.SERVER_ERROR_METHOD,
743 String.Format("Requested method [{0}] not found", methodName));
731 } 744 }
732 745
733 responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); 746 responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
@@ -747,6 +760,7 @@ namespace OpenSim.Framework.Servers.HttpServer
747 response.SendChunked = false; 760 response.SendChunked = false;
748 response.ContentLength64 = buf.Length; 761 response.ContentLength64 = buf.Length;
749 response.ContentEncoding = Encoding.UTF8; 762 response.ContentEncoding = Encoding.UTF8;
763
750 try 764 try
751 { 765 {
752 response.OutputStream.Write(buf, 0, buf.Length); 766 response.OutputStream.Write(buf, 0, buf.Length);
@@ -917,7 +931,7 @@ namespace OpenSim.Framework.Servers.HttpServer
917 } 931 }
918 catch (IOException e) 932 catch (IOException e)
919 { 933 {
920 m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e); 934 m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e);
921 } 935 }
922 catch (SocketException e) 936 catch (SocketException e)
923 { 937 {
@@ -1354,7 +1368,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1354 bestMatch = pattern; 1368 bestMatch = pattern;
1355 } 1369 }
1356 } 1370 }
1357 } 1371 }
1358 1372
1359 if (String.IsNullOrEmpty(bestMatch)) 1373 if (String.IsNullOrEmpty(bestMatch))
1360 { 1374 {
@@ -1466,7 +1480,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1466 { 1480 {
1467 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); 1481 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message);
1468 } 1482 }
1469 } 1483 }
1470 } 1484 }
1471 1485
1472 public void SendHTML404(OSHttpResponse response, string host) 1486 public void SendHTML404(OSHttpResponse response, string host)
@@ -1575,7 +1589,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1575 // if you want more detailed trace information from the HttpServer 1589 // if you want more detailed trace information from the HttpServer
1576 //m_httpListener2.UseTraceLogs = true; 1590 //m_httpListener2.UseTraceLogs = true;
1577 1591
1578 //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; 1592 //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor;
1579 } 1593 }
1580 else 1594 else
1581 { 1595 {
@@ -1610,7 +1624,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1610 } 1624 }
1611 1625
1612 public void httpServerDisconnectMonitor(IHttpClientContext source, SocketError err) 1626 public void httpServerDisconnectMonitor(IHttpClientContext source, SocketError err)
1613 { 1627 {
1614 switch (err) 1628 switch (err)
1615 { 1629 {
1616 case SocketError.NotSocket: 1630 case SocketError.NotSocket:
@@ -1621,7 +1635,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1621 } 1635 }
1622 1636
1623 public void httpServerException(object source, Exception exception) 1637 public void httpServerException(object source, Exception exception)
1624 { 1638 {
1625 m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); 1639 m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
1626 /* 1640 /*
1627 if (HTTPDRunning)// && NotSocketErrors > 5) 1641 if (HTTPDRunning)// && NotSocketErrors > 5)
@@ -1648,7 +1662,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1648 } 1662 }
1649 catch (NullReferenceException) 1663 catch (NullReferenceException)
1650 { 1664 {
1651 m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer."); 1665 m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer.");
1652 } 1666 }
1653 1667
1654 } 1668 }
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
index 1bdf4fa..d13408d 100644
--- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
@@ -128,6 +128,6 @@ namespace OpenSim.Framework.Servers.HttpServer
128 128
129 string GetHTTP404(string host); 129 string GetHTTP404(string host);
130 130
131 string GetHTTP500(); 131 string GetHTTP500();
132 } 132 }
133} 133}
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index fed490e..9d512c6 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -30,20 +30,23 @@ using System.Collections;
30using OpenMetaverse; 30using OpenMetaverse;
31namespace OpenSim.Framework.Servers.HttpServer 31namespace OpenSim.Framework.Servers.HttpServer
32{ 32{
33 public delegate bool HasEventsMethod(UUID pId); 33 public delegate void RequestMethod(UUID requestID, Hashtable request);
34 public delegate bool HasEventsMethod(UUID requestID, UUID pId);
34 35
35 public delegate Hashtable GetEventsMethod(UUID pId, string request); 36 public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId, string request);
36 37
37 public delegate Hashtable NoEventsMethod(); 38 public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId);
38 39
39 public class PollServiceEventArgs : EventArgs 40 public class PollServiceEventArgs : EventArgs
40 { 41 {
41 public HasEventsMethod HasEvents; 42 public HasEventsMethod HasEvents;
42 public GetEventsMethod GetEvents; 43 public GetEventsMethod GetEvents;
43 public NoEventsMethod NoEvents; 44 public NoEventsMethod NoEvents;
45 public RequestMethod Request;
44 public UUID Id; 46 public UUID Id;
45 public PollServiceEventArgs(HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId) 47 public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId)
46 { 48 {
49 Request = pRequest;
47 HasEvents = pHasEvents; 50 HasEvents = pHasEvents;
48 GetEvents = pGetEvents; 51 GetEvents = pGetEvents;
49 NoEvents = pNoEvents; 52 NoEvents = pNoEvents;
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index ff7c1e8..553a7eb 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using HttpServer; 29using HttpServer;
30using OpenMetaverse;
30 31
31namespace OpenSim.Framework.Servers.HttpServer 32namespace OpenSim.Framework.Servers.HttpServer
32{ 33{
@@ -37,12 +38,14 @@ namespace OpenSim.Framework.Servers.HttpServer
37 public readonly IHttpClientContext HttpContext; 38 public readonly IHttpClientContext HttpContext;
38 public readonly IHttpRequest Request; 39 public readonly IHttpRequest Request;
39 public readonly int RequestTime; 40 public readonly int RequestTime;
41 public readonly UUID RequestID;
40 public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) 42 public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest)
41 { 43 {
42 PollServiceArgs = pPollServiceArgs; 44 PollServiceArgs = pPollServiceArgs;
43 HttpContext = pHttpContext; 45 HttpContext = pHttpContext;
44 Request = pRequest; 46 Request = pRequest;
45 RequestTime = System.Environment.TickCount; 47 RequestTime = System.Environment.TickCount;
48 RequestID = UUID.Random();
46 } 49 }
47 } 50 }
48} 51}
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 4020190..1c54581 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer
130 foreach (object o in m_requests) 130 foreach (object o in m_requests)
131 { 131 {
132 PollServiceHttpRequest req = (PollServiceHttpRequest) o; 132 PollServiceHttpRequest req = (PollServiceHttpRequest) o;
133 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); 133 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));
134 } 134 }
135 135
136 m_requests.Clear(); 136 m_requests.Clear();
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs
index 41fb376..ce32443 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs
@@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers.HttpServer
100 PollServiceHttpRequest req = m_request.Dequeue(); 100 PollServiceHttpRequest req = m_request.Dequeue();
101 try 101 try
102 { 102 {
103 if (req.PollServiceArgs.HasEvents(req.PollServiceArgs.Id)) 103 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
104 { 104 {
105 StreamReader str = new StreamReader(req.Request.Body); 105 StreamReader str = new StreamReader(req.Request.Body);
106 106
107 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd()); 107 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
108 m_server.DoHTTPGruntWork(responsedata, 108 m_server.DoHTTPGruntWork(responsedata,
109 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); 109 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
110 } 110 }
@@ -112,7 +112,7 @@ namespace OpenSim.Framework.Servers.HttpServer
112 { 112 {
113 if ((Environment.TickCount - req.RequestTime) > m_timeout) 113 if ((Environment.TickCount - req.RequestTime) > m_timeout)
114 { 114 {
115 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), 115 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
116 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); 116 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
117 } 117 }
118 else 118 else
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
new file mode 100644
index 0000000..a0d4008
--- /dev/null
+++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
@@ -0,0 +1,95 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.IO;
30using System.Net;
31using System.Text;
32using System.Xml;
33using System.Xml.Serialization;
34
35namespace OpenSim.Framework.Servers.HttpServer
36{
37 public class SynchronousRestFormsRequester
38 {
39 /// <summary>
40 /// Perform a synchronous REST request.
41 /// </summary>
42 /// <param name="verb"></param>
43 /// <param name="requestUrl"></param>
44 /// <param name="obj"> </param>
45 /// <returns></returns>
46 ///
47 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
48 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
49 public static string MakeRequest(string verb, string requestUrl, string obj)
50 {
51 WebRequest request = WebRequest.Create(requestUrl);
52 request.Method = verb;
53
54 if ((verb == "POST") || (verb == "PUT"))
55 {
56 request.ContentType = "text/www-form-urlencoded";
57
58 MemoryStream buffer = new MemoryStream();
59 int length = 0;
60 using (StreamWriter writer = new StreamWriter(buffer))
61 {
62 writer.Write(obj);
63 writer.Flush();
64 }
65
66 length = (int)obj.Length;
67 request.ContentLength = length;
68
69 Stream requestStream = request.GetRequestStream();
70 requestStream.Write(buffer.ToArray(), 0, length);
71 }
72
73 string respstring = String.Empty;
74
75 try
76 {
77 using (WebResponse resp = request.GetResponse())
78 {
79 if (resp.ContentLength > 0)
80 {
81 using (StreamReader reader = new StreamReader(resp.GetResponseStream()))
82 {
83 respstring = reader.ReadToEnd();
84 }
85 }
86 }
87 }
88 catch (System.InvalidOperationException)
89 {
90 // This is what happens when there is invalid XML
91 }
92 return respstring;
93 }
94 }
95}
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index 6f9b00c..9f98310 100644
--- a/OpenSim/Framework/Servers/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -29,7 +29,7 @@ namespace OpenSim
29{ 29{
30 public class VersionInfo 30 public class VersionInfo
31 { 31 {
32 private const string VERSION_NUMBER = "0.6.6"; 32 private const string VERSION_NUMBER = "0.6.8";
33 private const Flavour VERSION_FLAVOUR = Flavour.Dev; 33 private const Flavour VERSION_FLAVOUR = Flavour.Dev;
34 34
35 public enum Flavour 35 public enum Flavour
@@ -56,7 +56,7 @@ namespace OpenSim
56 public const int VERSIONINFO_VERSION_LENGTH = 27; 56 public const int VERSIONINFO_VERSION_LENGTH = 27;
57 57
58 /// <value> 58 /// <value>
59 /// This is the external interface version. It is separate from the OpenSimulator project version. 59 /// This is the external interface version. It is separate from the OpenSimulator project version.
60 /// 60 ///
61 /// This version number should be 61 /// This version number should be
62 /// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible 62 /// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible
@@ -67,7 +67,7 @@ namespace OpenSim
67 /// 67 ///
68 /// Having this version number allows the grid service to reject connections from regions running a version 68 /// Having this version number allows the grid service to reject connections from regions running a version
69 /// of the code that is too old. 69 /// of the code that is too old.
70 /// 70 ///
71 /// </value> 71 /// </value>
72 public readonly static int MajorInterfaceVersion = 6; 72 public readonly static int MajorInterfaceVersion = 6;
73 } 73 }
diff --git a/OpenSim/Framework/SimStats.cs b/OpenSim/Framework/SimStats.cs
index 084964d..3d8f32f 100644
--- a/OpenSim/Framework/SimStats.cs
+++ b/OpenSim/Framework/SimStats.cs
@@ -35,9 +35,9 @@ namespace OpenSim.Framework
35 /// 35 ///
36 /// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats 36 /// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats
37 /// storage. 37 /// storage.
38 /// </summary> 38 /// </summary>
39 public class SimStats 39 public class SimStats
40 { 40 {
41 public uint RegionX 41 public uint RegionX
42 { 42 {
43 get { return m_regionX; } 43 get { return m_regionX; }
@@ -47,25 +47,25 @@ namespace OpenSim.Framework
47 public uint RegionY 47 public uint RegionY
48 { 48 {
49 get { return m_regionY; } 49 get { return m_regionY; }
50 } 50 }
51 private uint m_regionY; 51 private uint m_regionY;
52 52
53 public SimStatsPacket.RegionBlock RegionBlock 53 public SimStatsPacket.RegionBlock RegionBlock
54 { 54 {
55 get { return m_regionBlock; } 55 get { return m_regionBlock; }
56 } 56 }
57 private SimStatsPacket.RegionBlock m_regionBlock; 57 private SimStatsPacket.RegionBlock m_regionBlock;
58 58
59 public SimStatsPacket.StatBlock[] StatsBlock 59 public SimStatsPacket.StatBlock[] StatsBlock
60 { 60 {
61 get { return m_statsBlock; } 61 get { return m_statsBlock; }
62 } 62 }
63 private SimStatsPacket.StatBlock[] m_statsBlock; 63 private SimStatsPacket.StatBlock[] m_statsBlock;
64 64
65 public uint RegionFlags 65 public uint RegionFlags
66 { 66 {
67 get { return m_regionFlags; } 67 get { return m_regionFlags; }
68 } 68 }
69 private uint m_regionFlags; 69 private uint m_regionFlags;
70 70
71 public uint ObjectCapacity 71 public uint ObjectCapacity
@@ -76,7 +76,7 @@ namespace OpenSim.Framework
76 76
77 public UUID RegionUUID 77 public UUID RegionUUID
78 { 78 {
79 get { return regionUUID;} 79 get { return regionUUID; }
80 } 80 }
81 private UUID regionUUID; 81 private UUID regionUUID;
82 82
diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs
index 946d7f5..25ae6b0 100644
--- a/OpenSim/Framework/TaskInventoryDictionary.cs
+++ b/OpenSim/Framework/TaskInventoryDictionary.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework
38 /// A dictionary for task inventory. 38 /// A dictionary for task inventory.
39 /// </summary> 39 /// </summary>
40 /// This class is not thread safe. Callers must synchronize on Dictionary methods or Clone() this object before 40 /// This class is not thread safe. Callers must synchronize on Dictionary methods or Clone() this object before
41 /// iterating over it. 41 /// iterating over it.
42 public class TaskInventoryDictionary : Dictionary<UUID, TaskInventoryItem>, 42 public class TaskInventoryDictionary : Dictionary<UUID, TaskInventoryItem>,
43 ICloneable, IXmlSerializable 43 ICloneable, IXmlSerializable
44 { 44 {
diff --git a/OpenSim/Framework/ThreadTracker.cs b/OpenSim/Framework/ThreadTracker.cs
index fa6f0b8..d3a239d 100644
--- a/OpenSim/Framework/ThreadTracker.cs
+++ b/OpenSim/Framework/ThreadTracker.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Framework
57 } 57 }
58 58
59 private static void ThreadTrackerThreadLoop() 59 private static void ThreadTrackerThreadLoop()
60 { 60 {
61 try 61 try
62 { 62 {
63 while (true) 63 while (true)
@@ -70,8 +70,8 @@ namespace OpenSim.Framework
70 { 70 {
71 m_log.ErrorFormat( 71 m_log.ErrorFormat(
72 "[THREAD TRACKER]: Thread tracker cleanup thread terminating with exception. Please report this error. Exception is {0}", 72 "[THREAD TRACKER]: Thread tracker cleanup thread terminating with exception. Please report this error. Exception is {0}",
73 e); 73 e);
74 } 74 }
75 } 75 }
76 76
77 public static void Add(Thread thread) 77 public static void Add(Thread thread)
diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs
index 16f265c..0fa82cf 100644
--- a/OpenSim/Framework/UserConfig.cs
+++ b/OpenSim/Framework/UserConfig.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Framework
133 m_configMember.addConfigurationOption("library_location", 133 m_configMember.addConfigurationOption("library_location",
134 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 134 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
135 "Path to library control file", 135 "Path to library control file",
136 string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); 136 string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false);
137 137
138 m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, 138 m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
139 "DLL for database provider", "OpenSim.Data.MySQL.dll", false); 139 "DLL for database provider", "OpenSim.Data.MySQL.dll", false);
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index f51a199..413f152 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -217,7 +217,7 @@ namespace OpenSim.Framework
217 public string Name 217 public string Name
218 { 218 {
219 get { return String.Format("{0} {1}", m_firstname, m_surname); } 219 get { return String.Format("{0} {1}", m_firstname, m_surname); }
220 } 220 }
221 221
222 public string Email 222 public string Email
223 { 223 {
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 58344f3..17fc58c 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Framework
54 /// </summary> 54 /// </summary>
55 public class Util 55 public class Util
56 { 56 {
57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 58
59 private static uint nextXferID = 5000; 59 private static uint nextXferID = 5000;
60 private static Random randomClass = new Random(); 60 private static Random randomClass = new Random();
@@ -70,6 +70,39 @@ namespace OpenSim.Framework
70 public static readonly Regex UUIDPattern 70 public static readonly Regex UUIDPattern
71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); 71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
72 72
73 /// <summary>
74 /// Linear interpolates B<->C using percent A
75 /// </summary>
76 /// <param name="a"></param>
77 /// <param name="b"></param>
78 /// <param name="c"></param>
79 /// <returns></returns>
80 public static double lerp(double a, double b, double c)
81 {
82 return (b*a) + (c*(1 - a));
83 }
84
85 /// <summary>
86 /// Bilinear Interpolate, see Lerp but for 2D using 'percents' X & Y.
87 /// Layout:
88 /// A B
89 /// C D
90 /// A<->C = Y
91 /// C<->D = X
92 /// </summary>
93 /// <param name="x"></param>
94 /// <param name="y"></param>
95 /// <param name="a"></param>
96 /// <param name="b"></param>
97 /// <param name="c"></param>
98 /// <param name="d"></param>
99 /// <returns></returns>
100 public static double lerp2D(double x, double y, double a, double b, double c, double d)
101 {
102 return lerp(y, lerp(x, a, b), lerp(x, c, d));
103 }
104
105
73 /// <value> 106 /// <value>
74 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) 107 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards)
75 /// </value> 108 /// </value>
@@ -103,7 +136,7 @@ namespace OpenSim.Framework
103 float dx = a.X - b.X; 136 float dx = a.X - b.X;
104 float dy = a.Y - b.Y; 137 float dy = a.Y - b.Y;
105 float dz = a.Z - b.Z; 138 float dz = a.Z - b.Z;
106 return (dx*dx + dy*dy + dz*dz) < (amount*amount); 139 return (dx*dx + dy*dy + dz*dz) < (amount*amount);
107 } 140 }
108 141
109 /// <summary> 142 /// <summary>
@@ -942,7 +975,7 @@ namespace OpenSim.Framework
942 else 975 else
943 { 976 {
944 os = ReadEtcIssue(); 977 os = ReadEtcIssue();
945 } 978 }
946 979
947 if (os.Length > 45) 980 if (os.Length > 45)
948 { 981 {
@@ -1170,6 +1203,32 @@ namespace OpenSim.Framework
1170 return found.ToArray(); 1203 return found.ToArray();
1171 } 1204 }
1172 1205
1206 public static string ServerURI(string uri)
1207 {
1208 if (uri == string.Empty)
1209 return string.Empty;
1210
1211 // Get rid of eventual slashes at the end
1212 uri = uri.TrimEnd('/');
1213
1214 IPAddress ipaddr1 = null;
1215 string port1 = "";
1216 try
1217 {
1218 ipaddr1 = Util.GetHostFromURL(uri);
1219 }
1220 catch { }
1221
1222 try
1223 {
1224 port1 = uri.Split(new char[] { ':' })[2];
1225 }
1226 catch { }
1227
1228 // We tried our best to convert the domain names to IP addresses
1229 return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri;
1230 }
1231
1173 #region FireAndForget Threading Pattern 1232 #region FireAndForget Threading Pattern
1174 1233
1175 public static void FireAndForget(System.Threading.WaitCallback callback) 1234 public static void FireAndForget(System.Threading.WaitCallback callback)
diff --git a/OpenSim/Grid/MessagingServer.Modules/MessageService.cs b/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
index 6f2c1ba..df5eaab 100644
--- a/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
@@ -324,44 +324,53 @@ namespace OpenSim.Grid.MessagingServer.Modules
324 /// <returns></returns> 324 /// <returns></returns>
325 public XmlRpcResponse UserLoggedOn(XmlRpcRequest request, IPEndPoint remoteClient) 325 public XmlRpcResponse UserLoggedOn(XmlRpcRequest request, IPEndPoint remoteClient)
326 { 326 {
327 Hashtable requestData = (Hashtable)request.Params[0]; 327 try
328 {
329 Hashtable requestData = (Hashtable)request.Params[0];
330
331 AgentCircuitData agentData = new AgentCircuitData();
332 agentData.SessionID = new UUID((string)requestData["sessionid"]);
333 agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]);
334 agentData.firstname = (string)requestData["firstname"];
335 agentData.lastname = (string)requestData["lastname"];
336 agentData.AgentID = new UUID((string)requestData["agentid"]);
337 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
338 agentData.CapsPath = (string)requestData["caps_path"];
339
340 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
341 {
342 agentData.child = true;
343 }
344 else
345 {
346 agentData.startpos =
347 new Vector3(Convert.ToSingle(requestData["positionx"]),
348 Convert.ToSingle(requestData["positiony"]),
349 Convert.ToSingle(requestData["positionz"]));
350 agentData.child = false;
351 }
328 352
329 AgentCircuitData agentData = new AgentCircuitData(); 353 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
330 agentData.SessionID = new UUID((string)requestData["sessionid"]); 354
331 agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]); 355 m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
332 agentData.firstname = (string)requestData["firstname"]; 356 agentData.firstname, agentData.lastname, regionHandle, agentData.child ? "child" : "root");
333 agentData.lastname = (string)requestData["lastname"]; 357
334 agentData.AgentID = new UUID((string)requestData["agentid"]); 358 UserPresenceData up = new UserPresenceData();
335 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 359 up.agentData = agentData;
336 agentData.CapsPath = (string)requestData["caps_path"]; 360 up.friendData = GetUserFriendList(agentData.AgentID);
361 up.regionData = m_regionModule.GetRegionInfo(regionHandle);
362 up.OnlineYN = true;
363 up.lookupUserRegionYN = false;
364 ProcessFriendListSubscriptions(up);
337 365
338 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
339 {
340 agentData.child = true;
341 } 366 }
342 else 367 catch (Exception e)
343 { 368 {
344 agentData.startpos = 369 m_log.WarnFormat("[LOGIN]: Exception on UserLoggedOn: {0}", e);
345 new Vector3(Convert.ToSingle(requestData["positionx"]),
346 Convert.ToSingle(requestData["positiony"]),
347 Convert.ToSingle(requestData["positionz"]));
348 agentData.child = false;
349 } 370 }
350 371
351 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
352
353 m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
354 agentData.firstname, agentData.lastname, regionHandle, agentData.child ? "child" : "root");
355
356 UserPresenceData up = new UserPresenceData();
357 up.agentData = agentData;
358 up.friendData = GetUserFriendList(agentData.AgentID);
359 up.regionData = m_regionModule.GetRegionInfo(regionHandle);
360 up.OnlineYN = true;
361 up.lookupUserRegionYN = false;
362 ProcessFriendListSubscriptions(up);
363
364 return new XmlRpcResponse(); 372 return new XmlRpcResponse();
373
365 } 374 }
366 375
367 /// <summary> 376 /// <summary>
@@ -372,11 +381,18 @@ namespace OpenSim.Grid.MessagingServer.Modules
372 /// <returns></returns> 381 /// <returns></returns>
373 public XmlRpcResponse UserLoggedOff(XmlRpcRequest request, IPEndPoint remoteClient) 382 public XmlRpcResponse UserLoggedOff(XmlRpcRequest request, IPEndPoint remoteClient)
374 { 383 {
375 m_log.Info("[USERLOGOFF]: User logged off called"); 384 try
376 Hashtable requestData = (Hashtable)request.Params[0]; 385 {
386 m_log.Info("[USERLOGOFF]: User logged off called");
387 Hashtable requestData = (Hashtable)request.Params[0];
377 388
378 UUID AgentID = new UUID((string)requestData["agentid"]); 389 UUID AgentID = new UUID((string)requestData["agentid"]);
379 ProcessLogOff(AgentID); 390 ProcessLogOff(AgentID);
391 }
392 catch (Exception e)
393 {
394 m_log.WarnFormat("[USERLOGOFF]: Exception on UserLoggedOff: {0}", e);
395 }
380 396
381 return new XmlRpcResponse(); 397 return new XmlRpcResponse();
382 } 398 }
diff --git a/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs b/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs
index 8006119..76c4899 100644
--- a/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs
+++ b/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs
@@ -70,6 +70,6 @@ namespace OpenSim.Grid.MessagingServer.Modules
70 { 70 {
71 //throw new Exception("The method or operation is not implemented."); 71 //throw new Exception("The method or operation is not implemented.");
72 return null; 72 return null;
73 } 73 }
74 } 74 }
75} 75}
diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
index 9d31d81..77caf47 100644
--- a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Grid.UserServer.Modules
47 47
48 /// <summary> 48 /// <summary>
49 /// Hypergrid login service used in grid mode. 49 /// Hypergrid login service used in grid mode.
50 /// </summary> 50 /// </summary>
51 public class UserLoginAuthService : HGLoginAuthService 51 public class UserLoginAuthService : HGLoginAuthService
52 { 52 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
index 01d5537..7d0e0de 100644
--- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
@@ -34,6 +34,7 @@ using System.Text.RegularExpressions;
34using log4net; 34using log4net;
35using Nwc.XmlRpc; 35using Nwc.XmlRpc;
36using OpenMetaverse; 36using OpenMetaverse;
37using Nini.Config;
37using OpenSim.Data; 38using OpenSim.Data;
38using OpenSim.Framework; 39using OpenSim.Framework;
39using OpenSim.Framework.Communications; 40using OpenSim.Framework.Communications;
@@ -42,6 +43,9 @@ using OpenSim.Framework.Communications.Cache;
42using OpenSim.Framework.Capabilities; 43using OpenSim.Framework.Capabilities;
43using OpenSim.Framework.Servers; 44using OpenSim.Framework.Servers;
44using OpenSim.Framework.Servers.HttpServer; 45using OpenSim.Framework.Servers.HttpServer;
46using OpenSim.Services.Interfaces;
47using OpenSim.Services.Connectors;
48using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45 49
46namespace OpenSim.Grid.UserServer.Modules 50namespace OpenSim.Grid.UserServer.Modules
47{ 51{
@@ -51,7 +55,7 @@ namespace OpenSim.Grid.UserServer.Modules
51 55
52 /// <summary> 56 /// <summary>
53 /// Login service used in grid mode. 57 /// Login service used in grid mode.
54 /// </summary> 58 /// </summary>
55 public class UserLoginService : LoginService 59 public class UserLoginService : LoginService
56 { 60 {
57 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -63,6 +67,8 @@ namespace OpenSim.Grid.UserServer.Modules
63 public UserConfig m_config; 67 public UserConfig m_config;
64 private readonly IRegionProfileRouter m_regionProfileService; 68 private readonly IRegionProfileRouter m_regionProfileService;
65 69
70 private IGridService m_GridService;
71
66 protected BaseHttpServer m_httpServer; 72 protected BaseHttpServer m_httpServer;
67 73
68 public UserLoginService( 74 public UserLoginService(
@@ -76,6 +82,8 @@ namespace OpenSim.Grid.UserServer.Modules
76 m_defaultHomeY = m_config.DefaultY; 82 m_defaultHomeY = m_config.DefaultY;
77 m_interInventoryService = inventoryService; 83 m_interInventoryService = inventoryService;
78 m_regionProfileService = regionProfileService; 84 m_regionProfileService = regionProfileService;
85
86 m_GridService = new GridServicesConnector(config.GridServerURL.ToString());
79 } 87 }
80 88
81 public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers) 89 public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers)
@@ -203,47 +211,38 @@ namespace OpenSim.Grid.UserServer.Modules
203 211
204 protected override RegionInfo RequestClosestRegion(string region) 212 protected override RegionInfo RequestClosestRegion(string region)
205 { 213 {
206 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(region, 214 return GridRegionToRegionInfo(m_GridService.GetRegionByName(UUID.Zero, region));
207 m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
208
209 if (profileData != null)
210 {
211 return profileData.ToRegionInfo();
212 }
213 else
214 {
215 return null;
216 }
217 } 215 }
218 216
219 protected override RegionInfo GetRegionInfo(ulong homeRegionHandle) 217 protected override RegionInfo GetRegionInfo(ulong homeRegionHandle)
220 { 218 {
221 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionHandle, 219 uint x = 0, y = 0;
222 m_config.GridServerURL, m_config.GridSendKey, 220 Utils.LongToUInts(homeRegionHandle, out x, out y);
223 m_config.GridRecvKey); 221 return GridRegionToRegionInfo(m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y));
224 if (profileData != null)
225 {
226 return profileData.ToRegionInfo();
227 }
228 else
229 {
230 return null;
231 }
232 } 222 }
233 223
234 protected override RegionInfo GetRegionInfo(UUID homeRegionId) 224 protected override RegionInfo GetRegionInfo(UUID homeRegionId)
235 { 225 {
236 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionId, 226 return GridRegionToRegionInfo(m_GridService.GetRegionByUUID(UUID.Zero, homeRegionId));
237 m_config.GridServerURL, m_config.GridSendKey, 227 }
238 m_config.GridRecvKey); 228
239 if (profileData != null) 229 private RegionInfo GridRegionToRegionInfo(GridRegion gregion)
240 { 230 {
241 return profileData.ToRegionInfo(); 231 if (gregion == null)
242 }
243 else
244 {
245 return null; 232 return null;
246 } 233
234 RegionInfo rinfo = new RegionInfo();
235 rinfo.ExternalHostName = gregion.ExternalHostName;
236 rinfo.HttpPort = gregion.HttpPort;
237 rinfo.InternalEndPoint = gregion.InternalEndPoint;
238 rinfo.RegionID = gregion.RegionID;
239 rinfo.RegionLocX = (uint)(gregion.RegionLocX / Constants.RegionSize);
240 rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize);
241 rinfo.RegionName = gregion.RegionName;
242 rinfo.ScopeID = gregion.ScopeID;
243 rinfo.ServerURI = gregion.ServerURI;
244
245 return rinfo;
247 } 246 }
248 247
249 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) 248 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
@@ -280,9 +279,8 @@ namespace OpenSim.Grid.UserServer.Modules
280 //response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath); 279 //response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath);
281 280
282 // Take off trailing / so that the caps path isn't //CAPS/someUUID 281 // Take off trailing / so that the caps path isn't //CAPS/someUUID
283 if (regionInfo.httpServerURI.EndsWith("/")) 282 string uri = regionInfo.httpServerURI.Trim(new char[] { '/' });
284 regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1); 283 response.SeedCapability = uri + CapsUtil.GetCapsSeedPath(capsPath);
285 response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath);
286 284
287 285
288 // Notify the target of an incoming user 286 // Notify the target of an incoming user
diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs
index 002f232..36c6297 100644
--- a/OpenSim/Grid/UserServer.Modules/UserManager.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs
@@ -108,6 +108,9 @@ namespace OpenSim.Grid.UserServer.Modules
108 m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID); 108 m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID);
109 m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar); 109 m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar);
110 110
111 // Used by IAR module to do password checks
112 m_httpServer.AddXmlRPCHandler("authenticate_user_by_password", XmlRPCAuthenticateUserMethodPassword);
113
111 m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion); 114 m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion);
112 m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID); 115 m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID);
113 m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID); 116 m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID);
@@ -203,6 +206,57 @@ namespace OpenSim.Grid.UserServer.Modules
203 206
204 #region XMLRPC User Methods 207 #region XMLRPC User Methods
205 208
209 /// <summary>
210 /// Authenticate a user using their password
211 /// </summary>
212 /// <param name="request">Must contain values for "user_uuid" and "password" keys</param>
213 /// <param name="remoteClient"></param>
214 /// <returns></returns>
215 public XmlRpcResponse XmlRPCAuthenticateUserMethodPassword(XmlRpcRequest request, IPEndPoint remoteClient)
216 {
217// m_log.DebugFormat("[USER MANAGER]: Received authenticated user by password request from {0}", remoteClient);
218
219 Hashtable requestData = (Hashtable)request.Params[0];
220 string userUuidRaw = (string)requestData["user_uuid"];
221 string password = (string)requestData["password"];
222
223 if (null == userUuidRaw)
224 return Util.CreateUnknownUserErrorResponse();
225
226 UUID userUuid;
227 if (!UUID.TryParse(userUuidRaw, out userUuid))
228 return Util.CreateUnknownUserErrorResponse();
229
230 UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid);
231 if (null == userProfile)
232 return Util.CreateUnknownUserErrorResponse();
233
234 string authed;
235
236 if (null == password)
237 {
238 authed = "FALSE";
239 }
240 else
241 {
242 if (m_userDataBaseService.AuthenticateUserByPassword(userUuid, password))
243 authed = "TRUE";
244 else
245 authed = "FALSE";
246 }
247
248// m_log.DebugFormat(
249// "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}",
250// remoteClient, userUuid, authed);
251
252 XmlRpcResponse response = new XmlRpcResponse();
253 Hashtable responseData = new Hashtable();
254 responseData["auth_user"] = authed;
255 response.Value = responseData;
256
257 return response;
258 }
259
206 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient) 260 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient)
207 { 261 {
208 // XmlRpcResponse response = new XmlRpcResponse(); 262 // XmlRpcResponse response = new XmlRpcResponse();
@@ -246,10 +300,10 @@ namespace OpenSim.Grid.UserServer.Modules
246 m_userDataBaseService.CommitAgent(ref userProfile); 300 m_userDataBaseService.CommitAgent(ref userProfile);
247 //setUserProfile(userProfile); 301 //setUserProfile(userProfile);
248 302
249
250 returnstring = "TRUE"; 303 returnstring = "TRUE";
251 } 304 }
252 } 305 }
306
253 responseData.Add("returnString", returnstring); 307 responseData.Add("returnString", returnstring);
254 response.Value = responseData; 308 response.Value = responseData;
255 return response; 309 return response;
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index baf0fd3..286076d7 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -187,13 +187,13 @@ namespace OpenSim.Grid.UserServer
187 /// <param name="inventoryService"></param> 187 /// <param name="inventoryService"></param>
188 protected virtual void StartupUserServerModules() 188 protected virtual void StartupUserServerModules()
189 { 189 {
190 m_log.Info("[STARTUP]: Establishing data connection"); 190 m_log.Info("[STARTUP]: Establishing data connection");
191 191
192 //we only need core components so we can request them from here 192 //we only need core components so we can request them from here
193 IInterServiceInventoryServices inventoryService; 193 IInterServiceInventoryServices inventoryService;
194 TryGet<IInterServiceInventoryServices>(out inventoryService); 194 TryGet<IInterServiceInventoryServices>(out inventoryService);
195 195
196 CommunicationsManager commsManager = new UserServerCommsManager(inventoryService); 196 CommunicationsManager commsManager = new UserServerCommsManager(inventoryService);
197 197
198 //setup database access service, for now this has to be created before the other modules. 198 //setup database access service, for now this has to be created before the other modules.
199 m_userDataBaseService = new UserDataBaseService(commsManager); 199 m_userDataBaseService = new UserDataBaseService(commsManager);
@@ -260,8 +260,6 @@ namespace OpenSim.Grid.UserServer
260 m_userManager.PostInitialise(); 260 m_userManager.PostInitialise();
261 m_avatarAppearanceModule.PostInitialise(); 261 m_avatarAppearanceModule.PostInitialise();
262 m_friendsModule.PostInitialise(); 262 m_friendsModule.PostInitialise();
263
264 m_avatarAppearanceModule.PostInitialise();
265 } 263 }
266 264
267 protected virtual void RegisterHttpHandlers() 265 protected virtual void RegisterHttpHandlers()
@@ -276,8 +274,6 @@ namespace OpenSim.Grid.UserServer
276 m_avatarAppearanceModule.RegisterHandlers(m_httpServer); 274 m_avatarAppearanceModule.RegisterHandlers(m_httpServer);
277 m_messagesService.RegisterHandlers(m_httpServer); 275 m_messagesService.RegisterHandlers(m_httpServer);
278 m_gridInfoService.RegisterHandlers(m_httpServer); 276 m_gridInfoService.RegisterHandlers(m_httpServer);
279
280 m_avatarAppearanceModule.RegisterHandlers(m_httpServer);
281 } 277 }
282 278
283 public override void ShutdownSpecific() 279 public override void ShutdownSpecific()
diff --git a/OpenSim/Grid/UserServer/UserServerCommsManager.cs b/OpenSim/Grid/UserServer/UserServerCommsManager.cs
index 7200836..8ef693b 100644
--- a/OpenSim/Grid/UserServer/UserServerCommsManager.cs
+++ b/OpenSim/Grid/UserServer/UserServerCommsManager.cs
@@ -28,9 +28,9 @@
28using OpenSim.Framework.Communications; 28using OpenSim.Framework.Communications;
29 29
30namespace OpenSim.Grid.UserServer 30namespace OpenSim.Grid.UserServer
31{ 31{
32 public class UserServerCommsManager : CommunicationsManager 32 public class UserServerCommsManager : CommunicationsManager
33 { 33 {
34 public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService) 34 public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService)
35 : base(null, null) 35 : base(null, null)
36 { 36 {
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 2fd26bf..241af53 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -91,7 +91,7 @@ namespace OpenSim
91 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); 91 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
92 } 92 }
93 93
94 // Check if the system is compatible with OpenSimulator. 94 // Check if the system is compatible with OpenSimulator.
95 // Ensures that the minimum system requirements are met 95 // Ensures that the minimum system requirements are met
96 m_log.Info("Performing compatibility checks... "); 96 m_log.Info("Performing compatibility checks... ");
97 string supported = String.Empty; 97 string supported = String.Empty;
diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Region/Application/HGCommands.cs
index 1786e54..f503db7 100644
--- a/OpenSim/Region/Application/HGCommands.cs
+++ b/OpenSim/Region/Application/HGCommands.cs
@@ -43,16 +43,11 @@ namespace OpenSim
43 public class HGCommands 43 public class HGCommands
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 public static IHyperlink HGServices = null;
47
48 private static uint m_autoMappingX = 0;
49 private static uint m_autoMappingY = 0;
50 private static bool m_enableAutoMapping = false;
51 46
52 public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager, 47 public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
53 StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) 48 StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
54 { 49 {
55 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices); 50 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager);
56 51
57 return 52 return
58 new HGScene( 53 new HGScene(
@@ -61,213 +56,5 @@ namespace OpenSim
61 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 56 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
62 } 57 }
63 58
64 public static void RunHGCommand(string command, string[] cmdparams, Scene scene)
65 {
66 if (command.Equals("link-mapping"))
67 {
68 if (cmdparams.Length == 2)
69 {
70 try
71 {
72 m_autoMappingX = Convert.ToUInt32(cmdparams[0]);
73 m_autoMappingY = Convert.ToUInt32(cmdparams[1]);
74 m_enableAutoMapping = true;
75 }
76 catch (Exception)
77 {
78 m_autoMappingX = 0;
79 m_autoMappingY = 0;
80 m_enableAutoMapping = false;
81 }
82 }
83 }
84 else if (command.Equals("link-region"))
85 {
86 if (cmdparams.Length < 3)
87 {
88 if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
89 {
90 LoadXmlLinkFile(cmdparams, scene);
91 }
92 else
93 {
94 LinkRegionCmdUsage();
95 }
96 return;
97 }
98
99 if (cmdparams[2].Contains(":"))
100 {
101 // New format
102 uint xloc, yloc;
103 string mapName;
104 try
105 {
106 xloc = Convert.ToUInt32(cmdparams[0]);
107 yloc = Convert.ToUInt32(cmdparams[1]);
108 mapName = cmdparams[2];
109 if (cmdparams.Length > 3)
110 for (int i = 3; i < cmdparams.Length; i++)
111 mapName += " " + cmdparams[i];
112
113 m_log.Info(">> MapName: " + mapName);
114 //internalPort = Convert.ToUInt32(cmdparams[4]);
115 //remotingPort = Convert.ToUInt32(cmdparams[5]);
116 }
117 catch (Exception e)
118 {
119 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
120 LinkRegionCmdUsage();
121 return;
122 }
123
124 HGHyperlink.TryLinkRegionToCoords(scene, null, mapName, xloc, yloc);
125 }
126 else
127 {
128 // old format
129 RegionInfo regInfo;
130 uint xloc, yloc;
131 uint externalPort;
132 string externalHostName;
133 try
134 {
135 xloc = Convert.ToUInt32(cmdparams[0]);
136 yloc = Convert.ToUInt32(cmdparams[1]);
137 externalPort = Convert.ToUInt32(cmdparams[3]);
138 externalHostName = cmdparams[2];
139 //internalPort = Convert.ToUInt32(cmdparams[4]);
140 //remotingPort = Convert.ToUInt32(cmdparams[5]);
141 }
142 catch (Exception e)
143 {
144 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
145 LinkRegionCmdUsage();
146 return;
147 }
148
149 //if (TryCreateLink(xloc, yloc, externalPort, externalHostName, out regInfo))
150 if (HGHyperlink.TryCreateLink(scene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo))
151 {
152 if (cmdparams.Length >= 5)
153 {
154 regInfo.RegionName = "";
155 for (int i = 4; i < cmdparams.Length; i++)
156 regInfo.RegionName += cmdparams[i] + " ";
157 }
158 }
159 }
160 return;
161 }
162 else if (command.Equals("unlink-region"))
163 {
164 if (cmdparams.Length < 1)
165 {
166 UnlinkRegionCmdUsage();
167 return;
168 }
169 if (HGHyperlink.TryUnlinkRegion(scene, cmdparams[0]))
170 m_log.InfoFormat("[HGrid]: Successfully unlinked {0}", cmdparams[0]);
171 else
172 m_log.InfoFormat("[HGrid]: Unable to unlink {0}, region not found", cmdparams[0]);
173 }
174 }
175
176 private static void LoadXmlLinkFile(string[] cmdparams, Scene scene)
177 {
178 //use http://www.hgurl.com/hypergrid.xml for test
179 try
180 {
181 XmlReader r = XmlReader.Create(cmdparams[0]);
182 XmlConfigSource cs = new XmlConfigSource(r);
183 string[] excludeSections = null;
184
185 if (cmdparams.Length == 2)
186 {
187 if (cmdparams[1].ToLower().StartsWith("excludelist:"))
188 {
189 string excludeString = cmdparams[1].ToLower();
190 excludeString = excludeString.Remove(0, 12);
191 char[] splitter = {';'};
192
193 excludeSections = excludeString.Split(splitter);
194 }
195 }
196
197 for (int i = 0; i < cs.Configs.Count; i++)
198 {
199 bool skip = false;
200 if ((excludeSections != null) && (excludeSections.Length > 0))
201 {
202 for (int n = 0; n < excludeSections.Length; n++)
203 {
204 if (excludeSections[n] == cs.Configs[i].Name.ToLower())
205 {
206 skip = true;
207 break;
208 }
209 }
210 }
211 if (!skip)
212 {
213 ReadLinkFromConfig(cs.Configs[i], scene);
214 }
215 }
216 }
217 catch (Exception e)
218 {
219 m_log.Error(e.ToString());
220 }
221 }
222
223
224 private static void ReadLinkFromConfig(IConfig config, Scene scene)
225 {
226 RegionInfo regInfo;
227 uint xloc, yloc;
228 uint externalPort;
229 string externalHostName;
230 uint realXLoc, realYLoc;
231
232 xloc = Convert.ToUInt32(config.GetString("xloc", "0"));
233 yloc = Convert.ToUInt32(config.GetString("yloc", "0"));
234 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
235 externalHostName = config.GetString("externalHostName", "");
236 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
237 realYLoc = Convert.ToUInt32(config.GetString("real-yloc", "0"));
238
239 if (m_enableAutoMapping)
240 {
241 xloc = (uint) ((xloc%100) + m_autoMappingX);
242 yloc = (uint) ((yloc%100) + m_autoMappingY);
243 }
244
245 if (((realXLoc == 0) && (realYLoc == 0)) ||
246 (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
247 ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
248 {
249 if (
250 HGHyperlink.TryCreateLink(scene, null, xloc, yloc, "", externalPort,
251 externalHostName, out regInfo))
252 {
253 regInfo.RegionName = config.GetString("localName", "");
254 }
255 }
256 }
257
258
259 private static void LinkRegionCmdUsage()
260 {
261 m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>]");
262 m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName> <HttpPort> [<LocalName>]");
263 m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]");
264 }
265
266 private static void UnlinkRegionCmdUsage()
267 {
268 m_log.Info("Usage: unlink-region <HostName>:<HttpPort>");
269 m_log.Info("Usage: unlink-region <LocalName>");
270 }
271
272 } 59 }
273} 60}
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index b23cdc3..4d8409bb 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -493,7 +493,7 @@ namespace OpenSim
493 { 493 {
494 if (cmd.Length < 4) 494 if (cmd.Length < 4)
495 { 495 {
496 m_log.Error("Usage: create region <region name> <region_file.xml>"); 496 m_log.Error("Usage: create region <region name> <region_file.ini>");
497 return; 497 return;
498 } 498 }
499 if (cmd[3].EndsWith(".xml")) 499 if (cmd[3].EndsWith(".xml"))
@@ -520,7 +520,7 @@ namespace OpenSim
520 } 520 }
521 else 521 else
522 { 522 {
523 m_log.Error("Usage: create region <region name> <region_file.xml>"); 523 m_log.Error("Usage: create region <region name> <region_file.ini>");
524 return; 524 return;
525 } 525 }
526 } 526 }
@@ -553,7 +553,7 @@ namespace OpenSim
553 /// <param name="cmd"></param> 553 /// <param name="cmd"></param>
554 private void HandleLoginStatus(string module, string[] cmd) 554 private void HandleLoginStatus(string module, string[] cmd)
555 { 555 {
556 if (m_commsManager.GridService.RegionLoginsEnabled == false) 556 if (m_sceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled == false)
557 557
558 m_log.Info("[ Login ] Login are disabled "); 558 m_log.Info("[ Login ] Login are disabled ");
559 else 559 else
@@ -1230,20 +1230,20 @@ namespace OpenSim
1230 protected void LoadOar(string module, string[] cmdparams) 1230 protected void LoadOar(string module, string[] cmdparams)
1231 { 1231 {
1232 try 1232 try
1233 { 1233 {
1234 if (cmdparams.Length > 2) 1234 if (cmdparams.Length > 2)
1235 { 1235 {
1236 m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]); 1236 m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]);
1237 } 1237 }
1238 else 1238 else
1239 { 1239 {
1240 m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); 1240 m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME);
1241 } 1241 }
1242 } 1242 }
1243 catch (Exception e) 1243 catch (Exception e)
1244 { 1244 {
1245 m_log.Error(e.Message); 1245 m_log.Error(e.Message);
1246 } 1246 }
1247 } 1247 }
1248 1248
1249 /// <summary> 1249 /// <summary>
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 7bc0b77..468c5d7 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -98,7 +98,7 @@ namespace OpenSim
98 98
99 /// <value> 99 /// <value>
100 /// The config information passed into the OpenSimulator region server. 100 /// The config information passed into the OpenSimulator region server.
101 /// </value> 101 /// </value>
102 public OpenSimConfigSource ConfigSource 102 public OpenSimConfigSource ConfigSource
103 { 103 {
104 get { return m_config; } 104 get { return m_config; }
@@ -209,9 +209,9 @@ namespace OpenSim
209 } 209 }
210 210
211 // Only enable logins to the regions once we have completely finished starting up (apart from scripts) 211 // Only enable logins to the regions once we have completely finished starting up (apart from scripts)
212 if ((m_commsManager != null) && (m_commsManager.GridService != null)) 212 if ((SceneManager.CurrentOrFirstScene != null) && (SceneManager.CurrentOrFirstScene.SceneGridService != null))
213 { 213 {
214 m_commsManager.GridService.RegionLoginsEnabled = true; 214 SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = true;
215 } 215 }
216 216
217 AddPluginCommands(); 217 AddPluginCommands();
@@ -299,12 +299,12 @@ namespace OpenSim
299 if (LoginEnabled) 299 if (LoginEnabled)
300 { 300 {
301 m_log.Info("[LOGIN]: Login is now enabled."); 301 m_log.Info("[LOGIN]: Login is now enabled.");
302 m_commsManager.GridService.RegionLoginsEnabled = true; 302 SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = true;
303 } 303 }
304 else 304 else
305 { 305 {
306 m_log.Info("[LOGIN]: Login is now disabled."); 306 m_log.Info("[LOGIN]: Login is now disabled.");
307 m_commsManager.GridService.RegionLoginsEnabled = false; 307 SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = false;
308 } 308 }
309 } 309 }
310 310
@@ -383,14 +383,14 @@ namespace OpenSim
383 383
384 scene.SetModuleInterfaces(); 384 scene.SetModuleInterfaces();
385 385
386 // Prims have to be loaded after module configuration since some modules may be invoked during the load 386 // Prims have to be loaded after module configuration since some modules may be invoked during the load
387 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 387 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
388 388
389 // moved these here as the terrain texture has to be created after the modules are initialized 389 // moved these here as the terrain texture has to be created after the modules are initialized
390 // and has to happen before the region is registered with the grid. 390 // and has to happen before the region is registered with the grid.
391 scene.CreateTerrainTexture(false); 391 scene.CreateTerrainTexture(false);
392 392
393 // TODO : Try setting resource for region xstats here on scene 393 // TODO : Try setting resource for region xstats here on scene
394 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 394 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
395 395
396 try 396 try
@@ -399,7 +399,7 @@ namespace OpenSim
399 } 399 }
400 catch (Exception e) 400 catch (Exception e)
401 { 401 {
402 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e); 402 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
403 403
404 // Carrying on now causes a lot of confusion down the 404 // Carrying on now causes a lot of confusion down the
405 // line - we need to get the user's attention 405 // line - we need to get the user's attention
@@ -507,7 +507,7 @@ namespace OpenSim
507 /// Remove a region from the simulator without deleting it permanently. 507 /// Remove a region from the simulator without deleting it permanently.
508 /// </summary> 508 /// </summary>
509 /// <param name="scene"></param> 509 /// <param name="scene"></param>
510 /// <returns></returns> 510 /// <returns></returns>
511 public void CloseRegion(Scene scene) 511 public void CloseRegion(Scene scene)
512 { 512 {
513 // only need to check this if we are not at the 513 // only need to check this if we are not at the
@@ -526,7 +526,7 @@ namespace OpenSim
526 /// Remove a region from the simulator without deleting it permanently. 526 /// Remove a region from the simulator without deleting it permanently.
527 /// </summary> 527 /// </summary>
528 /// <param name="name"></param> 528 /// <param name="name"></param>
529 /// <returns></returns> 529 /// <returns></returns>
530 public void CloseRegion(string name) 530 public void CloseRegion(string name)
531 { 531 {
532 Scene target; 532 Scene target;
@@ -539,7 +539,7 @@ namespace OpenSim
539 /// </summary> 539 /// </summary>
540 /// <param name="regionInfo"></param> 540 /// <param name="regionInfo"></param>
541 /// <param name="clientServer"> </param> 541 /// <param name="clientServer"> </param>
542 /// <returns></returns> 542 /// <returns></returns>
543 protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer) 543 protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer)
544 { 544 {
545 return SetupScene(regionInfo, 0, null, out clientServer); 545 return SetupScene(regionInfo, 0, null, out clientServer);
@@ -750,7 +750,7 @@ namespace OpenSim
750 } 750 }
751 751
752 public string Path 752 public string Path
753 { 753 {
754 // This is for the OpenSimulator instance and is the osSecret hashed 754 // This is for the OpenSimulator instance and is the osSecret hashed
755 get { return "/" + osXStatsURI + "/"; } 755 get { return "/" + osXStatsURI + "/"; }
756 } 756 }
@@ -791,7 +791,7 @@ namespace OpenSim
791 } 791 }
792 792
793 public string Path 793 public string Path
794 { 794 {
795 // This is for the OpenSimulator instance and is the user provided URI 795 // This is for the OpenSimulator instance and is the user provided URI
796 get { return "/" + osUXStatsURI + "/"; } 796 get { return "/" + osUXStatsURI + "/"; }
797 } 797 }
diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs
index 5667d64..84ea0b3 100644
--- a/OpenSim/Region/ClientStack/ClientStackManager.cs
+++ b/OpenSim/Region/ClientStack/ClientStackManager.cs
@@ -87,9 +87,9 @@ namespace OpenSim.Region.ClientStack
87 public IClientNetworkServer CreateServer( 87 public IClientNetworkServer CreateServer(
88 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, 88 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port,
89 AgentCircuitManager authenticateClass) 89 AgentCircuitManager authenticateClass)
90 { 90 {
91 return CreateServer( 91 return CreateServer(
92 _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass); 92 _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass);
93 } 93 }
94 94
95 /// <summary> 95 /// <summary>
@@ -104,11 +104,11 @@ namespace OpenSim.Region.ClientStack
104 /// </param> 104 /// </param>
105 /// <param name="assetCache"></param> 105 /// <param name="assetCache"></param>
106 /// <param name="authenticateClass"></param> 106 /// <param name="authenticateClass"></param>
107 /// <returns></returns> 107 /// <returns></returns>
108 public IClientNetworkServer CreateServer( 108 public IClientNetworkServer CreateServer(
109 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, 109 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource,
110 AgentCircuitManager authenticateClass) 110 AgentCircuitManager authenticateClass)
111 { 111 {
112 if (plugin != null) 112 if (plugin != null)
113 { 113 {
114 IClientNetworkServer server = 114 IClientNetworkServer server =
diff --git a/OpenSim/Region/ClientStack/ClientStackUserSettings.cs b/OpenSim/Region/ClientStack/ClientStackUserSettings.cs
index a3c23cc..231b3aa 100644
--- a/OpenSim/Region/ClientStack/ClientStackUserSettings.cs
+++ b/OpenSim/Region/ClientStack/ClientStackUserSettings.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Region.ClientStack
32 /// 32 ///
33 /// At the moment this is very incomplete - other tweakable settings could be added. This is also somewhat LL client 33 /// At the moment this is very incomplete - other tweakable settings could be added. This is also somewhat LL client
34 /// oriented right now. 34 /// oriented right now.
35 /// </summary> 35 /// </summary>
36 public class ClientStackUserSettings 36 public class ClientStackUserSettings
37 { 37 {
38 /// <summary> 38 /// <summary>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index f05c490..d8bd36d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1637,6 +1637,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1637 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; 1637 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
1638 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; 1638 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
1639 enablesimpacket.SimulatorInfo.Port = neighbourPort; 1639 enablesimpacket.SimulatorInfo.Port = neighbourPort;
1640
1641 enablesimpacket.Header.Reliable = true; // ESP's should be reliable.
1642
1640 OutPacket(enablesimpacket, ThrottleOutPacketType.Task); 1643 OutPacket(enablesimpacket, ThrottleOutPacketType.Task);
1641 } 1644 }
1642 1645
@@ -2302,7 +2305,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2302 return itemBlock; 2305 return itemBlock;
2303 } 2306 }
2304 2307
2305 public void SendBulkUpdateInventory(InventoryNodeBase node) 2308 public void SendBulkUpdateInventory(InventoryNodeBase node)
2306 { 2309 {
2307 if (node is InventoryItemBase) 2310 if (node is InventoryItemBase)
2308 SendBulkUpdateInventoryItem((InventoryItemBase)node); 2311 SendBulkUpdateInventoryItem((InventoryItemBase)node);
@@ -2907,7 +2910,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2907 else if (m_avatarTerseUpdates.Count == 1) 2910 else if (m_avatarTerseUpdates.Count == 1)
2908 { 2911 {
2909 lock (m_avatarTerseUpdateTimer) 2912 lock (m_avatarTerseUpdateTimer)
2910 m_avatarTerseUpdateTimer.Start(); 2913 m_avatarTerseUpdateTimer.Start();
2911 } 2914 }
2912 } 2915 }
2913 } 2916 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 8484846..ff739c5 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
133 TextureThrottle = new LLPacketThrottle(1000, throttleMaxBPS / 2, 4000, userSettings.ClientThrottleMultipler); 133 TextureThrottle = new LLPacketThrottle(1000, throttleMaxBPS / 2, 4000, userSettings.ClientThrottleMultipler);
134 134
135 135
136 // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. 136 // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second.
137 137
138 138
139 ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; 139 ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings;
@@ -419,7 +419,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
419 { 419 {
420 LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); 420 LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();
421 421
422 SendQueue.Enqueue(qpack); 422 SendQueue.Enqueue(qpack);
423 TotalThrottle.AddBytes(qpack.Length); 423 TotalThrottle.AddBytes(qpack.Length);
424 ResendThrottle.AddBytes(qpack.Length); 424 ResendThrottle.AddBytes(qpack.Length);
425 425
@@ -491,7 +491,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
491 { 491 {
492 LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); 492 LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();
493 493
494 SendQueue.Enqueue(qpack); 494 SendQueue.Enqueue(qpack);
495 TotalThrottle.AddBytes(qpack.Length); 495 TotalThrottle.AddBytes(qpack.Length);
496 TextureThrottle.AddBytes(qpack.Length); 496 TextureThrottle.AddBytes(qpack.Length);
497 qchanged = true; 497 qchanged = true;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
index 56219d1..70d94e7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
@@ -48,11 +48,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
48 /// <summary> 48 /// <summary>
49 /// Tweakable user settings 49 /// Tweakable user settings
50 /// </summary> 50 /// </summary>
51 private ClientStackUserSettings m_userSettings; 51 private ClientStackUserSettings m_userSettings;
52 52
53 public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings) 53 public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings)
54 { 54 {
55 m_userSettings = userSettings; 55 m_userSettings = userSettings;
56 m_networkHandler = networkHandler; 56 m_networkHandler = networkHandler;
57 57
58 m_networkHandler.RegisterPacketServer(this); 58 m_networkHandler.RegisterPacketServer(this);
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
114 sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode); 114 sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode);
115 115
116 if (!sessionInfo.Authorised) 116 if (!sessionInfo.Authorised)
117 return false; 117 return false;
118 118
119 return true; 119 return true;
120 } 120 }
@@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
129 /// <param name="proxyEP"></param> 129 /// <param name="proxyEP"></param>
130 /// <returns> 130 /// <returns>
131 /// true if a new circuit was created, false if a circuit with the given circuit code already existed 131 /// true if a new circuit was created, false if a circuit with the given circuit code already existed
132 /// </returns> 132 /// </returns>
133 public virtual bool AddNewClient( 133 public virtual bool AddNewClient(
134 EndPoint epSender, UseCircuitCodePacket useCircuit, 134 EndPoint epSender, UseCircuitCodePacket useCircuit,
135 AuthenticateResponse sessionInfo, EndPoint proxyEP) 135 AuthenticateResponse sessionInfo, EndPoint proxyEP)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs
index 01bff6d..52effc5 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28namespace OpenSim.Region.ClientStack.LindenUDP 28namespace OpenSim.Region.ClientStack.LindenUDP
29{ 29{
30 public class LLPacketThrottle 30 public class LLPacketThrottle
31 { 31 {
32 private readonly int m_maxAllowableThrottle; 32 private readonly int m_maxAllowableThrottle;
@@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
49 public int Min 49 public int Min
50 { 50 {
51 get { return m_minAllowableThrottle; } 51 get { return m_minAllowableThrottle; }
52 } 52 }
53 53
54 public int Current 54 public int Current
55 { 55 {
@@ -105,13 +105,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
105 105
106 public int Throttle 106 public int Throttle
107 { 107 {
108 get { return m_currentThrottle; } 108 get { return m_currentThrottle; }
109 set 109 set
110 { 110 {
111 if (value < m_minAllowableThrottle) 111 if (value < m_minAllowableThrottle)
112 { 112 {
113 m_currentThrottle = m_minAllowableThrottle; 113 m_currentThrottle = m_minAllowableThrottle;
114 } 114 }
115 else if (value > m_maxAllowableThrottle) 115 else if (value > m_maxAllowableThrottle)
116 { 116 {
117 m_currentThrottle = m_maxAllowableThrottle; 117 m_currentThrottle = m_maxAllowableThrottle;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 9ee8df5..c779b08 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
166 userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); 166 userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier");
167 if (config.Contains("client_socket_rcvbuf_size")) 167 if (config.Contains("client_socket_rcvbuf_size"))
168 m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size"); 168 m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size");
169 } 169 }
170 170
171 m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); 171 m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler);
172 m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ? 172 m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ?
@@ -228,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
228 { 228 {
229 m_log.Debug("[CLIENT]: " + e); 229 m_log.Debug("[CLIENT]: " + e);
230 } 230 }
231 } 231 }
232 232
233 233
234 if (proxyPortOffset != 0) 234 if (proxyPortOffset != 0)
@@ -254,7 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
254 if (packet != null) 254 if (packet != null)
255 { 255 {
256 if (packet.Type == PacketType.UseCircuitCode) 256 if (packet.Type == PacketType.UseCircuitCode)
257 AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy); 257 AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy);
258 else 258 else
259 ProcessInPacket(packet, epSender); 259 ProcessInPacket(packet, epSender);
260 } 260 }
@@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
290 catch (Exception e) 290 catch (Exception e)
291 { 291 {
292 m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e); 292 m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e);
293 } 293 }
294 } 294 }
295 295
296 /// <summary> 296 /// <summary>
@@ -299,7 +299,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
299 protected virtual void BeginReceive() 299 protected virtual void BeginReceive()
300 { 300 {
301 m_socket.BeginReceiveFrom( 301 m_socket.BeginReceiveFrom(
302 RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null); 302 RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null);
303 } 303 }
304 304
305 /// <summary> 305 /// <summary>
@@ -322,7 +322,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
322 // ENDLESS LOOP ON PURPOSE! 322 // ENDLESS LOOP ON PURPOSE!
323 // Reset connection and get next UDP packet off the buffer 323 // Reset connection and get next UDP packet off the buffer
324 // If the UDP packet is part of the same stream, this will happen several hundreds of times before 324 // If the UDP packet is part of the same stream, this will happen several hundreds of times before
325 // the next set of UDP data is for a valid client. 325 // the next set of UDP data is for a valid client.
326 326
327 try 327 try
328 { 328 {
@@ -347,7 +347,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
347 m_log.ErrorFormat("[CLIENT]: Exception thrown during BeginReceive(): {0}", ex); 347 m_log.ErrorFormat("[CLIENT]: Exception thrown during BeginReceive(): {0}", ex);
348 } 348 }
349 } 349 }
350 } 350 }
351 351
352 /// <summary> 352 /// <summary>
353 /// Close a client circuit. This is done in response to an exception on receive, and should not be called 353 /// 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
363 { 363 {
364 m_packetServer.CloseCircuit(circuit); 364 m_packetServer.CloseCircuit(circuit);
365 365
366 if (e != null) 366 if (e != null)
367 m_log.ErrorFormat( 367 m_log.ErrorFormat(
368 "[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e); 368 "[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e);
369 } 369 }
370 } 370 }
371 } 371 }
372 372
373 /// <summary> 373 /// <summary>
374 /// Finish the process of asynchronously receiving the next bit of raw data 374 /// Finish the process of asynchronously receiving the next bit of raw data
@@ -410,7 +410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
410 { 410 {
411 m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName); 411 m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName);
412 // Uhh, what object, and why? this needs better handling. 412 // Uhh, what object, and why? this needs better handling.
413 } 413 }
414 414
415 return hasReceivedOkay; 415 return hasReceivedOkay;
416 } 416 }
@@ -422,10 +422,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
422 /// <param name="epSender"></param> 422 /// <param name="epSender"></param>
423 /// <param name="epProxy"></param> 423 /// <param name="epProxy"></param>
424 protected virtual void AddNewClient(UseCircuitCodePacket useCircuit, EndPoint epSender, EndPoint epProxy) 424 protected virtual void AddNewClient(UseCircuitCodePacket useCircuit, EndPoint epSender, EndPoint epProxy)
425 { 425 {
426 //Slave regions don't accept new clients 426 //Slave regions don't accept new clients
427 if (m_localScene.RegionStatus != RegionStatus.SlaveScene) 427 if (m_localScene.RegionStatus != RegionStatus.SlaveScene)
428 { 428 {
429 AuthenticateResponse sessionInfo; 429 AuthenticateResponse sessionInfo;
430 bool isNewCircuit = false; 430 bool isNewCircuit = false;
431 431
@@ -441,8 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
441 lock (clientCircuits) 441 lock (clientCircuits)
442 { 442 {
443 if (!clientCircuits.ContainsKey(epSender)) 443 if (!clientCircuits.ContainsKey(epSender))
444 { 444 {
445 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); 445 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
446 isNewCircuit = true; 446 isNewCircuit = true;
447 } 447 }
448 } 448 }
@@ -461,9 +461,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
461 461
462 //m_log.DebugFormat( 462 //m_log.DebugFormat(
463 // "[CONNECTION SUCCESS]: Incoming client {0} (circuit code {1}) received and authenticated for {2}", 463 // "[CONNECTION SUCCESS]: Incoming client {0} (circuit code {1}) received and authenticated for {2}",
464 // useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName); 464 // useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName);
465 } 465 }
466 } 466 }
467 467
468 // Ack the UseCircuitCode packet 468 // Ack the UseCircuitCode packet
469 PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); 469 PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
@@ -605,7 +605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
605 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); 605 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
606 606
607 return; 607 return;
608 } 608 }
609 609
610 lock (clientCircuits) 610 lock (clientCircuits)
611 { 611 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs
index f2a8bd2..c45d11f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs
@@ -28,7 +28,7 @@
28using OpenMetaverse; 28using OpenMetaverse;
29 29
30namespace OpenSim.Region.ClientStack.LindenUDP 30namespace OpenSim.Region.ClientStack.LindenUDP
31{ 31{
32 public class LLUtil 32 public class LLUtil
33 { 33 {
34 /// <summary> 34 /// <summary>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
index 9fb1041..daab84f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
54 catch 54 catch
55 { 55 {
56 // I don't care, just leave log4net off 56 // I don't care, just leave log4net off
57 } 57 }
58 } 58 }
59 59
60 /// <summary> 60 /// <summary>
@@ -63,20 +63,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
63 /// <param name="scene"></param> 63 /// <param name="scene"></param>
64 /// <param name="testLLUDPServer"></param> 64 /// <param name="testLLUDPServer"></param>
65 /// <param name="testPacketServer"></param> 65 /// <param name="testPacketServer"></param>
66 /// <param name="acm">Agent circuit manager used in setting up the stack</param> 66 /// <param name="acm">Agent circuit manager used in setting up the stack</param>
67 protected void SetupStack( 67 protected void SetupStack(
68 IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, 68 IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer,
69 out AgentCircuitManager acm) 69 out AgentCircuitManager acm)
70 { 70 {
71 IConfigSource configSource = new IniConfigSource(); 71 IConfigSource configSource = new IniConfigSource();
72 ClientStackUserSettings userSettings = new ClientStackUserSettings(); 72 ClientStackUserSettings userSettings = new ClientStackUserSettings();
73 testLLUDPServer = new TestLLUDPServer(); 73 testLLUDPServer = new TestLLUDPServer();
74 acm = new AgentCircuitManager(); 74 acm = new AgentCircuitManager();
75 75
76 uint port = 666; 76 uint port = 666;
77 testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); 77 testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm);
78 testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); 78 testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings);
79 testLLUDPServer.LocalScene = scene; 79 testLLUDPServer.LocalScene = scene;
80 } 80 }
81 81
82 /// <summary> 82 /// <summary>
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
124 124
125 acm.AddNewCircuit(circuitCode, acd); 125 acm.AddNewCircuit(circuitCode, acd);
126 126
127 testLLUDPServer.LoadReceive(uccp, epSender); 127 testLLUDPServer.LoadReceive(uccp, epSender);
128 testLLUDPServer.ReceiveData(null); 128 testLLUDPServer.ReceiveData(null);
129 } 129 }
130 130
@@ -142,15 +142,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
142 onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; 142 onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb };
143 onp.Header.Zerocoded = false; 143 onp.Header.Zerocoded = false;
144 144
145 return onp; 145 return onp;
146 } 146 }
147 147
148 /// <summary> 148 /// <summary>
149 /// Test adding a client to the stack 149 /// Test adding a client to the stack
150 /// </summary> 150 /// </summary>
151 [Test, LongRunning] 151 [Test, LongRunning]
152 public void TestAddClient() 152 public void TestAddClient()
153 { 153 {
154 TestHelper.InMethod(); 154 TestHelper.InMethod();
155 155
156 uint myCircuitCode = 123456; 156 uint myCircuitCode = 123456;
@@ -177,7 +177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
177 177
178 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); 178 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
179 179
180 testLLUDPServer.LoadReceive(uccp, testEp); 180 testLLUDPServer.LoadReceive(uccp, testEp);
181 testLLUDPServer.ReceiveData(null); 181 testLLUDPServer.ReceiveData(null);
182 182
183 // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet 183 // 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
185 185
186 acm.AddNewCircuit(myCircuitCode, acd); 186 acm.AddNewCircuit(myCircuitCode, acd);
187 187
188 testLLUDPServer.LoadReceive(uccp, testEp); 188 testLLUDPServer.LoadReceive(uccp, testEp);
189 testLLUDPServer.ReceiveData(null); 189 testLLUDPServer.ReceiveData(null);
190 190
191 // Should succeed now 191 // Should succeed now
192 Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); 192 Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
@@ -196,24 +196,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
196 /// <summary> 196 /// <summary>
197 /// Test removing a client from the stack 197 /// Test removing a client from the stack
198 /// </summary> 198 /// </summary>
199 [Test] 199 [Test]
200 public void TestRemoveClient() 200 public void TestRemoveClient()
201 { 201 {
202 TestHelper.InMethod(); 202 TestHelper.InMethod();
203 203
204 uint myCircuitCode = 123457; 204 uint myCircuitCode = 123457;
205 205
206 TestLLUDPServer testLLUDPServer; 206 TestLLUDPServer testLLUDPServer;
207 TestLLPacketServer testLLPacketServer; 207 TestLLPacketServer testLLPacketServer;
208 AgentCircuitManager acm; 208 AgentCircuitManager acm;
209 SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); 209 SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm);
210 AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); 210 AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm);
211 211
212 testLLUDPServer.RemoveClientCircuit(myCircuitCode); 212 testLLUDPServer.RemoveClientCircuit(myCircuitCode);
213 Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); 213 Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode));
214 214
215 // Check that removing a non-existant circuit doesn't have any bad effects 215 // Check that removing a non-existant circuit doesn't have any bad effects
216 testLLUDPServer.RemoveClientCircuit(101); 216 testLLUDPServer.RemoveClientCircuit(101);
217 Assert.IsFalse(testLLUDPServer.HasCircuit(101)); 217 Assert.IsFalse(testLLUDPServer.HasCircuit(101));
218 } 218 }
219 219
@@ -232,8 +232,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
232 TestLLUDPServer testLLUDPServer; 232 TestLLUDPServer testLLUDPServer;
233 TestLLPacketServer testLLPacketServer; 233 TestLLPacketServer testLLPacketServer;
234 AgentCircuitManager acm; 234 AgentCircuitManager acm;
235 SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); 235 SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
236 AddClient(myCircuitCode, testEp, testLLUDPServer, acm); 236 AddClient(myCircuitCode, testEp, testLLUDPServer, acm);
237 237
238 byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 }; 238 byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 };
239 239
@@ -252,7 +252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
252 testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); 252 testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp);
253 testLLUDPServer.ReceiveData(null); 253 testLLUDPServer.ReceiveData(null);
254 254
255 Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); 255 Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1));
256 Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); 256 Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1));
257 } 257 }
258 258
@@ -270,17 +270,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
270 uint circuitCodeA = 130000; 270 uint circuitCodeA = 130000;
271 EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); 271 EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300);
272 UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); 272 UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300");
273 UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); 273 UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300");
274 274
275 uint circuitCodeB = 130001; 275 uint circuitCodeB = 130001;
276 EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); 276 EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301);
277 UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); 277 UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301");
278 UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); 278 UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301");
279 279
280 TestLLUDPServer testLLUDPServer; 280 TestLLUDPServer testLLUDPServer;
281 TestLLPacketServer testLLPacketServer; 281 TestLLPacketServer testLLPacketServer;
282 AgentCircuitManager acm; 282 AgentCircuitManager acm;
283 SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); 283 SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
284 AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); 284 AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm);
285 AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); 285 AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm);
286 286
@@ -292,8 +292,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
292 292
293 Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); 293 Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA));
294 294
295 Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); 295 Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3));
296 Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); 296 Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3));
297 } 297 }
298 } 298 }
299} 299}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs
index c831f68..34c21aa 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs
@@ -28,6 +28,7 @@
28using OpenMetaverse; 28using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
31using GridRegion = OpenSim.Services.Interfaces.GridRegion;
31 32
32namespace OpenSim.Region.ClientStack.LindenUDP.Tests 33namespace OpenSim.Region.ClientStack.LindenUDP.Tests
33{ 34{
@@ -58,7 +59,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
58 59
59 public override void RemoveClient(UUID agentID) {} 60 public override void RemoveClient(UUID agentID) {}
60 public override void CloseAllAgents(uint circuitcode) {} 61 public override void CloseAllAgents(uint circuitcode) {}
61 public override bool OtherRegionUp(RegionInfo thisRegion) { return false; } 62 public override void OtherRegionUp(GridRegion otherRegion) { }
62 63
63 /// <summary> 64 /// <summary>
64 /// Doesn't really matter what the call is - we're using this to test that a packet has actually been received 65 /// Doesn't really matter what the call is - we're using this to test that a packet has actually been received
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs
index 8b11ccc..cde155b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
45 [Test] 45 [Test]
46 /// <summary> 46 /// <summary>
47 /// More a placeholder, really 47 /// More a placeholder, really
48 /// </summary> 48 /// </summary>
49 public void InPacketTest() 49 public void InPacketTest()
50 { 50 {
51 TestHelper.InMethod(); 51 TestHelper.InMethod();
@@ -87,20 +87,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
87 /// <param name="scene"></param> 87 /// <param name="scene"></param>
88 /// <param name="testLLUDPServer"></param> 88 /// <param name="testLLUDPServer"></param>
89 /// <param name="testPacketServer"></param> 89 /// <param name="testPacketServer"></param>
90 /// <param name="acm">Agent circuit manager used in setting up the stack</param> 90 /// <param name="acm">Agent circuit manager used in setting up the stack</param>
91 protected void SetupStack( 91 protected void SetupStack(
92 IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, 92 IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer,
93 out AgentCircuitManager acm) 93 out AgentCircuitManager acm)
94 { 94 {
95 IConfigSource configSource = new IniConfigSource(); 95 IConfigSource configSource = new IniConfigSource();
96 ClientStackUserSettings userSettings = new ClientStackUserSettings(); 96 ClientStackUserSettings userSettings = new ClientStackUserSettings();
97 testLLUDPServer = new TestLLUDPServer(); 97 testLLUDPServer = new TestLLUDPServer();
98 acm = new AgentCircuitManager(); 98 acm = new AgentCircuitManager();
99 99
100 uint port = 666; 100 uint port = 666;
101 testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); 101 testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm);
102 testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); 102 testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings);
103 testLLUDPServer.LocalScene = scene; 103 testLLUDPServer.LocalScene = scene;
104 } 104 }
105 } 105 }
106} 106}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs
index d055969..1fba847 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs
@@ -31,7 +31,7 @@ using OpenMetaverse.Packets;
31namespace OpenSim.Region.ClientStack.LindenUDP.Tests 31namespace OpenSim.Region.ClientStack.LindenUDP.Tests
32{ 32{
33 public class TestLLPacketServer : LLPacketServer 33 public class TestLLPacketServer : LLPacketServer
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// Record counts of packets received 36 /// Record counts of packets received
37 /// </summary> 37 /// </summary>
@@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
49 m_packetsReceived[packet.Type]++; 49 m_packetsReceived[packet.Type]++;
50 else 50 else
51 m_packetsReceived[packet.Type] = 1; 51 m_packetsReceived[packet.Type] = 1;
52 } 52 }
53 53
54 public int GetTotalPacketsReceived() 54 public int GetTotalPacketsReceived()
55 { 55 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs
index 1dffefb..f98586d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
66 ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); 66 ChunkSenderTuple tuple = m_chunksToLoad.Dequeue();
67 RecvBuffer = tuple.Data; 67 RecvBuffer = tuple.Data;
68 numBytes = tuple.Data.Length; 68 numBytes = tuple.Data.Length;
69 epSender = tuple.Sender; 69 epSender = tuple.Sender;
70 70
71 return true; 71 return true;
72 } 72 }
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
114 { 114 {
115 while (m_chunksToLoad.Count > 0) 115 while (m_chunksToLoad.Count > 0)
116 OnReceivedData(result); 116 OnReceivedData(result);
117 } 117 }
118 118
119 /// <summary> 119 /// <summary>
120 /// Has a circuit with the given code been established? 120 /// Has a circuit with the given code been established?
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
134 /// Record the data and sender tuple 134 /// Record the data and sender tuple
135 /// </summary> 135 /// </summary>
136 public class ChunkSenderTuple 136 public class ChunkSenderTuple
137 { 137 {
138 public byte[] Data; 138 public byte[] Data;
139 public EndPoint Sender; 139 public EndPoint Sender;
140 public bool BeginReceiveException; 140 public bool BeginReceiveException;
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index a266a40..c7aeca14 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack
61 get { return m_commsManager; } 61 get { return m_commsManager; }
62 set { m_commsManager = value; } 62 set { m_commsManager = value; }
63 } 63 }
64 protected CommunicationsManager m_commsManager; 64 protected CommunicationsManager m_commsManager;
65 65
66 protected StorageManager m_storageManager; 66 protected StorageManager m_storageManager;
67 67
@@ -80,15 +80,15 @@ namespace OpenSim.Region.ClientStack
80 /// </summary> 80 /// </summary>
81 /// 81 ///
82 /// <param name="osSceneIdentifier"> 82 /// <param name="osSceneIdentifier">
83 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages. 83 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages.
84 /// </param> 84 /// </param>
85 /// <returns></returns> 85 /// <returns></returns>
86 protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); 86 protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier);
87 87
88 protected abstract StorageManager CreateStorageManager(); 88 protected abstract StorageManager CreateStorageManager();
89 protected abstract ClientStackManager CreateClientStackManager(); 89 protected abstract ClientStackManager CreateClientStackManager();
90 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 90 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
91 AgentCircuitManager circuitManager); 91 AgentCircuitManager circuitManager);
92 92
93 protected override void StartupSpecific() 93 protected override void StartupSpecific()
94 { 94 {
@@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
121 /// <param name="meshEngine">The name of the mesh engine to use</param> 121 /// <param name="meshEngine">The name of the mesh engine to use</param>
122 /// <param name="config">The configuration data to pass to the physics and mesh engines</param> 122 /// <param name="config">The configuration data to pass to the physics and mesh engines</param>
123 /// <param name="osSceneIdentifier"> 123 /// <param name="osSceneIdentifier">
124 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages. 124 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages.
125 /// </param> 125 /// </param>
126 /// <returns></returns> 126 /// <returns></returns>
127 protected PhysicsScene GetPhysicsScene( 127 protected PhysicsScene GetPhysicsScene(
diff --git a/OpenSim/Region/ClientStack/ThrottleSettings.cs b/OpenSim/Region/ClientStack/ThrottleSettings.cs
index 5dcb706..fe4718c 100644
--- a/OpenSim/Region/ClientStack/ThrottleSettings.cs
+++ b/OpenSim/Region/ClientStack/ThrottleSettings.cs
@@ -26,12 +26,12 @@
26 */ 26 */
27 27
28namespace OpenSim.Region.ClientStack 28namespace OpenSim.Region.ClientStack
29{ 29{
30 /// <summary> 30 /// <summary>
31 /// Represent throttle settings for a client stack. These settings are in bytes per second 31 /// Represent throttle settings for a client stack. These settings are in bytes per second
32 /// </summary> 32 /// </summary>
33 public class ThrottleSettings 33 public class ThrottleSettings
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// Minimum bytes per second that the throttle can be set to. 36 /// Minimum bytes per second that the throttle can be set to.
37 /// </summary> 37 /// </summary>
@@ -39,13 +39,13 @@ namespace OpenSim.Region.ClientStack
39 39
40 /// <summary> 40 /// <summary>
41 /// Maximum bytes per second that the throttle can be set to. 41 /// Maximum bytes per second that the throttle can be set to.
42 /// </summary> 42 /// </summary>
43 public int Max; 43 public int Max;
44 44
45 /// <summary> 45 /// <summary>
46 /// Current bytes per second that the throttle should be set to. 46 /// Current bytes per second that the throttle should be set to.
47 /// </summary> 47 /// </summary>
48 public int Current; 48 public int Current;
49 49
50 public ThrottleSettings(int min, int max, int current) 50 public ThrottleSettings(int min, int max, int current)
51 { 51 {
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
index 80f2e79..e80f6ab 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
@@ -40,30 +40,21 @@ namespace OpenSim.Region.Communications.Hypergrid
40{ 40{
41 public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1 41 public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1
42 { 42 {
43 IHyperlink m_osw = null;
44 public IHyperlink HGServices
45 {
46 get { return m_osw; }
47 }
48 43
49 public HGCommunicationsGridMode( 44 public HGCommunicationsGridMode(
50 NetworkServersInfo serversInfo, 45 NetworkServersInfo serversInfo,
51 SceneManager sman, LibraryRootFolder libraryRootFolder) 46 SceneManager sman, LibraryRootFolder libraryRootFolder)
52 : base(serversInfo, libraryRootFolder) 47 : base(serversInfo, libraryRootFolder)
53 { 48 {
54 // From constructor at CommunicationsOGS1
55 HGGridServices gridInterComms = new HGGridServicesGridMode(serversInfo, sman, m_userProfileCacheService);
56 m_gridService = gridInterComms;
57 m_osw = gridInterComms;
58 49
59 HGUserServices userServices = new HGUserServices(this); 50 HGUserServices userServices = new HGUserServices(this);
60 // This plugin arrangement could eventually be configurable rather than hardcoded here. 51 // This plugin arrangement could eventually be configurable rather than hardcoded here.
61 userServices.AddPlugin(new TemporaryUserProfilePlugin()); 52 userServices.AddPlugin(new TemporaryUserProfilePlugin());
62 userServices.AddPlugin(new HGUserDataPlugin(this, userServices)); 53 userServices.AddPlugin(new HGUserDataPlugin(this, userServices));
63 54
64 m_userService = userServices; 55 m_userService = userServices;
65 m_messageService = userServices; 56 m_messageService = userServices;
66 m_avatarService = userServices; 57 m_avatarService = userServices;
67 } 58 }
68 } 59 }
69} 60}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
index e4e12d4..4e3f5a1 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs
@@ -41,14 +41,13 @@ namespace OpenSim.Region.Communications.Hypergrid
41 public class HGCommunicationsStandalone : CommunicationsManager 41 public class HGCommunicationsStandalone : CommunicationsManager
42 { 42 {
43 public HGCommunicationsStandalone( 43 public HGCommunicationsStandalone(
44 ConfigSettings configSettings, 44 ConfigSettings configSettings,
45 NetworkServersInfo serversInfo, 45 NetworkServersInfo serversInfo,
46 BaseHttpServer httpServer, 46 BaseHttpServer httpServer,
47 HGGridServices gridService,
48 LibraryRootFolder libraryRootFolder, 47 LibraryRootFolder libraryRootFolder,
49 bool dumpAssetsToFile) 48 bool dumpAssetsToFile)
50 : base(serversInfo, libraryRootFolder) 49 : base(serversInfo, libraryRootFolder)
51 { 50 {
52 LocalUserServices localUserService = 51 LocalUserServices localUserService =
53 new LocalUserServices( 52 new LocalUserServices(
54 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); 53 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
@@ -59,13 +58,11 @@ namespace OpenSim.Region.Communications.Hypergrid
59 hgUserService.AddPlugin(new TemporaryUserProfilePlugin()); 58 hgUserService.AddPlugin(new TemporaryUserProfilePlugin());
60 hgUserService.AddPlugin(new HGUserDataPlugin(this, hgUserService)); 59 hgUserService.AddPlugin(new HGUserDataPlugin(this, hgUserService));
61 60
62 m_userService = hgUserService; 61 m_userService = hgUserService;
63 m_userAdminService = hgUserService; 62 m_userAdminService = hgUserService;
64 m_avatarService = hgUserService; 63 m_avatarService = hgUserService;
65 m_messageService = hgUserService; 64 m_messageService = hgUserService;
66 65
67 gridService.UserProfileCache = m_userProfileCacheService;
68 m_gridService = gridService;
69 } 66 }
70 } 67 }
71} 68}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
deleted file mode 100644
index 54cde0f..0000000
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
+++ /dev/null
@@ -1,1024 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29using System;
30using System.Collections;
31using System.Collections.Generic;
32using System.Drawing;
33using System.Net;
34using System.Net.Sockets;
35using System.Reflection;
36using System.Runtime.Remoting;
37using System.Security.Authentication;
38using log4net;
39using Nwc.XmlRpc;
40using OpenMetaverse;
41using OpenMetaverse.Imaging;
42using OpenSim.Framework;
43using OpenSim.Framework.Communications;
44using OpenSim.Framework.Communications.Cache;
45using OpenSim.Framework.Servers;
46using OpenSim.Framework.Servers.HttpServer;
47using OpenSim.Region.Communications.OGS1;
48using OpenSim.Region.Framework.Scenes;
49using OpenSim.Services.Interfaces;
50// using OpenSim.Region.Environment.Modules.Framework;
51
52namespace OpenSim.Region.Communications.Hypergrid
53{
54 /// <summary>
55 /// This class encapsulates the main hypergrid functions related to creating and managing
56 /// hyperlinks, as well as processing all the inter-region comms between a region and
57 /// an hyperlinked region.
58 /// </summary>
59 public class HGGridServices : IGridServices, IHyperlink
60 {
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62
63
64 public BaseHttpServer httpListener;
65 public NetworkServersInfo serversInfo;
66
67 protected List<RegionInfo> m_regionsOnInstance = new List<RegionInfo>();
68
69 // Hyperlink regions are hyperlinks on the map
70 protected List<RegionInfo> m_hyperlinkRegions = new List<RegionInfo>();
71
72 // Known regions are home regions of visiting foreign users.
73 // They are not on the map as static hyperlinks. They are dynamic hyperlinks, they go away when
74 // the visitor goes away. They are mapped to X=0 on the map.
75 // This is key-ed on agent ID
76 protected Dictionary<UUID, RegionInfo> m_knownRegions = new Dictionary<UUID, RegionInfo>();
77
78 protected UserProfileCacheService m_userProfileCache;
79 protected SceneManager m_sceneman;
80
81 private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>();
82
83 public virtual string gdebugRegionName
84 {
85 get { return "Override me"; }
86 set { ; }
87 }
88
89 public string rdebugRegionName
90 {
91 get { return _rdebugRegionName; }
92 set { _rdebugRegionName = value; }
93 }
94 private string _rdebugRegionName = String.Empty;
95
96 public virtual bool RegionLoginsEnabled
97 {
98 get { return true; }
99 set { ; }
100 }
101
102 public UserProfileCacheService UserProfileCache
103 {
104 set { m_userProfileCache = value; }
105 }
106
107 private Random random;
108
109 /// <summary>
110 /// Contructor. Adds "expect_hg_user" and "check" xmlrpc method handlers
111 /// </summary>
112 /// <param name="servers_info"></param>
113 public HGGridServices(NetworkServersInfo servers_info, SceneManager sman)
114 {
115 serversInfo = servers_info;
116 m_sceneman = sman;
117
118 random = new Random();
119
120 MainServer.Instance.AddXmlRPCHandler("link_region", LinkRegionRequest);
121 MainServer.Instance.AddXmlRPCHandler("expect_hg_user", ExpectHGUser);
122
123 HGNetworkServersInfo.Init(servers_info.AssetURL, servers_info.InventoryURL, servers_info.UserURL);
124 }
125
126 // see IGridServices
127 public virtual RegionCommsListener RegisterRegion(RegionInfo regionInfo)
128 {
129 // Region doesn't exist here. Trying to link remote region
130
131 m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort);
132 regionInfo.RegionID = LinkRegion(regionInfo); // UUID.Random();
133 if (!regionInfo.RegionID.Equals(UUID.Zero))
134 {
135 m_hyperlinkRegions.Add(regionInfo);
136 m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID);
137
138 //Try get the map image
139 GetMapImage(regionInfo);
140 }
141 else
142 {
143 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")");
144 }
145 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners
146 return null;
147 }
148
149 // see IGridServices
150 public virtual bool DeregisterRegion(RegionInfo regionInfo)
151 {
152 if (m_hyperlinkRegions.Contains(regionInfo))
153 {
154 m_hyperlinkRegions.Remove(regionInfo);
155 return true;
156 }
157 foreach (KeyValuePair<UUID, RegionInfo> kvp in m_knownRegions)
158 {
159 if (kvp.Value == regionInfo)
160 {
161 m_knownRegions.Remove(kvp.Key);
162 return true;
163 }
164 }
165 return false;
166 }
167
168 public virtual Dictionary<string, string> GetGridSettings()
169 {
170 Dictionary<string, string> returnGridSettings = new Dictionary<string, string>();
171 lock (m_queuedGridSettings)
172 {
173 foreach (string Dictkey in m_queuedGridSettings.Keys)
174 {
175 returnGridSettings.Add(Dictkey, m_queuedGridSettings[Dictkey]);
176 }
177
178 m_queuedGridSettings.Clear();
179 }
180
181 return returnGridSettings;
182 }
183
184 // see IGridServices
185 public virtual List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
186 {
187 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
188 foreach (RegionInfo reg in m_hyperlinkRegions)
189 {
190 if (reg.RegionLocX != x || reg.RegionLocY != y)
191 {
192 //m_log.Debug("CommsManager- RequestNeighbours() - found a different region in list, checking location");
193 if ((reg.RegionLocX > (x - 2)) && (reg.RegionLocX < (x + 2)))
194 {
195 if ((reg.RegionLocY > (y - 2)) && (reg.RegionLocY < (y + 2)))
196 {
197 neighbours.Add(reg);
198 }
199 }
200 }
201 }
202
203 return neighbours;
204 }
205
206 /// <summary>
207 /// Request information about a region.
208 /// </summary>
209 /// <param name="regionHandle"></param>
210 /// <returns>
211 /// null on a failure to contact or get a response from the grid server
212 /// FIXME: Might be nicer to return a proper exception here since we could inform the client more about the
213 /// nature of the faiulre.
214 /// </returns>
215 public virtual RegionInfo RequestNeighbourInfo(UUID Region_UUID)
216 {
217 foreach (RegionInfo info in m_hyperlinkRegions)
218 {
219 if (info.RegionID == Region_UUID) return info;
220 }
221
222 // I don't trust region uuids to be unique...
223 //foreach (RegionInfo info in m_knownRegions.Values)
224 //{
225 // if (info.RegionID == Region_UUID) return info;
226 //}
227
228 return null;
229 }
230
231 /// <summary>
232 /// Request information about a region.
233 /// </summary>
234 /// <param name="regionHandle"></param>
235 /// <returns></returns>
236 public virtual RegionInfo RequestNeighbourInfo(ulong regionHandle)
237 {
238 //m_log.Debug(" >> RequestNeighbourInfo for " + regionHandle);
239 foreach (RegionInfo info in m_hyperlinkRegions)
240 {
241 //m_log.Debug(" .. " + info.RegionHandle);
242 if (info.RegionHandle == regionHandle) return info;
243 }
244
245 foreach (RegionInfo info in m_knownRegions.Values)
246 {
247 if (info.RegionHandle == regionHandle)
248 {
249 //m_log.Debug("XXX------ known region " + info.RegionHandle);
250 return info;
251 }
252 }
253
254 return null;
255 }
256
257 public virtual RegionInfo RequestNeighbourInfo(string name)
258 {
259 foreach (RegionInfo info in m_hyperlinkRegions)
260 {
261 //m_log.Debug(" .. " + info.RegionHandle);
262 if (info.RegionName == name) return info;
263 }
264
265 foreach (RegionInfo info in m_knownRegions.Values)
266 {
267 if (info.RegionName == name)
268 {
269 //m_log.Debug("XXX------ known region " + info.RegionHandle);
270 return info;
271 }
272 }
273
274 return null;
275 }
276
277 public virtual RegionInfo RequestNeighbourInfo(string hostName, uint port)
278 {
279 foreach (RegionInfo info in m_hyperlinkRegions)
280 {
281 //m_log.Debug(" .. " + info.RegionHandle);
282 if ((info.ExternalHostName == hostName) && (info.HttpPort == port))
283 return info;
284 }
285
286 foreach (RegionInfo info in m_knownRegions.Values)
287 {
288 if ((info.ExternalHostName == hostName) && (info.HttpPort == port))
289 {
290 //m_log.Debug("XXX------ known region " + info.RegionHandle);
291 return info;
292 }
293 }
294
295 return null;
296 }
297
298 public virtual RegionInfo RequestClosestRegion(string regionName)
299 {
300 foreach (RegionInfo info in m_hyperlinkRegions)
301 {
302 if (info.RegionName == regionName) return info;
303 }
304
305 return null;
306 }
307
308 /// <summary>
309 ///
310 /// </summary>
311 /// <param name="minX"></param>
312 /// <param name="minY"></param>
313 /// <param name="maxX"></param>
314 /// <param name="maxY"></param>
315 /// <returns></returns>
316 public virtual List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
317 {
318 List<MapBlockData> neighbours = new List<MapBlockData>();
319
320 foreach (RegionInfo regInfo in m_hyperlinkRegions)
321 {
322 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) &&
323 ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
324 {
325 MapBlockData map = new MapBlockData();
326 map.Name = regInfo.RegionName;
327 map.X = (ushort)regInfo.RegionLocX;
328 map.Y = (ushort)regInfo.RegionLocY;
329 map.WaterHeight = (byte)regInfo.RegionSettings.WaterHeight;
330 map.MapImageId = regInfo.RegionSettings.TerrainImageID;
331 // m_log.Debug("ImgID: " + map.MapImageId);
332 map.Agents = 1;
333 map.RegionFlags = 72458694;
334 map.Access = regInfo.AccessLevel;
335 neighbours.Add(map);
336 }
337 }
338
339 return neighbours;
340 }
341
342
343 protected virtual void GetMapImage(RegionInfo info)
344 {
345 try
346 {
347 string regionimage = "regionImage" + info.RegionID.ToString();
348 regionimage = regionimage.Replace("-", "");
349
350 WebClient c = new WebClient();
351 string uri = "http://" + info.ExternalHostName + ":" + info.HttpPort + "/index.php?method=" + regionimage;
352 //m_log.Debug("JPEG: " + uri);
353 c.DownloadFile(uri, info.RegionID.ToString() + ".jpg");
354 Bitmap m = new Bitmap(info.RegionID.ToString() + ".jpg");
355 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
356 byte[] imageData = OpenJPEG.EncodeFromImage(m, true);
357 AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString());
358 info.RegionSettings.TerrainImageID = ass.FullID;
359 ass.Type = (int)AssetType.Texture;
360 ass.Temporary = false;
361 ass.Local = true;
362 ass.Data = imageData;
363
364 m_sceneman.CurrentOrFirstScene.AssetService.Store(ass);
365
366 }
367 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
368 {
369 m_log.Warn("[HGrid]: Failed getting/storing map image, because it is probably already in the cache");
370 }
371 }
372
373 // A little ugly, since this code is exactly the same as OSG1's, and we're already
374 // calling that for when the region in in grid mode... (for the grid regions)
375 //
376 public virtual LandData RequestLandData (ulong regionHandle, uint x, uint y)
377 {
378 m_log.DebugFormat("[HGrid]: requests land data in {0}, at {1}, {2}",
379 regionHandle, x, y);
380
381 // Remote region
382
383 Hashtable hash = new Hashtable();
384 hash["region_handle"] = regionHandle.ToString();
385 hash["x"] = x.ToString();
386 hash["y"] = y.ToString();
387
388 IList paramList = new ArrayList();
389 paramList.Add(hash);
390 LandData landData = null;
391
392 try
393 {
394 RegionInfo info = RequestNeighbourInfo(regionHandle);
395 if (info != null) // just to be sure
396 {
397 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
398 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
399 XmlRpcResponse response = request.Send(uri, 10000);
400 if (response.IsFault)
401 {
402 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
403 }
404 else
405 {
406 hash = (Hashtable)response.Value;
407 try
408 {
409 landData = new LandData();
410 landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
411 landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
412 landData.Area = Convert.ToInt32(hash["Area"]);
413 landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
414 landData.Description = (string)hash["Description"];
415 landData.Flags = Convert.ToUInt32(hash["Flags"]);
416 landData.GlobalID = new UUID((string)hash["GlobalID"]);
417 landData.Name = (string)hash["Name"];
418 landData.OwnerID = new UUID((string)hash["OwnerID"]);
419 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
420 landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
421 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
422 m_log.DebugFormat("[HGrid]: Got land data for parcel {0}", landData.Name);
423 }
424 catch (Exception e)
425 {
426 m_log.Error("[HGrid]: Got exception while parsing land-data:", e);
427 }
428 }
429 }
430 else m_log.WarnFormat("[HGrid]: Couldn't find region with handle {0}", regionHandle);
431 }
432 catch (Exception e)
433 {
434 m_log.ErrorFormat("[HGrid]: Couldn't contact region {0}: {1}", regionHandle, e);
435 }
436
437 return landData;
438 }
439
440 // Grid Request Processing
441 public virtual List<RegionInfo> RequestNamedRegions (string name, int maxNumber)
442 {
443 List<RegionInfo> infos = new List<RegionInfo>();
444 foreach (RegionInfo info in m_hyperlinkRegions)
445 {
446 if (info.RegionName.ToLower().Contains(name))
447 {
448 infos.Add(info);
449 }
450 }
451 return infos;
452 }
453
454
455 private UUID LinkRegion(RegionInfo info)
456 {
457 UUID uuid = UUID.Zero;
458
459 Hashtable hash = new Hashtable();
460 hash["region_name"] = info.RegionName;
461
462 IList paramList = new ArrayList();
463 paramList.Add(hash);
464
465 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
466 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
467 m_log.Debug("[HGrid]: Linking to " + uri);
468 XmlRpcResponse response = request.Send(uri, 10000);
469 if (response.IsFault)
470 {
471 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
472 }
473 else
474 {
475 hash = (Hashtable)response.Value;
476 //foreach (Object o in hash)
477 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
478 try
479 {
480 UUID.TryParse((string)hash["uuid"], out uuid);
481 info.RegionID = uuid;
482 if ((string)hash["handle"] != null)
483 {
484 info.regionSecret = (string)hash["handle"];
485 //m_log.Debug(">> HERE: " + info.regionSecret);
486 }
487 if (hash["region_image"] != null)
488 {
489 UUID img = UUID.Zero;
490 UUID.TryParse((string)hash["region_image"], out img);
491 info.RegionSettings.TerrainImageID = img;
492 }
493 if (hash["region_name"] != null)
494 {
495 info.RegionName = (string)hash["region_name"];
496 //m_log.Debug(">> " + info.RegionName);
497 }
498 if (hash["internal_port"] != null)
499 {
500 int port = Convert.ToInt32((string)hash["internal_port"]);
501 info.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
502 //m_log.Debug(">> " + info.InternalEndPoint.ToString());
503 }
504 if (hash["remoting_port"] != null)
505 {
506 info.RemotingPort = Convert.ToUInt32(hash["remoting_port"]);
507 //m_log.Debug(">> " + info.RemotingPort);
508 }
509
510 }
511 catch (Exception e)
512 {
513 m_log.Error("[HGrid]: Got exception while parsing hyperlink response " + e.StackTrace);
514 }
515 }
516 return uuid;
517 }
518
519 /// <summary>
520 /// Someone wants to link to us
521 /// </summary>
522 /// <param name="request"></param>
523 /// <returns></returns>
524 public XmlRpcResponse LinkRegionRequest(XmlRpcRequest request, IPEndPoint remoteClient)
525 {
526 Hashtable requestData = (Hashtable)request.Params[0];
527 //string host = (string)requestData["host"];
528 //string portstr = (string)requestData["port"];
529 string name = (string)requestData["region_name"];
530
531 m_log.DebugFormat("[HGrid]: Hyperlink request");
532
533
534 RegionInfo regInfo = null;
535 foreach (RegionInfo r in m_regionsOnInstance)
536 {
537 if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower()))
538 {
539 regInfo = r;
540 break;
541 }
542 }
543
544 if (regInfo == null)
545 regInfo = m_regionsOnInstance[0]; // Send out the first region
546
547 Hashtable hash = new Hashtable();
548 hash["uuid"] = regInfo.RegionID.ToString();
549 hash["handle"] = regInfo.RegionHandle.ToString();
550 //m_log.Debug(">> Here " + regInfo.RegionHandle);
551 hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString();
552 hash["region_name"] = regInfo.RegionName;
553 hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
554 hash["remoting_port"] = ConfigSettings.DefaultRegionRemotingPort.ToString();
555 //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port);
556
557
558 XmlRpcResponse response = new XmlRpcResponse();
559 response.Value = hash;
560 return response;
561 }
562
563 public bool InformRegionOfUser(RegionInfo regInfo, AgentCircuitData agentData)
564 {
565 //ulong regionHandle = regInfo.RegionHandle;
566 try
567 {
568 //regionHandle = Convert.ToUInt64(regInfo.regionSecret);
569 m_log.Info("[HGrid]: InformRegionOfUser: Remote hyperlinked region " + regInfo.regionSecret);
570 }
571 catch
572 {
573 m_log.Info("[HGrid]: InformRegionOfUser: Local grid region " + regInfo.regionSecret);
574 }
575
576 string capsPath = agentData.CapsPath;
577 Hashtable loginParams = new Hashtable();
578 loginParams["session_id"] = agentData.SessionID.ToString();
579 loginParams["secure_session_id"] = agentData.SecureSessionID.ToString();
580
581 loginParams["firstname"] = agentData.firstname;
582 loginParams["lastname"] = agentData.lastname;
583
584 loginParams["agent_id"] = agentData.AgentID.ToString();
585 loginParams["circuit_code"] = agentData.circuitcode.ToString();
586 loginParams["startpos_x"] = agentData.startpos.X.ToString();
587 loginParams["startpos_y"] = agentData.startpos.Y.ToString();
588 loginParams["startpos_z"] = agentData.startpos.Z.ToString();
589 loginParams["caps_path"] = capsPath;
590
591 CachedUserInfo u = m_userProfileCache.GetUserDetails(agentData.AgentID);
592 if (u != null && u.UserProfile != null)
593 {
594 loginParams["region_uuid"] = u.UserProfile.HomeRegionID.ToString(); // This seems to be always Zero
595 //m_log.Debug(" --------- Home Region UUID -------");
596 //m_log.Debug(" >> " + loginParams["region_uuid"] + " <<");
597 //m_log.Debug(" --------- ---------------- -------");
598
599 string serverURI = "";
600 if (u.UserProfile is ForeignUserProfileData)
601 serverURI = HGNetworkServersInfo.ServerURI(((ForeignUserProfileData)u.UserProfile).UserServerURI);
602 loginParams["userserver_id"] = (serverURI == "") || (serverURI == null) ? HGNetworkServersInfo.Singleton.LocalUserServerURI : serverURI;
603
604 serverURI = HGNetworkServersInfo.ServerURI(u.UserProfile.UserAssetURI);
605 loginParams["assetserver_id"] = (serverURI == "") || (serverURI == null) ? HGNetworkServersInfo.Singleton.LocalAssetServerURI : serverURI;
606
607 serverURI = HGNetworkServersInfo.ServerURI(u.UserProfile.UserInventoryURI);
608 loginParams["inventoryserver_id"] = (serverURI == "") || (serverURI == null) ? HGNetworkServersInfo.Singleton.LocalInventoryServerURI : serverURI;
609
610 loginParams["root_folder_id"] = u.UserProfile.RootInventoryFolderID;
611
612 RegionInfo rinfo = RequestNeighbourInfo(u.UserProfile.HomeRegion);
613 if (rinfo != null)
614 {
615 loginParams["internal_port"] = rinfo.InternalEndPoint.Port.ToString();
616 if (!IsLocalUser(u))
617 {
618 loginParams["regionhandle"] = rinfo.regionSecret; // user.CurrentAgent.Handle.ToString();
619 //m_log.Debug("XXX--- informregionofuser (foreign user) here handle: " + rinfo.regionSecret);
620
621 loginParams["home_address"] = ((ForeignUserProfileData)(u.UserProfile)).UserHomeAddress;
622 loginParams["home_port"] = ((ForeignUserProfileData)(u.UserProfile)).UserHomePort;
623 loginParams["home_remoting"] = ((ForeignUserProfileData)(u.UserProfile)).UserHomeRemotingPort;
624 }
625 else
626 {
627 //m_log.Debug("XXX--- informregionofuser (local user) here handle: " + rinfo.regionSecret);
628
629 //// local user about to jump out, let's process the name
630 // On second thoughts, let's not do this for the *user*; let's only do it for the *agent*
631 //loginParams["firstname"] = agentData.firstname + "." + agentData.lastname;
632 //loginParams["lastname"] = serversInfo.UserURL;
633
634 // local user, first time out. let's ask the grid about this user's home region
635 loginParams["regionhandle"] = u.UserProfile.HomeRegion.ToString(); // user.CurrentAgent.Handle.ToString();
636
637 loginParams["home_address"] = rinfo.ExternalHostName;
638 m_log.Debug(" --------- Home Address -------");
639 m_log.Debug(" >> " + loginParams["home_address"] + " <<");
640 m_log.Debug(" --------- ------------ -------");
641 loginParams["home_port"] = rinfo.HttpPort.ToString();
642 loginParams["home_remoting"] = ConfigSettings.DefaultRegionRemotingPort.ToString(); ;
643 }
644 }
645 else
646 {
647 m_log.Warn("[HGrid]: User's home region info not found: " + u.UserProfile.HomeRegionX + ", " + u.UserProfile.HomeRegionY);
648 }
649 }
650
651 ArrayList SendParams = new ArrayList();
652 SendParams.Add(loginParams);
653
654 // Send
655 string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/";
656 //m_log.Debug("XXX uri: " + uri);
657 XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams);
658 XmlRpcResponse reply;
659 try
660 {
661 reply = request.Send(uri, 6000);
662 }
663 catch (Exception e)
664 {
665 m_log.Warn("[HGrid]: Failed to notify region about user. Reason: " + e.Message);
666 return false;
667 }
668
669 if (!reply.IsFault)
670 {
671 bool responseSuccess = true;
672 if (reply.Value != null)
673 {
674 Hashtable resp = (Hashtable)reply.Value;
675 if (resp.ContainsKey("success"))
676 {
677 if ((string)resp["success"] == "FALSE")
678 {
679 responseSuccess = false;
680 }
681 }
682 }
683 if (responseSuccess)
684 {
685 m_log.Info("[HGrid]: Successfully informed remote region about user " + agentData.AgentID);
686 return true;
687 }
688 else
689 {
690 m_log.ErrorFormat("[HGrid]: Region responded that it is not available to receive clients");
691 return false;
692 }
693 }
694 else
695 {
696 m_log.ErrorFormat("[HGrid]: XmlRpc request to region failed with message {0}, code {1} ", reply.FaultString, reply.FaultCode);
697 return false;
698 }
699 }
700
701
702 /// <summary>
703 /// Received from other HGrid nodes when a user wants to teleport here. This call allows
704 /// the region to prepare for direct communication from the client. Sends back an empty
705 /// xmlrpc response on completion.
706 /// This is somewhat similar to OGS1's ExpectUser, but with the additional task of
707 /// registering the user in the local user cache.
708 /// </summary>
709 /// <param name="request"></param>
710 /// <returns></returns>
711 public XmlRpcResponse ExpectHGUser(XmlRpcRequest request, IPEndPoint remoteClient)
712 {
713 Hashtable requestData = (Hashtable)request.Params[0];
714 ForeignUserProfileData userData = new ForeignUserProfileData();
715
716 userData.FirstName = (string)requestData["firstname"];
717 userData.SurName = (string)requestData["lastname"];
718 userData.ID = new UUID((string)requestData["agent_id"]);
719 userData.HomeLocation = new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]),
720 (float)Convert.ToDecimal((string)requestData["startpos_y"]),
721 (float)Convert.ToDecimal((string)requestData["startpos_z"]));
722
723 userData.UserServerURI = (string)requestData["userserver_id"];
724 userData.UserAssetURI = (string)requestData["assetserver_id"];
725 userData.UserInventoryURI = (string)requestData["inventoryserver_id"];
726
727 UUID rootID = UUID.Zero;
728 UUID.TryParse((string)requestData["root_folder_id"], out rootID);
729 userData.RootInventoryFolderID = rootID;
730
731 UUID uuid = UUID.Zero;
732 UUID.TryParse((string)requestData["region_uuid"], out uuid);
733 userData.HomeRegionID = uuid; // not quite comfortable about this...
734 ulong userRegionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
735 //userData.HomeRegion = userRegionHandle;
736 userData.UserHomeAddress = (string)requestData["home_address"];
737 userData.UserHomePort = (string)requestData["home_port"];
738 int userhomeinternalport = Convert.ToInt32((string)requestData["internal_port"]);
739 userData.UserHomeRemotingPort = (string)requestData["home_remoting"];
740
741
742 m_log.DebugFormat("[HGrid]: Prepare for connection from {0} {1} (@{2}) UUID={3}",
743 userData.FirstName, userData.SurName, userData.UserServerURI, userData.ID);
744 m_log.Debug("[HGrid]: home_address: " + userData.UserHomeAddress +
745 "; home_port: " + userData.UserHomePort + "; remoting: " + userData.UserHomeRemotingPort);
746
747 XmlRpcResponse resp = new XmlRpcResponse();
748
749 // Let's check if someone is trying to get in with a stolen local identity.
750 // The need for this test is a consequence of not having truly global names :-/
751 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(userData.ID);
752 if ((uinfo != null) && !(uinfo.UserProfile is ForeignUserProfileData))
753 {
754 m_log.WarnFormat("[HGrid]: Foreign user trying to get in with local identity. Access denied.");
755 Hashtable respdata = new Hashtable();
756 respdata["success"] = "FALSE";
757 respdata["reason"] = "Foreign user has the same ID as a local user.";
758 resp.Value = respdata;
759 return resp;
760 }
761
762 if (!RegionLoginsEnabled)
763 {
764 m_log.InfoFormat(
765 "[HGrid]: Denying access for user {0} {1} because region login is currently disabled",
766 userData.FirstName, userData.SurName);
767
768 Hashtable respdata = new Hashtable();
769 respdata["success"] = "FALSE";
770 respdata["reason"] = "region login currently disabled";
771 resp.Value = respdata;
772 }
773 else
774 {
775 // Finally, everything looks ok
776 //m_log.Debug("XXX---- EVERYTHING OK ---XXX");
777
778 // 1 - Preload the user data
779 m_userProfileCache.PreloadUserCache(userData);
780
781 if (m_knownRegions.ContainsKey(userData.ID))
782 {
783 // This was left here when the user departed
784 m_knownRegions.Remove(userData.ID);
785 }
786
787 // 2 - Load the region info into list of known regions
788 RegionInfo rinfo = new RegionInfo();
789 rinfo.RegionID = userData.HomeRegionID;
790 rinfo.ExternalHostName = userData.UserHomeAddress;
791 rinfo.HttpPort = Convert.ToUInt32(userData.UserHomePort);
792 rinfo.RemotingPort = Convert.ToUInt32(userData.UserHomeRemotingPort);
793 rinfo.RegionID = userData.HomeRegionID;
794 // X=0 on the map
795 rinfo.RegionLocX = 0;
796 rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count;
797 rinfo.regionSecret = userRegionHandle.ToString();
798 //m_log.Debug("XXX--- Here: handle = " + rinfo.regionSecret);
799 try
800 {
801 rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport);
802 }
803 catch (Exception e)
804 {
805 m_log.Warn("[HGrid]: Exception while constructing internal endpoint: " + e);
806 }
807 rinfo.RemotingAddress = rinfo.ExternalEndPoint.Address.ToString(); //userData.UserHomeAddress;
808
809 if (!IsComingHome(userData))
810 {
811 // Change the user's home region here!!!
812 userData.HomeRegion = rinfo.RegionHandle;
813 }
814
815 if (!m_knownRegions.ContainsKey(userData.ID))
816 m_knownRegions.Add(userData.ID, rinfo);
817
818 // 3 - Send the reply
819 Hashtable respdata = new Hashtable();
820 respdata["success"] = "TRUE";
821 resp.Value = respdata;
822
823 DumpUserData(userData);
824 DumpRegionData(rinfo);
825
826 }
827
828 return resp;
829 }
830
831 public bool SendUserInformation(RegionInfo regInfo, AgentCircuitData agentData)
832 {
833 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
834
835 if ((IsLocalUser(uinfo) && IsHyperlinkRegion(regInfo.RegionHandle)) ||
836 (!IsLocalUser(uinfo) && !IsGoingHome(uinfo, regInfo)))
837 {
838 m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere");
839 if (!InformRegionOfUser(regInfo, agentData))
840 {
841 m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
842 return false;
843 }
844 }
845 //if ((uinfo == null) || !IsGoingHome(uinfo, regInfo))
846 //{
847 // m_log.Info("[HGrid]: User seems to be going to foreign region.");
848 // if (!InformRegionOfUser(regInfo, agentData))
849 // {
850 // m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
851 // return false;
852 // }
853 //}
854 //else
855 // m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
856
857 // May need to change agent's name
858 if (IsLocalUser(uinfo) && IsHyperlinkRegion(regInfo.RegionHandle))
859 {
860 agentData.firstname = agentData.firstname + "." + agentData.lastname;
861 agentData.lastname = "@" + serversInfo.UserURL.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI;
862 }
863
864 return true;
865 }
866
867
868 #region Methods triggered by calls from external instances
869
870 /// <summary>
871 ///
872 /// </summary>
873 /// <param name="regionHandle"></param>
874 /// <param name="agentData"></param>
875 /// <returns></returns>
876 public void AdjustUserInformation(AgentCircuitData agentData)
877 {
878 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
879 if ((uinfo != null) && (uinfo.UserProfile != null) &&
880 (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData)))
881 {
882 //m_log.Debug("---------------> Local User!");
883 string[] parts = agentData.firstname.Split(new char[] { '.' });
884 if (parts.Length == 2)
885 {
886 agentData.firstname = parts[0];
887 agentData.lastname = parts[1];
888 }
889 }
890 //else
891 // m_log.Debug("---------------> Foreign User!");
892 }
893 #endregion
894
895
896 #region IHyperGrid interface
897
898 public virtual bool IsHyperlinkRegion(ulong ihandle)
899 {
900 if (GetHyperlinkRegion(ihandle) == null)
901 return false;
902 else
903 return true;
904 }
905
906 public virtual RegionInfo GetHyperlinkRegion(ulong ihandle)
907 {
908 foreach (RegionInfo info in m_hyperlinkRegions)
909 {
910 if (info.RegionHandle == ihandle)
911 return info;
912 }
913
914 foreach (RegionInfo info in m_knownRegions.Values)
915 {
916 if (info.RegionHandle == ihandle)
917 return info;
918 }
919
920 return null;
921 }
922
923 public virtual ulong FindRegionHandle(ulong ihandle)
924 {
925 long ohandle = -1;
926 List<RegionInfo> rlist = new List<RegionInfo>(m_hyperlinkRegions);
927 rlist.AddRange(m_knownRegions.Values);
928 foreach (RegionInfo info in rlist)
929 {
930 if (info.RegionHandle == ihandle)
931 {
932 try
933 {
934 ohandle = Convert.ToInt64(info.regionSecret);
935 m_log.Info("[HGrid] remote region " + ohandle);
936 }
937 catch
938 {
939 m_log.Error("[HGrid] Could not convert secret for " + ihandle + " (" + info.regionSecret + ")");
940 }
941 break;
942 }
943 }
944 return ohandle < 0 ? ihandle : (ulong)ohandle;
945 }
946 #endregion
947
948 #region Misc
949
950 protected bool IsComingHome(ForeignUserProfileData userData)
951 {
952 return (userData.UserServerURI == HGNetworkServersInfo.Singleton.LocalUserServerURI);
953 }
954
955 protected bool IsGoingHome(CachedUserInfo uinfo, RegionInfo rinfo)
956 {
957 if (uinfo.UserProfile == null)
958 return false;
959
960 string userUserServerURI = String.Empty;
961 if (uinfo.UserProfile is ForeignUserProfileData)
962 {
963 userUserServerURI = HGNetworkServersInfo.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI);
964 }
965
966 return ((uinfo.UserProfile.HomeRegionID == rinfo.RegionID) &&
967 (userUserServerURI != HGNetworkServersInfo.Singleton.LocalUserServerURI));
968 }
969
970 protected bool IsLocalUser(CachedUserInfo uinfo)
971 {
972 if (uinfo == null)
973 return true;
974
975 if (uinfo.UserProfile is ForeignUserProfileData)
976 return HGNetworkServersInfo.Singleton.IsLocalUser(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI);
977 else
978 return true;
979
980 }
981
982 protected bool IsLocalRegion(ulong handle)
983 {
984 foreach (RegionInfo reg in m_regionsOnInstance)
985 if (reg.RegionHandle == handle)
986 return true;
987 return false;
988 }
989
990 private void DumpUserData(ForeignUserProfileData userData)
991 {
992 m_log.Info(" ------------ User Data Dump ----------");
993 m_log.Info(" >> Name: " + userData.FirstName + " " + userData.SurName);
994 m_log.Info(" >> HomeID: " + userData.HomeRegionID);
995 m_log.Info(" >> HomeHandle: " + userData.HomeRegion);
996 m_log.Info(" >> HomeX: " + userData.HomeRegionX);
997 m_log.Info(" >> HomeY: " + userData.HomeRegionY);
998 m_log.Info(" >> UserServer: " + userData.UserServerURI);
999 m_log.Info(" >> InvServer: " + userData.UserInventoryURI);
1000 m_log.Info(" >> AssetServer: " + userData.UserAssetURI);
1001 m_log.Info(" ------------ -------------- ----------");
1002 }
1003
1004 private void DumpRegionData(RegionInfo rinfo)
1005 {
1006 m_log.Info(" ------------ Region Data Dump ----------");
1007 m_log.Info(" >> handle: " + rinfo.RegionHandle);
1008 m_log.Info(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY);
1009 m_log.Info(" >> secret: " + rinfo.regionSecret);
1010 m_log.Info(" >> remoting address: " + rinfo.RemotingAddress);
1011 m_log.Info(" >> remoting port: " + rinfo.RemotingPort);
1012 m_log.Info(" >> external host name: " + rinfo.ExternalHostName);
1013 m_log.Info(" >> http port: " + rinfo.HttpPort);
1014 m_log.Info(" >> external EP address: " + rinfo.ExternalEndPoint.Address);
1015 m_log.Info(" >> external EP port: " + rinfo.ExternalEndPoint.Port);
1016 m_log.Info(" ------------ -------------- ----------");
1017 }
1018
1019
1020 #endregion
1021
1022
1023 }
1024}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs
deleted file mode 100644
index 5ce1e79..0000000
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Framework.Servers.HttpServer;
36using OpenSim.Region.Communications.OGS1;
37using OpenSim.Region.Framework.Scenes;
38
39namespace OpenSim.Region.Communications.Hypergrid
40{
41 public class HGGridServicesGridMode : HGGridServices
42 {
43 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44
45 /// <summary>
46 /// Encapsulate remote backend services for manipulation of grid regions
47 /// </summary>
48 private OGS1GridServices m_remoteBackend = null;
49
50 public OGS1GridServices RemoteBackend
51 {
52 get { return m_remoteBackend; }
53 }
54
55
56 public override string gdebugRegionName
57 {
58 get { return m_remoteBackend.gdebugRegionName; }
59 set { m_remoteBackend.gdebugRegionName = value; }
60 }
61
62 public override bool RegionLoginsEnabled
63 {
64 get { return m_remoteBackend.RegionLoginsEnabled; }
65 set { m_remoteBackend.RegionLoginsEnabled = value; }
66 }
67
68 public HGGridServicesGridMode(NetworkServersInfo servers_info,
69 SceneManager sman, UserProfileCacheService userv)
70 : base(servers_info, sman)
71 {
72 m_remoteBackend = new OGS1GridServices(servers_info);
73 m_userProfileCache = userv;
74 }
75
76 #region IGridServices interface
77
78 public override RegionCommsListener RegisterRegion(RegionInfo regionInfo)
79 {
80 if (!regionInfo.RegionID.Equals(UUID.Zero))
81 {
82 m_regionsOnInstance.Add(regionInfo);
83 return m_remoteBackend.RegisterRegion(regionInfo);
84 }
85 else
86 return base.RegisterRegion(regionInfo);
87 }
88
89 public override bool DeregisterRegion(RegionInfo regionInfo)
90 {
91 bool success = base.DeregisterRegion(regionInfo);
92 if (!success)
93 success = m_remoteBackend.DeregisterRegion(regionInfo);
94 return success;
95 }
96
97 public override List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
98 {
99 List<SimpleRegionInfo> neighbours = m_remoteBackend.RequestNeighbours(x, y);
100 //List<SimpleRegionInfo> remotes = base.RequestNeighbours(x, y);
101 //neighbours.AddRange(remotes);
102
103 return neighbours;
104 }
105
106 public override RegionInfo RequestNeighbourInfo(UUID Region_UUID)
107 {
108 RegionInfo info = m_remoteBackend.RequestNeighbourInfo(Region_UUID);
109 if (info == null)
110 info = base.RequestNeighbourInfo(Region_UUID);
111 return info;
112 }
113
114 public override RegionInfo RequestNeighbourInfo(ulong regionHandle)
115 {
116 RegionInfo info = base.RequestNeighbourInfo(regionHandle);
117 if (info == null)
118 info = m_remoteBackend.RequestNeighbourInfo(regionHandle);
119 return info;
120 }
121
122 public override RegionInfo RequestClosestRegion(string regionName)
123 {
124 RegionInfo info = m_remoteBackend.RequestClosestRegion(regionName);
125 if (info == null)
126 info = base.RequestClosestRegion(regionName);
127 return info;
128 }
129
130 public override List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
131 {
132 List<MapBlockData> neighbours = m_remoteBackend.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
133 List<MapBlockData> remotes = base.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
134 neighbours.AddRange(remotes);
135
136 return neighbours;
137 }
138
139 public override LandData RequestLandData(ulong regionHandle, uint x, uint y)
140 {
141 LandData land = m_remoteBackend.RequestLandData(regionHandle, x, y);
142 if (land == null)
143 land = base.RequestLandData(regionHandle, x, y);
144 return land;
145 }
146
147 public override List<RegionInfo> RequestNamedRegions(string name, int maxNumber)
148 {
149 List<RegionInfo> infos = m_remoteBackend.RequestNamedRegions(name, maxNumber);
150 List<RegionInfo> remotes = base.RequestNamedRegions(name, maxNumber);
151 infos.AddRange(remotes);
152 return infos;
153 }
154
155 #endregion
156
157
158 }
159}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServicesStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServicesStandalone.cs
deleted file mode 100644
index 94cfc49..0000000
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServicesStandalone.cs
+++ /dev/null
@@ -1,259 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Net;
32using System.Net.Sockets;
33using System.Reflection;
34using System.Runtime.Remoting;
35using System.Runtime.Remoting.Channels;
36using System.Runtime.Remoting.Channels.Tcp;
37using System.Security.Authentication;
38using log4net;
39using Nwc.XmlRpc;
40using OpenMetaverse;
41using OpenSim.Framework;
42using OpenSim.Framework.Servers;
43using OpenSim.Framework.Servers.HttpServer;
44using OpenSim.Region.Communications.Local;
45using OpenSim.Region.Communications.OGS1;
46using OpenSim.Region.Framework.Scenes;
47
48namespace OpenSim.Region.Communications.Hypergrid
49{
50 public class HGGridServicesStandalone : HGGridServices
51 {
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53
54 /// <summary>
55 /// Encapsulate local backend services for manipulation of local regions
56 /// </summary>
57 protected LocalBackEndServices m_localBackend = new LocalBackEndServices();
58
59 //private Dictionary<ulong, int> m_deadRegionCache = new Dictionary<ulong, int>();
60
61 public LocalBackEndServices LocalBackend
62 {
63 get { return m_localBackend; }
64 }
65
66 public override string gdebugRegionName
67 {
68 get { return m_localBackend.gdebugRegionName; }
69 set { m_localBackend.gdebugRegionName = value; }
70 }
71
72 public override bool RegionLoginsEnabled
73 {
74 get { return m_localBackend.RegionLoginsEnabled; }
75 set { m_localBackend.RegionLoginsEnabled = value; }
76 }
77
78
79 public HGGridServicesStandalone(NetworkServersInfo servers_info, BaseHttpServer httpServe, SceneManager sman)
80 : base(servers_info, sman)
81 {
82 //Respond to Grid Services requests
83 MainServer.Instance.AddXmlRPCHandler("logoff_user", LogOffUser);
84 MainServer.Instance.AddXmlRPCHandler("check", PingCheckReply);
85 MainServer.Instance.AddXmlRPCHandler("land_data", LandData);
86
87 }
88
89 #region IGridServices interface
90
91 public override RegionCommsListener RegisterRegion(RegionInfo regionInfo)
92 {
93 if (!regionInfo.RegionID.Equals(UUID.Zero))
94 {
95 m_regionsOnInstance.Add(regionInfo);
96 return m_localBackend.RegisterRegion(regionInfo);
97 }
98 else
99 return base.RegisterRegion(regionInfo);
100
101 }
102
103 public override bool DeregisterRegion(RegionInfo regionInfo)
104 {
105 bool success = m_localBackend.DeregisterRegion(regionInfo);
106 if (!success)
107 success = base.DeregisterRegion(regionInfo);
108 return success;
109 }
110
111 public override List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
112 {
113 List<SimpleRegionInfo> neighbours = m_localBackend.RequestNeighbours(x, y);
114 //List<SimpleRegionInfo> remotes = base.RequestNeighbours(x, y);
115 //neighbours.AddRange(remotes);
116
117 return neighbours;
118 }
119
120 public override RegionInfo RequestNeighbourInfo(UUID Region_UUID)
121 {
122 RegionInfo info = m_localBackend.RequestNeighbourInfo(Region_UUID);
123 if (info == null)
124 info = base.RequestNeighbourInfo(Region_UUID);
125 return info;
126 }
127
128 public override RegionInfo RequestNeighbourInfo(ulong regionHandle)
129 {
130 RegionInfo info = m_localBackend.RequestNeighbourInfo(regionHandle);
131 //m_log.Info("[HGrid] Request neighbor info, local backend returned " + info);
132 if (info == null)
133 info = base.RequestNeighbourInfo(regionHandle);
134 return info;
135 }
136
137 public override RegionInfo RequestClosestRegion(string regionName)
138 {
139 RegionInfo info = m_localBackend.RequestClosestRegion(regionName);
140 if (info == null)
141 info = base.RequestClosestRegion(regionName);
142 return info;
143 }
144
145 public override List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
146 {
147 //m_log.Info("[HGrid] Request map blocks " + minX + "-" + minY + "-" + maxX + "-" + maxY);
148 List<MapBlockData> neighbours = m_localBackend.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
149 List<MapBlockData> remotes = base.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
150 neighbours.AddRange(remotes);
151
152 return neighbours;
153 }
154
155 public override LandData RequestLandData(ulong regionHandle, uint x, uint y)
156 {
157 LandData land = m_localBackend.RequestLandData(regionHandle, x, y);
158 if (land == null)
159 land = base.RequestLandData(regionHandle, x, y);
160 return land;
161 }
162
163 public override List<RegionInfo> RequestNamedRegions(string name, int maxNumber)
164 {
165 List<RegionInfo> infos = m_localBackend.RequestNamedRegions(name, maxNumber);
166 List<RegionInfo> remotes = base.RequestNamedRegions(name, maxNumber);
167 infos.AddRange(remotes);
168 return infos;
169 }
170
171 #endregion
172
173 #region XML Request Handlers
174
175 /// <summary>
176 /// A ping / version check
177 /// </summary>
178 /// <param name="request"></param>
179 /// <returns></returns>
180 public virtual XmlRpcResponse PingCheckReply(XmlRpcRequest request, IPEndPoint remoteClient)
181 {
182 XmlRpcResponse response = new XmlRpcResponse();
183
184 Hashtable respData = new Hashtable();
185 respData["online"] = "true";
186
187 m_localBackend.PingCheckReply(respData);
188
189 response.Value = respData;
190
191 return response;
192 }
193
194
195 // Grid Request Processing
196 /// <summary>
197 /// Ooops, our Agent must be dead if we're getting this request!
198 /// </summary>
199 /// <param name="request"></param>
200 /// <returns></returns>
201 public XmlRpcResponse LogOffUser(XmlRpcRequest request, IPEndPoint remoteClient)
202 {
203 m_log.Debug("[HGrid]: LogOff User Called");
204
205 Hashtable requestData = (Hashtable)request.Params[0];
206 string message = (string)requestData["message"];
207 UUID agentID = UUID.Zero;
208 UUID RegionSecret = UUID.Zero;
209 UUID.TryParse((string)requestData["agent_id"], out agentID);
210 UUID.TryParse((string)requestData["region_secret"], out RegionSecret);
211
212 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
213
214 m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret, message);
215
216 return new XmlRpcResponse();
217 }
218
219 /// <summary>
220 /// Someone asked us about parcel-information
221 /// </summary>
222 /// <param name="request"></param>
223 /// <returns></returns>
224 public XmlRpcResponse LandData(XmlRpcRequest request, IPEndPoint remoteClient)
225 {
226 Hashtable requestData = (Hashtable)request.Params[0];
227 ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]);
228 uint x = Convert.ToUInt32(requestData["x"]);
229 uint y = Convert.ToUInt32(requestData["y"]);
230 m_log.DebugFormat("[HGrid]: Got XML reqeuest for land data at {0}, {1} in region {2}", x, y, regionHandle);
231
232 LandData landData = m_localBackend.RequestLandData(regionHandle, x, y);
233 Hashtable hash = new Hashtable();
234 if (landData != null)
235 {
236 // for now, only push out the data we need for answering a ParcelInfoReqeust
237 hash["AABBMax"] = landData.AABBMax.ToString();
238 hash["AABBMin"] = landData.AABBMin.ToString();
239 hash["Area"] = landData.Area.ToString();
240 hash["AuctionID"] = landData.AuctionID.ToString();
241 hash["Description"] = landData.Description;
242 hash["Flags"] = landData.Flags.ToString();
243 hash["GlobalID"] = landData.GlobalID.ToString();
244 hash["Name"] = landData.Name;
245 hash["OwnerID"] = landData.OwnerID.ToString();
246 hash["SalePrice"] = landData.SalePrice.ToString();
247 hash["SnapshotID"] = landData.SnapshotID.ToString();
248 hash["UserLocation"] = landData.UserLocation.ToString();
249 }
250
251 XmlRpcResponse response = new XmlRpcResponse();
252 response.Value = hash;
253 return response;
254 }
255
256 #endregion
257
258 }
259}
diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
index f1a56ef..49a2261 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Communications.Hypergrid
87 return m_localUserServices.AddUserAgent(agentdata); 87 return m_localUserServices.AddUserAgent(agentdata);
88 88
89 return base.AddUserAgent(agentdata); 89 return base.AddUserAgent(agentdata);
90 } 90 }
91 91
92 public override UserAgentData GetAgentByUUID(UUID userId) 92 public override UserAgentData GetAgentByUUID(UUID userId)
93 { 93 {
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index a658416..eaf996d 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Communications.Local
37 public class CommunicationsLocal : CommunicationsManager 37 public class CommunicationsLocal : CommunicationsManager
38 { 38 {
39 public CommunicationsLocal( 39 public CommunicationsLocal(
40 ConfigSettings configSettings, 40 ConfigSettings configSettings,
41 NetworkServersInfo serversInfo, 41 NetworkServersInfo serversInfo,
42 LibraryRootFolder libraryRootFolder) 42 LibraryRootFolder libraryRootFolder)
43 : base(serversInfo, libraryRootFolder) 43 : base(serversInfo, libraryRootFolder)
@@ -47,15 +47,13 @@ namespace OpenSim.Region.Communications.Local
47 = new LocalUserServices( 47 = new LocalUserServices(
48 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); 48 serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
49 lus.AddPlugin(new TemporaryUserProfilePlugin()); 49 lus.AddPlugin(new TemporaryUserProfilePlugin());
50 lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); 50 lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
51 m_userService = lus; 51 m_userService = lus;
52 m_userAdminService = lus; 52 m_userAdminService = lus;
53 m_avatarService = lus; 53 m_avatarService = lus;
54 m_messageService = lus; 54 m_messageService = lus;
55 55
56 m_gridService = new LocalBackEndServices(); 56 //LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService);
57
58 //LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService);
59 } 57 }
60 } 58 }
61} 59}
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
deleted file mode 100644
index 0ab9374..0000000
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ /dev/null
@@ -1,410 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Reflection;
32using log4net;
33using OpenMetaverse;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36
37namespace OpenSim.Region.Communications.Local
38{
39 public class LocalBackEndServices : IGridServices
40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42
43 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>();
44
45 protected Dictionary<ulong, RegionCommsListener> m_regionListeners =
46 new Dictionary<ulong, RegionCommsListener>();
47
48 // private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
49
50 private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>();
51
52 public string _gdebugRegionName = String.Empty;
53
54 public bool RegionLoginsEnabled
55 {
56 get { return m_regionLoginsEnabled; }
57 set { m_regionLoginsEnabled = value; }
58 }
59 private bool m_regionLoginsEnabled;
60
61 public bool CheckRegion(string address, uint port)
62 {
63 return true;
64 }
65
66 public string gdebugRegionName
67 {
68 get { return _gdebugRegionName; }
69 set { _gdebugRegionName = value; }
70 }
71
72 public string _rdebugRegionName = String.Empty;
73
74 public string rdebugRegionName
75 {
76 get { return _rdebugRegionName; }
77 set { _rdebugRegionName = value; }
78 }
79
80 /// <summary>
81 /// Register a region method with the BackEnd Services.
82 /// </summary>
83 /// <param name="regionInfo"></param>
84 /// <returns></returns>
85 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
86 {
87 //m_log.Debug("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
88 if (!m_regions.ContainsKey(regionInfo.RegionHandle))
89 {
90 //m_log.Debug("CommsManager - Adding Region " + regionInfo.RegionHandle);
91 m_regions.Add(regionInfo.RegionHandle, regionInfo);
92
93 RegionCommsListener regionHost = new RegionCommsListener();
94 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
95 {
96 m_log.Error("[INTERREGION STANDALONE]: " +
97 "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. " +
98 "In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
99 m_regionListeners.Remove(regionInfo.RegionHandle);
100 }
101 m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
102
103 return regionHost;
104 }
105 else
106 {
107 // Already in our list, so the region went dead and restarted.
108 // don't replace the old regioninfo.. this might be a locking issue.. however we need to
109 // remove it and let it add normally below or we get extremely strange and intermittant
110 // connectivity errors.
111 // Don't change this line below to 'm_regions[regionInfo.RegionHandle] = regionInfo' unless you
112 // *REALLY* know what you are doing here.
113 m_regions[regionInfo.RegionHandle] = regionInfo;
114
115 m_log.Warn("[INTERREGION STANDALONE]: Region registered twice. Region went down and came back up.");
116
117 RegionCommsListener regionHost = new RegionCommsListener();
118 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
119 {
120 m_regionListeners.Remove(regionInfo.RegionHandle);
121 }
122 m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
123
124 return regionHost;
125 }
126 }
127
128 public bool DeregisterRegion(RegionInfo regionInfo)
129 {
130 if (m_regions.ContainsKey(regionInfo.RegionHandle))
131 {
132 m_regions.Remove(regionInfo.RegionHandle);
133 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
134 {
135 m_regionListeners.Remove(regionInfo.RegionHandle);
136 }
137 return true;
138 }
139 return false;
140 }
141
142 /// <summary>
143 /// </summary>
144 /// <param name="regionInfo"></param>
145 /// <returns></returns>
146 public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
147 {
148 // m_log.Debug("Finding Neighbours to " + regionInfo.RegionHandle);
149 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
150
151 foreach (RegionInfo reg in m_regions.Values)
152 {
153 // m_log.Debug("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
154 if (reg.RegionLocX != x || reg.RegionLocY != y)
155 {
156 //m_log.Debug("CommsManager- RequestNeighbours() - found a different region in list, checking location");
157 if ((reg.RegionLocX > (x - 2)) && (reg.RegionLocX < (x + 2)))
158 {
159 if ((reg.RegionLocY > (y - 2)) && (reg.RegionLocY < (y + 2)))
160 {
161 neighbours.Add(reg);
162 }
163 }
164 }
165 }
166 return neighbours;
167 }
168
169 /// <summary>
170 /// Get information about a neighbouring region
171 /// </summary>
172 /// <param name="regionHandle"></param>
173 /// <returns></returns>
174 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
175 {
176 if (m_regions.ContainsKey(regionHandle))
177 {
178 return m_regions[regionHandle];
179 }
180
181 return null;
182 }
183
184 /// <summary>
185 /// Get information about a neighbouring region
186 /// </summary>
187 /// <param name="regionHandle"></param>
188 /// <returns></returns>
189 public RegionInfo RequestNeighbourInfo(UUID regionID)
190 {
191 // TODO add a dictionary for faster lookup
192 foreach (RegionInfo info in m_regions.Values)
193 {
194 if (info.RegionID == regionID)
195 return info;
196 }
197
198 return null;
199 }
200
201 /// <summary>
202 /// Get information about a neighbouring region
203 /// </summary>
204 /// <param name="regionHandle"></param>
205 /// <returns></returns>
206 public RegionInfo RequestNeighbourInfo(string name)
207 {
208 foreach (RegionInfo info in m_regions.Values)
209 {
210 if (info.RegionName == name)
211 return info;
212 }
213
214 return null;
215 }
216
217 /// <summary>
218 /// Get information about a neighbouring region
219 /// </summary>
220 /// <param name="regionHandle"></param>
221 /// <returns></returns>
222 public RegionInfo RequestNeighbourInfo(string host, uint port)
223 {
224 foreach (RegionInfo info in m_regions.Values)
225 {
226 if ((info.ExternalHostName == host) && (info.HttpPort == port))
227 return info;
228 }
229
230 return null;
231 }
232
233 /// <summary>
234 /// Get information about the closet region given a region name.
235 /// </summary>
236 /// <param name="regionName"></param>
237 /// <returns></returns>
238 public RegionInfo RequestClosestRegion(string regionName)
239 {
240 foreach (RegionInfo regInfo in m_regions.Values)
241 {
242 if (regInfo.RegionName == regionName)
243 return regInfo;
244 }
245 return null;
246 }
247
248 /// <summary>
249 ///
250 /// </summary>
251 /// <param name="minX"></param>
252 /// <param name="minY"></param>
253 /// <param name="maxX"></param>
254 /// <param name="maxY"></param>
255 /// <returns></returns>
256 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
257 {
258 List<MapBlockData> mapBlocks = new List<MapBlockData>();
259 foreach (RegionInfo regInfo in m_regions.Values)
260 {
261 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) &&
262 ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
263 {
264 MapBlockData map = new MapBlockData();
265 map.Name = regInfo.RegionName;
266 map.X = (ushort) regInfo.RegionLocX;
267 map.Y = (ushort) regInfo.RegionLocY;
268 map.WaterHeight = (byte) regInfo.RegionSettings.WaterHeight;
269 map.MapImageId = regInfo.RegionSettings.TerrainImageID;
270 map.Agents = 1;
271 map.RegionFlags = 72458694;
272 map.Access = regInfo.AccessLevel;
273 mapBlocks.Add(map);
274 }
275 }
276 return mapBlocks;
277 }
278
279 // This function is only here to keep this class in line with the Grid Interface.
280 // It never gets called.
281 public virtual Dictionary<string, string> GetGridSettings()
282 {
283 Dictionary<string, string> returnGridSettings = new Dictionary<string, string>();
284 lock (m_queuedGridSettings)
285 {
286 returnGridSettings = m_queuedGridSettings;
287 m_queuedGridSettings.Clear();
288 }
289
290 return returnGridSettings;
291 }
292
293 public virtual void SetForcefulBanlistsDisallowed()
294 {
295 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE");
296 }
297
298
299 /// <summary>
300 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
301 /// </summary>
302 /// <param name="regionHandle"></param>
303 /// <param name="loginData"></param>
304 /// <returns></returns>
305 public void AddNewSession(ulong regionHandle, Login loginData)
306 {
307 AgentCircuitData agent = new AgentCircuitData();
308 agent.AgentID = loginData.Agent;
309 agent.firstname = loginData.First;
310 agent.lastname = loginData.Last;
311 agent.SessionID = loginData.Session;
312 agent.SecureSessionID = loginData.SecureSession;
313 agent.circuitcode = loginData.CircuitCode;
314 agent.BaseFolder = loginData.BaseFolder;
315 agent.InventoryFolder = loginData.InventoryFolder;
316 agent.startpos = loginData.StartPos;
317 agent.CapsPath = loginData.CapsPath;
318 if (loginData.Appearance != null)
319 agent.Appearance = loginData.Appearance;
320 else
321 {
322 m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
323 agent.Appearance = new AvatarAppearance(agent.AgentID);
324 }
325
326 TriggerExpectUser(regionHandle, agent);
327 }
328
329 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
330 {
331 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
332
333 if (m_regionListeners.ContainsKey(regionHandle))
334 {
335 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
336
337 m_regionListeners[regionHandle].TriggerExpectUser(agent);
338 }
339 }
340
341 public void TriggerLogOffUser(ulong regionHandle, UUID agentID, UUID RegionSecret, string message)
342 {
343 if (m_regionListeners.ContainsKey(regionHandle))
344 {
345 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
346
347 m_regionListeners[regionHandle].TriggerLogOffUser(agentID, RegionSecret, message);
348 }
349 }
350
351 public void PingCheckReply(Hashtable respData)
352 {
353 foreach (ulong region in m_regions.Keys)
354 {
355 Hashtable regData = new Hashtable();
356 RegionInfo reg = m_regions[region];
357 regData["status"] = "active";
358 regData["handle"] = region.ToString();
359
360 respData[reg.RegionID.ToString()] = regData;
361 }
362 }
363
364
365 public LandData RequestLandData (ulong regionHandle, uint x, uint y)
366 {
367 m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}",
368 regionHandle, x, y);
369
370 if (m_regionListeners.ContainsKey(regionHandle))
371 {
372 LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y);
373 return land;
374 }
375
376 m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally.");
377 return null;
378 }
379
380 public List<RegionInfo> RequestNamedRegions (string name, int maxNumber)
381 {
382 List<RegionInfo> lowercase_regions = new List<RegionInfo>();
383 List<RegionInfo> regions = new List<RegionInfo>();
384 foreach (RegionInfo info in m_regions.Values)
385 {
386 // Prioritizes exact match
387 if (info.RegionName.StartsWith(name))
388 {
389 regions.Add(info);
390 if (regions.Count >= maxNumber) break;
391 }
392 // But still saves lower case matches
393 else if (info.RegionName.ToLower().StartsWith(name))
394 {
395 if (lowercase_regions.Count < maxNumber)
396 {
397 lowercase_regions.Add(info);
398 }
399 }
400 }
401
402 // If no exact matches found, return lowercase matches (libOMV compatiblity)
403 if (regions.Count == 0 && lowercase_regions.Count != 0)
404 {
405 return lowercase_regions;
406 }
407 return regions;
408 }
409 }
410}
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index af4fb37..89b55c4 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -80,6 +80,21 @@ namespace OpenSim.Region.Communications.Local
80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running."); 80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running.");
81 } 81 }
82 return data; 82 return data;
83 } 83 }
84
85 public override bool AuthenticateUserByPassword(UUID userID, string password)
86 {
87 UserProfileData userProfile = GetUserProfile(userID);
88
89 if (null == userProfile)
90 return false;
91
92 string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt);
93
94 if (md5PasswordHash == userProfile.PasswordHash)
95 return true;
96 else
97 return false;
98 }
84 } 99 }
85} 100} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index 8b5779f..94e4ed2 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -39,10 +39,8 @@ namespace OpenSim.Region.Communications.OGS1
39 LibraryRootFolder libraryRootFolder) 39 LibraryRootFolder libraryRootFolder)
40 : base(serversInfo, libraryRootFolder) 40 : base(serversInfo, libraryRootFolder)
41 { 41 {
42 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo);
43 m_gridService = gridInterComms;
44 42
45 // This plugin arrangement could eventually be configurable rather than hardcoded here. 43 // This plugin arrangement could eventually be configurable rather than hardcoded here.
46 OGS1UserServices userServices = new OGS1UserServices(this); 44 OGS1UserServices userServices = new OGS1UserServices(this);
47 userServices.AddPlugin(new TemporaryUserProfilePlugin()); 45 userServices.AddPlugin(new TemporaryUserProfilePlugin());
48 userServices.AddPlugin(new OGS1UserDataPlugin(this)); 46 userServices.AddPlugin(new OGS1UserDataPlugin(this));
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
deleted file mode 100644
index 47c7fe4..0000000
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ /dev/null
@@ -1,937 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Net;
32using System.Net.Sockets;
33using System.Reflection;
34using log4net;
35using Nwc.XmlRpc;
36using OpenMetaverse;
37using OpenSim.Framework;
38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Servers.HttpServer;
40using OpenSim.Region.Communications.Local;
41
42namespace OpenSim.Region.Communications.OGS1
43{
44 public class OGS1GridServices : IGridServices
45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 private bool m_useRemoteRegionCache = true;
49 /// <summary>
50 /// Encapsulate local backend services for manipulation of local regions
51 /// </summary>
52 private LocalBackEndServices m_localBackend = new LocalBackEndServices();
53
54 private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
55 // private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>();
56 private Dictionary<ulong, int> m_deadRegionCache = new Dictionary<ulong, int>();
57 private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>();
58 private List<RegionInfo> m_regionsOnInstance = new List<RegionInfo>();
59
60 public BaseHttpServer httpListener;
61 public NetworkServersInfo serversInfo;
62
63 public string gdebugRegionName
64 {
65 get { return m_localBackend.gdebugRegionName; }
66 set { m_localBackend.gdebugRegionName = value; }
67 }
68
69 public string rdebugRegionName
70 {
71 get { return _rdebugRegionName; }
72 set { _rdebugRegionName = value; }
73 }
74 private string _rdebugRegionName = String.Empty;
75
76 public bool RegionLoginsEnabled
77 {
78 get { return m_localBackend.RegionLoginsEnabled; }
79 set { m_localBackend.RegionLoginsEnabled = value; }
80 }
81
82 /// <summary>
83 /// Contructor. Adds "expect_user" and "check" xmlrpc method handlers
84 /// </summary>
85 /// <param name="servers_info"></param>
86 /// <param name="httpServe"></param>
87 public OGS1GridServices(NetworkServersInfo servers_info)
88 {
89 serversInfo = servers_info;
90
91 //Respond to Grid Services requests
92 MainServer.Instance.AddXmlRPCHandler("check", PingCheckReply);
93 }
94
95 // see IGridServices
96 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
97 {
98 if (m_regionsOnInstance.Contains(regionInfo))
99 {
100 m_log.Error("[OGS1 GRID SERVICES]: Foobar! Caller is confused, region already registered " + regionInfo.RegionName);
101 Exception e = new Exception(String.Format("Unable to register region"));
102
103 throw e;
104 }
105
106 m_log.InfoFormat(
107 "[OGS1 GRID SERVICES]: Registering region {0} with grid at {1}",
108 regionInfo.RegionName, serversInfo.GridURL);
109
110 m_regionsOnInstance.Add(regionInfo);
111
112 Hashtable GridParams = new Hashtable();
113 // Login / Authentication
114
115 GridParams["authkey"] = serversInfo.GridSendKey;
116 GridParams["recvkey"] = serversInfo.GridRecvKey;
117 GridParams["UUID"] = regionInfo.RegionID.ToString();
118 GridParams["sim_ip"] = regionInfo.ExternalHostName;
119 GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString();
120 GridParams["region_locx"] = regionInfo.RegionLocX.ToString();
121 GridParams["region_locy"] = regionInfo.RegionLocY.ToString();
122 GridParams["sim_name"] = regionInfo.RegionName;
123 GridParams["http_port"] = serversInfo.HttpListenerPort.ToString();
124 GridParams["remoting_port"] = ConfigSettings.DefaultRegionRemotingPort.ToString();
125 GridParams["map-image-id"] = regionInfo.RegionSettings.TerrainImageID.ToString();
126 GridParams["originUUID"] = regionInfo.originRegionID.ToString();
127 GridParams["server_uri"] = regionInfo.ServerURI;
128 GridParams["region_secret"] = regionInfo.regionSecret;
129 GridParams["major_interface_version"] = VersionInfo.MajorInterfaceVersion.ToString();
130
131 if (regionInfo.MasterAvatarAssignedUUID != UUID.Zero)
132 GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();
133 else
134 GridParams["master_avatar_uuid"] = regionInfo.EstateSettings.EstateOwner.ToString();
135
136 GridParams["maturity"] = regionInfo.RegionSettings.Maturity.ToString();
137
138 // Package into an XMLRPC Request
139 ArrayList SendParams = new ArrayList();
140 SendParams.Add(GridParams);
141
142 // Send Request
143 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
144 XmlRpcResponse GridResp;
145
146 try
147 {
148 // The timeout should always be significantly larger than the timeout for the grid server to request
149 // the initial status of the region before confirming registration.
150 GridResp = GridReq.Send(serversInfo.GridURL, 9999999);
151 }
152 catch (Exception e)
153 {
154 Exception e2
155 = new Exception(
156 String.Format(
157 "Unable to register region with grid at {0}. Grid service not running?",
158 serversInfo.GridURL),
159 e);
160
161 throw e2;
162 }
163
164 Hashtable GridRespData = (Hashtable)GridResp.Value;
165 // Hashtable griddatahash = GridRespData;
166
167 // Process Response
168 if (GridRespData.ContainsKey("error"))
169 {
170 string errorstring = (string) GridRespData["error"];
171
172 Exception e = new Exception(
173 String.Format("Unable to connect to grid at {0}: {1}", serversInfo.GridURL, errorstring));
174
175 throw e;
176 }
177 else
178 {
179 // m_knownRegions = RequestNeighbours(regionInfo.RegionLocX, regionInfo.RegionLocY);
180 if (GridRespData.ContainsKey("allow_forceful_banlines"))
181 {
182 if ((string) GridRespData["allow_forceful_banlines"] != "TRUE")
183 {
184 //m_localBackend.SetForcefulBanlistsDisallowed(regionInfo.RegionHandle);
185 if (!m_queuedGridSettings.ContainsKey("allow_forceful_banlines"))
186 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE");
187 }
188 }
189
190 m_log.InfoFormat(
191 "[OGS1 GRID SERVICES]: Region {0} successfully registered with grid at {1}",
192 regionInfo.RegionName, serversInfo.GridURL);
193 }
194
195 return m_localBackend.RegisterRegion(regionInfo);
196 }
197
198 // see IGridServices
199 public bool DeregisterRegion(RegionInfo regionInfo)
200 {
201 Hashtable GridParams = new Hashtable();
202
203 GridParams["UUID"] = regionInfo.RegionID.ToString();
204
205 // Package into an XMLRPC Request
206 ArrayList SendParams = new ArrayList();
207 SendParams.Add(GridParams);
208
209 // Send Request
210 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_after_region_moved", SendParams);
211 XmlRpcResponse GridResp = null;
212
213 try
214 {
215 GridResp = GridReq.Send(serversInfo.GridURL, 10000);
216 }
217 catch (Exception e)
218 {
219 Exception e2
220 = new Exception(
221 String.Format(
222 "Unable to deregister region with grid at {0}. Grid service not running?",
223 serversInfo.GridURL),
224 e);
225
226 throw e2;
227 }
228
229 Hashtable GridRespData = (Hashtable) GridResp.Value;
230
231 // Hashtable griddatahash = GridRespData;
232
233 // Process Response
234 if (GridRespData != null && GridRespData.ContainsKey("error"))
235 {
236 string errorstring = (string)GridRespData["error"];
237 m_log.Error("Unable to connect to grid: " + errorstring);
238 return false;
239 }
240
241 return m_localBackend.DeregisterRegion(regionInfo);
242 }
243
244 public virtual Dictionary<string, string> GetGridSettings()
245 {
246 Dictionary<string, string> returnGridSettings = new Dictionary<string, string>();
247 lock (m_queuedGridSettings)
248 {
249 foreach (string Dictkey in m_queuedGridSettings.Keys)
250 {
251 returnGridSettings.Add(Dictkey, m_queuedGridSettings[Dictkey]);
252 }
253
254 m_queuedGridSettings.Clear();
255 }
256
257 return returnGridSettings;
258 }
259
260 // see IGridServices
261 public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
262 {
263 Hashtable respData = MapBlockQuery((int) x - 1, (int) y - 1, (int) x + 1, (int) y + 1);
264
265 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
266
267 foreach (ArrayList neighboursList in respData.Values)
268 {
269 foreach (Hashtable neighbourData in neighboursList)
270 {
271 uint regX = Convert.ToUInt32(neighbourData["x"]);
272 uint regY = Convert.ToUInt32(neighbourData["y"]);
273 if ((x != regX) || (y != regY))
274 {
275 string simIp = (string) neighbourData["sim_ip"];
276
277 uint port = Convert.ToUInt32(neighbourData["sim_port"]);
278 // string externalUri = (string) neighbourData["sim_uri"];
279
280 // string externalIpStr = String.Empty;
281 try
282 {
283 // externalIpStr = Util.GetHostFromDNS(simIp).ToString();
284 Util.GetHostFromDNS(simIp).ToString();
285 }
286 catch (SocketException e)
287 {
288 m_log.WarnFormat(
289 "[OGS1 GRID SERVICES]: RequestNeighbours(): Lookup of neighbour {0} failed! Not including in neighbours list. {1}",
290 simIp, e);
291
292 continue;
293 }
294
295 SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port);
296
297 sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]);
298
299 if (neighbourData.ContainsKey("http_port"))
300 {
301 sri.HttpPort = Convert.ToUInt32(neighbourData["http_port"]);
302 }
303 else
304 {
305 m_log.Error("[OGS1 GRID SERVICES]: Couldn't find httpPort, using default 9000; please upgrade your grid-server to r7621 or later");
306 sri.HttpPort = 9000; // that's the default and will probably be wrong
307 }
308
309 sri.RegionID = new UUID((string) neighbourData["uuid"]);
310
311 neighbours.Add(sri);
312 }
313 }
314 }
315
316 return neighbours;
317 }
318
319 /// <summary>
320 /// Request information about a region.
321 /// </summary>
322 /// <param name="regionHandle"></param>
323 /// <returns>
324 /// null on a failure to contact or get a response from the grid server
325 /// FIXME: Might be nicer to return a proper exception here since we could inform the client more about the
326 /// nature of the faiulre.
327 /// </returns>
328 public RegionInfo RequestNeighbourInfo(UUID Region_UUID)
329 {
330 // don't ask the gridserver about regions on this instance...
331 foreach (RegionInfo info in m_regionsOnInstance)
332 {
333 if (info.RegionID == Region_UUID) return info;
334 }
335
336 // didn't find it so far, we have to go the long way
337 RegionInfo regionInfo;
338 Hashtable requestData = new Hashtable();
339 requestData["region_UUID"] = Region_UUID.ToString();
340 requestData["authkey"] = serversInfo.GridSendKey;
341 ArrayList SendParams = new ArrayList();
342 SendParams.Add(requestData);
343 XmlRpcRequest gridReq = new XmlRpcRequest("simulator_data_request", SendParams);
344 XmlRpcResponse gridResp = null;
345
346 try
347 {
348 gridResp = gridReq.Send(serversInfo.GridURL, 3000);
349 }
350 catch (Exception e)
351 {
352 m_log.ErrorFormat(
353 "[OGS1 GRID SERVICES]: Communication with the grid server at {0} failed, {1}",
354 serversInfo.GridURL, e);
355
356 return null;
357 }
358
359 Hashtable responseData = (Hashtable)gridResp.Value;
360
361 if (responseData.ContainsKey("error"))
362 {
363 m_log.WarnFormat("[OGS1 GRID SERVICES]: Error received from grid server: {0}", responseData["error"]);
364 return null;
365 }
366
367 regionInfo = buildRegionInfo(responseData, String.Empty);
368 if ((m_useRemoteRegionCache) && (requestData.ContainsKey("regionHandle")))
369 {
370 m_remoteRegionInfoCache.Add(Convert.ToUInt64((string) requestData["regionHandle"]), regionInfo);
371 }
372
373 return regionInfo;
374 }
375
376 /// <summary>
377 /// Request information about a region.
378 /// </summary>
379 /// <param name="regionHandle"></param>
380 /// <returns></returns>
381 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
382 {
383 RegionInfo regionInfo = m_localBackend.RequestNeighbourInfo(regionHandle);
384
385 if (regionInfo != null)
386 {
387 return regionInfo;
388 }
389
390 if ((!m_useRemoteRegionCache) || (!m_remoteRegionInfoCache.TryGetValue(regionHandle, out regionInfo)))
391 {
392 try
393 {
394 Hashtable requestData = new Hashtable();
395 requestData["region_handle"] = regionHandle.ToString();
396 requestData["authkey"] = serversInfo.GridSendKey;
397 ArrayList SendParams = new ArrayList();
398 SendParams.Add(requestData);
399 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
400 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
401
402 Hashtable responseData = (Hashtable) GridResp.Value;
403
404 if (responseData.ContainsKey("error"))
405 {
406 m_log.Error("[OGS1 GRID SERVICES]: Error received from grid server: " + responseData["error"]);
407 return null;
408 }
409
410 uint regX = Convert.ToUInt32((string) responseData["region_locx"]);
411 uint regY = Convert.ToUInt32((string) responseData["region_locy"]);
412 string externalHostName = (string) responseData["sim_ip"];
413 uint simPort = Convert.ToUInt32(responseData["sim_port"]);
414 string regionName = (string)responseData["region_name"];
415 UUID regionID = new UUID((string)responseData["region_UUID"]);
416 uint remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
417
418 uint httpPort = 9000;
419 if (responseData.ContainsKey("http_port"))
420 {
421 httpPort = Convert.ToUInt32((string)responseData["http_port"]);
422 }
423
424 // Ok, so this is definitively the wrong place to do this, way too hard coded, but it doesn't seem we GET this info?
425
426 string simURI = "http://" + externalHostName + ":" + simPort;
427
428 // string externalUri = (string) responseData["sim_uri"];
429
430 //IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port);
431 regionInfo = RegionInfo.Create(regionID, regionName, regX, regY, externalHostName, httpPort, simPort, remotingPort, simURI);
432
433 if (m_useRemoteRegionCache)
434 {
435 lock (m_remoteRegionInfoCache)
436 {
437 if (!m_remoteRegionInfoCache.ContainsKey(regionHandle))
438 {
439 m_remoteRegionInfoCache.Add(regionHandle, regionInfo);
440 }
441 }
442 }
443 }
444 catch (Exception e)
445 {
446 m_log.Error("[OGS1 GRID SERVICES]: " +
447 "Region lookup failed for: " + regionHandle.ToString() +
448 " - Is the GridServer down?" + e.ToString());
449 return null;
450 }
451 }
452
453 return regionInfo;
454 }
455
456 /// <summary>
457 /// Get information about a neighbouring region
458 /// </summary>
459 /// <param name="regionHandle"></param>
460 /// <returns></returns>
461 public RegionInfo RequestNeighbourInfo(string name)
462 {
463 // Not implemented yet
464 return null;
465 }
466
467 /// <summary>
468 /// Get information about a neighbouring region
469 /// </summary>
470 /// <param name="regionHandle"></param>
471 /// <returns></returns>
472 public RegionInfo RequestNeighbourInfo(string host, uint port)
473 {
474 // Not implemented yet
475 return null;
476 }
477
478 public RegionInfo RequestClosestRegion(string regionName)
479 {
480 if (m_useRemoteRegionCache)
481 {
482 foreach (RegionInfo ri in m_remoteRegionInfoCache.Values)
483 {
484 if (ri.RegionName == regionName)
485 return ri;
486 }
487 }
488
489 RegionInfo regionInfo = null;
490 try
491 {
492 Hashtable requestData = new Hashtable();
493 requestData["region_name_search"] = regionName;
494 requestData["authkey"] = serversInfo.GridSendKey;
495 ArrayList SendParams = new ArrayList();
496 SendParams.Add(requestData);
497 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
498 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
499
500 Hashtable responseData = (Hashtable) GridResp.Value;
501
502 if (responseData.ContainsKey("error"))
503 {
504 m_log.ErrorFormat("[OGS1 GRID SERVICES]: Error received from grid server: ", responseData["error"]);
505 return null;
506 }
507
508 regionInfo = buildRegionInfo(responseData, "");
509
510 if ((m_useRemoteRegionCache) && (!m_remoteRegionInfoCache.ContainsKey(regionInfo.RegionHandle)))
511 m_remoteRegionInfoCache.Add(regionInfo.RegionHandle, regionInfo);
512 }
513 catch
514 {
515 m_log.Error("[OGS1 GRID SERVICES]: " +
516 "Region lookup failed for: " + regionName +
517 " - Is the GridServer down?");
518 }
519
520 return regionInfo;
521 }
522
523 /// <summary>
524 ///
525 /// </summary>
526 /// <param name="minX"></param>
527 /// <param name="minY"></param>
528 /// <param name="maxX"></param>
529 /// <param name="maxY"></param>
530 /// <returns></returns>
531 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
532 {
533 int temp = 0;
534
535 if (minX > maxX)
536 {
537 temp = minX;
538 minX = maxX;
539 maxX = temp;
540 }
541 if (minY > maxY)
542 {
543 temp = minY;
544 minY = maxY;
545 maxY = temp;
546 }
547
548 Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY);
549
550 List<MapBlockData> neighbours = new List<MapBlockData>();
551
552 foreach (ArrayList a in respData.Values)
553 {
554 foreach (Hashtable n in a)
555 {
556 MapBlockData neighbour = new MapBlockData();
557
558 neighbour.X = Convert.ToUInt16(n["x"]);
559 neighbour.Y = Convert.ToUInt16(n["y"]);
560
561 neighbour.Name = (string) n["name"];
562 neighbour.Access = Convert.ToByte(n["access"]);
563 neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]);
564 neighbour.WaterHeight = Convert.ToByte(n["water-height"]);
565 neighbour.MapImageId = new UUID((string) n["map-image-id"]);
566
567 neighbours.Add(neighbour);
568 }
569 }
570
571 return neighbours;
572 }
573
574 /// <summary>
575 /// Performs a XML-RPC query against the grid server returning mapblock information in the specified coordinates
576 /// </summary>
577 /// <remarks>REDUNDANT - OGS1 is to be phased out in favour of OGS2</remarks>
578 /// <param name="minX">Minimum X value</param>
579 /// <param name="minY">Minimum Y value</param>
580 /// <param name="maxX">Maximum X value</param>
581 /// <param name="maxY">Maximum Y value</param>
582 /// <returns>Hashtable of hashtables containing map data elements</returns>
583 private Hashtable MapBlockQuery(int minX, int minY, int maxX, int maxY)
584 {
585 Hashtable param = new Hashtable();
586 param["xmin"] = minX;
587 param["ymin"] = minY;
588 param["xmax"] = maxX;
589 param["ymax"] = maxY;
590 IList parameters = new ArrayList();
591 parameters.Add(param);
592
593 try
594 {
595 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
596 XmlRpcResponse resp = req.Send(serversInfo.GridURL, 10000);
597 Hashtable respData = (Hashtable) resp.Value;
598 return respData;
599 }
600 catch (Exception e)
601 {
602 m_log.Error("MapBlockQuery XMLRPC failure: " + e);
603 return new Hashtable();
604 }
605 }
606
607 /// <summary>
608 /// A ping / version check
609 /// </summary>
610 /// <param name="request"></param>
611 /// <returns></returns>
612 public XmlRpcResponse PingCheckReply(XmlRpcRequest request, IPEndPoint remoteClient)
613 {
614 XmlRpcResponse response = new XmlRpcResponse();
615
616 Hashtable respData = new Hashtable();
617 respData["online"] = "true";
618
619 m_localBackend.PingCheckReply(respData);
620
621 response.Value = respData;
622
623 return response;
624 }
625
626 /// <summary>
627 /// Received from the user server when a user starts logging in. This call allows
628 /// the region to prepare for direct communication from the client. Sends back an empty
629 /// xmlrpc response on completion.
630 /// </summary>
631 /// <param name="request"></param>
632 /// <returns></returns>
633 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
634 {
635 Hashtable requestData = (Hashtable) request.Params[0];
636 AgentCircuitData agentData = new AgentCircuitData();
637 agentData.SessionID = new UUID((string) requestData["session_id"]);
638 agentData.SecureSessionID = new UUID((string) requestData["secure_session_id"]);
639 agentData.firstname = (string) requestData["firstname"];
640 agentData.lastname = (string) requestData["lastname"];
641 agentData.AgentID = new UUID((string) requestData["agent_id"]);
642 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
643 agentData.CapsPath = (string)requestData["caps_path"];
644 ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]);
645
646 // Appearance
647 if (requestData["appearance"] != null)
648 agentData.Appearance = new AvatarAppearance((Hashtable)requestData["appearance"]);
649
650 m_log.DebugFormat(
651 "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}",
652 agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode);
653
654 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
655 {
656 //m_log.Debug("[CLIENT]: Child agent detected");
657 agentData.child = true;
658 }
659 else
660 {
661 //m_log.Debug("[CLIENT]: Main agent detected");
662 agentData.startpos =
663 new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]),
664 (float)Convert.ToDecimal((string)requestData["startpos_y"]),
665 (float)Convert.ToDecimal((string)requestData["startpos_z"]));
666 agentData.child = false;
667 }
668
669 XmlRpcResponse resp = new XmlRpcResponse();
670
671 if (!RegionLoginsEnabled)
672 {
673 m_log.InfoFormat(
674 "[CLIENT]: Denying access for user {0} {1} because region login is currently disabled",
675 agentData.firstname, agentData.lastname);
676
677 Hashtable respdata = new Hashtable();
678 respdata["success"] = "FALSE";
679 respdata["reason"] = "region login currently disabled";
680 resp.Value = respdata;
681 }
682 else
683 {
684 RegionInfo[] regions = m_regionsOnInstance.ToArray();
685 bool banned = false;
686
687 for (int i = 0; i < regions.Length; i++)
688 {
689 if (regions[i] != null)
690 {
691 if (regions[i].RegionHandle == regionHandle)
692 {
693 if (regions[i].EstateSettings.IsBanned(agentData.AgentID))
694 {
695 banned = true;
696 break;
697 }
698 }
699 }
700 }
701
702 if (banned)
703 {
704 m_log.InfoFormat(
705 "[CLIENT]: Denying access for user {0} {1} because user is banned",
706 agentData.firstname, agentData.lastname);
707
708 Hashtable respdata = new Hashtable();
709 respdata["success"] = "FALSE";
710 respdata["reason"] = "banned";
711 resp.Value = respdata;
712 }
713 else
714 {
715 m_localBackend.TriggerExpectUser(regionHandle, agentData);
716 Hashtable respdata = new Hashtable();
717 respdata["success"] = "TRUE";
718 resp.Value = respdata;
719 }
720 }
721
722 return resp;
723 }
724
725 // Grid Request Processing
726 /// <summary>
727 /// Ooops, our Agent must be dead if we're getting this request!
728 /// </summary>
729 /// <param name="request"></param>
730 /// <returns></returns>
731 public XmlRpcResponse LogOffUser(XmlRpcRequest request)
732 {
733 m_log.Debug("[CONNECTION DEBUGGING]: LogOff User Called");
734
735 Hashtable requestData = (Hashtable)request.Params[0];
736 string message = (string)requestData["message"];
737 UUID agentID = UUID.Zero;
738 UUID RegionSecret = UUID.Zero;
739 UUID.TryParse((string)requestData["agent_id"], out agentID);
740 UUID.TryParse((string)requestData["region_secret"], out RegionSecret);
741
742 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
743
744 m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret,message);
745
746 return new XmlRpcResponse();
747 }
748
749 public void NoteDeadRegion(ulong regionhandle)
750 {
751 lock (m_deadRegionCache)
752 {
753 if (m_deadRegionCache.ContainsKey(regionhandle))
754 {
755 m_deadRegionCache[regionhandle] = m_deadRegionCache[regionhandle] + 1;
756 }
757 else
758 {
759 m_deadRegionCache.Add(regionhandle, 1);
760 }
761 }
762 }
763
764 public LandData RequestLandData (ulong regionHandle, uint x, uint y)
765 {
766 m_log.DebugFormat("[OGS1 GRID SERVICES] requests land data in {0}, at {1}, {2}",
767 regionHandle, x, y);
768 LandData landData = m_localBackend.RequestLandData(regionHandle, x, y);
769 if (landData == null)
770 {
771 Hashtable hash = new Hashtable();
772 hash["region_handle"] = regionHandle.ToString();
773 hash["x"] = x.ToString();
774 hash["y"] = y.ToString();
775
776 IList paramList = new ArrayList();
777 paramList.Add(hash);
778
779 try
780 {
781 // this might be cached, as we probably requested it just a moment ago...
782 RegionInfo info = RequestNeighbourInfo(regionHandle);
783 if (info != null) // just to be sure
784 {
785 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
786 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
787 XmlRpcResponse response = request.Send(uri, 10000);
788 if (response.IsFault)
789 {
790 m_log.ErrorFormat("[OGS1 GRID SERVICES] remote call returned an error: {0}", response.FaultString);
791 }
792 else
793 {
794 hash = (Hashtable)response.Value;
795 try
796 {
797 landData = new LandData();
798 landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
799 landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
800 landData.Area = Convert.ToInt32(hash["Area"]);
801 landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
802 landData.Description = (string)hash["Description"];
803 landData.Flags = Convert.ToUInt32(hash["Flags"]);
804 landData.GlobalID = new UUID((string)hash["GlobalID"]);
805 landData.Name = (string)hash["Name"];
806 landData.OwnerID = new UUID((string)hash["OwnerID"]);
807 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
808 landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
809 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
810 m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
811 }
812 catch (Exception e)
813 {
814 m_log.Error("[OGS1 GRID SERVICES] Got exception while parsing land-data:", e);
815 }
816 }
817 }
818 else m_log.WarnFormat("[OGS1 GRID SERVICES] Couldn't find region with handle {0}", regionHandle);
819 }
820 catch (Exception e)
821 {
822 m_log.ErrorFormat("[OGS1 GRID SERVICES] Couldn't contact region {0}: {1}", regionHandle, e);
823 }
824 }
825 return landData;
826 }
827
828 // Grid Request Processing
829 /// <summary>
830 /// Someone asked us about parcel-information
831 /// </summary>
832 /// <param name="request"></param>
833 /// <returns></returns>
834 public XmlRpcResponse LandData(XmlRpcRequest request, IPEndPoint remoteClient)
835 {
836 Hashtable requestData = (Hashtable)request.Params[0];
837 ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]);
838 uint x = Convert.ToUInt32(requestData["x"]);
839 uint y = Convert.ToUInt32(requestData["y"]);
840 m_log.DebugFormat("[OGS1 GRID SERVICES]: Got XML reqeuest for land data at {0}, {1} in region {2}", x, y, regionHandle);
841
842 LandData landData = m_localBackend.RequestLandData(regionHandle, x, y);
843 Hashtable hash = new Hashtable();
844 if (landData != null)
845 {
846 // for now, only push out the data we need for answering a ParcelInfoReqeust
847 hash["AABBMax"] = landData.AABBMax.ToString();
848 hash["AABBMin"] = landData.AABBMin.ToString();
849 hash["Area"] = landData.Area.ToString();
850 hash["AuctionID"] = landData.AuctionID.ToString();
851 hash["Description"] = landData.Description;
852 hash["Flags"] = landData.Flags.ToString();
853 hash["GlobalID"] = landData.GlobalID.ToString();
854 hash["Name"] = landData.Name;
855 hash["OwnerID"] = landData.OwnerID.ToString();
856 hash["SalePrice"] = landData.SalePrice.ToString();
857 hash["SnapshotID"] = landData.SnapshotID.ToString();
858 hash["UserLocation"] = landData.UserLocation.ToString();
859 }
860
861 XmlRpcResponse response = new XmlRpcResponse();
862 response.Value = hash;
863 return response;
864 }
865
866 public List<RegionInfo> RequestNamedRegions (string name, int maxNumber)
867 {
868 // no asking of the local backend first, here, as we have to ask the gridserver anyway.
869 Hashtable hash = new Hashtable();
870 hash["name"] = name;
871 hash["maxNumber"] = maxNumber.ToString();
872
873 IList paramList = new ArrayList();
874 paramList.Add(hash);
875
876 Hashtable result = XmlRpcSearchForRegionByName(paramList);
877 if (result == null) return null;
878
879 uint numberFound = Convert.ToUInt32(result["numFound"]);
880 List<RegionInfo> infos = new List<RegionInfo>();
881 for (int i = 0; i < numberFound; ++i)
882 {
883 string prefix = "region" + i + ".";
884 RegionInfo info = buildRegionInfo(result, prefix);
885 infos.Add(info);
886 }
887 return infos;
888 }
889
890 private RegionInfo buildRegionInfo(Hashtable responseData, string prefix)
891 {
892 uint regX = Convert.ToUInt32((string) responseData[prefix + "region_locx"]);
893 uint regY = Convert.ToUInt32((string) responseData[prefix + "region_locy"]);
894 string internalIpStr = (string) responseData[prefix + "sim_ip"];
895 uint port = Convert.ToUInt32(responseData[prefix + "sim_port"]);
896
897 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(internalIpStr), (int) port);
898
899 RegionInfo regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
900 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData[prefix + "remoting_port"]);
901 regionInfo.RemotingAddress = internalIpStr;
902
903 if (responseData.ContainsKey(prefix + "http_port"))
904 {
905 regionInfo.HttpPort = Convert.ToUInt32((string) responseData[prefix + "http_port"]);
906 }
907
908 regionInfo.RegionID = new UUID((string) responseData[prefix + "region_UUID"]);
909 regionInfo.RegionName = (string) responseData[prefix + "region_name"];
910
911 regionInfo.RegionSettings.TerrainImageID = new UUID((string) responseData[prefix + "map_UUID"]);
912 return regionInfo;
913 }
914
915 private Hashtable XmlRpcSearchForRegionByName(IList parameters)
916 {
917 try
918 {
919 XmlRpcRequest request = new XmlRpcRequest("search_for_region_by_name", parameters);
920 XmlRpcResponse resp = request.Send(serversInfo.GridURL, 10000);
921 Hashtable respData = (Hashtable) resp.Value;
922 if (respData != null && respData.Contains("faultCode"))
923 {
924 m_log.WarnFormat("[OGS1 GRID SERVICES]: Got an error while contacting GridServer: {0}", respData["faultString"]);
925 return null;
926 }
927
928 return respData;
929 }
930 catch (Exception e)
931 {
932 m_log.Error("[OGS1 GRID SERVICES]: MapBlockQuery XMLRPC failure: ", e);
933 return null;
934 }
935 }
936 }
937}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
index 01d6ec8..2f9a45f 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Communications.OGS1
81 public virtual void AddTemporaryUserProfile(UserProfileData userProfile) 81 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
82 { 82 {
83 // Not interested 83 // Not interested
84 } 84 }
85 85
86 public UserProfileData GetUserByUri(Uri uri) 86 public UserProfileData GetUserByUri(Uri uri)
87 { 87 {
@@ -695,7 +695,7 @@ namespace OpenSim.Region.Communications.OGS1
695 userData.Partner = UUID.Zero; 695 userData.Partner = UUID.Zero;
696 696
697 return userData; 697 return userData;
698 } 698 }
699 699
700 protected AvatarAppearance ConvertXMLRPCDataToAvatarAppearance(Hashtable data) 700 protected AvatarAppearance ConvertXMLRPCDataToAvatarAppearance(Hashtable data)
701 { 701 {
@@ -766,6 +766,6 @@ namespace OpenSim.Region.Communications.OGS1
766 } 766 }
767 767
768 return buddylist; 768 return buddylist;
769 } 769 }
770 } 770 }
771} 771}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index dff8305..ed3526d 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -41,7 +41,7 @@ using OpenSim.Framework.Communications;
41using OpenSim.Framework.Communications.Clients; 41using OpenSim.Framework.Communications.Clients;
42 42
43namespace OpenSim.Region.Communications.OGS1 43namespace OpenSim.Region.Communications.OGS1
44{ 44{
45 public class OGS1UserServices : UserManagerBase 45 public class OGS1UserServices : UserManagerBase
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Communications.OGS1
94 catch (WebException) 94 catch (WebException)
95 { 95 {
96 m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); 96 m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff");
97 } 97 }
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
@@ -140,6 +140,37 @@ namespace OpenSim.Region.Communications.OGS1
140 { 140 {
141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID); 141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID);
142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID); 142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID);
143 } 143 }
144
145 public override bool AuthenticateUserByPassword(UUID userID, string password)
146 {
147 Hashtable param = new Hashtable();
148 param["user_uuid"] = userID.ToString();
149 param["password"] = password;
150 IList parameters = new ArrayList();
151 parameters.Add(param);
152 XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
153 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
154
155 // Temporary measure to deal with older services
156 if (resp.IsFault && resp.FaultCode == XmlRpcErrorCodes.SERVER_ERROR_METHOD)
157 {
158 throw new Exception(
159 String.Format(
160 "XMLRPC method 'authenticate_user_by_password' not yet implemented by user service at {0}",
161 m_commsManager.NetworkServersInfo.UserURL));
162 }
163
164 Hashtable respData = (Hashtable)resp.Value;
165
166 if ((string)respData["auth_user"] == "TRUE")
167 {
168 return true;
169 }
170 else
171 {
172 return false;
173 }
174 }
144 } 175 }
145} \ No newline at end of file 176} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs
index addc36b..9c646b6 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
162 AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); 162 AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
163 163
164 transactions.RequestUpdateTaskInventoryItem(remoteClient, part, transactionID, item); 164 transactions.RequestUpdateTaskInventoryItem(remoteClient, part, transactionID, item);
165 } 165 }
166 166
167 /// <summary> 167 /// <summary>
168 /// Request that a client (agent) begin an asset transfer. 168 /// Request that a client (agent) begin an asset transfer.
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index 0c6900d..2a1355b 100644
--- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
49 /// </summary> 49 /// </summary>
50 protected Dictionary<UUID, Caps> m_capsHandlers = new Dictionary<UUID, Caps>(); 50 protected Dictionary<UUID, Caps> m_capsHandlers = new Dictionary<UUID, Caps>();
51 51
52 protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>(); 52 protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>();
53 protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds 53 protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds
54 = new Dictionary<UUID, Dictionary<ulong, string>>(); 54 = new Dictionary<UUID, Dictionary<ulong, string>>();
55 55
56 public void Initialise(IConfigSource source) 56 public void Initialise(IConfigSource source)
57 { 57 {
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
147 agentId, m_scene.RegionInfo.RegionName); 147 agentId, m_scene.RegionInfo.RegionName);
148 } 148 }
149 } 149 }
150 } 150 }
151 151
152 public Caps GetCapsHandlerForUser(UUID agentId) 152 public Caps GetCapsHandlerForUser(UUID agentId)
153 { 153 {
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
177 } 177 }
178 178
179 return null; 179 return null;
180 } 180 }
181 181
182 public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) 182 public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID)
183 { 183 {
@@ -225,6 +225,6 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
225 y = y / Constants.RegionSize; 225 y = y / Constants.RegionSize;
226 m_log.Info(" >> "+x+", "+y+": "+kvp.Value); 226 m_log.Info(" >> "+x+", "+y+": "+kvp.Value);
227 } 227 }
228 } 228 }
229 } 229 }
230} 230}
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs
index 394b1bb..8502006 100644
--- a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs
+++ b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
51 { 51 {
52 // Only need to run through all this if there are entries in the ban list 52 // Only need to run through all this if there are entries in the ban list
53 if (bans.Count > 0) 53 if (bans.Count > 0)
54 { 54 {
55 IClientIPEndpoint ipEndpoint; 55 IClientIPEndpoint ipEndpoint;
56 if (client.TryGet(out ipEndpoint)) 56 if (client.TryGet(out ipEndpoint))
57 { 57 {
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
index a1e27f1..5a5ad7e 100644
--- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Asset
42 /// <para> 42 /// <para>
43 /// Cache is enabled by setting "AssetCaching" configuration to value "CenomeMemoryAssetCache". 43 /// Cache is enabled by setting "AssetCaching" configuration to value "CenomeMemoryAssetCache".
44 /// When cache is successfully enable log should have message 44 /// When cache is successfully enable log should have message
45 /// "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = XXX bytes, MaxCount = XXX, ExpirationTime = XXX)". 45 /// "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = XXX bytes, MaxCount = XXX, ExpirationTime = XXX)".
46 /// </para> 46 /// </para>
47 /// <para> 47 /// <para>
48 /// Cache's size is limited by two parameters: 48 /// Cache's size is limited by two parameters:
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Asset
113 113
114 /// <summary> 114 /// <summary>
115 /// Asset's default expiration time in the cache. 115 /// Asset's default expiration time in the cache.
116 /// </summary> 116 /// </summary>
117 public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0); 117 public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0);
118 118
119 /// <summary> 119 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index d85d3df..817e0d4 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -142,7 +142,7 @@ namespace Flotsam.RegionModules.AssetCache
142 m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory); 142 m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory);
143 m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory); 143 m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory);
144 144
145 m_MemoryCacheEnabled = assetConfig.GetBoolean("MemoryCacheEnabled", true); 145 m_MemoryCacheEnabled = assetConfig.GetBoolean("MemoryCacheEnabled", false);
146 m_MemoryExpiration = TimeSpan.FromHours(assetConfig.GetDouble("MemoryCacheTimeout", m_DefaultMemoryExpiration)); 146 m_MemoryExpiration = TimeSpan.FromHours(assetConfig.GetDouble("MemoryCacheTimeout", m_DefaultMemoryExpiration));
147 147
148#if WAIT_ON_INPROGRESS_REQUESTS 148#if WAIT_ON_INPROGRESS_REQUESTS
@@ -150,7 +150,7 @@ namespace Flotsam.RegionModules.AssetCache
150#endif 150#endif
151 151
152 m_LogLevel = assetConfig.GetInt("LogLevel", 1); 152 m_LogLevel = assetConfig.GetInt("LogLevel", 1);
153 m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1); 153 m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1000);
154 154
155 m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); 155 m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration));
156 m_FileExpirationCleanupTimer = TimeSpan.FromHours(assetConfig.GetDouble("FileCleanupTimer", m_DefaultFileExpiration)); 156 m_FileExpirationCleanupTimer = TimeSpan.FromHours(assetConfig.GetDouble("FileCleanupTimer", m_DefaultFileExpiration));
@@ -470,7 +470,7 @@ namespace Flotsam.RegionModules.AssetCache
470 else if (dirSize >= m_CacheWarnAt) 470 else if (dirSize >= m_CacheWarnAt)
471 { 471 {
472 m_log.WarnFormat("[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", dir, dirSize); 472 m_log.WarnFormat("[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", dir, dirSize);
473 } 473 }
474 } 474 }
475 475
476 private string GetFileName(string id) 476 private string GetFileName(string id)
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index fcc2673..66a9b5a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
114 scene.EventManager.OnChatBroadcast -= OnChatBroadcast; 114 scene.EventManager.OnChatBroadcast -= OnChatBroadcast;
115 m_scenes.Remove(scene); 115 m_scenes.Remove(scene);
116 } 116 }
117 } 117 }
118 } 118 }
119 119
120 public virtual void Close() 120 public virtual void Close()
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
index 046fc4a..ebebaf9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
52 this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand); 52 this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
53 53
54 m_scene.AddCommand( 54 m_scene.AddCommand(
55 this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand); 55 this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
56 } 56 }
57 57
58 public void PostInitialise() {} 58 public void PostInitialise() {}
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
63 public void SendAlertToUser(IClientAPI client, string message) 63 public void SendAlertToUser(IClientAPI client, string message)
64 { 64 {
65 SendAlertToUser(client, message, false); 65 SendAlertToUser(client, message, false);
66 } 66 }
67 67
68 public void SendAlertToUser(IClientAPI client, string message, bool modal) 68 public void SendAlertToUser(IClientAPI client, string message, bool modal)
69 { 69 {
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
73 public void SendAlertToUser(UUID agentID, string message) 73 public void SendAlertToUser(UUID agentID, string message)
74 { 74 {
75 SendAlertToUser(agentID, message, false); 75 SendAlertToUser(agentID, message, false);
76 } 76 }
77 77
78 public void SendAlertToUser(UUID agentID, string message, bool modal) 78 public void SendAlertToUser(UUID agentID, string message, bool modal)
79 { 79 {
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
81 81
82 if (sp != null) 82 if (sp != null)
83 sp.ControllingClient.SendAgentAlertMessage(message, modal); 83 sp.ControllingClient.SendAgentAlertMessage(message, modal);
84 } 84 }
85 85
86 public void SendAlertToUser(string firstName, string lastName, string message, bool modal) 86 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
87 { 87 {
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
95 break; 95 break;
96 } 96 }
97 } 97 }
98 } 98 }
99 99
100 public void SendGeneralAlert(string message) 100 public void SendGeneralAlert(string message)
101 { 101 {
@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
106 if (!presence.IsChildAgent) 106 if (!presence.IsChildAgent)
107 presence.ControllingClient.SendAlertMessage(message); 107 presence.ControllingClient.SendAlertMessage(message);
108 } 108 }
109 } 109 }
110 110
111 public void SendDialogToUser( 111 public void SendDialogToUser(
112 UUID avatarID, string objectName, UUID objectID, UUID ownerID, 112 UUID avatarID, string objectName, UUID objectID, UUID ownerID,
@@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
135 { 135 {
136 ScenePresence sp = m_scene.GetScenePresence(avatarID); 136 ScenePresence sp = m_scene.GetScenePresence(avatarID);
137 137
138 if (sp != null) 138 if (sp != null)
139 sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); 139 sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
140 } 140 }
141 141
142 public void SendNotificationToUsersInEstate( 142 public void SendNotificationToUsersInEstate(
143 UUID fromAvatarID, string fromAvatarName, string message) 143 UUID fromAvatarID, string fromAvatarName, string message)
@@ -145,11 +145,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
145 // TODO: This does not yet do what it says on the tin - it only sends the message to users in the same 145 // TODO: This does not yet do what it says on the tin - it only sends the message to users in the same
146 // region as the sending avatar. 146 // region as the sending avatar.
147 SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); 147 SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message);
148 } 148 }
149 149
150 public void SendNotificationToUsersInRegion( 150 public void SendNotificationToUsersInRegion(
151 UUID fromAvatarID, string fromAvatarName, string message) 151 UUID fromAvatarID, string fromAvatarName, string message)
152 { 152 {
153 List<ScenePresence> presenceList = m_scene.GetScenePresences(); 153 List<ScenePresence> presenceList = m_scene.GetScenePresences();
154 154
155 foreach (ScenePresence presence in presenceList) 155 foreach (ScenePresence presence in presenceList)
@@ -185,7 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
185 185
186 m_log.InfoFormat( 186 m_log.InfoFormat(
187 "[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}", 187 "[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
188 m_scene.RegionInfo.RegionName, firstName, lastName, message); 188 m_scene.RegionInfo.RegionName, firstName, lastName, message);
189 SendAlertToUser(firstName, lastName, message, false); 189 SendAlertToUser(firstName, lastName, message, false);
190 } 190 }
191 } 191 }
@@ -199,6 +199,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
199 } 199 }
200 200
201 return result; 201 return result;
202 } 202 }
203 } 203 }
204} 204}
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 49b2b5c..fc7d63a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -40,6 +40,7 @@ using OpenSim.Framework.Communications.Cache;
40using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Region.Framework.Scenes; 41using OpenSim.Region.Framework.Scenes;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43using GridRegion = OpenSim.Services.Interfaces.GridRegion;
43 44
44namespace OpenSim.Region.CoreModules.Avatar.Friends 45namespace OpenSim.Region.CoreModules.Avatar.Friends
45{ 46{
@@ -108,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
108 private Dictionary<ulong, Scene> m_scenes = new Dictionary<ulong,Scene>(); 109 private Dictionary<ulong, Scene> m_scenes = new Dictionary<ulong,Scene>();
109 private IMessageTransferModule m_TransferModule = null; 110 private IMessageTransferModule m_TransferModule = null;
110 111
111 private IGridServices m_gridServices = null; 112 private IGridService m_gridServices = null;
112 113
113 #region IRegionModule Members 114 #region IRegionModule Members
114 115
@@ -142,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
142 if (m_scenes.Count > 0) 143 if (m_scenes.Count > 0)
143 { 144 {
144 m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>(); 145 m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>();
145 m_gridServices = m_initialScene.CommsManager.GridService; 146 m_gridServices = m_initialScene.GridService;
146 } 147 }
147 if (m_TransferModule == null) 148 if (m_TransferModule == null)
148 m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); 149 m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work");
@@ -171,7 +172,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
171 List<UUID> tpdAway = new List<UUID>(); 172 List<UUID> tpdAway = new List<UUID>();
172 173
173 // destRegionHandle is a region on another server 174 // destRegionHandle is a region on another server
174 RegionInfo info = m_gridServices.RequestNeighbourInfo(destRegionHandle); 175 uint x = 0, y = 0;
176 Utils.LongToUInts(destRegionHandle, out x, out y);
177 GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y);
175 if (info != null) 178 if (info != null)
176 { 179 {
177 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk"; 180 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk";
@@ -223,7 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
223 public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID) 226 public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID)
224 { 227 {
225 // destRegionHandle is a region on another server 228 // destRegionHandle is a region on another server
226 RegionInfo info = m_gridServices.RequestNeighbourInfo(destRegionHandle); 229 uint x = 0, y = 0;
230 Utils.LongToUInts(destRegionHandle, out x, out y);
231 GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y);
227 if (info == null) 232 if (info == null)
228 { 233 {
229 m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle); 234 m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle);
@@ -492,7 +497,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
492 { 497 {
493 m_log.ErrorFormat("[FRIENDS]: No user found for id {0} in OfferFriendship()", fromUserId); 498 m_log.ErrorFormat("[FRIENDS]: No user found for id {0} in OfferFriendship()", fromUserId);
494 } 499 }
495 } 500 }
496 501
497 #region FriendRequestHandling 502 #region FriendRequestHandling
498 503
@@ -503,7 +508,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
503 508
504 if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38 509 if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38
505 { 510 {
506 // fromAgentName is the *destination* name (the friend we offer friendship to) 511 // fromAgentName is the *destination* name (the friend we offer friendship to)
507 ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID)); 512 ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID));
508 im.fromAgentName = initiator != null ? initiator.Name : "(hippo)"; 513 im.fromAgentName = initiator != null ? initiator.Name : "(hippo)";
509 514
@@ -523,13 +528,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
523 /// Invoked when a user offers a friendship. 528 /// Invoked when a user offers a friendship.
524 /// </summary> 529 /// </summary>
525 /// 530 ///
526 /// <param name="im"></param> 531 /// <param name="im"></param>
527 /// <param name="client"></param> 532 /// <param name="client"></param>
528 private void FriendshipOffered(GridInstantMessage im) 533 private void FriendshipOffered(GridInstantMessage im)
529 { 534 {
530 // this is triggered by the initiating agent: 535 // this is triggered by the initiating agent:
531 // A local agent offers friendship to some possibly remote friend. 536 // A local agent offers friendship to some possibly remote friend.
532 // A IM is triggered, processed here and sent to the friend (possibly in a remote region). 537 // A IM is triggered, processed here and sent to the friend (possibly in a remote region).
533 538
534 m_log.DebugFormat("[FRIEND]: Offer(38) - From: {0}, FromName: {1} To: {2}, Session: {3}, Message: {4}, Offline {5}", 539 m_log.DebugFormat("[FRIEND]: Offer(38) - From: {0}, FromName: {1} To: {2}, Session: {3}, Message: {4}, Offline {5}",
535 im.fromAgentID, im.fromAgentName, im.toAgentID, im.imSessionID, im.message, im.offline); 540 im.fromAgentID, im.fromAgentName, im.toAgentID, im.imSessionID, im.message, im.offline);
@@ -554,7 +559,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
554 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); 559 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success);
555 } 560 }
556 ); 561 );
557 } 562 }
558 } 563 }
559 564
560 /// <summary> 565 /// <summary>
@@ -565,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
565 private void FriendshipAccepted(IClientAPI client, GridInstantMessage im) 570 private void FriendshipAccepted(IClientAPI client, GridInstantMessage im)
566 { 571 {
567 m_log.DebugFormat("[FRIEND]: 39 - from client {0}, agent {2} {3}, imsession {4} to {5}: {6} (dialog {7})", 572 m_log.DebugFormat("[FRIEND]: 39 - from client {0}, agent {2} {3}, imsession {4} to {5}: {6} (dialog {7})",
568 client.AgentId, im.fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog); 573 client.AgentId, im.fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog);
569 } 574 }
570 575
571 /// <summary> 576 /// <summary>
@@ -597,7 +602,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
597 delegate(bool success) { 602 delegate(bool success) {
598 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success); 603 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success);
599 } 604 }
600 ); 605 );
601 } 606 }
602 607
603 private void OnGridInstantMessage(GridInstantMessage msg) 608 private void OnGridInstantMessage(GridInstantMessage msg)
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index ff12361..8ce5092 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -91,6 +91,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
91 else 91 else
92 m_log.ErrorFormat( 92 m_log.ErrorFormat(
93 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); 93 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
94 } 94 }
95 } 95 }
96} \ No newline at end of file 96} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 8926527..f941728 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
43 { 43 {
44 m_scene = scene; 44 m_scene = scene;
45 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); 45 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
46 m_scene.RegisterModuleInterface<IGodsModule>(this); 46 m_scene.RegisterModuleInterface<IGodsModule>(this);
47 } 47 }
48 48
49 public void PostInitialise() {} 49 public void PostInitialise() {}
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
84 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 84 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 /// <summary> 89 /// <summary>
90 /// Kicks User specified from the simulator. This logs them off of the grid 90 /// Kicks User specified from the simulator. This logs them off of the grid
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
142 } 142 }
143 } 143 }
144 else 144 else
145 { 145 {
146 m_dialogModule.SendAlertToUser(godID, "Kick request denied"); 146 m_dialogModule.SendAlertToUser(godID, "Kick request denied");
147 } 147 }
148 } 148 }
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
index 66f1e14..9a68749 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
38{ 38{
39 public class InstantMessageModule : IRegionModule 39 public class InstantMessageModule : IRegionModule
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 /// <value> 43 /// <value>
44 /// Is this module enabled? 44 /// Is this module enabled?
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 4495303..e5159b3 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -36,6 +36,7 @@ using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40namespace OpenSim.Region.CoreModules.Avatar.InstantMessage 41namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
41{ 42{
@@ -497,7 +498,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
497 { 498 {
498 if (upd.AgentOnline) 499 if (upd.AgentOnline)
499 { 500 {
500 RegionInfo reginfo = m_Scenes[0].SceneGridService.RequestNeighbouringRegionInfo(upd.Handle); 501 uint x = 0, y = 0;
502 Utils.LongToUInts(upd.Handle, out x, out y);
503 GridRegion reginfo = m_Scenes[0].GridService.GetRegionByPosition(m_Scenes[0].RegionInfo.ScopeID,
504 (int)x, (int)y);
501 if (reginfo != null) 505 if (reginfo != null)
502 { 506 {
503 Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im); 507 Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im);
@@ -559,7 +563,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
559 /// <param name="reginfo">RegionInfo we pull the data out of to send the request to</param> 563 /// <param name="reginfo">RegionInfo we pull the data out of to send the request to</param>
560 /// <param name="xmlrpcdata">The Instant Message data Hashtable</param> 564 /// <param name="xmlrpcdata">The Instant Message data Hashtable</param>
561 /// <returns>Bool if the message was successfully delivered at the other side.</returns> 565 /// <returns>Bool if the message was successfully delivered at the other side.</returns>
562 protected virtual bool doIMSending(RegionInfo reginfo, Hashtable xmlrpcdata) 566 protected virtual bool doIMSending(GridRegion reginfo, Hashtable xmlrpcdata)
563 { 567 {
564 568
565 ArrayList SendParams = new ArrayList(); 569 ArrayList SendParams = new ArrayList();
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
index ebd9a72..ad05bab 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
@@ -35,6 +35,7 @@ using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38 39
39namespace OpenSim.Region.CoreModules.Avatar.InstantMessage 40namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
40{ 41{
@@ -171,7 +172,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
171 { 172 {
172 // TODO this is the old messaging-server protocol; only the regionHandle is available. 173 // TODO this is the old messaging-server protocol; only the regionHandle is available.
173 // Fetch region-info to get the id 174 // Fetch region-info to get the id
174 RegionInfo regionInfo = m_initialScene.RequestNeighbouringRegionInfo(info.regionHandle); 175 uint x = 0, y = 0;
176 Utils.LongToUInts(info.regionHandle, out x, out y);
177 GridRegion regionInfo = m_initialScene.GridService.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID,
178 (int)x, (int)y);
175 regionID = regionInfo.RegionID; 179 regionID = regionInfo.RegionID;
176 } 180 }
177 result[indices[i]] = new PresenceInfo(uuids[i], regionID); 181 result[indices[i]] = new PresenceInfo(uuids[i], regionID);
@@ -349,6 +353,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
349 353
350 private void NotifyMessageServerOfShutdown(Scene scene) 354 private void NotifyMessageServerOfShutdown(Scene scene)
351 { 355 {
356 if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty)
357 return;
358
352 Hashtable xmlrpcdata = new Hashtable(); 359 Hashtable xmlrpcdata = new Hashtable();
353 xmlrpcdata["RegionUUID"] = scene.RegionInfo.RegionID.ToString(); 360 xmlrpcdata["RegionUUID"] = scene.RegionInfo.RegionID.ToString();
354 ArrayList SendParams = new ArrayList(); 361 ArrayList SendParams = new ArrayList();
@@ -372,6 +379,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
372 379
373 private void NotifyMessageServerOfAgentLocation(UUID agentID, UUID region, ulong regionHandle) 380 private void NotifyMessageServerOfAgentLocation(UUID agentID, UUID region, ulong regionHandle)
374 { 381 {
382 if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty)
383 return;
384
375 Hashtable xmlrpcdata = new Hashtable(); 385 Hashtable xmlrpcdata = new Hashtable();
376 xmlrpcdata["AgentID"] = agentID.ToString(); 386 xmlrpcdata["AgentID"] = agentID.ToString();
377 xmlrpcdata["RegionUUID"] = region.ToString(); 387 xmlrpcdata["RegionUUID"] = region.ToString();
@@ -397,6 +407,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
397 407
398 private void NotifyMessageServerOfAgentLeaving(UUID agentID, UUID region, ulong regionHandle) 408 private void NotifyMessageServerOfAgentLeaving(UUID agentID, UUID region, ulong regionHandle)
399 { 409 {
410 if (m_Scenes[0].CommsManager.NetworkServersInfo.MessagingURL == string.Empty)
411 return;
412
400 Hashtable xmlrpcdata = new Hashtable(); 413 Hashtable xmlrpcdata = new Hashtable();
401 xmlrpcdata["AgentID"] = agentID.ToString(); 414 xmlrpcdata["AgentID"] = agentID.ToString();
402 xmlrpcdata["RegionUUID"] = region.ToString(); 415 xmlrpcdata["RegionUUID"] = region.ToString();
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 907e2d4..f761bf0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
59 /// <value> 59 /// <value>
60 /// We only use this to request modules 60 /// We only use this to request modules
61 /// </value> 61 /// </value>
62 protected Scene m_scene; 62 protected Scene m_scene;
63 63
64 /// <value> 64 /// <value>
65 /// The stream from which the inventory archive will be loaded. 65 /// The stream from which the inventory archive will be loaded.
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
186 item.Folder = foundFolder.ID; 186 item.Folder = foundFolder.ID;
187 187
188 //m_userInfo.AddItem(item); 188 //m_userInfo.AddItem(item);
189 m_scene.InventoryService.AddItem(item); 189 m_scene.InventoryService.AddItem(item);
190 successfulItemRestores++; 190 successfulItemRestores++;
191 191
192 // If we're loading an item directly into the given destination folder then we need to record 192 // If we're loading an item directly into the given destination folder then we need to record
@@ -299,14 +299,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
299 = new InventoryFolderBase( 299 = new InventoryFolderBase(
300 newFolderId, newFolderName, m_userInfo.UserProfile.ID, 300 newFolderId, newFolderName, m_userInfo.UserProfile.ID,
301 (short)AssetType.Unknown, destFolder.ID, 1); 301 (short)AssetType.Unknown, destFolder.ID, 1);
302 m_scene.InventoryService.AddFolder(destFolder); 302 m_scene.InventoryService.AddFolder(destFolder);
303 303
304// UUID newFolderId = UUID.Random(); 304// UUID newFolderId = UUID.Random();
305// m_scene.InventoryService.AddFolder( 305// m_scene.InventoryService.AddFolder(
306// m_userInfo.CreateFolder( 306// m_userInfo.CreateFolder(
307// folderName, newFolderId, (ushort)AssetType.Folder, foundFolder.ID); 307// folderName, newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
308 308
309// m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName); 309// m_log.DebugFormat("[INVENTORY ARCHIVER]: Retrieving newly created folder {0}", folderName);
310// foundFolder = foundFolder.GetChildFolder(newFolderId); 310// foundFolder = foundFolder.GetChildFolder(newFolderId);
311// m_log.DebugFormat( 311// m_log.DebugFormat(
312// "[INVENTORY ARCHIVER]: Retrieved newly created folder {0} with ID {1}", 312// "[INVENTORY ARCHIVER]: Retrieved newly created folder {0} with ID {1}",
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
321 nodesLoaded.Add(destFolder); 321 nodesLoaded.Add(destFolder);
322 322
323 i++; 323 i++;
324 } 324 }
325 325
326 return destFolder; 326 return destFolder;
327 327
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
357 rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID); 357 rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
358 foundFolder = foundFolder.GetChildFolder(newFolderId); 358 foundFolder = foundFolder.GetChildFolder(newFolderId);
359 } 359 }
360 */ 360 */
361 } 361 }
362 362
363 /// <summary> 363 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 5ebf2fa..a822d10 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
42 42
43 /// <summary> 43 /// <summary>
44 /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder 44 /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder
45 /// </summary> 45 /// </summary>
46 /// 46 ///
47 /// This method does not handle paths that contain multiple delimitors 47 /// This method does not handle paths that contain multiple delimitors
48 /// 48 ///
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
58 /// User id to search 58 /// User id to search
59 /// </param> 59 /// </param>
60 /// <param name="path"> 60 /// <param name="path">
61 /// The path to the required folder. 61 /// The path to the required folder.
62 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. 62 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
63 /// </param> 63 /// </param>
64 /// <returns>null if the folder is not found</returns> 64 /// <returns>null if the folder is not found</returns>
@@ -71,11 +71,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
71 return null; 71 return null;
72 72
73 return FindFolderByPath(inventoryService, rootFolder, path); 73 return FindFolderByPath(inventoryService, rootFolder, path);
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Find a folder given a PATH_DELIMITER delimited path starting from this folder 77 /// Find a folder given a PATH_DELIMITER delimited path starting from this folder
78 /// </summary> 78 /// </summary>
79 /// 79 ///
80 /// This method does not handle paths that contain multiple delimitors 80 /// This method does not handle paths that contain multiple delimitors
81 /// 81 ///
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
91 /// The folder from which the path starts 91 /// The folder from which the path starts
92 /// </param> 92 /// </param>
93 /// <param name="path"> 93 /// <param name="path">
94 /// The path to the required folder. 94 /// The path to the required folder.
95 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. 95 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
96 /// </param> 96 /// </param>
97 /// <returns>null if the folder is not found</returns> 97 /// <returns>null if the folder is not found</returns>
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
154 return null; 154 return null;
155 155
156 return FindItemByPath(inventoryService, rootFolder, path); 156 return FindItemByPath(inventoryService, rootFolder, path);
157 } 157 }
158 158
159 /// <summary> 159 /// <summary>
160 /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. 160 /// Find an item given a PATH_DELIMITOR delimited path starting from this folder.
@@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
194 } 194 }
195 else 195 else
196 { 196 {
197 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); 197 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
198 198
199 foreach (InventoryFolderBase folder in contents.Folders) 199 foreach (InventoryFolderBase folder in contents.Folders)
200 { 200 {
@@ -205,6 +205,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
205 205
206 // We didn't find an item or intermediate folder with the given name 206 // We didn't find an item or intermediate folder with the given name
207 return null; 207 return null;
208 } 208 }
209 } 209 }
210} \ No newline at end of file 210} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 7b4a9eb..499c552 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
55 55
56 private InventoryArchiverModule m_module; 56 private InventoryArchiverModule m_module;
57 private CachedUserInfo m_userInfo; 57 private CachedUserInfo m_userInfo;
58 private string m_invPath; 58 private string m_invPath;
59 protected TarArchiveWriter m_archiveWriter; 59 protected TarArchiveWriter m_archiveWriter;
60 protected UuidGatherer m_assetGatherer; 60 protected UuidGatherer m_assetGatherer;
61 61
@@ -118,6 +118,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
118 118
119 protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) 119 protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
120 { 120 {
121 // We're almost done. Just need to write out the control file now
122 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
123 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
124
121 Exception reportedException = null; 125 Exception reportedException = null;
122 bool succeeded = true; 126 bool succeeded = true;
123 127
@@ -164,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
164 { 168 {
165 path += CreateArchiveFolderName(inventoryFolder); 169 path += CreateArchiveFolderName(inventoryFolder);
166 170
167 // We need to make sure that we record empty folders 171 // We need to make sure that we record empty folders
168 m_archiveWriter.WriteDir(path); 172 m_archiveWriter.WriteDir(path);
169 } 173 }
170 174
@@ -258,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
258 if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) 262 if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD)
259 { 263 {
260 foundStar = true; 264 foundStar = true;
261 maxComponentIndex--; 265 maxComponentIndex--;
262 } 266 }
263 267
264 m_invPath = String.Empty; 268 m_invPath = String.Empty;
@@ -320,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
320 SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); 324 SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
321 } 325 }
322 326
323 SaveUsers(); 327 // Don't put all this profile information into the archive right now.
328 //SaveUsers();
329
324 new AssetsRequest( 330 new AssetsRequest(
325 new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, 331 new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys,
326 m_scene.AssetService, ReceivedAllAssets).Execute(); 332 m_scene.AssetService, ReceivedAllAssets).Execute();
@@ -363,8 +369,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
363 /// <returns></returns> 369 /// <returns></returns>
364 public static string CreateArchiveFolderName(InventoryFolderBase folder) 370 public static string CreateArchiveFolderName(InventoryFolderBase folder)
365 { 371 {
366 return CreateArchiveFolderName(folder.Name, folder.ID); 372 return CreateArchiveFolderName(folder.Name, folder.ID);
367 } 373 }
368 374
369 /// <summary> 375 /// <summary>
370 /// Create the archive name for a particular item. 376 /// Create the archive name for a particular item.
@@ -377,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
377 /// <returns></returns> 383 /// <returns></returns>
378 public static string CreateArchiveItemName(InventoryItemBase item) 384 public static string CreateArchiveItemName(InventoryItemBase item)
379 { 385 {
380 return CreateArchiveItemName(item.Name, item.ID); 386 return CreateArchiveItemName(item.Name, item.ID);
381 } 387 }
382 388
383 /// <summary> 389 /// <summary>
@@ -392,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
392 "{0}{1}{2}/", 398 "{0}{1}{2}/",
393 name, 399 name,
394 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, 400 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR,
395 id); 401 id);
396 } 402 }
397 403
398 /// <summary> 404 /// <summary>
@@ -400,14 +406,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
400 /// </summary> 406 /// </summary>
401 /// <param name="name"></param> 407 /// <param name="name"></param>
402 /// <param name="id"></param> 408 /// <param name="id"></param>
403 /// <returns></returns> 409 /// <returns></returns>
404 public static string CreateArchiveItemName(string name, UUID id) 410 public static string CreateArchiveItemName(string name, UUID id)
405 { 411 {
406 return string.Format( 412 return string.Format(
407 "{0}{1}{2}.xml", 413 "{0}{1}{2}.xml",
408 name, 414 name,
409 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, 415 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR,
410 id); 416 id);
417 }
418
419 /// <summary>
420 /// Create the control file for a 0.1 version archive
421 /// </summary>
422 /// <returns></returns>
423 public static string Create0p1ControlFile()
424 {
425 StringWriter sw = new StringWriter();
426 XmlTextWriter xtw = new XmlTextWriter(sw);
427 xtw.Formatting = Formatting.Indented;
428 xtw.WriteStartDocument();
429 xtw.WriteStartElement("archive");
430 xtw.WriteAttributeString("major_version", "0");
431 xtw.WriteAttributeString("minor_version", "1");
432 xtw.WriteEndElement();
433
434 xtw.Flush();
435 xtw.Close();
436
437 String s = sw.ToString();
438 sw.Close();
439
440 return s;
411 } 441 }
412 } 442 }
413} \ No newline at end of file 443} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 9f49da9..1228eb1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -40,12 +40,12 @@ using OpenSim.Region.Framework.Scenes;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41 41
42namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver 42namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// This module loads and saves OpenSimulator inventory archives 45 /// This module loads and saves OpenSimulator inventory archives
46 /// </summary> 46 /// </summary>
47 public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule 47 public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
48 { 48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 public string Name { get { return "Inventory Archiver Module"; } } 51 public string Name { get { return "Inventory Archiver Module"; } }
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
57 /// </value> 57 /// </value>
58 public bool DisablePresenceChecks { get; set; } 58 public bool DisablePresenceChecks { get; set; }
59 59
60 public event InventoryArchiveSaved OnInventoryArchiveSaved; 60 public event InventoryArchiveSaved OnInventoryArchiveSaved;
61 61
62 /// <summary> 62 /// <summary>
63 /// The file to load and save inventory if no filename has been specified 63 /// The file to load and save inventory if no filename has been specified
@@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
83 } 83 }
84 84
85 public void Initialise(Scene scene, IConfigSource source) 85 public void Initialise(Scene scene, IConfigSource source)
86 { 86 {
87 if (m_scenes.Count == 0) 87 if (m_scenes.Count == 0)
88 { 88 {
89 scene.RegisterModuleInterface<IInventoryArchiverModule>(this); 89 scene.RegisterModuleInterface<IInventoryArchiverModule>(this);
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
102 m_aScene = scene; 102 m_aScene = scene;
103 } 103 }
104 104
105 m_scenes[scene.RegionInfo.RegionID] = scene; 105 m_scenes[scene.RegionInfo.RegionID] = scene;
106 } 106 }
107 107
108 public void PostInitialise() {} 108 public void PostInitialise() {}
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
119 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; 119 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
120 if (handlerInventoryArchiveSaved != null) 120 if (handlerInventoryArchiveSaved != null)
121 handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); 121 handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException);
122 } 122 }
123 123
124 public bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) 124 public bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
125 { 125 {
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
174 public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) 174 public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream)
175 { 175 {
176 if (m_scenes.Count > 0) 176 if (m_scenes.Count > 0)
177 { 177 {
178 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 178 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass);
179 179
180 if (userInfo != null) 180 if (userInfo != null)
@@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
182 if (CheckPresence(userInfo.UserProfile.ID)) 182 if (CheckPresence(userInfo.UserProfile.ID))
183 { 183 {
184 InventoryArchiveReadRequest request = 184 InventoryArchiveReadRequest request =
185 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); 185 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
186 UpdateClientWithLoadedNodes(userInfo, request.Execute()); 186 UpdateClientWithLoadedNodes(userInfo, request.Execute());
187 187
188 return true; 188 return true;
@@ -197,12 +197,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
197 } 197 }
198 198
199 return false; 199 return false;
200 } 200 }
201 201
202 public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, string loadPath) 202 public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, string loadPath)
203 { 203 {
204 if (m_scenes.Count > 0) 204 if (m_scenes.Count > 0)
205 { 205 {
206 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass); 206 CachedUserInfo userInfo = GetUserInfo(firstName, lastName, pass);
207 207
208 if (userInfo != null) 208 if (userInfo != null)
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
210 if (CheckPresence(userInfo.UserProfile.ID)) 210 if (CheckPresence(userInfo.UserProfile.ID))
211 { 211 {
212 InventoryArchiveReadRequest request = 212 InventoryArchiveReadRequest request =
213 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); 213 new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
214 UpdateClientWithLoadedNodes(userInfo, request.Execute()); 214 UpdateClientWithLoadedNodes(userInfo, request.Execute());
215 215
216 return true; 216 return true;
@@ -221,11 +221,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
221 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator", 221 "[INVENTORY ARCHIVER]: User {0} {1} not logged in to this region simulator",
222 userInfo.UserProfile.Name, userInfo.UserProfile.ID); 222 userInfo.UserProfile.Name, userInfo.UserProfile.ID);
223 } 223 }
224 } 224 }
225 } 225 }
226 226
227 return false; 227 return false;
228 } 228 }
229 229
230 /// <summary> 230 /// <summary>
231 /// Load inventory from an inventory file archive 231 /// Load inventory from an inventory file archive
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
252 "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", 252 "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}",
253 loadPath, invPath, firstName, lastName); 253 loadPath, invPath, firstName, lastName);
254 254
255 if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath)) 255 if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath))
256 m_log.InfoFormat( 256 m_log.InfoFormat(
257 "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", 257 "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}",
258 loadPath, firstName, lastName); 258 loadPath, firstName, lastName);
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
264 /// <param name="cmdparams"></param> 264 /// <param name="cmdparams"></param>
265 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) 265 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
266 { 266 {
267 if (cmdparams.Length < 5) 267 if (cmdparams.Length < 6)
268 { 268 {
269 m_log.Error( 269 m_log.Error(
270 "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); 270 "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]");
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
288 288
289 lock (m_pendingConsoleSaves) 289 lock (m_pendingConsoleSaves)
290 m_pendingConsoleSaves.Add(id); 290 m_pendingConsoleSaves.Add(id);
291 } 291 }
292 292
293 private void SaveInvConsoleCommandCompleted( 293 private void SaveInvConsoleCommandCompleted(
294 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, 294 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream,
@@ -324,6 +324,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
324 protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass) 324 protected CachedUserInfo GetUserInfo(string firstName, string lastName, string pass)
325 { 325 {
326 CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName); 326 CachedUserInfo userInfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(firstName, lastName);
327 //m_aScene.CommsManager.UserService.GetUserProfile(firstName, lastName);
327 if (null == userInfo) 328 if (null == userInfo)
328 { 329 {
329 m_log.ErrorFormat( 330 m_log.ErrorFormat(
@@ -332,16 +333,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
332 return null; 333 return null;
333 } 334 }
334 335
335 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(pass) + ":" + userInfo.UserProfile.PasswordSalt); 336 try
336 if (userInfo.UserProfile.PasswordHash != md5PasswdHash)
337 { 337 {
338 m_log.ErrorFormat( 338 if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
339 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.", 339 {
340 firstName, lastName); 340 return userInfo;
341 }
342 else
343 {
344 m_log.ErrorFormat(
345 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
346 firstName, lastName);
347 return null;
348 }
349 }
350 catch (Exception e)
351 {
352 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
341 return null; 353 return null;
342 } 354 }
343
344 return userInfo;
345 } 355 }
346 356
347 /// <summary> 357 /// <summary>
@@ -349,7 +359,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
349 /// </summary> 359 /// </summary>
350 /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> 360 /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param>
351 private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes) 361 private void UpdateClientWithLoadedNodes(CachedUserInfo userInfo, List<InventoryNodeBase> loadedNodes)
352 { 362 {
353 if (loadedNodes.Count == 0) 363 if (loadedNodes.Count == 0)
354 return; 364 return;
355 365
@@ -358,19 +368,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
358 ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID); 368 ScenePresence user = scene.GetScenePresence(userInfo.UserProfile.ID);
359 369
360 if (user != null && !user.IsChildAgent) 370 if (user != null && !user.IsChildAgent)
361 { 371 {
362 foreach (InventoryNodeBase node in loadedNodes) 372 foreach (InventoryNodeBase node in loadedNodes)
363 { 373 {
364 m_log.DebugFormat( 374// m_log.DebugFormat(
365 "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}", 375// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
366 user.Name, node.Name); 376// user.Name, node.Name);
367 377
368 user.ControllingClient.SendBulkUpdateInventory(node); 378 user.ControllingClient.SendBulkUpdateInventory(node);
369 } 379 }
370 380
371 break; 381 break;
372 } 382 }
373 } 383 }
374 } 384 }
375 385
376 /// <summary> 386 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index ed293cd..b0fdcd6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -37,7 +37,7 @@ using OpenMetaverse;
37using OpenSim.Data; 37using OpenSim.Data;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Serialization; 39using OpenSim.Framework.Serialization;
40using OpenSim.Framework.Serialization.External; 40using OpenSim.Framework.Serialization.External;
41using OpenSim.Framework.Communications; 41using OpenSim.Framework.Communications;
42using OpenSim.Framework.Communications.Cache; 42using OpenSim.Framework.Communications.Cache;
43using OpenSim.Framework.Communications.Osp; 43using OpenSim.Framework.Communications.Osp;
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
70 Exception reportedException) 70 Exception reportedException)
71 { 71 {
72 mre.Set(); 72 mre.Set();
73 } 73 }
74 74
75 /// <summary> 75 /// <summary>
76 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). 76 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
157 string expectedObject1FilePath = string.Format( 157 string expectedObject1FilePath = string.Format(
158 "{0}{1}{2}", 158 "{0}{1}{2}",
159 ArchiveConstants.INVENTORY_PATH, 159 ArchiveConstants.INVENTORY_PATH,
160 InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder), 160 InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder),
161 expectedObject1FileName); 161 expectedObject1FileName);
162 162
163 string filePath; 163 string filePath;
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
195 Assert.That(gotObject1File, Is.True, "No item1 file in archive"); 195 Assert.That(gotObject1File, Is.True, "No item1 file in archive");
196// Assert.That(gotObject2File, Is.True, "No object2 file in archive"); 196// Assert.That(gotObject2File, Is.True, "No object2 file in archive");
197 197
198 // TODO: Test presence of more files and contents of files. 198 // TODO: Test presence of more files and contents of files.
199 } 199 }
200 200
201 /// <summary> 201 /// <summary>
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
206 /// This test also does some deeper probing of loading into nested inventory structures 206 /// This test also does some deeper probing of loading into nested inventory structures
207 [Test] 207 [Test]
208 public void TestLoadIarV0_1ExistingUsers() 208 public void TestLoadIarV0_1ExistingUsers()
209 { 209 {
210 TestHelper.InMethod(); 210 TestHelper.InMethod();
211 211
212 //log4net.Config.XmlConfigurator.Configure(); 212 //log4net.Config.XmlConfigurator.Configure();
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
238 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); 238 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
239 tar.Close(); 239 tar.Close();
240 240
241 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 241 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
242 SerialiserModule serialiserModule = new SerialiserModule(); 242 SerialiserModule serialiserModule = new SerialiserModule();
243 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 243 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
244 244
@@ -271,9 +271,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
271 Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), 271 Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
272 "Loaded item owner doesn't match inventory reciever"); 272 "Loaded item owner doesn't match inventory reciever");
273 273
274 // Now try loading to a root child folder 274 // Now try loading to a root child folder
275 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA"); 275 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA");
276 archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); 276 archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
277 archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); 277 archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
278 278
279 InventoryItemBase foundItem2 279 InventoryItemBase foundItem2
@@ -282,12 +282,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
282 282
283 // Now try loading to a more deeply nested folder 283 // Now try loading to a more deeply nested folder
284 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC"); 284 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC");
285 archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); 285 archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
286 archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); 286 archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
287 287
288 InventoryItemBase foundItem3 288 InventoryItemBase foundItem3
289 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName); 289 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName);
290 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); 290 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
291 } 291 }
292 292
293 /// <summary> 293 /// <summary>
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
299 /// (as tested in the a later commented out test) 299 /// (as tested in the a later commented out test)
300 [Test] 300 [Test]
301 public void TestLoadIarV0_1AbsentUsers() 301 public void TestLoadIarV0_1AbsentUsers()
302 { 302 {
303 TestHelper.InMethod(); 303 TestHelper.InMethod();
304 304
305 log4net.Config.XmlConfigurator.Configure(); 305 log4net.Config.XmlConfigurator.Configure();
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
331 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); 331 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
332 tar.Close(); 332 tar.Close();
333 333
334 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 334 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
335 SerialiserModule serialiserModule = new SerialiserModule(); 335 SerialiserModule serialiserModule = new SerialiserModule();
336 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 336 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
337 337
@@ -357,8 +357,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
357// "Loaded item non-uuid creator doesn't match that of the loading user"); 357// "Loaded item non-uuid creator doesn't match that of the loading user");
358 Assert.That( 358 Assert.That(
359 foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), 359 foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid),
360 "Loaded item uuid creator doesn't match that of the loading user"); 360 "Loaded item uuid creator doesn't match that of the loading user");
361 } 361 }
362 362
363 /// <summary> 363 /// <summary>
364 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where 364 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
367 /// Disabled since temporary profiles have not yet been implemented. 367 /// Disabled since temporary profiles have not yet been implemented.
368 //[Test] 368 //[Test]
369 public void TestLoadIarV0_1TempProfiles() 369 public void TestLoadIarV0_1TempProfiles()
370 { 370 {
371 TestHelper.InMethod(); 371 TestHelper.InMethod();
372 372
373 log4net.Config.XmlConfigurator.Configure(); 373 log4net.Config.XmlConfigurator.Configure();
@@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
396 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); 396 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
397 tar.Close(); 397 tar.Close();
398 398
399 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 399 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
400 SerialiserModule serialiserModule = new SerialiserModule(); 400 SerialiserModule serialiserModule = new SerialiserModule();
401 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 401 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
402 402
@@ -436,7 +436,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
436 Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); 436 Assert.That(foundItem.Owner, Is.EqualTo(userUuid));
437 437
438 Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod()); 438 Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod());
439 } 439 }
440 440
441 /// <summary> 441 /// <summary>
442 /// Test replication of an archive path to the user's inventory. 442 /// Test replication of an archive path to the user's inventory.
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
474 string itemArchivePath 474 string itemArchivePath
475 = string.Format( 475 = string.Format(
476 "{0}{1}{2}{3}", 476 "{0}{1}{2}{3}",
477 ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); 477 ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName);
478 478
479 //Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); 479 //Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder);
480 480
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 75976e2..d9a021f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -169,12 +169,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
169 byte[] copyIDBytes = copyID.GetBytes(); 169 byte[] copyIDBytes = copyID.GetBytes();
170 im.binaryBucket = new byte[1 + copyIDBytes.Length]; 170 im.binaryBucket = new byte[1 + copyIDBytes.Length];
171 im.binaryBucket[0] = (byte)AssetType.Folder; 171 im.binaryBucket[0] = (byte)AssetType.Folder;
172 Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); 172 Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
173 173
174 if (user != null && !user.IsChildAgent) 174 if (user != null && !user.IsChildAgent)
175 { 175 {
176 user.ControllingClient.SendBulkUpdateInventory(folderCopy); 176 user.ControllingClient.SendBulkUpdateInventory(folderCopy);
177 } 177 }
178 } 178 }
179 else 179 else
180 { 180 {
@@ -199,10 +199,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
199 } 199 }
200 200
201 copyID = itemCopy.ID; 201 copyID = itemCopy.ID;
202 Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); 202 Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16);
203 203
204 if (user != null && !user.IsChildAgent) 204 if (user != null && !user.IsChildAgent)
205 { 205 {
206 user.ControllingClient.SendBulkUpdateInventory(itemCopy); 206 user.ControllingClient.SendBulkUpdateInventory(itemCopy);
207 } 207 }
208 } 208 }
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
241 } 241 }
242 } 242 }
243 else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) 243 else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined)
244 { 244 {
245 // Here, the recipient is local and we can assume that the 245 // Here, the recipient is local and we can assume that the
246 // inventory is loaded. Courtesy of the above bulk update, 246 // inventory is loaded. Courtesy of the above bulk update,
247 // It will have been pushed to the client, too 247 // It will have been pushed to the client, too
@@ -284,7 +284,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
284 } 284 }
285 285
286 if ((null == item && null == folder) | null == trashFolder) 286 if ((null == item && null == folder) | null == trashFolder)
287 { 287 {
288 string reason = String.Empty; 288 string reason = String.Empty;
289 289
290 if (trashFolder == null) 290 if (trashFolder == null)
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
index 34d46a0..1b23d92 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
@@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
316 316
317 // This will persist this beyond the expiry of the caps handlers 317 // This will persist this beyond the expiry of the caps handlers
318 MainServer.Instance.AddPollServiceHTTPHandler( 318 MainServer.Instance.AddPollServiceHTTPHandler(
319 capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePath2, new PollServiceEventArgs(HasEvents, GetEvents, NoEvents, agentID)); 319 capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
320 320
321 Random rnd = new Random(Environment.TickCount); 321 Random rnd = new Random(Environment.TickCount);
322 lock (m_ids) 322 lock (m_ids)
@@ -326,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
326 } 326 }
327 } 327 }
328 328
329 public bool HasEvents(UUID agentID) 329 public bool HasEvents(UUID requestID, UUID agentID)
330 { 330 {
331 // Don't use this, because of race conditions at agent closing time 331 // Don't use this, because of race conditions at agent closing time
332 //Queue<OSD> queue = TryGetQueue(agentID); 332 //Queue<OSD> queue = TryGetQueue(agentID);
@@ -343,14 +343,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
343 return false; 343 return false;
344 } 344 }
345 345
346 public Hashtable GetEvents(UUID pAgentId, string request) 346 public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request)
347 { 347 {
348 Queue<OSD> queue = TryGetQueue(pAgentId); 348 Queue<OSD> queue = TryGetQueue(pAgentId);
349 OSD element; 349 OSD element;
350 lock (queue) 350 lock (queue)
351 { 351 {
352 if (queue.Count == 0) 352 if (queue.Count == 0)
353 return NoEvents(); 353 return NoEvents(requestID, pAgentId);
354 element = queue.Dequeue(); // 15s timeout 354 element = queue.Dequeue(); // 15s timeout
355 } 355 }
356 356
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
398 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); 398 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
399 } 399 }
400 400
401 public Hashtable NoEvents() 401 public Hashtable NoEvents(UUID requestID, UUID agentID)
402 { 402 {
403 Hashtable responsedata = new Hashtable(); 403 Hashtable responsedata = new Hashtable();
404 responsedata["int_response_code"] = 502; 404 responsedata["int_response_code"] = 502;
@@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
454 responsedata["error_status_text"] = "Upstream error:"; 454 responsedata["error_status_text"] = "Upstream error:";
455 responsedata["http_protocol_version"] = "HTTP/1.0"; 455 responsedata["http_protocol_version"] = "HTTP/1.0";
456 return responsedata; 456 return responsedata;
457 } 457 }
458 458
459 OSDArray array = new OSDArray(); 459 OSDArray array = new OSDArray();
460 if (element == null) // didn't have an event in 15s 460 if (element == null) // didn't have an event in 15s
@@ -491,6 +491,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
491 return responsedata; 491 return responsedata;
492 } 492 }
493 493
494 public Hashtable EventQueuePoll(Hashtable request)
495 {
496 return new Hashtable();
497 }
498
494 public Hashtable EventQueuePath2(Hashtable request) 499 public Hashtable EventQueuePath2(Hashtable request)
495 { 500 {
496 string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); 501 string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/","");
diff --git a/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs b/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs
deleted file mode 100644
index 8c92727..0000000
--- a/OpenSim/Region/CoreModules/Framework/Services/RegionMapService.cs
+++ /dev/null
@@ -1,208 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Net;
32using System.Reflection;
33using log4net;
34using Nini.Config;
35using OpenMetaverse;
36using OpenSim.Data;
37using OpenSim.Framework;
38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Communications.Cache;
40using OpenSim.Framework.Servers.HttpServer;
41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes;
43
44using Nwc.XmlRpc;
45
46
47namespace OpenSim.Region.CoreModules.Framework.Services
48{
49 public class RegionMapService : IRegionModule
50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 private static bool initialized = false;
53 private static bool enabled = false;
54
55 Scene m_scene;
56 //AssetService m_assetService;
57
58 #region IRegionModule interface
59
60 public void Initialise(Scene scene, IConfigSource config)
61 {
62 if (!initialized)
63 {
64 initialized = true;
65 m_scene = scene;
66
67 // This module is only on for hypergrid mode
68 enabled = config.Configs["Startup"].GetBoolean("hypergrid", false);
69 }
70 }
71
72 public void PostInitialise()
73 {
74 if (enabled)
75 {
76 m_log.Info("[RegionMapService]: Starting...");
77
78 //m_assetService = new AssetService(m_scene);
79 new GridService(m_scene);
80 }
81 }
82
83 public void Close()
84 {
85 }
86
87 public string Name
88 {
89 get { return "RegionMapService"; }
90 }
91
92 public bool IsSharedModule
93 {
94 get { return true; }
95 }
96
97 #endregion
98
99 }
100
101 public class GridService
102 {
103// private IUserService m_userService;
104 private IGridServices m_gridService;
105 private bool m_doLookup = false;
106
107 public bool DoLookup
108 {
109 get { return m_doLookup; }
110 set { m_doLookup = value; }
111 }
112 private static readonly ILog m_log
113 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
114
115 public GridService(Scene m_scene)
116 {
117 AddHandlers(m_scene);
118// m_userService = m_scene.CommsManager.UserService;
119 m_gridService = m_scene.CommsManager.GridService;
120 }
121
122 protected void AddHandlers(Scene m_scene)
123 {
124// IAssetDataPlugin m_assetProvider
125// = ((AssetServerBase)m_scene.CommsManager.AssetCache.AssetServer).AssetProviderPlugin;
126
127 IHttpServer httpServer = MainServer.Instance;
128 httpServer.AddXmlRPCHandler("simulator_data_request", XmlRpcSimulatorDataRequestMethod);
129 //m_httpServer.AddXmlRPCHandler("map_block", XmlRpcMapBlockMethod);
130 //m_httpServer.AddXmlRPCHandler("search_for_region_by_name", XmlRpcSearchForRegionMethod);
131
132 }
133
134 /// <summary>
135 /// Returns an XML RPC response to a simulator profile request
136 /// </summary>
137 /// <param name="request"></param>
138 /// <returns></returns>
139 public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request, IPEndPoint remoteClient)
140 {
141 Hashtable requestData = (Hashtable)request.Params[0];
142 Hashtable responseData = new Hashtable();
143 RegionInfo simData = null;
144 if (requestData.ContainsKey("region_UUID"))
145 {
146 UUID regionID = new UUID((string)requestData["region_UUID"]);
147 simData = m_gridService.RequestNeighbourInfo(regionID); //.GetRegion(regionID);
148 if (simData == null)
149 {
150 m_log.WarnFormat("[HGGridService] didn't find region for regionID {0} from {1}",
151 regionID, request.Params.Count > 1 ? request.Params[1] : "unknwon source");
152 }
153 }
154 else if (requestData.ContainsKey("region_handle"))
155 {
156 //CFK: The if/else below this makes this message redundant.
157 //CFK: m_log.Info("requesting data for region " + (string) requestData["region_handle"]);
158 ulong regionHandle = Convert.ToUInt64((string)requestData["region_handle"]);
159 simData = m_gridService.RequestNeighbourInfo(regionHandle); //m_gridDBService.GetRegion(regionHandle);
160 if (simData == null)
161 {
162 m_log.WarnFormat("[HGGridService] didn't find region for regionHandle {0} from {1}",
163 regionHandle, request.Params.Count > 1 ? request.Params[1] : "unknwon source");
164 }
165 }
166 else if (requestData.ContainsKey("region_name_search"))
167 {
168 string regionName = (string)requestData["region_name_search"];
169 List<RegionInfo> regInfos = m_gridService.RequestNamedRegions(regionName, 1);//m_gridDBService.GetRegion(regionName);
170 if (regInfos != null)
171 simData = regInfos[0];
172
173 if (simData == null)
174 {
175 m_log.WarnFormat("[HGGridService] didn't find region for regionName {0} from {1}",
176 regionName, request.Params.Count > 1 ? request.Params[1] : "unknwon source");
177 }
178 }
179 else m_log.Warn("[HGGridService] regionlookup without regionID, regionHandle or regionHame");
180
181 if (simData == null)
182 {
183 //Sim does not exist
184 responseData["error"] = "Sim does not exist";
185 }
186 else
187 {
188 m_log.Debug("[HGGridService]: found " + (string)simData.RegionName + " regionHandle = " +
189 (string)requestData["region_handle"]);
190 responseData["sim_ip"] = simData.ExternalEndPoint.Address.ToString();
191 responseData["sim_port"] = simData.ExternalEndPoint.Port.ToString();
192 //responseData["server_uri"] = simData.serverURI;
193 responseData["http_port"] = simData.HttpPort.ToString();
194 //responseData["remoting_port"] = simData.remotingPort.ToString();
195 responseData["region_locx"] = simData.RegionLocX.ToString();
196 responseData["region_locy"] = simData.RegionLocY.ToString();
197 responseData["region_UUID"] = simData.RegionID.ToString();
198 responseData["region_name"] = simData.RegionName;
199 responseData["region_secret"] = simData.regionSecret;
200 }
201
202 XmlRpcResponse response = new XmlRpcResponse();
203 response.Value = responseData;
204 return response;
205 }
206
207 }
208}
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
index 613dbe9..4199c98 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
61 { 61 {
62 if (m_firstScene != null) 62 if (m_firstScene != null)
63 { 63 {
64 return m_firstScene.CommsManager.GridService.RegionLoginsEnabled; 64 return m_firstScene.SceneGridService.RegionLoginsEnabled;
65 } 65 }
66 else 66 else
67 { 67 {
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index 6774060..a0ccdc7 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -34,6 +34,7 @@ using OpenSim.Framework;
34using OpenSim.Region.CoreModules.World.WorldMap; 34using OpenSim.Region.CoreModules.World.WorldMap;
35using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 36using OpenSim.Region.Framework.Scenes;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
37 38
38namespace OpenSim.Region.CoreModules.Hypergrid 39namespace OpenSim.Region.CoreModules.Hypergrid
39{ 40{
@@ -59,7 +60,17 @@ namespace OpenSim.Region.CoreModules.Hypergrid
59 60
60 protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 61 protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
61 { 62 {
62 List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, maxX + 4, maxY + 4); 63 List<MapBlockData> mapBlocks = new List<MapBlockData>();
64 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
65 (minX - 4) * (int)Constants.RegionSize, (maxX + 4) * (int)Constants.RegionSize,
66 (minY - 4) * (int)Constants.RegionSize, (maxY + 4) * (int)Constants.RegionSize);
67
68 foreach (GridRegion r in regions)
69 {
70 MapBlockData block = new MapBlockData();
71 MapBlockFromGridRegion(block, r);
72 mapBlocks.Add(block);
73 }
63 74
64 // Different from super 75 // Different from super
65 FillInMap(mapBlocks, minX, minY, maxX, maxY); 76 FillInMap(mapBlocks, minX, minY, maxX, maxY);
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index e9c1e9d..7d6f150 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -353,11 +353,11 @@ namespace OpenSim.Region.CoreModules.InterGrid
353 return responseMap; 353 return responseMap;
354 } 354 }
355 355
356 // Using OpenSim.Framework.Capabilities.Caps here one time.. 356 // Using OpenSim.Framework.Capabilities.Caps here one time..
357 // so the long name is probably better then a using statement 357 // so the long name is probably better then a using statement
358 public void OnRegisterCaps(UUID agentID, Caps caps) 358 public void OnRegisterCaps(UUID agentID, Caps caps)
359 { 359 {
360 /* If we ever want to register our own caps here.... 360 /* If we ever want to register our own caps here....
361 * 361 *
362 string capsBase = "/CAPS/" + caps.CapsObjectPath; 362 string capsBase = "/CAPS/" + caps.CapsObjectPath;
363 caps.RegisterHandler("CAPNAME", 363 caps.RegisterHandler("CAPNAME",
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index f9e61aa..8f82718 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -38,11 +38,15 @@
38 <RegionModule id="RemoteLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.RemoteLandServicesConnector" /> 38 <RegionModule id="RemoteLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.RemoteLandServicesConnector" />
39 <RegionModule id="LocalInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.LocalInterregionComms" /> 39 <RegionModule id="LocalInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.LocalInterregionComms" />
40 <RegionModule id="RESTInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.RESTInterregionComms" /> 40 <RegionModule id="RESTInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.RESTInterregionComms" />
41 <RegionModule id="LocalGridServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.LocalGridServicesConnector" />
42 <RegionModule id="RemoteGridServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.RemoteGridServicesConnector" />
43 <RegionModule id="HGGridConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.HGGridConnector" />
41 <!-- Service connectors IN modules --> 44 <!-- Service connectors IN modules -->
42 <RegionModule id="AssetServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset.AssetServiceInConnectorModule" /> 45 <RegionModule id="AssetServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset.AssetServiceInConnectorModule" />
43 <RegionModule id="InventoryServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory.InventoryServiceInConnectorModule" /> 46 <RegionModule id="InventoryServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory.InventoryServiceInConnectorModule" />
44 <RegionModule id="LandServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Land.LandServiceInConnectorModule" /> 47 <RegionModule id="LandServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Land.LandServiceInConnectorModule" />
45 <RegionModule id="NeighbourServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour.NeighbourServiceInConnectorModule" /> \ 48 <RegionModule id="NeighbourServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour.NeighbourServiceInConnectorModule" /> \
49 <RegionModule id="HypergridServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.HypergridServiceInConnectorModule" /> \
46 50
47 </Extension> 51 </Extension>
48 52
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 6a2a6c8..b885420 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -55,14 +55,19 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
55 public UUID requestID; 55 public UUID requestID;
56 public Dictionary<string, string> headers; 56 public Dictionary<string, string> headers;
57 public string body; 57 public string body;
58 public int responseCode;
59 public string responseBody;
58 public ManualResetEvent ev; 60 public ManualResetEvent ev;
61 public bool requestDone;
62 public int startTime;
63 public string uri;
59 } 64 }
60 65
61 public class UrlModule : ISharedRegionModule, IUrlModule 66 public class UrlModule : ISharedRegionModule, IUrlModule
62 { 67 {
63// private static readonly ILog m_log = 68 private static readonly ILog m_log =
64// LogManager.GetLogger( 69 LogManager.GetLogger(
65// MethodBase.GetCurrentMethod().DeclaringType); 70 MethodBase.GetCurrentMethod().DeclaringType);
66 71
67 private Dictionary<UUID, UrlData> m_RequestMap = 72 private Dictionary<UUID, UrlData> m_RequestMap =
68 new Dictionary<UUID, UrlData>(); 73 new Dictionary<UUID, UrlData>();
@@ -70,15 +75,23 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
70 private Dictionary<string, UrlData> m_UrlMap = 75 private Dictionary<string, UrlData> m_UrlMap =
71 new Dictionary<string, UrlData>(); 76 new Dictionary<string, UrlData>();
72 77
78
73 private int m_TotalUrls = 100; 79 private int m_TotalUrls = 100;
74 80
75 private IHttpServer m_HttpServer = null; 81 private IHttpServer m_HttpServer = null;
76 82
83 private string m_ExternalHostNameForLSL = "";
84
77 public Type ReplaceableInterface 85 public Type ReplaceableInterface
78 { 86 {
79 get { return null; } 87 get { return null; }
80 } 88 }
81 89
90 private Hashtable HandleHttpPoll(Hashtable request)
91 {
92 return new Hashtable();
93 }
94
82 public string Name 95 public string Name
83 { 96 {
84 get { return "UrlModule"; } 97 get { return "UrlModule"; }
@@ -86,6 +99,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
86 99
87 public void Initialise(IConfigSource config) 100 public void Initialise(IConfigSource config)
88 { 101 {
102 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName);
89 } 103 }
90 104
91 public void PostInitialise() 105 public void PostInitialise()
@@ -117,7 +131,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
117 public void Close() 131 public void Close()
118 { 132 {
119 } 133 }
120
121 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) 134 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
122 { 135 {
123 UUID urlcode = UUID.Random(); 136 UUID urlcode = UUID.Random();
@@ -129,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
129 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 142 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
130 return urlcode; 143 return urlcode;
131 } 144 }
132 string url = "http://"+System.Environment.MachineName+":"+m_HttpServer.Port.ToString()+"/lslhttp/"+urlcode.ToString()+"/"; 145 string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
133 146
134 UrlData urlData = new UrlData(); 147 UrlData urlData = new UrlData();
135 urlData.hostID = host.UUID; 148 urlData.hostID = host.UUID;
@@ -139,9 +152,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
139 urlData.urlcode = urlcode; 152 urlData.urlcode = urlcode;
140 urlData.requests = new Dictionary<UUID, RequestData>(); 153 urlData.requests = new Dictionary<UUID, RequestData>();
141 154
155
142 m_UrlMap[url] = urlData; 156 m_UrlMap[url] = urlData;
143 157
144 m_HttpServer.AddHTTPHandler("/lslhttp/"+urlcode.ToString()+"/", HttpRequestHandler); 158 string uri = "/lslhttp/" + urlcode.ToString() + "/";
159
160 m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll,
161 new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents,
162 urlcode));
145 163
146 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 164 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
147 } 165 }
@@ -165,7 +183,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
165 UrlData data; 183 UrlData data;
166 184
167 if (!m_UrlMap.TryGetValue(url, out data)) 185 if (!m_UrlMap.TryGetValue(url, out data))
186 {
168 return; 187 return;
188 }
169 189
170 foreach (UUID req in data.requests.Keys) 190 foreach (UUID req in data.requests.Keys)
171 m_RequestMap.Remove(req); 191 m_RequestMap.Remove(req);
@@ -174,13 +194,36 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
174 m_UrlMap.Remove(url); 194 m_UrlMap.Remove(url);
175 } 195 }
176 } 196 }
177 197
178 public void HttpResponse(UUID request, int status, string body) 198 public void HttpResponse(UUID request, int status, string body)
179 { 199 {
200 if (m_RequestMap.ContainsKey(request))
201 {
202 UrlData urlData = m_RequestMap[request];
203 urlData.requests[request].responseCode = status;
204 urlData.requests[request].responseBody = body;
205 //urlData.requests[request].ev.Set();
206 urlData.requests[request].requestDone =true;
207 }
208 else
209 {
210 m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
211 }
180 } 212 }
181 213
182 public string GetHttpHeader(UUID request, string header) 214 public string GetHttpHeader(UUID requestId, string header)
183 { 215 {
216 if (m_RequestMap.ContainsKey(requestId))
217 {
218 UrlData urlData=m_RequestMap[requestId];
219 string value;
220 if (urlData.requests[requestId].headers.TryGetValue(header,out value))
221 return value;
222 }
223 else
224 {
225 m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
226 }
184 return String.Empty; 227 return String.Empty;
185 } 228 }
186 229
@@ -233,26 +276,214 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
233 } 276 }
234 } 277 }
235 278
279
236 private void RemoveUrl(UrlData data) 280 private void RemoveUrl(UrlData data)
237 { 281 {
238 m_HttpServer.RemoveHTTPHandler("", "/lslhttp/"+data.urlcode.ToString()+"/"); 282 m_HttpServer.RemoveHTTPHandler("", "/lslhttp/"+data.urlcode.ToString()+"/");
239 } 283 }
240 284
241 private Hashtable HttpRequestHandler(Hashtable request) 285 private Hashtable NoEvents(UUID requestID, UUID sessionID)
242 { 286 {
243 string uri = request["uri"].ToString(); 287 Hashtable response = new Hashtable();
244 //A solution to this ugly mess would be to use only the /lslhttp/<UUID>/ part of the URI as the key. 288 UrlData url;
245 UrlData url = m_UrlMap["http://"+System.Environment.MachineName+":"+m_HttpServer.Port.ToString()+uri]; 289 lock (m_RequestMap)
290 {
291 if (!m_RequestMap.ContainsKey(requestID))
292 return response;
293 url = m_RequestMap[requestID];
294 }
295
296 if (System.Environment.TickCount - url.requests[requestID].startTime > 25000)
297 {
298 response["int_response_code"] = 500;
299 response["str_response_string"] = "Script timeout";
300 response["content_type"] = "text/plain";
301 response["keepalive"] = false;
302 response["reusecontext"] = false;
303
304 //remove from map
305 lock (url)
306 {
307 url.requests.Remove(requestID);
308 m_RequestMap.Remove(requestID);
309 }
310
311 return response;
312 }
313
314
315 return response;
316 }
317
318 private bool HasEvents(UUID requestID, UUID sessionID)
319 {
320 UrlData url=null;
246 321
247 //UUID.Random() below is a hack! Eventually we will do HTTP requests and responses properly. 322 lock (m_RequestMap)
248 url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { UUID.Random().ToString(), request["http-method"].ToString(), request["body"].ToString() }); 323 {
324 if (!m_RequestMap.ContainsKey(requestID))
325 {
326 return false;
327 }
328 url = m_RequestMap[requestID];
329 if (!url.requests.ContainsKey(requestID))
330 {
331 return false;
332 }
333 }
249 334
335 if (System.Environment.TickCount-url.requests[requestID].startTime>25000)
336 {
337 return true;
338 }
339
340 if (url.requests[requestID].requestDone)
341 return true;
342 else
343 return false;
344
345 }
346 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
347 {
348 UrlData url = null;
349 RequestData requestData = null;
350
351 lock (m_RequestMap)
352 {
353 if (!m_RequestMap.ContainsKey(requestID))
354 return NoEvents(requestID,sessionID);
355 url = m_RequestMap[requestID];
356 requestData = url.requests[requestID];
357 }
358
359 if (!requestData.requestDone)
360 return NoEvents(requestID,sessionID);
361
250 Hashtable response = new Hashtable(); 362 Hashtable response = new Hashtable();
251 response["int_response_code"] = 200; 363
252 response["str_response_string"] = "This is a generic response as OpenSim does not yet support proper responses. Your request has been passed to the object."; 364 if (System.Environment.TickCount - requestData.startTime > 25000)
365 {
366 response["int_response_code"] = 500;
367 response["str_response_string"] = "Script timeout";
368 response["content_type"] = "text/plain";
369 response["keepalive"] = false;
370 response["reusecontext"] = false;
371 return response;
372 }
373 //put response
374 response["int_response_code"] = requestData.responseCode;
375 response["str_response_string"] = requestData.responseBody;
376 response["content_type"] = "text/plain";
377 response["keepalive"] = false;
378 response["reusecontext"] = false;
379
380 //remove from map
381 lock (url)
382 {
383 url.requests.Remove(requestID);
384 m_RequestMap.Remove(requestID);
385 }
253 386
254 return response; 387 return response;
255 } 388 }
389 public void HttpRequestHandler(UUID requestID, Hashtable request)
390 {
391 lock (request)
392 {
393 string uri = request["uri"].ToString();
394
395 try
396 {
397 Hashtable headers = (Hashtable)request["headers"];
398
399// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
400
401 int pos1 = uri.IndexOf("/");// /lslhttp
402 int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
403 int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
404 string uri_tmp = uri.Substring(0, pos3 + 1);
405 //HTTP server code doesn't provide us with QueryStrings
406 string pathInfo;
407 string queryString;
408 queryString = "";
409
410 pathInfo = uri.Substring(pos3);
411
412 UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
413
414 //for llGetHttpHeader support we need to store original URI here
415 //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
416 //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader
417
418 RequestData requestData = new RequestData();
419 requestData.requestID = requestID;
420 requestData.requestDone = false;
421 requestData.startTime = System.Environment.TickCount;
422 requestData.uri = uri;
423 if (requestData.headers == null)
424 requestData.headers = new Dictionary<string, string>();
425
426 foreach (DictionaryEntry header in headers)
427 {
428 string key = (string)header.Key;
429 string value = (string)header.Value;
430 requestData.headers.Add(key, value);
431 }
432 foreach (DictionaryEntry de in request)
433 {
434 if (de.Key.ToString() == "querystringkeys")
435 {
436 System.String[] keys = (System.String[])de.Value;
437 foreach (String key in keys)
438 {
439 if (request.ContainsKey(key))
440 {
441 string val = (String)request[key];
442 queryString = queryString + key + "=" + val + "&";
443 }
444 }
445 if (queryString.Length > 1)
446 queryString = queryString.Substring(0, queryString.Length - 1);
447
448 }
449
450 }
451
452 //if this machine is behind DNAT/port forwarding, currently this is being
453 //set to address of port forwarding router
454 requestData.headers["x-remote-ip"] = requestData.headers["remote_addr"];
455 requestData.headers["x-path-info"] = pathInfo;
456 requestData.headers["x-query-string"] = queryString;
457 requestData.headers["x-script-url"] = url.url;
458
459 requestData.ev = new ManualResetEvent(false);
460 lock (url.requests)
461 {
462 url.requests.Add(requestID, requestData);
463 }
464 lock (m_RequestMap)
465 {
466 //add to request map
467 m_RequestMap.Add(requestID, url);
468 }
469
470 url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() });
471
472 //send initial response?
473// Hashtable response = new Hashtable();
474
475 return;
476
477 }
478 catch (Exception we)
479 {
480 //Hashtable response = new Hashtable();
481 m_log.Warn("[HttpRequestHandler]: http-in request failed");
482 m_log.Warn(we.Message);
483 m_log.Warn(we.StackTrace);
484 }
485 }
486 }
256 487
257 private void OnScriptReset(uint localID, UUID itemID) 488 private void OnScriptReset(uint localID, UUID itemID)
258 { 489 {
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index bea6222..d57a8e5 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
184 string value = ""; 184 string value = "";
185 185
186 if (nvp[0] != null) 186 if (nvp[0] != null)
187 { 187 {
188 name = nvp[0].Trim(); 188 name = nvp[0].Trim();
189 } 189 }
190 190
@@ -291,10 +291,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
291 temp = 128; 291 temp = 128;
292 292
293 width = temp; 293 width = temp;
294 height = temp; 294 height = temp;
295 } 295 }
296 } 296 }
297 break; 297 break;
298 } 298 }
299 } 299 }
300 300
@@ -410,7 +410,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
410 Font myFont = new Font(fontName, fontSize); 410 Font myFont = new Font(fontName, fontSize);
411 SolidBrush myBrush = new SolidBrush(Color.Black); 411 SolidBrush myBrush = new SolidBrush(Color.Black);
412 412
413 char[] lineDelimiter = {dataDelim}; 413 char[] lineDelimiter = {dataDelim};
414 char[] partsDelimiter = {','}; 414 char[] partsDelimiter = {','};
415 string[] lines = data.Split(lineDelimiter); 415 string[] lines = data.Split(lineDelimiter);
416 416
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs
new file mode 100644
index 0000000..92db15b
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs
@@ -0,0 +1,134 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Reflection;
30using System.Collections.Generic;
31using log4net;
32using Nini.Config;
33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base;
39using OpenSim.Server.Handlers.Grid;
40using OpenSim.Services.Interfaces;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
42
43namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
44{
45 public class HypergridServiceInConnectorModule : ISharedRegionModule
46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private static bool m_Enabled = false;
49
50 private IConfigSource m_Config;
51 bool m_Registered = false;
52 HypergridServiceInConnector m_HypergridHandler;
53
54 #region IRegionModule interface
55
56 public void Initialise(IConfigSource config)
57 {
58 //// This module is only on for standalones in hypergrid mode
59 //enabled = (!config.Configs["Startup"].GetBoolean("gridmode", true)) &&
60 // config.Configs["Startup"].GetBoolean("hypergrid", true);
61 //m_log.DebugFormat("[RegionInventoryService]: enabled? {0}", enabled);
62 m_Config = config;
63 IConfig moduleConfig = config.Configs["Modules"];
64 if (moduleConfig != null)
65 {
66 m_Enabled = moduleConfig.GetBoolean("HypergridServiceInConnector", false);
67 if (m_Enabled)
68 {
69 m_log.Info("[HGGRID IN CONNECTOR]: Hypergrid Service In Connector enabled");
70 }
71
72 }
73
74 }
75
76 public void PostInitialise()
77 {
78 }
79
80 public void Close()
81 {
82 }
83
84 public Type ReplaceableInterface
85 {
86 get { return null; }
87 }
88
89 public string Name
90 {
91 get { return "HypergridService"; }
92 }
93
94 public void AddRegion(Scene scene)
95 {
96 if (!m_Enabled)
97 return;
98
99 }
100
101 public void RemoveRegion(Scene scene)
102 {
103 if (!m_Enabled)
104 return;
105
106 GridRegion rinfo = new GridRegion(scene.RegionInfo);
107 m_HypergridHandler.RemoveRegion(rinfo);
108 }
109
110 public void RegionLoaded(Scene scene)
111 {
112 if (!m_Enabled)
113 return;
114
115 if (!m_Registered)
116 {
117 m_Registered = true;
118
119 m_log.Info("[HypergridService]: Starting...");
120
121 Object[] args = new Object[] { m_Config, MainServer.Instance };
122
123 m_HypergridHandler = new HypergridServiceInConnector(m_Config, MainServer.Instance, scene.RequestModuleInterface<IHyperlinkService>());
124 //ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args);
125 }
126
127 GridRegion rinfo = new GridRegion(scene.RegionInfo);
128 m_HypergridHandler.AddRegion(rinfo);
129 }
130
131 #endregion
132
133 }
134}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
index a31ce8e..8a90370 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour
121 121
122 #region INeighbourService 122 #region INeighbourService
123 123
124 public bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 124 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
125 { 125 {
126 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", 126 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
127 thisRegion.RegionName, regionHandle, m_Scenes.Count); 127 thisRegion.RegionName, regionHandle, m_Scenes.Count);
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour
134 } 134 }
135 } 135 }
136 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle); 136 m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle);
137 return false; 137 return null;
138 } 138 }
139 139
140 #endregion INeighbourService 140 #endregion INeighbourService
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
index e69613a..85a1ac3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
134 134
135 public bool IsAuthorizedForRegion(string userID, string regionID, out string message) 135 public bool IsAuthorizedForRegion(string userID, string regionID, out string message)
136 { 136 {
137 return m_AuthorizationService.IsAuthorizedForRegion(userID, regionID, out message); 137 return m_AuthorizationService.IsAuthorizedForRegion(userID, regionID, out message);
138 } 138 }
139 139
140 } 140 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
index a672f4f..fca2df2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
146 else 146 else
147 { 147 {
148 m_log.ErrorFormat("[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0} ",regionID); 148 m_log.ErrorFormat("[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0} ",regionID);
149 } 149 }
150 150
151 151
152 return isAuthorized; 152 return isAuthorized;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
new file mode 100644
index 0000000..0974372
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGCommands.cs
@@ -0,0 +1,303 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Xml;
32using log4net;
33using Nini.Config;
34using OpenSim.Framework;
35//using OpenSim.Framework.Communications;
36using OpenSim.Framework.Console;
37using OpenSim.Region.Framework;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.Framework.Scenes.Hypergrid;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{
44 public class HGCommands
45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private HGGridConnector m_HGGridConnector;
48 private Scene m_scene;
49
50 private static uint m_autoMappingX = 0;
51 private static uint m_autoMappingY = 0;
52 private static bool m_enableAutoMapping = false;
53
54 public HGCommands(HGGridConnector hgConnector, Scene scene)
55 {
56 m_HGGridConnector = hgConnector;
57 m_scene = scene;
58 }
59
60 //public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
61 // StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
62 //{
63 // HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices);
64
65 // return
66 // new HGScene(
67 // regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
68 // m_moduleLoader, false, m_configSettings.PhysicalPrim,
69 // m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
70 //}
71
72 public void RunCommand(string module, string[] cmdparams)
73 {
74 List<string> args = new List<string>(cmdparams);
75 if (args.Count < 1)
76 return;
77
78 string command = args[0];
79 args.RemoveAt(0);
80
81 cmdparams = args.ToArray();
82
83 RunHGCommand(command, cmdparams);
84
85 }
86
87 private void RunHGCommand(string command, string[] cmdparams)
88 {
89 if (command.Equals("link-mapping"))
90 {
91 if (cmdparams.Length == 2)
92 {
93 try
94 {
95 m_autoMappingX = Convert.ToUInt32(cmdparams[0]);
96 m_autoMappingY = Convert.ToUInt32(cmdparams[1]);
97 m_enableAutoMapping = true;
98 }
99 catch (Exception)
100 {
101 m_autoMappingX = 0;
102 m_autoMappingY = 0;
103 m_enableAutoMapping = false;
104 }
105 }
106 }
107 else if (command.Equals("link-region"))
108 {
109 if (cmdparams.Length < 3)
110 {
111 if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
112 {
113 LoadXmlLinkFile(cmdparams);
114 }
115 else
116 {
117 LinkRegionCmdUsage();
118 }
119 return;
120 }
121
122 if (cmdparams[2].Contains(":"))
123 {
124 // New format
125 int xloc, yloc;
126 string mapName;
127 try
128 {
129 xloc = Convert.ToInt32(cmdparams[0]);
130 yloc = Convert.ToInt32(cmdparams[1]);
131 mapName = cmdparams[2];
132 if (cmdparams.Length > 3)
133 for (int i = 3; i < cmdparams.Length; i++)
134 mapName += " " + cmdparams[i];
135
136 m_log.Info(">> MapName: " + mapName);
137 //internalPort = Convert.ToUInt32(cmdparams[4]);
138 //remotingPort = Convert.ToUInt32(cmdparams[5]);
139 }
140 catch (Exception e)
141 {
142 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
143 LinkRegionCmdUsage();
144 return;
145 }
146
147 // Convert cell coordinates given by the user to meters
148 xloc = xloc * (int)Constants.RegionSize;
149 yloc = yloc * (int)Constants.RegionSize;
150 m_HGGridConnector.TryLinkRegionToCoords(m_scene, null, mapName, xloc, yloc);
151 }
152 else
153 {
154 // old format
155 GridRegion regInfo;
156 int xloc, yloc;
157 uint externalPort;
158 string externalHostName;
159 try
160 {
161 xloc = Convert.ToInt32(cmdparams[0]);
162 yloc = Convert.ToInt32(cmdparams[1]);
163 externalPort = Convert.ToUInt32(cmdparams[3]);
164 externalHostName = cmdparams[2];
165 //internalPort = Convert.ToUInt32(cmdparams[4]);
166 //remotingPort = Convert.ToUInt32(cmdparams[5]);
167 }
168 catch (Exception e)
169 {
170 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
171 LinkRegionCmdUsage();
172 return;
173 }
174
175 // Convert cell coordinates given by the user to meters
176 xloc = xloc * (int)Constants.RegionSize;
177 yloc = yloc * (int)Constants.RegionSize;
178 if (m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo))
179 {
180 if (cmdparams.Length >= 5)
181 {
182 regInfo.RegionName = "";
183 for (int i = 4; i < cmdparams.Length; i++)
184 regInfo.RegionName += cmdparams[i] + " ";
185 }
186 }
187 }
188 return;
189 }
190 else if (command.Equals("unlink-region"))
191 {
192 if (cmdparams.Length < 1)
193 {
194 UnlinkRegionCmdUsage();
195 return;
196 }
197 if (m_HGGridConnector.TryUnlinkRegion(m_scene, cmdparams[0]))
198 m_log.InfoFormat("[HGrid]: Successfully unlinked {0}", cmdparams[0]);
199 else
200 m_log.InfoFormat("[HGrid]: Unable to unlink {0}, region not found", cmdparams[0]);
201 }
202 }
203
204 private void LoadXmlLinkFile(string[] cmdparams)
205 {
206 //use http://www.hgurl.com/hypergrid.xml for test
207 try
208 {
209 XmlReader r = XmlReader.Create(cmdparams[0]);
210 XmlConfigSource cs = new XmlConfigSource(r);
211 string[] excludeSections = null;
212
213 if (cmdparams.Length == 2)
214 {
215 if (cmdparams[1].ToLower().StartsWith("excludelist:"))
216 {
217 string excludeString = cmdparams[1].ToLower();
218 excludeString = excludeString.Remove(0, 12);
219 char[] splitter = { ';' };
220
221 excludeSections = excludeString.Split(splitter);
222 }
223 }
224
225 for (int i = 0; i < cs.Configs.Count; i++)
226 {
227 bool skip = false;
228 if ((excludeSections != null) && (excludeSections.Length > 0))
229 {
230 for (int n = 0; n < excludeSections.Length; n++)
231 {
232 if (excludeSections[n] == cs.Configs[i].Name.ToLower())
233 {
234 skip = true;
235 break;
236 }
237 }
238 }
239 if (!skip)
240 {
241 ReadLinkFromConfig(cs.Configs[i]);
242 }
243 }
244 }
245 catch (Exception e)
246 {
247 m_log.Error(e.ToString());
248 }
249 }
250
251
252 private void ReadLinkFromConfig(IConfig config)
253 {
254 GridRegion regInfo;
255 int xloc, yloc;
256 uint externalPort;
257 string externalHostName;
258 uint realXLoc, realYLoc;
259
260 xloc = Convert.ToInt32(config.GetString("xloc", "0"));
261 yloc = Convert.ToInt32(config.GetString("yloc", "0"));
262 externalPort = Convert.ToUInt32(config.GetString("externalPort", "0"));
263 externalHostName = config.GetString("externalHostName", "");
264 realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0"));
265 realYLoc = Convert.ToUInt32(config.GetString("real-yloc", "0"));
266
267 if (m_enableAutoMapping)
268 {
269 xloc = (int)((xloc % 100) + m_autoMappingX);
270 yloc = (int)((yloc % 100) + m_autoMappingY);
271 }
272
273 if (((realXLoc == 0) && (realYLoc == 0)) ||
274 (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
275 ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
276 {
277 xloc = xloc * (int)Constants.RegionSize;
278 yloc = yloc * (int)Constants.RegionSize;
279 if (
280 m_HGGridConnector.TryCreateLink(m_scene, null, xloc, yloc, "", externalPort,
281 externalHostName, out regInfo))
282 {
283 regInfo.RegionName = config.GetString("localName", "");
284 }
285 }
286 }
287
288
289 private void LinkRegionCmdUsage()
290 {
291 m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>]");
292 m_log.Info("Usage: link-region <Xloc> <Yloc> <HostName> <HttpPort> [<LocalName>]");
293 m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]");
294 }
295
296 private void UnlinkRegionCmdUsage()
297 {
298 m_log.Info("Usage: unlink-region <HostName>:<HttpPort>");
299 m_log.Info("Usage: unlink-region <LocalName>");
300 }
301
302 }
303}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
new file mode 100644
index 0000000..148331b
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -0,0 +1,795 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Net;
31using System.Reflection;
32using System.Xml;
33
34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Region.Framework.Scenes.Hypergrid;
39using OpenSim.Services.Interfaces;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41using OpenSim.Server.Base;
42using OpenSim.Services.Connectors.Grid;
43using OpenSim.Framework.Console;
44
45using OpenMetaverse;
46using log4net;
47using Nini.Config;
48
49namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
50{
51 public class HGGridConnector : ISharedRegionModule, IGridService, IHyperlinkService
52 {
53 private static readonly ILog m_log =
54 LogManager.GetLogger(
55 MethodBase.GetCurrentMethod().DeclaringType);
56 private static string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI;
57
58 private bool m_Enabled = false;
59 private bool m_Initialized = false;
60
61 private Scene m_aScene;
62 private Dictionary<ulong, Scene> m_LocalScenes = new Dictionary<ulong, Scene>();
63
64 private IGridService m_GridServiceConnector;
65 private HypergridServiceConnector m_HypergridServiceConnector;
66
67 // Hyperlink regions are hyperlinks on the map
68 protected Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
69
70 // Known regions are home regions of visiting foreign users.
71 // They are not on the map as static hyperlinks. They are dynamic hyperlinks, they go away when
72 // the visitor goes away. They are mapped to X=0 on the map.
73 // This is key-ed on agent ID
74 protected Dictionary<UUID, GridRegion> m_knownRegions = new Dictionary<UUID, GridRegion>();
75
76 protected Dictionary<UUID, ulong> m_HyperlinkHandles = new Dictionary<UUID, ulong>();
77
78 #region ISharedRegionModule
79
80 public Type ReplaceableInterface
81 {
82 get { return null; }
83 }
84
85 public string Name
86 {
87 get { return "HGGridServicesConnector"; }
88 }
89
90 public void Initialise(IConfigSource source)
91 {
92 IConfig moduleConfig = source.Configs["Modules"];
93 if (moduleConfig != null)
94 {
95 string name = moduleConfig.GetString("GridServices", "");
96 if (name == Name)
97 {
98 IConfig gridConfig = source.Configs["GridService"];
99 if (gridConfig == null)
100 {
101 m_log.Error("[HGGRID CONNECTOR]: GridService missing from OpenSim.ini");
102 return;
103 }
104
105
106 InitialiseConnectorModule(source);
107
108 m_Enabled = true;
109 m_log.Info("[HGGRID CONNECTOR]: HG grid enabled");
110 }
111 }
112 }
113
114 private void InitialiseConnectorModule(IConfigSource source)
115 {
116 IConfig gridConfig = source.Configs["GridService"];
117 if (gridConfig == null)
118 {
119 m_log.Error("[HGGRID CONNECTOR]: GridService missing from OpenSim.ini");
120 throw new Exception("Grid connector init error");
121 }
122
123 string module = gridConfig.GetString("GridServiceConnectorModule", String.Empty);
124 if (module == String.Empty)
125 {
126 m_log.Error("[HGGRID CONNECTOR]: No GridServiceConnectorModule named in section GridService");
127 //return;
128 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
129 }
130
131 Object[] args = new Object[] { source };
132 m_GridServiceConnector = ServerUtils.LoadPlugin<IGridService>(module, args);
133
134 }
135
136 public void PostInitialise()
137 {
138 if (m_Enabled)
139 ((ISharedRegionModule)m_GridServiceConnector).PostInitialise();
140 }
141
142 public void Close()
143 {
144 }
145
146 public void AddRegion(Scene scene)
147 {
148 if (!m_Enabled)
149 return;
150
151 m_LocalScenes[scene.RegionInfo.RegionHandle] = scene;
152 scene.RegisterModuleInterface<IGridService>(this);
153 scene.RegisterModuleInterface<IHyperlinkService>(this);
154
155 ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene);
156
157 }
158
159 public void RemoveRegion(Scene scene)
160 {
161 if (m_Enabled)
162 {
163 m_LocalScenes.Remove(scene.RegionInfo.RegionHandle);
164 ((ISharedRegionModule)m_GridServiceConnector).RemoveRegion(scene);
165 }
166 }
167
168 public void RegionLoaded(Scene scene)
169 {
170 if (!m_Enabled)
171 return;
172
173 if (!m_Initialized)
174 {
175 m_aScene = scene;
176 LocalAssetServerURI = m_aScene.CommsManager.NetworkServersInfo.UserURL;
177 LocalInventoryServerURI = m_aScene.CommsManager.NetworkServersInfo.InventoryURL;
178 LocalUserServerURI = m_aScene.CommsManager.NetworkServersInfo.UserURL;
179
180 m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService);
181
182 HGCommands hgCommands = new HGCommands(this, scene);
183 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region",
184 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
185 "Link a hypergrid region", hgCommands.RunCommand);
186 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlink-region",
187 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
188 "Unlink a hypergrid region", hgCommands.RunCommand);
189 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
190 "Set local coordinate to map HG regions to", hgCommands.RunCommand);
191
192 // Yikes!! Remove this as soon as user services get refactored
193 HGNetworkServersInfo.Init(LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI);
194
195 m_Initialized = true;
196 }
197 }
198
199 #endregion
200
201 #region IGridService
202
203 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
204 {
205 // Region doesn't exist here. Trying to link remote region
206 if (regionInfo.RegionID.Equals(UUID.Zero))
207 {
208 m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort);
209 ulong regionHandle = 0;
210 regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo, out regionHandle);
211 if (!regionInfo.RegionID.Equals(UUID.Zero))
212 {
213 AddHyperlinkRegion(regionInfo, regionHandle);
214 m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID);
215
216 // Try get the map image
217 m_HypergridServiceConnector.GetMapImage(regionInfo);
218 return true;
219 }
220 else
221 {
222 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")");
223 return false;
224 }
225 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners
226 }
227 else // normal grid
228 return m_GridServiceConnector.RegisterRegion(scopeID, regionInfo);
229 }
230
231 public bool DeregisterRegion(UUID regionID)
232 {
233 // Try the hyperlink collection
234 if (m_HyperlinkRegions.ContainsKey(regionID))
235 {
236 RemoveHyperlinkRegion(regionID);
237 return true;
238 }
239 // Try the foreign users home collection
240
241 foreach (GridRegion r in m_knownRegions.Values)
242 if (r.RegionID == regionID)
243 {
244 RemoveHyperlinkHomeRegion(regionID);
245 return true;
246 }
247
248 // Finally, try the normal route
249 return m_GridServiceConnector.DeregisterRegion(regionID);
250 }
251
252 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
253 {
254 // No serving neighbours on hyperliked regions.
255 // Just the regular regions.
256 return m_GridServiceConnector.GetNeighbours(scopeID, regionID);
257 }
258
259 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
260 {
261 // Try the hyperlink collection
262 if (m_HyperlinkRegions.ContainsKey(regionID))
263 return m_HyperlinkRegions[regionID];
264
265 // Try the foreign users home collection
266 foreach (GridRegion r in m_knownRegions.Values)
267 if (r.RegionID == regionID)
268 return r;
269
270 // Finally, try the normal route
271 return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID);
272 }
273
274 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
275 {
276 int snapX = (int) (x / Constants.RegionSize) * (int)Constants.RegionSize;
277 int snapY = (int) (y / Constants.RegionSize) * (int)Constants.RegionSize;
278 // Try the hyperlink collection
279 foreach (GridRegion r in m_HyperlinkRegions.Values)
280 {
281 if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY))
282 return r;
283 }
284
285 // Try the foreign users home collection
286 foreach (GridRegion r in m_knownRegions.Values)
287 {
288 if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY))
289 {
290 return r;
291 }
292 }
293
294 // Finally, try the normal route
295 return m_GridServiceConnector.GetRegionByPosition(scopeID, x, y);
296 }
297
298 public GridRegion GetRegionByName(UUID scopeID, string regionName)
299 {
300 // Try normal grid first
301 GridRegion region = m_GridServiceConnector.GetRegionByName(scopeID, regionName);
302 if (region != null)
303 return region;
304
305 // Try the hyperlink collection
306 foreach (GridRegion r in m_HyperlinkRegions.Values)
307 {
308 if (r.RegionName == regionName)
309 return r;
310 }
311
312 // Try the foreign users home collection
313 foreach (GridRegion r in m_knownRegions.Values)
314 {
315 if (r.RegionName == regionName)
316 return r;
317 }
318 return null;
319 }
320
321 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
322 {
323 List<GridRegion> rinfos = new List<GridRegion>();
324
325 // Commenting until regionname exists
326 //foreach (SimpleRegionInfo r in m_HyperlinkRegions.Values)
327 // if ((r.RegionName != null) && r.RegionName.StartsWith(name))
328 // rinfos.Add(r);
329
330 rinfos.AddRange(m_GridServiceConnector.GetRegionsByName(scopeID, name, maxNumber));
331 return rinfos;
332 }
333
334 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
335 {
336 int snapXmin = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
337 int snapXmax = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize;
338 int snapYmin = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize;
339 int snapYmax = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize;
340
341 List<GridRegion> rinfos = new List<GridRegion>();
342 foreach (GridRegion r in m_HyperlinkRegions.Values)
343 if ((r.RegionLocX > snapXmin) && (r.RegionLocX < snapYmax) &&
344 (r.RegionLocY > snapYmin) && (r.RegionLocY < snapYmax))
345 rinfos.Add(r);
346
347 rinfos.AddRange(m_GridServiceConnector.GetRegionRange(scopeID, xmin, xmax, ymin, ymax));
348
349 return rinfos;
350 }
351
352 #endregion
353
354 #region Auxiliary
355
356 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle)
357 {
358 m_HyperlinkRegions[regionInfo.RegionID] = regionInfo;
359 m_HyperlinkHandles[regionInfo.RegionID] = regionHandle;
360 }
361
362 private void RemoveHyperlinkRegion(UUID regionID)
363 {
364 m_HyperlinkRegions.Remove(regionID);
365 m_HyperlinkHandles.Remove(regionID);
366 }
367
368 private void AddHyperlinkHomeRegion(UUID userID, GridRegion regionInfo, ulong regionHandle)
369 {
370 m_knownRegions[userID] = regionInfo;
371 m_HyperlinkHandles[regionInfo.RegionID] = regionHandle;
372 }
373
374 private void RemoveHyperlinkHomeRegion(UUID regionID)
375 {
376 foreach (KeyValuePair<UUID, GridRegion> kvp in m_knownRegions)
377 {
378 if (kvp.Value.RegionID == regionID)
379 {
380 m_knownRegions.Remove(kvp.Key);
381 }
382 }
383 m_HyperlinkHandles.Remove(regionID);
384 }
385 #endregion
386
387 #region IHyperlinkService
388
389 private static Random random = new Random();
390
391
392 public GridRegion TryLinkRegionToCoords(Scene m_scene, IClientAPI client, string mapName, int xloc, int yloc)
393 {
394 string host = "127.0.0.1";
395 string portstr;
396 string regionName = "";
397 uint port = 9000;
398 string[] parts = mapName.Split(new char[] { ':' });
399 if (parts.Length >= 1)
400 {
401 host = parts[0];
402 }
403 if (parts.Length >= 2)
404 {
405 portstr = parts[1];
406 if (!UInt32.TryParse(portstr, out port))
407 regionName = parts[1];
408 }
409 // always take the last one
410 if (parts.Length >= 3)
411 {
412 regionName = parts[2];
413 }
414
415 // Sanity check. Don't ever link to this sim.
416 IPAddress ipaddr = null;
417 try
418 {
419 ipaddr = Util.GetHostFromDNS(host);
420 }
421 catch { }
422
423 if ((ipaddr != null) &&
424 !((m_scene.RegionInfo.ExternalEndPoint.Address.Equals(ipaddr)) && (m_scene.RegionInfo.HttpPort == port)))
425 {
426 GridRegion regInfo;
427 bool success = TryCreateLink(m_scene, client, xloc, yloc, regionName, port, host, out regInfo);
428 if (success)
429 {
430 regInfo.RegionName = mapName;
431 return regInfo;
432 }
433 }
434
435 return null;
436 }
437
438
439 // From the map search and secondlife://blah
440 public GridRegion TryLinkRegion(Scene m_scene, IClientAPI client, string mapName)
441 {
442 int xloc = random.Next(0, Int16.MaxValue) * (int) Constants.RegionSize;
443 return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0);
444 }
445
446 public bool TryCreateLink(Scene m_scene, IClientAPI client, int xloc, int yloc,
447 string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo)
448 {
449 m_log.DebugFormat("[HGrid]: Link to {0}:{1}, in {2}-{3}", externalHostName, externalPort, xloc, yloc);
450
451 regInfo = new GridRegion();
452 regInfo.RegionName = externalRegionName;
453 regInfo.HttpPort = externalPort;
454 regInfo.ExternalHostName = externalHostName;
455 regInfo.RegionLocX = xloc;
456 regInfo.RegionLocY = yloc;
457
458 try
459 {
460 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
461 }
462 catch (Exception e)
463 {
464 m_log.Warn("[HGrid]: Wrong format for link-region: " + e.Message);
465 return false;
466 }
467
468 // Finally, link it
469 if (!RegisterRegion(UUID.Zero, regInfo))
470 {
471 m_log.Warn("[HGrid]: Unable to link region");
472 return false;
473 }
474
475 int x, y;
476 if (!Check4096(m_scene, regInfo, out x, out y))
477 {
478 DeregisterRegion(regInfo.RegionID);
479 if (client != null)
480 client.SendAlertMessage("Region is too far (" + x + ", " + y + ")");
481 m_log.Info("[HGrid]: Unable to link, region is too far (" + x + ", " + y + ")");
482 return false;
483 }
484
485 if (!CheckCoords(m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, x, y))
486 {
487 DeregisterRegion(regInfo.RegionID);
488 if (client != null)
489 client.SendAlertMessage("Region has incompatible coordinates (" + x + ", " + y + ")");
490 m_log.Info("[HGrid]: Unable to link, region has incompatible coordinates (" + x + ", " + y + ")");
491 return false;
492 }
493
494 m_log.Debug("[HGrid]: link region succeeded");
495 return true;
496 }
497
498 public bool TryUnlinkRegion(Scene m_scene, string mapName)
499 {
500 GridRegion regInfo = null;
501 if (mapName.Contains(":"))
502 {
503 string host = "127.0.0.1";
504 //string portstr;
505 //string regionName = "";
506 uint port = 9000;
507 string[] parts = mapName.Split(new char[] { ':' });
508 if (parts.Length >= 1)
509 {
510 host = parts[0];
511 }
512 // if (parts.Length >= 2)
513 // {
514 // portstr = parts[1];
515 // if (!UInt32.TryParse(portstr, out port))
516 // regionName = parts[1];
517 // }
518 // always take the last one
519 // if (parts.Length >= 3)
520 // {
521 // regionName = parts[2];
522 // }
523 foreach (GridRegion r in m_HyperlinkRegions.Values)
524 if (host.Equals(r.ExternalHostName) && (port == r.HttpPort))
525 regInfo = r;
526 }
527 else
528 {
529 foreach (GridRegion r in m_HyperlinkRegions.Values)
530 if (r.RegionName.Equals(mapName))
531 regInfo = r;
532 }
533 if (regInfo != null)
534 {
535 return DeregisterRegion(regInfo.RegionID);
536 }
537 else
538 {
539 m_log.InfoFormat("[HGrid]: Region {0} not found", mapName);
540 return false;
541 }
542 }
543
544 /// <summary>
545 /// Cope with this viewer limitation.
546 /// </summary>
547 /// <param name="regInfo"></param>
548 /// <returns></returns>
549 public bool Check4096(Scene m_scene, GridRegion regInfo, out int x, out int y)
550 {
551 ulong realHandle = m_HyperlinkHandles[regInfo.RegionID];
552 uint ux = 0, uy = 0;
553 Utils.LongToUInts(realHandle, out ux, out uy);
554 x = (int)(ux / Constants.RegionSize);
555 y = (int)(uy / Constants.RegionSize);
556
557 if ((Math.Abs((int)m_scene.RegionInfo.RegionLocX - x) >= 4096) ||
558 (Math.Abs((int)m_scene.RegionInfo.RegionLocY - y) >= 4096))
559 {
560 return false;
561 }
562 return true;
563 }
564
565 public bool CheckCoords(uint thisx, uint thisy, int x, int y)
566 {
567 if ((thisx == x) && (thisy == y))
568 return false;
569 return true;
570 }
571
572 public GridRegion TryLinkRegion(IClientAPI client, string regionDescriptor)
573 {
574 return TryLinkRegion((Scene)client.Scene, client, regionDescriptor);
575 }
576
577 public GridRegion GetHyperlinkRegion(ulong handle)
578 {
579 foreach (GridRegion r in m_HyperlinkRegions.Values)
580 if (r.RegionHandle == handle)
581 return r;
582 foreach (GridRegion r in m_knownRegions.Values)
583 if (r.RegionHandle == handle)
584 return r;
585 return null;
586 }
587
588 public ulong FindRegionHandle(ulong handle)
589 {
590 foreach (GridRegion r in m_HyperlinkRegions.Values)
591 if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID)))
592 return m_HyperlinkHandles[r.RegionID];
593
594 foreach (GridRegion r in m_knownRegions.Values)
595 if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID)))
596 return m_HyperlinkHandles[r.RegionID];
597
598 return handle;
599 }
600
601 public bool SendUserInformation(GridRegion regInfo, AgentCircuitData agentData)
602 {
603 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID);
604
605 if ((IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) ||
606 (!IsLocalUser(uinfo) && !IsGoingHome(uinfo, regInfo)))
607 {
608 m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere");
609
610 // Set the position of the region on the remote grid
611 ulong realHandle = FindRegionHandle(regInfo.RegionHandle);
612 uint x = 0, y = 0;
613 Utils.LongToUInts(regInfo.RegionHandle, out x, out y);
614 GridRegion clonedRegion = new GridRegion(regInfo);
615 clonedRegion.RegionLocX = (int)x;
616 clonedRegion.RegionLocY = (int)y;
617
618 // Get the user's home region information
619 GridRegion home = m_aScene.GridService.GetRegionByUUID(m_aScene.RegionInfo.ScopeID, uinfo.UserProfile.HomeRegionID);
620
621 // Get the user's service URLs
622 string serverURI = "";
623 if (uinfo.UserProfile is ForeignUserProfileData)
624 serverURI = Util.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI);
625 string userServer = (serverURI == "") || (serverURI == null) ? LocalUserServerURI : serverURI;
626
627 string assetServer = Util.ServerURI(uinfo.UserProfile.UserAssetURI);
628 if ((assetServer == null) || (assetServer == ""))
629 assetServer = LocalAssetServerURI;
630
631 string inventoryServer = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
632 if ((inventoryServer == null) || (inventoryServer == ""))
633 inventoryServer = LocalInventoryServerURI;
634
635 if (!m_HypergridServiceConnector.InformRegionOfUser(clonedRegion, agentData, home, userServer, assetServer, inventoryServer))
636 {
637 m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
638 return false;
639 }
640 }
641 //if ((uinfo == null) || !IsGoingHome(uinfo, regInfo))
642 //{
643 // m_log.Info("[HGrid]: User seems to be going to foreign region.");
644 // if (!InformRegionOfUser(regInfo, agentData))
645 // {
646 // m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
647 // return false;
648 // }
649 //}
650 //else
651 // m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
652
653 // May need to change agent's name
654 if (IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null))
655 {
656 agentData.firstname = agentData.firstname + "." + agentData.lastname;
657 agentData.lastname = "@" + LocalUserServerURI.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI;
658 }
659
660 return true;
661 }
662
663 public void AdjustUserInformation(AgentCircuitData agentData)
664 {
665 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID);
666 if ((uinfo != null) && (uinfo.UserProfile != null) &&
667 (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData)))
668 {
669 //m_log.Debug("---------------> Local User!");
670 string[] parts = agentData.firstname.Split(new char[] { '.' });
671 if (parts.Length == 2)
672 {
673 agentData.firstname = parts[0];
674 agentData.lastname = parts[1];
675 }
676 }
677 //else
678 // m_log.Debug("---------------> Foreign User!");
679 }
680
681 // Check if a local user exists with the same UUID as the incoming foreign user
682 public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome)
683 {
684 comingHome = false;
685 if (!m_aScene.SceneGridService.RegionLoginsEnabled)
686 return false;
687
688 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
689 if (uinfo != null)
690 {
691 // uh-oh we have a potential intruder
692 if (uinfo.SessionID != sessionID)
693 // can't have a foreigner with a local UUID
694 return false;
695 else
696 // oh, so it's you! welcome back
697 comingHome = true;
698 }
699
700 // OK, user can come in
701 return true;
702 }
703
704 public void AcceptUser(ForeignUserProfileData user, GridRegion home)
705 {
706 m_aScene.CommsManager.UserProfileCacheService.PreloadUserCache(user);
707 ulong realHandle = home.RegionHandle;
708 // Change the local coordinates
709 // X=0 on the map
710 home.RegionLocX = 0;
711 home.RegionLocY = random.Next(0, 10000) * (int)Constants.RegionSize;
712
713 AddHyperlinkHomeRegion(user.ID, home, realHandle);
714
715 DumpUserData(user);
716 DumpRegionData(home);
717
718 }
719
720 public bool IsLocalUser(UUID userID)
721 {
722 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
723 return IsLocalUser(uinfo);
724 }
725
726 #endregion
727
728 #region IHyperlink Misc
729
730 protected bool IsComingHome(ForeignUserProfileData userData)
731 {
732 return (userData.UserServerURI == LocalUserServerURI);
733 }
734
735 // Is the user going back to the home region or the home grid?
736 protected bool IsGoingHome(CachedUserInfo uinfo, GridRegion rinfo)
737 {
738 if (uinfo.UserProfile == null)
739 return false;
740
741 if (!(uinfo.UserProfile is ForeignUserProfileData))
742 // it's a home user, can't be outside to return home
743 return false;
744
745 // OK, it's a foreign user with a ForeignUserProfileData
746 // and is going back to exactly the home region.
747 // We can't check if it's going back to a non-home region
748 // of the home grid. That will be dealt with in the
749 // receiving end
750 return (uinfo.UserProfile.HomeRegionID == rinfo.RegionID);
751 }
752
753 protected bool IsLocalUser(CachedUserInfo uinfo)
754 {
755 if (uinfo == null)
756 return false;
757
758 return !(uinfo.UserProfile is ForeignUserProfileData);
759
760 }
761
762 protected bool IsLocalRegion(ulong handle)
763 {
764 return m_LocalScenes.ContainsKey(handle);
765 }
766
767 private void DumpUserData(ForeignUserProfileData userData)
768 {
769 m_log.Info(" ------------ User Data Dump ----------");
770 m_log.Info(" >> Name: " + userData.FirstName + " " + userData.SurName);
771 m_log.Info(" >> HomeID: " + userData.HomeRegionID);
772 m_log.Info(" >> UserServer: " + userData.UserServerURI);
773 m_log.Info(" >> InvServer: " + userData.UserInventoryURI);
774 m_log.Info(" >> AssetServer: " + userData.UserAssetURI);
775 m_log.Info(" ------------ -------------- ----------");
776 }
777
778 private void DumpRegionData(GridRegion rinfo)
779 {
780 m_log.Info(" ------------ Region Data Dump ----------");
781 m_log.Info(" >> handle: " + rinfo.RegionHandle);
782 m_log.Info(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY);
783 m_log.Info(" >> external host name: " + rinfo.ExternalHostName);
784 m_log.Info(" >> http port: " + rinfo.HttpPort);
785 m_log.Info(" >> external EP address: " + rinfo.ExternalEndPoint.Address);
786 m_log.Info(" >> external EP port: " + rinfo.ExternalEndPoint.Port);
787 m_log.Info(" ------------ -------------- ----------");
788 }
789
790
791 #endregion
792
793
794 }
795}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
new file mode 100644
index 0000000..3ca4882
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -0,0 +1,240 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using log4net;
29using Nini.Config;
30using System;
31using System.Collections.Generic;
32using System.Reflection;
33using OpenSim.Framework;
34using OpenSim.Framework.Console;
35using OpenSim.Server.Base;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Services.Interfaces;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
40using OpenMetaverse;
41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{
44 public class LocalGridServicesConnector :
45 ISharedRegionModule, IGridService
46 {
47 private static readonly ILog m_log =
48 LogManager.GetLogger(
49 MethodBase.GetCurrentMethod().DeclaringType);
50
51 private static LocalGridServicesConnector m_MainInstance;
52
53 private IGridService m_GridService;
54 private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>();
55
56 private bool m_Enabled = false;
57
58 public LocalGridServicesConnector()
59 {
60 }
61
62 public LocalGridServicesConnector(IConfigSource source)
63 {
64 m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated");
65 m_MainInstance = this;
66 InitialiseService(source);
67 }
68
69 #region ISharedRegionModule
70
71 public Type ReplaceableInterface
72 {
73 get { return null; }
74 }
75
76 public string Name
77 {
78 get { return "LocalGridServicesConnector"; }
79 }
80
81 public void Initialise(IConfigSource source)
82 {
83 IConfig moduleConfig = source.Configs["Modules"];
84 if (moduleConfig != null)
85 {
86 string name = moduleConfig.GetString("GridServices", "");
87 if (name == Name)
88 {
89 InitialiseService(source);
90 m_MainInstance = this;
91 m_Enabled = true;
92 m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled");
93 }
94 }
95 }
96
97 private void InitialiseService(IConfigSource source)
98 {
99 IConfig assetConfig = source.Configs["GridService"];
100 if (assetConfig == null)
101 {
102 m_log.Error("[LOCAL GRID CONNECTOR]: GridService missing from OpenSim.ini");
103 return;
104 }
105
106 string serviceDll = assetConfig.GetString("LocalServiceModule",
107 String.Empty);
108
109 if (serviceDll == String.Empty)
110 {
111 m_log.Error("[LOCAL GRID CONNECTOR]: No LocalServiceModule named in section GridService");
112 return;
113 }
114
115 Object[] args = new Object[] { source };
116 m_GridService =
117 ServerUtils.LoadPlugin<IGridService>(serviceDll,
118 args);
119
120 if (m_GridService == null)
121 {
122 m_log.Error("[LOCAL GRID CONNECTOR]: Can't load grid service");
123 return;
124 }
125 }
126
127 public void PostInitialise()
128 {
129 if (m_MainInstance == this)
130 {
131 MainConsole.Instance.Commands.AddCommand("LocalGridConnector", false, "show neighbours",
132 "show neighbours",
133 "Shows the local regions' neighbours", NeighboursCommand);
134 }
135 }
136
137 public void Close()
138 {
139 }
140
141 public void AddRegion(Scene scene)
142 {
143 if (m_Enabled)
144 scene.RegisterModuleInterface<IGridService>(this);
145
146 if (m_MainInstance == this)
147 {
148 if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
149 m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
150 else
151 m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
152 }
153 }
154
155 public void RemoveRegion(Scene scene)
156 {
157 if (m_MainInstance == this)
158 {
159 m_LocalCache[scene.RegionInfo.RegionID].Clear();
160 m_LocalCache.Remove(scene.RegionInfo.RegionID);
161 }
162 }
163
164 public void RegionLoaded(Scene scene)
165 {
166 }
167
168 #endregion
169
170 #region IGridService
171
172 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
173 {
174 return m_GridService.RegisterRegion(scopeID, regionInfo);
175 }
176
177 public bool DeregisterRegion(UUID regionID)
178 {
179 return m_GridService.DeregisterRegion(regionID);
180 }
181
182 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
183 {
184 if (m_LocalCache.ContainsKey(regionID))
185 {
186 List<GridRegion> neighbours = m_LocalCache[regionID].GetNeighbours();
187 if (neighbours.Count == 0)
188 // try the DB
189 neighbours = m_GridService.GetNeighbours(scopeID, regionID);
190 return neighbours;
191 }
192 else
193 {
194 m_log.WarnFormat("[LOCAL GRID CONNECTOR]: GetNeighbours: Requested region {0} is not on this sim", regionID);
195 return new List<GridRegion>();
196 }
197
198 // Don't go to the DB
199 //return m_GridService.GetNeighbours(scopeID, regionID);
200 }
201
202 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
203 {
204 return m_GridService.GetRegionByUUID(scopeID, regionID);
205 }
206
207 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
208 {
209 return m_GridService.GetRegionByPosition(scopeID, x, y);
210 }
211
212 public GridRegion GetRegionByName(UUID scopeID, string regionName)
213 {
214 return m_GridService.GetRegionByName(scopeID, regionName);
215 }
216
217 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
218 {
219 return m_GridService.GetRegionsByName(scopeID, name, maxNumber);
220 }
221
222 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
223 {
224 return m_GridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
225 }
226
227 #endregion
228
229 public void NeighboursCommand(string module, string[] cmdparams)
230 {
231 foreach (KeyValuePair<UUID, RegionCache> kvp in m_LocalCache)
232 {
233 m_log.InfoFormat("*** Neighbours of {0} {1} ***", kvp.Key, kvp.Value.RegionName);
234 List<GridRegion> regions = kvp.Value.GetNeighbours();
235 foreach (GridRegion r in regions)
236 m_log.InfoFormat(" {0} @ {1}={2}", r.RegionName, r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize);
237 }
238 }
239 }
240}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
new file mode 100644
index 0000000..2b336bb
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Services.Interfaces;
34using GridRegion = OpenSim.Services.Interfaces.GridRegion;
35
36using log4net;
37
38namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
39{
40 public class RegionCache
41 {
42 private static readonly ILog m_log =
43 LogManager.GetLogger(
44 MethodBase.GetCurrentMethod().DeclaringType);
45
46 private Scene m_scene;
47 private Dictionary<ulong, GridRegion> m_neighbours = new Dictionary<ulong, GridRegion>();
48
49 public string RegionName
50 {
51 get { return m_scene.RegionInfo.RegionName; }
52 }
53
54 public RegionCache(Scene s)
55 {
56 m_scene = s;
57 m_scene.EventManager.OnRegionUp += OnRegionUp;
58 }
59
60 private void OnRegionUp(GridRegion otherRegion)
61 {
62 m_log.DebugFormat("[REGION CACHE]: (on region {0}) Region {1} is up @ {2}-{3}",
63 m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
64
65 m_neighbours[otherRegion.RegionHandle] = otherRegion;
66 }
67
68 public void Clear()
69 {
70 m_scene.EventManager.OnRegionUp -= OnRegionUp;
71 m_neighbours.Clear();
72 }
73
74 public List<GridRegion> GetNeighbours()
75 {
76 return new List<GridRegion>(m_neighbours.Values);
77 }
78 }
79}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
new file mode 100644
index 0000000..72c00fc
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -0,0 +1,194 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using log4net;
29using System;
30using System.Collections.Generic;
31using System.Reflection;
32using Nini.Config;
33using OpenMetaverse;
34
35using OpenSim.Framework;
36using OpenSim.Services.Connectors;
37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Services.Interfaces;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{
44 public class RemoteGridServicesConnector :
45 GridServicesConnector, ISharedRegionModule, IGridService
46 {
47 private static readonly ILog m_log =
48 LogManager.GetLogger(
49 MethodBase.GetCurrentMethod().DeclaringType);
50
51 private bool m_Enabled = false;
52
53 private IGridService m_LocalGridService;
54
55 public RemoteGridServicesConnector()
56 {
57 }
58
59 public RemoteGridServicesConnector(IConfigSource source)
60 {
61 InitialiseServices(source);
62 }
63
64 #region ISharedRegionmodule
65
66 public Type ReplaceableInterface
67 {
68 get { return null; }
69 }
70
71 public string Name
72 {
73 get { return "RemoteGridServicesConnector"; }
74 }
75
76 public override void Initialise(IConfigSource source)
77 {
78 IConfig moduleConfig = source.Configs["Modules"];
79 if (moduleConfig != null)
80 {
81 string name = moduleConfig.GetString("GridServices", "");
82 if (name == Name)
83 {
84 InitialiseServices(source);
85 m_Enabled = true;
86 m_log.Info("[REMOTE GRID CONNECTOR]: Remote grid enabled");
87 }
88 }
89 }
90
91 private void InitialiseServices(IConfigSource source)
92 {
93 IConfig gridConfig = source.Configs["GridService"];
94 if (gridConfig == null)
95 {
96 m_log.Error("[REMOTE GRID CONNECTOR]: GridService missing from OpenSim.ini");
97 return;
98 }
99
100 base.Initialise(source);
101
102 m_LocalGridService = new LocalGridServicesConnector(source);
103 }
104
105 public void PostInitialise()
106 {
107 if (m_LocalGridService != null)
108 ((ISharedRegionModule)m_LocalGridService).PostInitialise();
109 }
110
111 public void Close()
112 {
113 }
114
115 public void AddRegion(Scene scene)
116 {
117 if (m_Enabled)
118 scene.RegisterModuleInterface<IGridService>(this);
119
120 if (m_LocalGridService != null)
121 ((ISharedRegionModule)m_LocalGridService).AddRegion(scene);
122 }
123
124 public void RemoveRegion(Scene scene)
125 {
126 if (m_LocalGridService != null)
127 ((ISharedRegionModule)m_LocalGridService).RemoveRegion(scene);
128 }
129
130 public void RegionLoaded(Scene scene)
131 {
132 }
133
134 #endregion
135
136 #region IGridService
137
138 public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
139 {
140 if (m_LocalGridService.RegisterRegion(scopeID, regionInfo))
141 return base.RegisterRegion(scopeID, regionInfo);
142
143 return false;
144 }
145
146 public override bool DeregisterRegion(UUID regionID)
147 {
148 if (m_LocalGridService.DeregisterRegion(regionID))
149 return base.DeregisterRegion(regionID);
150
151 return false;
152 }
153
154 // Let's override GetNeighbours completely -- never go to the grid server
155 // Neighbours are/should be cached locally
156 // For retrieval from the DB, caller should call GetRegionByPosition
157 public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
158 {
159 return m_LocalGridService.GetNeighbours(scopeID, regionID);
160 }
161
162 public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
163 {
164 GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID);
165 if (rinfo == null)
166 rinfo = base.GetRegionByUUID(scopeID, regionID);
167
168 return rinfo;
169 }
170
171 public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
172 {
173 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
174 if (rinfo == null)
175 rinfo = base.GetRegionByPosition(scopeID, x, y);
176
177 return rinfo;
178 }
179
180 public override GridRegion GetRegionByName(UUID scopeID, string regionName)
181 {
182 GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName);
183 if (rinfo == null)
184 rinfo = base.GetRegionByName(scopeID, regionName);
185
186 return rinfo;
187 }
188
189 // Let's not override GetRegionsByName -- let's get them all from the grid server
190 // Let's not override GetRegionRange -- let's get them all from the grid server
191
192 #endregion
193 }
194}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
new file mode 100644
index 0000000..2ca90f8
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -0,0 +1,141 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using System.Threading;
33using log4net.Config;
34using NUnit.Framework;
35using NUnit.Framework.SyntaxHelpers;
36using OpenMetaverse;
37using OpenSim.Framework;
38using Nini.Config;
39
40using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
41using OpenSim.Region.Framework.Scenes;
42using GridRegion = OpenSim.Services.Interfaces.GridRegion;
43using OpenSim.Tests.Common;
44using OpenSim.Tests.Common.Setup;
45
46namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
47{
48 [TestFixture]
49 public class GridConnectorsTests
50 {
51 LocalGridServicesConnector m_LocalConnector;
52 private void SetUp()
53 {
54 IConfigSource config = new IniConfigSource();
55 config.AddConfig("Modules");
56 config.AddConfig("GridService");
57 config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
58 config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
59 config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
60
61 m_LocalConnector = new LocalGridServicesConnector(config);
62 }
63
64 /// <summary>
65 /// Test saving a V0.2 OpenSim Region Archive.
66 /// </summary>
67 [Test]
68 public void TestRegisterRegionV0_2()
69 {
70 SetUp();
71
72 // Create 3 regions
73 GridRegion r1 = new GridRegion();
74 r1.RegionName = "Test Region 1";
75 r1.RegionID = new UUID(1);
76 r1.RegionLocX = 1000 * (int)Constants.RegionSize;
77 r1.RegionLocY = 1000 * (int)Constants.RegionSize;
78 r1.ExternalHostName = "127.0.0.1";
79 r1.HttpPort = 9001;
80 r1.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
81 Scene s = new Scene(new RegionInfo());
82 s.RegionInfo.RegionID = r1.RegionID;
83 m_LocalConnector.AddRegion(s);
84
85
86 GridRegion r2 = new GridRegion();
87 r2.RegionName = "Test Region 2";
88 r2.RegionID = new UUID(2);
89 r2.RegionLocX = 1001 * (int)Constants.RegionSize;
90 r2.RegionLocY = 1000 * (int)Constants.RegionSize;
91 r2.ExternalHostName = "127.0.0.1";
92 r2.HttpPort = 9002;
93 r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
94 s = new Scene(new RegionInfo());
95 s.RegionInfo.RegionID = r1.RegionID;
96 m_LocalConnector.AddRegion(s);
97
98 GridRegion r3 = new GridRegion();
99 r3.RegionName = "Test Region 3";
100 r3.RegionID = new UUID(3);
101 r3.RegionLocX = 1005 * (int)Constants.RegionSize;
102 r3.RegionLocY = 1000 * (int)Constants.RegionSize;
103 r3.ExternalHostName = "127.0.0.1";
104 r3.HttpPort = 9003;
105 r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
106 s = new Scene(new RegionInfo());
107 s.RegionInfo.RegionID = r1.RegionID;
108 m_LocalConnector.AddRegion(s);
109
110 m_LocalConnector.RegisterRegion(UUID.Zero, r1);
111 GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test");
112 Assert.IsNotNull(result, "Retrieved GetRegionByName is null");
113 Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match");
114
115 result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1));
116 Assert.IsNotNull(result, "Retrieved GetRegionByUUID is null");
117 Assert.That(result.RegionID, Is.EqualTo(new UUID(1)), "Retrieved region's UUID does not match");
118
119 result = m_LocalConnector.GetRegionByPosition(UUID.Zero, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize);
120 Assert.IsNotNull(result, "Retrieved GetRegionByPosition is null");
121 Assert.That(result.RegionLocX, Is.EqualTo(1000 * (int)Constants.RegionSize), "Retrieved region's position does not match");
122
123 m_LocalConnector.RegisterRegion(UUID.Zero, r2);
124 m_LocalConnector.RegisterRegion(UUID.Zero, r3);
125
126 List<GridRegion> results = m_LocalConnector.GetNeighbours(UUID.Zero, new UUID(1));
127 Assert.IsNotNull(results, "Retrieved neighbours list is null");
128 Assert.That(results.Count, Is.EqualTo(1), "Retrieved neighbour collection is greater than expected");
129 Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved region's UUID does not match");
130
131 results = m_LocalConnector.GetRegionsByName(UUID.Zero, "Test", 10);
132 Assert.IsNotNull(results, "Retrieved GetRegionsByName list is null");
133 Assert.That(results.Count, Is.EqualTo(3), "Retrieved neighbour collection is less than expected");
134
135 results = m_LocalConnector.GetRegionRange(UUID.Zero, 900 * (int)Constants.RegionSize, 1002 * (int)Constants.RegionSize,
136 900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
137 Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
138 Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
139 }
140 }
141}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
index 9519e23..696225c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
@@ -42,6 +42,8 @@ using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
43using OpenSim.Region.Framework.Scenes.Hypergrid; 43using OpenSim.Region.Framework.Scenes.Hypergrid;
44using OpenSim.Region.Framework.Scenes.Serialization; 44using OpenSim.Region.Framework.Scenes.Serialization;
45using OpenSim.Services.Interfaces;
46using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45 47
46namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion 48namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
47{ 49{
@@ -59,6 +61,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
59 61
60 protected RegionToRegionClient m_regionClient; 62 protected RegionToRegionClient m_regionClient;
61 63
64 protected IHyperlinkService m_hyperlinkService;
65
62 protected bool m_safemode; 66 protected bool m_safemode;
63 protected IPAddress m_thisIP; 67 protected IPAddress m_thisIP;
64 68
@@ -134,7 +138,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
134 m_localBackend = new LocalInterregionComms(); 138 m_localBackend = new LocalInterregionComms();
135 m_commsManager = scene.CommsManager; 139 m_commsManager = scene.CommsManager;
136 m_aScene = scene; 140 m_aScene = scene;
137 m_regionClient = new RegionToRegionClient(m_aScene); 141 m_hyperlinkService = m_aScene.RequestModuleInterface<IHyperlinkService>();
142 m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService);
138 m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); 143 m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName);
139 } 144 }
140 145
@@ -161,7 +166,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
161 // else do the remote thing 166 // else do the remote thing
162 if (!m_localBackend.IsLocalRegion(regionHandle)) 167 if (!m_localBackend.IsLocalRegion(regionHandle))
163 { 168 {
164 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 169 uint x = 0, y = 0;
170 Utils.LongToUInts(regionHandle, out x, out y);
171 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
165 if (regInfo != null) 172 if (regInfo != null)
166 { 173 {
167 m_regionClient.SendUserInformation(regInfo, aCircuit); 174 m_regionClient.SendUserInformation(regInfo, aCircuit);
@@ -183,7 +190,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
183 // else do the remote thing 190 // else do the remote thing
184 if (!m_localBackend.IsLocalRegion(regionHandle)) 191 if (!m_localBackend.IsLocalRegion(regionHandle))
185 { 192 {
186 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 193 uint x = 0, y = 0;
194 Utils.LongToUInts(regionHandle, out x, out y);
195 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
187 if (regInfo != null) 196 if (regInfo != null)
188 { 197 {
189 return m_regionClient.DoChildAgentUpdateCall(regInfo, cAgentData); 198 return m_regionClient.DoChildAgentUpdateCall(regInfo, cAgentData);
@@ -204,7 +213,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
204 // else do the remote thing 213 // else do the remote thing
205 if (!m_localBackend.IsLocalRegion(regionHandle)) 214 if (!m_localBackend.IsLocalRegion(regionHandle))
206 { 215 {
207 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 216 uint x = 0, y = 0;
217 Utils.LongToUInts(regionHandle, out x, out y);
218 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
208 if (regInfo != null) 219 if (regInfo != null)
209 { 220 {
210 return m_regionClient.DoChildAgentUpdateCall(regInfo, cAgentData); 221 return m_regionClient.DoChildAgentUpdateCall(regInfo, cAgentData);
@@ -225,7 +236,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
225 // else do the remote thing 236 // else do the remote thing
226 if (!m_localBackend.IsLocalRegion(regionHandle)) 237 if (!m_localBackend.IsLocalRegion(regionHandle))
227 { 238 {
228 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 239 uint x = 0, y = 0;
240 Utils.LongToUInts(regionHandle, out x, out y);
241 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
229 if (regInfo != null) 242 if (regInfo != null)
230 { 243 {
231 return m_regionClient.DoRetrieveRootAgentCall(regInfo, id, out agent); 244 return m_regionClient.DoRetrieveRootAgentCall(regInfo, id, out agent);
@@ -257,7 +270,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
257 // else do the remote thing 270 // else do the remote thing
258 if (!m_localBackend.IsLocalRegion(regionHandle)) 271 if (!m_localBackend.IsLocalRegion(regionHandle))
259 { 272 {
260 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 273 uint x = 0, y = 0;
274 Utils.LongToUInts(regionHandle, out x, out y);
275 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
261 if (regInfo != null) 276 if (regInfo != null)
262 { 277 {
263 return m_regionClient.DoCloseAgentCall(regInfo, id); 278 return m_regionClient.DoCloseAgentCall(regInfo, id);
@@ -284,7 +299,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
284 // else do the remote thing 299 // else do the remote thing
285 if (!m_localBackend.IsLocalRegion(regionHandle)) 300 if (!m_localBackend.IsLocalRegion(regionHandle))
286 { 301 {
287 RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle); 302 uint x = 0, y = 0;
303 Utils.LongToUInts(regionHandle, out x, out y);
304 GridRegion regInfo = m_aScene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
288 if (regInfo != null) 305 if (regInfo != null)
289 { 306 {
290 return m_regionClient.DoCreateObjectCall( 307 return m_regionClient.DoCreateObjectCall(
@@ -776,16 +793,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
776 protected class RegionToRegionClient : RegionClient 793 protected class RegionToRegionClient : RegionClient
777 { 794 {
778 Scene m_aScene = null; 795 Scene m_aScene = null;
796 IHyperlinkService m_hyperlinkService;
779 797
780 public RegionToRegionClient(Scene s) 798 public RegionToRegionClient(Scene s, IHyperlinkService hyperService)
781 { 799 {
782 m_aScene = s; 800 m_aScene = s;
801 m_hyperlinkService = hyperService;
783 } 802 }
784 803
785 public override ulong GetRegionHandle(ulong handle) 804 public override ulong GetRegionHandle(ulong handle)
786 { 805 {
787 if (m_aScene.SceneGridService is HGSceneCommunicationService) 806 if (m_aScene.SceneGridService is HGSceneCommunicationService)
788 return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.FindRegionHandle(handle); 807 {
808 if (m_hyperlinkService != null)
809 return m_hyperlinkService.FindRegionHandle(handle);
810 }
789 811
790 return handle; 812 return handle;
791 } 813 }
@@ -793,29 +815,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
793 public override bool IsHyperlink(ulong handle) 815 public override bool IsHyperlink(ulong handle)
794 { 816 {
795 if (m_aScene.SceneGridService is HGSceneCommunicationService) 817 if (m_aScene.SceneGridService is HGSceneCommunicationService)
796 return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.IsHyperlinkRegion(handle); 818 {
797 819 if ((m_hyperlinkService != null) && (m_hyperlinkService.GetHyperlinkRegion(handle) != null))
820 return true;
821 }
798 return false; 822 return false;
799 } 823 }
800 824
801 public override void SendUserInformation(RegionInfo regInfo, AgentCircuitData aCircuit) 825 public override void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit)
802 { 826 {
803 try 827 if (m_hyperlinkService != null)
804 { 828 m_hyperlinkService.SendUserInformation(regInfo, aCircuit);
805 if (m_aScene.SceneGridService is HGSceneCommunicationService)
806 {
807 ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.SendUserInformation(regInfo, aCircuit);
808 }
809 }
810 catch // Bad cast
811 { }
812 829
813 } 830 }
814 831
815 public override void AdjustUserInformation(AgentCircuitData aCircuit) 832 public override void AdjustUserInformation(AgentCircuitData aCircuit)
816 { 833 {
817 if (m_aScene.SceneGridService is HGSceneCommunicationService) 834 if (m_hyperlinkService != null)
818 ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.AdjustUserInformation(aCircuit); 835 m_hyperlinkService.AdjustUserInformation(aCircuit);
819 } 836 }
820 } 837 }
821 838
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 1c66254..fd1a759 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -525,7 +525,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
525 return true; 525 return true;
526 } 526 }
527 527
528 string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); 528 if ((uinfo.UserProfile.UserInventoryURI == null) || (uinfo.UserProfile.UserInventoryURI == ""))
529 // this happens in standalone profiles, apparently
530 return true;
531
532 string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
533
529 string uri = m_LocalGridInventoryURI.TrimEnd('/'); 534 string uri = m_LocalGridInventoryURI.TrimEnd('/');
530 535
531 if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) 536 if ((userInventoryServerURI == uri) || (userInventoryServerURI == ""))
@@ -544,7 +549,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
544 if ((uinfo == null) || (uinfo.UserProfile == null)) 549 if ((uinfo == null) || (uinfo.UserProfile == null))
545 return invURI; 550 return invURI;
546 551
547 string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); 552 string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
548 553
549 if ((userInventoryServerURI != null) && 554 if ((userInventoryServerURI != null) &&
550 (userInventoryServerURI != "")) 555 (userInventoryServerURI != ""))
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index 0d32c77..69504df 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
107 public void AddRegion(Scene scene) 107 public void AddRegion(Scene scene)
108 { 108 {
109 m_Scene = scene; 109 m_Scene = scene;
110 m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); 110 //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName);
111 111
112 if (!m_Enabled) 112 if (!m_Enabled)
113 return; 113 return;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
index a52c70b..b0ace39 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
@@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Scenes;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39 39
40
40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land 41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
41{ 42{
42 public class RemoteLandServicesConnector : 43 public class RemoteLandServicesConnector :
@@ -89,7 +90,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
89 if (!m_Enabled) 90 if (!m_Enabled)
90 return; 91 return;
91 92
92 m_MapService = scene.CommsManager.GridService; 93 m_GridService = scene.GridService;
93 m_LocalService.AddRegion(scene); 94 m_LocalService.AddRegion(scene);
94 scene.RegisterModuleInterface<ILandService>(this); 95 scene.RegisterModuleInterface<ILandService>(this);
95 } 96 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
index 61bf481..daba0b3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
119 119
120 #region INeighbourService 120 #region INeighbourService
121 121
122 public bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 122 public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
123 { 123 {
124 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", 124 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}",
125 thisRegion.RegionName, regionHandle, m_Scenes.Count); 125 thisRegion.RegionName, regionHandle, m_Scenes.Count);
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
132 } 132 }
133 } 133 }
134 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); 134 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle);
135 return false; 135 return null;
136 } 136 }
137 137
138 #endregion INeighbourService 138 #endregion INeighbourService
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs
index c5bc03b..c6fc2a1 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs
@@ -118,7 +118,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
118 if (!m_Enabled) 118 if (!m_Enabled)
119 return; 119 return;
120 120
121 m_MapService = scene.CommsManager.GridService;
122 m_LocalService.AddRegion(scene); 121 m_LocalService.AddRegion(scene);
123 scene.RegisterModuleInterface<INeighbourService>(this); 122 scene.RegisterModuleInterface<INeighbourService>(this);
124 } 123 }
@@ -134,16 +133,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
134 if (!m_Enabled) 133 if (!m_Enabled)
135 return; 134 return;
136 135
136 m_GridService = scene.GridService;
137
137 m_log.InfoFormat("[NEIGHBOUR CONNECTOR]: Enabled remote neighbours for region {0}", scene.RegionInfo.RegionName); 138 m_log.InfoFormat("[NEIGHBOUR CONNECTOR]: Enabled remote neighbours for region {0}", scene.RegionInfo.RegionName);
138 139
139 } 140 }
140 141
141 #region INeighbourService 142 #region INeighbourService
142 143
143 public override bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 144 public override GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
144 { 145 {
145 if (m_LocalService.HelloNeighbour(regionHandle, thisRegion)) 146 GridRegion region = m_LocalService.HelloNeighbour(regionHandle, thisRegion);
146 return true; 147 if (region != null)
148 return region;
147 149
148 return base.HelloNeighbour(regionHandle, thisRegion); 150 return base.HelloNeighbour(regionHandle, thisRegion);
149 } 151 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 376ea8a..65f83fd 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -110,12 +110,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
110 TarArchiveReader.TarEntryType entryType; 110 TarArchiveReader.TarEntryType entryType;
111 111
112 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 112 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
113 { 113 {
114 //m_log.DebugFormat( 114 //m_log.DebugFormat(
115 // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); 115 // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length);
116 116
117 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) 117 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType)
118 continue; 118 continue;
119 119
120 if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) 120 if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
121 { 121 {
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
173 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 173 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
174 174
175 IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>(); 175 IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>();
176 int sceneObjectsLoadedCount = 0; 176 int sceneObjectsLoadedCount = 0;
177 177
178 foreach (string serialisedSceneObject in serialisedSceneObjects) 178 foreach (string serialisedSceneObject in serialisedSceneObjects)
179 { 179 {
@@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
499 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); 499 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
500 500
501 XmlTextReader xtr 501 XmlTextReader xtr
502 = new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context); 502 = new XmlTextReader(m_asciiEncoding.GetString(data), XmlNodeType.Document, context);
503 503
504 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; 504 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
505 505
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 63608a8..9e4fbbe 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -74,14 +74,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
74 m_scene = scene; 74 m_scene = scene;
75 m_saveStream = saveStream; 75 m_saveStream = saveStream;
76 m_requestId = requestId; 76 m_requestId = requestId;
77 } 77 }
78 78
79 /// <summary> 79 /// <summary>
80 /// Archive the region requested. 80 /// Archive the region requested.
81 /// </summary> 81 /// </summary>
82 /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception> 82 /// <exception cref="System.IO.IOException">if there was an io problem with creating the file</exception>
83 public void ArchiveRegion() 83 public void ArchiveRegion()
84 { 84 {
85 Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>(); 85 Dictionary<UUID, int> assetUuids = new Dictionary<UUID, int>();
86 86
87 List<EntityBase> entities = m_scene.GetEntities(); 87 List<EntityBase> entities = m_scene.GetEntities();
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
137 m_scene.RequestModuleInterface<IRegionSerialiserModule>(), 137 m_scene.RequestModuleInterface<IRegionSerialiserModule>(),
138 m_scene, 138 m_scene,
139 archiveWriter, 139 archiveWriter,
140 m_requestId); 140 m_requestId);
141 141
142 new AssetsRequest( 142 new AssetsRequest(
143 new AssetsArchiver(archiveWriter), assetUuids.Keys, 143 new AssetsArchiver(archiveWriter), assetUuids.Keys,
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 5c58b69..8d4f91b 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
78 78
79 public void Close() 79 public void Close()
80 { 80 {
81 } 81 }
82 82
83 public void ArchiveRegion(string savePath) 83 public void ArchiveRegion(string savePath)
84 { 84 {
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
90 m_log.InfoFormat( 90 m_log.InfoFormat(
91 "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); 91 "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath);
92 92
93 new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(); 93 new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion();
94 } 94 }
95 95
96 public void ArchiveRegion(Stream saveStream) 96 public void ArchiveRegion(Stream saveStream)
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
101 public void ArchiveRegion(Stream saveStream, Guid requestId) 101 public void ArchiveRegion(Stream saveStream, Guid requestId)
102 { 102 {
103 new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(); 103 new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion();
104 } 104 }
105 105
106 public void DearchiveRegion(string loadPath) 106 public void DearchiveRegion(string loadPath)
107 { 107 {
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
114 "[ARCHIVER]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath); 114 "[ARCHIVER]: Loading archive to region {0} from {1}", m_scene.RegionInfo.RegionName, loadPath);
115 115
116 new ArchiveReadRequest(m_scene, loadPath, merge, requestId).DearchiveRegion(); 116 new ArchiveReadRequest(m_scene, loadPath, merge, requestId).DearchiveRegion();
117 } 117 }
118 118
119 public void DearchiveRegion(Stream loadStream) 119 public void DearchiveRegion(Stream loadStream)
120 { 120 {
@@ -124,6 +124,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
124 public void DearchiveRegion(Stream loadStream, bool merge, Guid requestId) 124 public void DearchiveRegion(Stream loadStream, bool merge, Guid requestId)
125 { 125 {
126 new ArchiveReadRequest(m_scene, loadStream, merge, requestId).DearchiveRegion(); 126 new ArchiveReadRequest(m_scene, loadStream, merge, requestId).DearchiveRegion();
127 } 127 }
128 } 128 }
129} 129}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
index 330fa3f..95d109c 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
65 /// </summary> 65 /// </summary>
66 /// <param name="archive"></param> 66 /// <param name="archive"></param>
67 public void WriteAsset(AssetBase asset) 67 public void WriteAsset(AssetBase asset)
68 { 68 {
69 //WriteMetadata(archive); 69 //WriteMetadata(archive);
70 WriteData(asset); 70 WriteData(asset);
71 } 71 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 82803bf..fe9c8d9 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -115,7 +115,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
115 115
116 m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT); 116 m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT);
117 m_requestCallbackTimer.AutoReset = false; 117 m_requestCallbackTimer.AutoReset = false;
118 m_requestCallbackTimer.Elapsed += new ElapsedEventHandler(OnRequestCallbackTimeout); 118 m_requestCallbackTimer.Elapsed += new ElapsedEventHandler(OnRequestCallbackTimeout);
119 } 119 }
120 120
121 protected internal void Execute() 121 protected internal void Execute()
@@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
143 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) 143 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
144 { 144 {
145 try 145 try
146 { 146 {
147 lock (this) 147 lock (this)
148 { 148 {
149 // Take care of the possibilty that this thread started but was paused just outside the lock before 149 // Take care of the possibilty that this thread started but was paused just outside the lock before
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
155 } 155 }
156 156
157 // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure 157 // Calculate which uuids were not found. This is an expensive way of doing it, but this is a failure
158 // case anyway. 158 // case anyway.
159 List<UUID> uuids = new List<UUID>(); 159 List<UUID> uuids = new List<UUID>();
160 foreach (UUID uuid in m_uuids) 160 foreach (UUID uuid in m_uuids)
161 { 161 {
@@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
188 m_log.ErrorFormat( 188 m_log.ErrorFormat(
189 "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); 189 "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT);
190 190
191 m_log.Error("[ARCHIVER]: OAR save aborted."); 191 m_log.Error("[ARCHIVER]: OAR save aborted.");
192 } 192 }
193 catch (Exception e) 193 catch (Exception e)
194 { 194 {
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
213 { 213 {
214 //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); 214 //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id);
215 215
216 m_requestCallbackTimer.Stop(); 216 m_requestCallbackTimer.Stop();
217 217
218 if (m_requestState == RequestState.Aborted) 218 if (m_requestState == RequestState.Aborted)
219 { 219 {
@@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
258 } 258 }
259 catch (Exception e) 259 catch (Exception e)
260 { 260 {
261 m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e); 261 m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e);
262 } 262 }
263 } 263 }
264 264
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 5c42e94..edac4a4 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
59 m_lastErrorMessage = errorMessage; 59 m_lastErrorMessage = errorMessage;
60 Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); 60 Console.WriteLine("About to pulse ArchiverTests on LoadCompleted");
61 61
62 Monitor.PulseAll(this); 62 Monitor.PulseAll(this);
63 } 63 }
64 } 64 }
65 65
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
138 archiverModule.ArchiveRegion(archiveWriteStream, requestId); 138 archiverModule.ArchiveRegion(archiveWriteStream, requestId);
139 //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; 139 //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer;
140 //while (assetServer.HasWaitingRequests()) 140 //while (assetServer.HasWaitingRequests())
141 // assetServer.ProcessNextRequest(); 141 // assetServer.ProcessNextRequest();
142 142
143 Monitor.Wait(this, 60000); 143 Monitor.Wait(this, 60000);
144 } 144 }
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
213 213
214 // Also check that direct entries which will also have a file entry containing that directory doesn't 214 // Also check that direct entries which will also have a file entry containing that directory doesn't
215 // upset load 215 // upset load
216 tar.WriteDir(ArchiveConstants.TERRAINS_PATH); 216 tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
217 217
218 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); 218 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
219 219
@@ -251,7 +251,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
251 { 251 {
252 scene.EventManager.OnOarFileLoaded += LoadCompleted; 252 scene.EventManager.OnOarFileLoaded += LoadCompleted;
253 archiverModule.DearchiveRegion(archiveReadStream); 253 archiverModule.DearchiveRegion(archiveReadStream);
254 } 254 }
255 255
256 Assert.That(m_lastErrorMessage, Is.Null); 256 Assert.That(m_lastErrorMessage, Is.Null);
257 257
@@ -271,7 +271,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
271 271
272 /// <summary> 272 /// <summary>
273 /// Test merging a V0.2 OpenSim Region Archive into an existing scene 273 /// Test merging a V0.2 OpenSim Region Archive into an existing scene
274 /// </summary> 274 /// </summary>
275 //[Test] 275 //[Test]
276 public void TestMergeOarV0_2() 276 public void TestMergeOarV0_2()
277 { 277 {
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 75b3fe6..4896edf 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -33,7 +33,6 @@ using log4net;
33using Nini.Config; 33using Nini.Config;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.CoreModules.World.Terrain;
37using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
39 38
@@ -47,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
47 46
48 private Scene m_scene; 47 private Scene m_scene;
49 48
50 private EstateTerrainXferHandler TerrainUploader = null; 49 private EstateTerrainXferHandler TerrainUploader;
51 50
52 #region Packet Data Responders 51 #region Packet Data Responders
53 52
@@ -155,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
155 break; 154 break;
156 } 155 }
157 m_scene.RegionInfo.RegionSettings.Save(); 156 m_scene.RegionInfo.RegionSettings.Save();
157 sendRegionInfoPacketToAll();
158 } 158 }
159 159
160 public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue) 160 public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
@@ -179,6 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
179 break; 179 break;
180 } 180 }
181 m_scene.RegionInfo.RegionSettings.Save(); 181 m_scene.RegionInfo.RegionSettings.Save();
182 sendRegionInfoPacketToAll();
182 } 183 }
183 184
184 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient) 185 private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
@@ -668,7 +669,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
668 LookupUUID(uuidNameLookupList); 669 LookupUUID(uuidNameLookupList);
669 } 670 }
670 671
671 private void LookupUUIDSCompleted(IAsyncResult iar) 672 private static void LookupUUIDSCompleted(IAsyncResult iar)
672 { 673 {
673 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; 674 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
674 icon.EndInvoke(iar); 675 icon.EndInvoke(iar);
@@ -683,7 +684,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
683 } 684 }
684 private void LookupUUIDsAsync(List<UUID> uuidLst) 685 private void LookupUUIDsAsync(List<UUID> uuidLst)
685 { 686 {
686 UUID[] uuidarr = new UUID[0]; 687 UUID[] uuidarr;
687 688
688 lock (uuidLst) 689 lock (uuidLst)
689 { 690 {
@@ -707,7 +708,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
707 708
708 for (int i = 0; i < avatars.Count; i++) 709 for (int i = 0; i < avatars.Count; i++)
709 { 710 {
710 HandleRegionInfoRequest(avatars[i].ControllingClient); ; 711 HandleRegionInfoRequest(avatars[i].ControllingClient);
711 } 712 }
712 } 713 }
713 714
@@ -768,7 +769,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
768 else 769 else
769 { 770 {
770 m_scene.RegionInfo.EstateSettings.UseGlobalTime = false; 771 m_scene.RegionInfo.EstateSettings.UseGlobalTime = false;
771 m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0; 772 m_scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0;
772 } 773 }
773 774
774 if ((parms1 & 0x00000010) != 0) 775 if ((parms1 & 0x00000010) != 0)
@@ -828,8 +829,108 @@ namespace OpenSim.Region.CoreModules.World.Estate
828 m_scene.RegisterModuleInterface<IEstateModule>(this); 829 m_scene.RegisterModuleInterface<IEstateModule>(this);
829 m_scene.EventManager.OnNewClient += EventManager_OnNewClient; 830 m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
830 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; 831 m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
832
833 m_scene.AddCommand(this, "set terrain texture",
834 "set terrain texture <number> <uuid> [<x>] [<y>]",
835 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
836 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
837 " that coordinate.",
838 consoleSetTerrainTexture);
839
840 m_scene.AddCommand(this, "set terrain heights",
841 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
842 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
843 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
844 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
845 consoleSetTerrainHeights);
846 }
847
848 #region Console Commands
849
850 public void consoleSetTerrainTexture(string module, string[] args)
851 {
852 string num = args[3];
853 string uuid = args[4];
854 int x = (args.Length > 5 ? int.Parse(args[5]) : -1);
855 int y = (args.Length > 6 ? int.Parse(args[6]) : -1);
856
857 if (x == -1 || m_scene.RegionInfo.RegionLocX == x)
858 {
859 if (y == -1 || m_scene.RegionInfo.RegionLocY == y)
860 {
861 int corner = int.Parse(num);
862 UUID texture = UUID.Parse(uuid);
863
864 m_log.Debug("[ESTATEMODULE] Setting terrain textures for " + m_scene.RegionInfo.RegionName +
865 string.Format(" (C#{0} = {1})", corner, texture));
866
867 switch (corner)
868 {
869 case 0:
870 m_scene.RegionInfo.RegionSettings.TerrainTexture1 = texture;
871 break;
872 case 1:
873 m_scene.RegionInfo.RegionSettings.TerrainTexture2 = texture;
874 break;
875 case 2:
876 m_scene.RegionInfo.RegionSettings.TerrainTexture3 = texture;
877 break;
878 case 3:
879 m_scene.RegionInfo.RegionSettings.TerrainTexture4 = texture;
880 break;
881 }
882 m_scene.RegionInfo.RegionSettings.Save();
883 sendRegionInfoPacketToAll();
884
885 }
886 }
887 }
888
889 public void consoleSetTerrainHeights(string module, string[] args)
890 {
891 string num = args[3];
892 string min = args[4];
893 string max = args[5];
894 int x = (args.Length > 6 ? int.Parse(args[6]) : -1);
895 int y = (args.Length > 7 ? int.Parse(args[7]) : -1);
896
897 if (x == -1 || m_scene.RegionInfo.RegionLocX == x)
898 {
899 if (y == -1 || m_scene.RegionInfo.RegionLocY == y)
900 {
901 int corner = int.Parse(num);
902 float lowValue = float.Parse(min);
903 float highValue = float.Parse(max);
904
905 m_log.Debug("[ESTATEMODULE] Setting terrain heights " + m_scene.RegionInfo.RegionName +
906 string.Format(" (C{0}, {1}-{2}", corner, lowValue, highValue));
907
908 switch (corner)
909 {
910 case 0:
911 m_scene.RegionInfo.RegionSettings.Elevation1SW = lowValue;
912 m_scene.RegionInfo.RegionSettings.Elevation2SW = highValue;
913 break;
914 case 1:
915 m_scene.RegionInfo.RegionSettings.Elevation1NW = lowValue;
916 m_scene.RegionInfo.RegionSettings.Elevation2NW = highValue;
917 break;
918 case 2:
919 m_scene.RegionInfo.RegionSettings.Elevation1SE = lowValue;
920 m_scene.RegionInfo.RegionSettings.Elevation2SE = highValue;
921 break;
922 case 3:
923 m_scene.RegionInfo.RegionSettings.Elevation1NE = lowValue;
924 m_scene.RegionInfo.RegionSettings.Elevation2NE = highValue;
925 break;
926 }
927 m_scene.RegionInfo.RegionSettings.Save();
928 sendRegionHandshakeToAll();
929 }
930 }
831 } 931 }
832 932
933 #endregion
833 934
834 public void PostInitialise() 935 public void PostInitialise()
835 { 936 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 76ff6da..fdff61e 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -36,10 +36,12 @@ using OpenSim.Framework;
36using OpenSim.Framework.Capabilities; 36using OpenSim.Framework.Capabilities;
37using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
38using OpenSim.Framework.Servers.HttpServer; 38using OpenSim.Framework.Servers.HttpServer;
39using OpenSim.Services.Interfaces;
39using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 41using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.Physics.Manager; 42using OpenSim.Region.Physics.Manager;
42using Caps=OpenSim.Framework.Capabilities.Caps; 43using Caps=OpenSim.Framework.Capabilities.Caps;
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
43 45
44namespace OpenSim.Region.CoreModules.World.Land 46namespace OpenSim.Region.CoreModules.World.Land
45{ 47{
@@ -1301,7 +1303,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1301 else 1303 else
1302 { 1304 {
1303 // a parcel request for a parcel in another region. Ask the grid about the region 1305 // a parcel request for a parcel in another region. Ask the grid about the region
1304 RegionInfo info = m_scene.CommsManager.GridService.RequestNeighbourInfo(regionID); 1306 GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, regionID);
1305 if (info != null) 1307 if (info != null)
1306 parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); 1308 parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
1307 } 1309 }
@@ -1359,9 +1361,10 @@ namespace OpenSim.Region.CoreModules.World.Land
1359 } 1361 }
1360 else 1362 else
1361 { 1363 {
1362 extLandData.landData = m_scene.CommsManager.GridService.RequestLandData(extLandData.regionHandle, 1364 ILandService landService = m_scene.RequestModuleInterface<ILandService>();
1363 extLandData.x, 1365 extLandData.landData = landService.GetLandData(extLandData.regionHandle,
1364 extLandData.y); 1366 extLandData.x,
1367 extLandData.y);
1365 if (extLandData.landData == null) 1368 if (extLandData.landData == null)
1366 { 1369 {
1367 // we didn't find the region/land => don't cache 1370 // we didn't find the region/land => don't cache
@@ -1373,20 +1376,27 @@ namespace OpenSim.Region.CoreModules.World.Land
1373 1376
1374 if (data != null) // if we found some data, send it 1377 if (data != null) // if we found some data, send it
1375 { 1378 {
1376 RegionInfo info; 1379 GridRegion info;
1377 if (data.regionHandle == m_scene.RegionInfo.RegionHandle) 1380 if (data.regionHandle == m_scene.RegionInfo.RegionHandle)
1378 { 1381 {
1379 info = m_scene.RegionInfo; 1382 info = new GridRegion(m_scene.RegionInfo);
1380 } 1383 }
1381 else 1384 else
1382 { 1385 {
1383 // most likely still cached from building the extLandData entry 1386 // most likely still cached from building the extLandData entry
1384 info = m_scene.CommsManager.GridService.RequestNeighbourInfo(data.regionHandle); 1387 uint x = 0, y = 0;
1388 Utils.LongToUInts(data.regionHandle, out x, out y);
1389 info = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
1385 } 1390 }
1386 // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. 1391 // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark.
1387 m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...", 1392 m_log.DebugFormat("[LAND] got parcelinfo for parcel {0} in region {1}; sending...",
1388 data.landData.Name, data.regionHandle); 1393 data.landData.Name, data.regionHandle);
1389 remoteClient.SendParcelInfo(info, data.landData, parcelID, data.x, data.y); 1394 // HACK for now
1395 RegionInfo r = new RegionInfo();
1396 r.RegionName = info.RegionName;
1397 r.RegionLocX = (uint)info.RegionLocX;
1398 r.RegionLocY = (uint)info.RegionLocY;
1399 remoteClient.SendParcelInfo(r, data.landData, parcelID, data.x, data.y);
1390 } 1400 }
1391 else 1401 else
1392 m_log.Debug("[LAND] got no parcelinfo; not sending"); 1402 m_log.Debug("[LAND] got no parcelinfo; not sending");
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 2701f60..3be5f45 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -954,7 +954,7 @@ namespace OpenSim.Region.CoreModules.World.Land
954 public void SetMediaUrl(string url) 954 public void SetMediaUrl(string url)
955 { 955 {
956 landData.MediaURL = url; 956 landData.MediaURL = url;
957 sendLandUpdateToAvatarsOverMe(); 957 sendLandUpdateToAvatarsOverMe();
958 } 958 }
959 959
960 /// <summary> 960 /// <summary>
@@ -964,7 +964,7 @@ namespace OpenSim.Region.CoreModules.World.Land
964 public void SetMusicUrl(string url) 964 public void SetMusicUrl(string url)
965 { 965 {
966 landData.MusicURL = url; 966 landData.MusicURL = url;
967 sendLandUpdateToAvatarsOverMe(); 967 sendLandUpdateToAvatarsOverMe();
968 } 968 }
969 } 969 }
970} 970}
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs
index 65f22b1..2cbaf96 100644
--- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs
+++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Land
85 private void LocalRezObject(IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart, 85 private void LocalRezObject(IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart,
86 UUID raytargetid, byte bypassraycast, bool rayendisintersection, bool rezselected, bool removeitem, 86 UUID raytargetid, byte bypassraycast, bool rayendisintersection, bool rezselected, bool removeitem,
87 UUID fromtaskid) 87 UUID fromtaskid)
88 { 88 {
89 int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX; 89 int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX;
90 int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY; 90 int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY;
91 rayend.X += differenceX * (int)Constants.RegionSize; 91 rayend.X += differenceX * (int)Constants.RegionSize;
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs
index 1436912..05d19a2 100644
--- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Client; 35using OpenSim.Framework.Client;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Framework.Console;
38 39
39namespace OpenSim.Region.CoreModules.World.Land 40namespace OpenSim.Region.CoreModules.World.Land
40{ 41{
@@ -61,7 +62,10 @@ namespace OpenSim.Region.CoreModules.World.Land
61 IConfig myConfig = source.Configs["Startup"]; 62 IConfig myConfig = source.Configs["Startup"];
62 enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); 63 enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false);
63 //enabledYN = true; 64 //enabledYN = true;
64 } 65 if (enabledYN)
66 MainConsole.Instance.Commands.AddCommand("RegionCombinerModule", false, "fix-phantoms",
67 "Fix phantom objects", "Fixes phantom objects after an import to megaregions", FixPhantoms);
68 }
65 69
66 public void Close() 70 public void Close()
67 { 71 {
@@ -79,12 +83,12 @@ namespace OpenSim.Region.CoreModules.World.Land
79 { 83 {
80 if (!enabledYN) 84 if (!enabledYN)
81 return; 85 return;
82 86/*
83 // For testing on a single instance 87 // For testing on a single instance
84 if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000) 88 if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000)
85 return; 89 return;
86 // 90 //
87 91*/
88 lock (m_startingScenes) 92 lock (m_startingScenes)
89 m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); 93 m_startingScenes.Add(scene.RegionInfo.originRegionID, scene);
90 94
@@ -504,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Land
504 scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; 508 scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY;
505 } 509 }
506 510
507 /* 511 /*
508 else 512 else
509 { 513 {
510 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; 514 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize;
@@ -876,7 +880,7 @@ namespace OpenSim.Region.CoreModules.World.Land
876 VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; 880 VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject;
877 VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED 881 VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED
878 VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED 882 VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED
879 VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED 883 VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED
880 VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; 884 VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage;
881 VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED 885 VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED
882 VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED 886 VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED
@@ -895,11 +899,11 @@ namespace OpenSim.Region.CoreModules.World.Land
895 VirtualRegion.Permissions.OnDelinkObject += BigRegion.PermissionModule.CanDelinkObject; //NOT YET IMPLEMENTED 899 VirtualRegion.Permissions.OnDelinkObject += BigRegion.PermissionModule.CanDelinkObject; //NOT YET IMPLEMENTED
896 VirtualRegion.Permissions.OnBuyLand += BigRegion.PermissionModule.CanBuyLand; //NOT YET IMPLEMENTED 900 VirtualRegion.Permissions.OnBuyLand += BigRegion.PermissionModule.CanBuyLand; //NOT YET IMPLEMENTED
897 VirtualRegion.Permissions.OnViewNotecard += BigRegion.PermissionModule.CanViewNotecard; //NOT YET IMPLEMENTED 901 VirtualRegion.Permissions.OnViewNotecard += BigRegion.PermissionModule.CanViewNotecard; //NOT YET IMPLEMENTED
898 VirtualRegion.Permissions.OnViewScript += BigRegion.PermissionModule.CanViewScript; //NOT YET IMPLEMENTED 902 VirtualRegion.Permissions.OnViewScript += BigRegion.PermissionModule.CanViewScript; //NOT YET IMPLEMENTED
899 VirtualRegion.Permissions.OnEditNotecard += BigRegion.PermissionModule.CanEditNotecard; //NOT YET IMPLEMENTED 903 VirtualRegion.Permissions.OnEditNotecard += BigRegion.PermissionModule.CanEditNotecard; //NOT YET IMPLEMENTED
900 VirtualRegion.Permissions.OnEditScript += BigRegion.PermissionModule.CanEditScript; //NOT YET IMPLEMENTED 904 VirtualRegion.Permissions.OnEditScript += BigRegion.PermissionModule.CanEditScript; //NOT YET IMPLEMENTED
901 VirtualRegion.Permissions.OnCreateObjectInventory += BigRegion.PermissionModule.CanCreateObjectInventory; //NOT IMPLEMENTED HERE 905 VirtualRegion.Permissions.OnCreateObjectInventory += BigRegion.PermissionModule.CanCreateObjectInventory; //NOT IMPLEMENTED HERE
902 VirtualRegion.Permissions.OnEditObjectInventory += BigRegion.PermissionModule.CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED 906 VirtualRegion.Permissions.OnEditObjectInventory += BigRegion.PermissionModule.CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
903 VirtualRegion.Permissions.OnCopyObjectInventory += BigRegion.PermissionModule.CanCopyObjectInventory; //NOT YET IMPLEMENTED 907 VirtualRegion.Permissions.OnCopyObjectInventory += BigRegion.PermissionModule.CanCopyObjectInventory; //NOT YET IMPLEMENTED
904 VirtualRegion.Permissions.OnDeleteObjectInventory += BigRegion.PermissionModule.CanDeleteObjectInventory; //NOT YET IMPLEMENTED 908 VirtualRegion.Permissions.OnDeleteObjectInventory += BigRegion.PermissionModule.CanDeleteObjectInventory; //NOT YET IMPLEMENTED
905 VirtualRegion.Permissions.OnResetScript += BigRegion.PermissionModule.CanResetScript; 909 VirtualRegion.Permissions.OnResetScript += BigRegion.PermissionModule.CanResetScript;
@@ -910,5 +914,20 @@ namespace OpenSim.Region.CoreModules.World.Land
910 VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED 914 VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED
911 VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED 915 VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED
912 } 916 }
917
918 #region console commands
919 public void FixPhantoms(string module, string[] cmdparams)
920 {
921 List<Scene> scenes = new List<Scene>(m_startingScenes.Values);
922 foreach (Scene s in scenes)
923 {
924 s.ForEachSOG(delegate(SceneObjectGroup e)
925 {
926 e.AbsolutePosition = e.AbsolutePosition;
927 }
928 );
929 }
930 }
931 #endregion
913 } 932 }
914} 933}
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index f360577..a9e0b7f 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
103 //private uint PERM_MODIFY = (uint)16384; 103 //private uint PERM_MODIFY = (uint)16384;
104 private uint PERM_MOVE = (uint)524288; 104 private uint PERM_MOVE = (uint)524288;
105 private uint PERM_TRANS = (uint)8192; 105 private uint PERM_TRANS = (uint)8192;
106 private uint PERM_LOCKED = (uint)540672; 106 private uint PERM_LOCKED = (uint)540672;
107 107
108 /// <value> 108 /// <value>
109 /// Different user set names that come in from the configuration file. 109 /// Different user set names that come in from the configuration file.
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
114 Administrators 114 Administrators
115 }; 115 };
116 116
117 #endregion 117 #endregion
118 118
119 #region Bypass Permissions / Debug Permissions Stuff 119 #region Bypass Permissions / Debug Permissions Stuff
120 120
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
136 /// <value> 136 /// <value>
137 /// The set of users that are allowed to edit (save) scripts. This is only active if 137 /// The set of users that are allowed to edit (save) scripts. This is only active if
138 /// permissions are not being bypassed. This overrides normal permissions.- 138 /// permissions are not being bypassed. This overrides normal permissions.-
139 /// </value> 139 /// </value>
140 private UserSet m_allowedScriptEditors = UserSet.All; 140 private UserSet m_allowedScriptEditors = UserSet.All;
141 141
142 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); 142 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>();
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
190 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 190 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
191 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED 191 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
192 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED 192 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED
193 m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED 193 m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED
194 m_scene.Permissions.OnInstantMessage += CanInstantMessage; 194 m_scene.Permissions.OnInstantMessage += CanInstantMessage;
195 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED 195 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED
196 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED 196 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
210 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED 210 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED
211 211
212 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED 212 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED
213 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED 213 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED
214 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED 214 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED
215 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED 215 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED
216 216
217 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE 217 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE
218 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED 218 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
219 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED 219 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED
220 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED 220 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED
221 m_scene.Permissions.OnResetScript += CanResetScript; 221 m_scene.Permissions.OnResetScript += CanResetScript;
@@ -249,7 +249,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
249 foreach (string uuidl in grant.Split(',')) { 249 foreach (string uuidl in grant.Split(',')) {
250 string uuid = uuidl.Trim(" \t".ToCharArray()); 250 string uuid = uuidl.Trim(" \t".ToCharArray());
251 GrantLSL.Add(uuid, true); 251 GrantLSL.Add(uuid, true);
252 } 252 }
253 } 253 }
254 254
255 grant = myConfig.GetString("GrantCS",""); 255 grant = myConfig.GetString("GrantCS","");
@@ -431,7 +431,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
431 m_log.ErrorFormat( 431 m_log.ErrorFormat(
432 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", 432 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}",
433 rawSetting, settingName, userSet); 433 rawSetting, settingName, userSet);
434 } 434 }
435 435
436 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); 436 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet);
437 437
@@ -942,7 +942,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
942 if (m_bypassPermissions) return m_bypassPermissionsValue; 942 if (m_bypassPermissions) return m_bypassPermissionsValue;
943 943
944 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) 944 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user))
945 return false; 945 return false;
946 946
947 // Ordinarily, if you can view it, you can edit it 947 // Ordinarily, if you can view it, you can edit it
948 // There is no viewing a no mod script 948 // There is no viewing a no mod script
@@ -957,7 +957,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
957 /// <param name="objectID"></param> 957 /// <param name="objectID"></param>
958 /// <param name="user"></param> 958 /// <param name="user"></param>
959 /// <param name="scene"></param> 959 /// <param name="scene"></param>
960 /// <returns></returns> 960 /// <returns></returns>
961 private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) 961 private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
962 { 962 {
963 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 963 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1377,11 +1377,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1377 /// <param name="objectID"></param> 1377 /// <param name="objectID"></param>
1378 /// <param name="user"></param> 1378 /// <param name="user"></param>
1379 /// <param name="scene"></param> 1379 /// <param name="scene"></param>
1380 /// <returns></returns> 1380 /// <returns></returns>
1381 private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene) 1381 private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene)
1382 { 1382 {
1383 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1383 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1384 if (m_bypassPermissions) return m_bypassPermissionsValue; 1384 if (m_bypassPermissions) return m_bypassPermissionsValue;
1385 1385
1386 if (objectID == UUID.Zero) // User inventory 1386 if (objectID == UUID.Zero) // User inventory
1387 { 1387 {
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1472 /// <param name="objectID"></param> 1472 /// <param name="objectID"></param>
1473 /// <param name="user"></param> 1473 /// <param name="user"></param>
1474 /// <param name="scene"></param> 1474 /// <param name="scene"></param>
1475 /// <returns></returns> 1475 /// <returns></returns>
1476 private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) 1476 private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
1477 { 1477 {
1478 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1478 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1609 /// </summary> 1609 /// </summary>
1610 /// <param name="invType"></param> 1610 /// <param name="invType"></param>
1611 /// <param name="userID"></param> 1611 /// <param name="userID"></param>
1612 /// <returns></returns> 1612 /// <returns></returns>
1613 private bool CanCreateUserInventory(int invType, UUID userID) 1613 private bool CanCreateUserInventory(int invType, UUID userID)
1614 { 1614 {
1615 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1615 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1619,7 +1619,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1619 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) 1619 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID))
1620 return false; 1620 return false;
1621 1621
1622 return true; 1622 return true;
1623 } 1623 }
1624 1624
1625 /// <summary> 1625 /// <summary>
@@ -1627,27 +1627,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1627 /// </summary> 1627 /// </summary>
1628 /// <param name="itemID"></param> 1628 /// <param name="itemID"></param>
1629 /// <param name="userID"></param> 1629 /// <param name="userID"></param>
1630 /// <returns></returns> 1630 /// <returns></returns>
1631 private bool CanCopyUserInventory(UUID itemID, UUID userID) 1631 private bool CanCopyUserInventory(UUID itemID, UUID userID)
1632 { 1632 {
1633 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1633 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1634 if (m_bypassPermissions) return m_bypassPermissionsValue; 1634 if (m_bypassPermissions) return m_bypassPermissionsValue;
1635 1635
1636 return true; 1636 return true;
1637 } 1637 }
1638 1638
1639 /// <summary> 1639 /// <summary>
1640 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. 1640 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory.
1641 /// </summary> 1641 /// </summary>
1642 /// <param name="itemID"></param> 1642 /// <param name="itemID"></param>
1643 /// <param name="userID"></param> 1643 /// <param name="userID"></param>
1644 /// <returns></returns> 1644 /// <returns></returns>
1645 private bool CanEditUserInventory(UUID itemID, UUID userID) 1645 private bool CanEditUserInventory(UUID itemID, UUID userID)
1646 { 1646 {
1647 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1647 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1648 if (m_bypassPermissions) return m_bypassPermissionsValue; 1648 if (m_bypassPermissions) return m_bypassPermissionsValue;
1649 1649
1650 return true; 1650 return true;
1651 } 1651 }
1652 1652
1653 /// <summary> 1653 /// <summary>
@@ -1655,14 +1655,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1655 /// </summary> 1655 /// </summary>
1656 /// <param name="itemID"></param> 1656 /// <param name="itemID"></param>
1657 /// <param name="userID"></param> 1657 /// <param name="userID"></param>
1658 /// <returns></returns> 1658 /// <returns></returns>
1659 private bool CanDeleteUserInventory(UUID itemID, UUID userID) 1659 private bool CanDeleteUserInventory(UUID itemID, UUID userID)
1660 { 1660 {
1661 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1661 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1662 if (m_bypassPermissions) return m_bypassPermissionsValue; 1662 if (m_bypassPermissions) return m_bypassPermissionsValue;
1663 1663
1664 return true; 1664 return true;
1665 } 1665 }
1666 1666
1667 private bool CanTeleport(UUID userID, Scene scene) 1667 private bool CanTeleport(UUID userID, Scene scene)
1668 { 1668 {
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
index e0331d3..58e4261 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
153 public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) 153 public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName)
154 { 154 {
155 SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); 155 SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName);
156 } 156 }
157 157
158 public SceneObjectGroup DeserializeGroupFromXml2(string xmlString) 158 public SceneObjectGroup DeserializeGroupFromXml2(string xmlString)
159 { 159 {
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index 373b6ab..799a448 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
238 { 238 {
239 m_serialiserModule = new SerialiserModule(); 239 m_serialiserModule = new SerialiserModule();
240 m_scene = SceneSetupHelpers.SetupScene(""); 240 m_scene = SceneSetupHelpers.SetupScene("");
241 SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); 241 SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
242 } 242 }
243 243
244 [Test] 244 [Test]
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
299 continue; 299 continue;
300 300
301 switch (xtr.Name) 301 switch (xtr.Name)
302 { 302 {
303 case "UUID": 303 case "UUID":
304 xtr.ReadStartElement("UUID"); 304 xtr.ReadStartElement("UUID");
305 uuid = UUID.Parse(xtr.ReadElementString("Guid")); 305 uuid = UUID.Parse(xtr.ReadElementString("Guid"));
@@ -311,7 +311,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
311 case "CreatorID": 311 case "CreatorID":
312 xtr.ReadStartElement("CreatorID"); 312 xtr.ReadStartElement("CreatorID");
313 creatorId = UUID.Parse(xtr.ReadElementString("Guid")); 313 creatorId = UUID.Parse(xtr.ReadElementString("Guid"));
314 xtr.ReadEndElement(); 314 xtr.ReadEndElement();
315 break; 315 break;
316 } 316 }
317 } 317 }
@@ -325,8 +325,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
325 // TODO: More checks 325 // TODO: More checks
326 Assert.That(uuid, Is.EqualTo(rpUuid)); 326 Assert.That(uuid, Is.EqualTo(rpUuid));
327 Assert.That(name, Is.EqualTo(rpName)); 327 Assert.That(name, Is.EqualTo(rpName));
328 Assert.That(creatorId, Is.EqualTo(rpCreatorId)); 328 Assert.That(creatorId, Is.EqualTo(rpCreatorId));
329 } 329 }
330 330
331 [Test] 331 [Test]
332 public void TestDeserializeXml2() 332 public void TestDeserializeXml2()
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
372 string xml2 = m_serialiserModule.SerializeGroupToXml2(so); 372 string xml2 = m_serialiserModule.SerializeGroupToXml2(so);
373 373
374 XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); 374 XmlTextReader xtr = new XmlTextReader(new StringReader(xml2));
375 xtr.ReadStartElement("SceneObjectGroup"); 375 xtr.ReadStartElement("SceneObjectGroup");
376 xtr.ReadStartElement("SceneObjectPart"); 376 xtr.ReadStartElement("SceneObjectPart");
377 377
378 UUID uuid = UUID.Zero; 378 UUID uuid = UUID.Zero;
@@ -385,7 +385,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
385 continue; 385 continue;
386 386
387 switch (xtr.Name) 387 switch (xtr.Name)
388 { 388 {
389 case "UUID": 389 case "UUID":
390 xtr.ReadStartElement("UUID"); 390 xtr.ReadStartElement("UUID");
391 uuid = UUID.Parse(xtr.ReadElementString("Guid")); 391 uuid = UUID.Parse(xtr.ReadElementString("Guid"));
@@ -397,7 +397,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
397 case "CreatorID": 397 case "CreatorID":
398 xtr.ReadStartElement("CreatorID"); 398 xtr.ReadStartElement("CreatorID");
399 creatorId = UUID.Parse(xtr.ReadElementString("Guid")); 399 creatorId = UUID.Parse(xtr.ReadElementString("Guid"));
400 xtr.ReadEndElement(); 400 xtr.ReadEndElement();
401 break; 401 break;
402 } 402 }
403 } 403 }
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index 6cc0ed9..37f1f2e 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -33,9 +33,9 @@ using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
34 34
35namespace OpenSim.Region.CoreModules.World.Sound 35namespace OpenSim.Region.CoreModules.World.Sound
36{ 36{
37 public class SoundModule : IRegionModule, ISoundModule 37 public class SoundModule : IRegionModule, ISoundModule
38 { 38 {
39 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 39 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40 40
41 protected Scene m_scene; 41 protected Scene m_scene;
@@ -68,11 +68,11 @@ namespace OpenSim.Region.CoreModules.World.Sound
68 if (dis > 100.0) // Max audio distance 68 if (dis > 100.0) // Max audio distance
69 continue; 69 continue;
70 70
71 // Scale by distance 71 // Scale by distance
72 gain = (float)((double)gain*((100.0 - dis) / 100.0)); 72 gain = (float)((double)gain*((100.0 - dis) / 100.0));
73 73
74 p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); 74 p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
75 } 75 }
76 } 76 }
77 77
78 public virtual void TriggerSound( 78 public virtual void TriggerSound(
@@ -84,12 +84,12 @@ namespace OpenSim.Region.CoreModules.World.Sound
84 if (dis > 100.0) // Max audio distance 84 if (dis > 100.0) // Max audio distance
85 continue; 85 continue;
86 86
87 // Scale by distance 87 // Scale by distance
88 gain = (float)((double)gain*((100.0 - dis) / 100.0)); 88 gain = (float)((double)gain*((100.0 - dis) / 100.0));
89 89
90 p.ControllingClient.SendTriggeredSound( 90 p.ControllingClient.SendTriggeredSound(
91 soundId, ownerID, objectID, parentID, handle, position, (float)gain); 91 soundId, ownerID, objectID, parentID, handle, position, (float)gain);
92 } 92 }
93 } 93 }
94 } 94 }
95} 95}
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index aa38c09..0712a7f 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules
322 m_DayLengthHours = config.Configs["Sun"].GetDouble("day_length", d_day_length); 322 m_DayLengthHours = config.Configs["Sun"].GetDouble("day_length", d_day_length);
323 323
324 // Horizon shift, this is used to shift the sun's orbit, this affects the day / night ratio 324 // Horizon shift, this is used to shift the sun's orbit, this affects the day / night ratio
325 // must hard code to ~.5 to match sun position in LL based viewers 325 // must hard code to ~.5 to match sun position in LL based viewers
326 m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night); 326 m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night);
327 327
328 328
@@ -494,7 +494,7 @@ namespace OpenSim.Region.CoreModules
494 receivedEstateToolsSunUpdate = true; 494 receivedEstateToolsSunUpdate = true;
495 495
496 // Generate shared values 496 // Generate shared values
497 GenSunPos(); 497 GenSunPos();
498 498
499 // When sun settings are updated, we should update all clients with new settings. 499 // When sun settings are updated, we should update all clients with new settings.
500 SunUpdateToAllClients(); 500 SunUpdateToAllClients();
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
index a09315a..c2ad7b8 100644
--- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
+++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
43 protected Scene m_scene; 43 protected Scene m_scene;
44 44
45 protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; 45 protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree };
46 public PCode[] CreationCapabilities { get { return creationCapabilities; } } 46 public PCode[] CreationCapabilities { get { return creationCapabilities; } }
47 47
48 public void Initialise(Scene scene, IConfigSource source) 48 public void Initialise(Scene scene, IConfigSource source)
49 { 49 {
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
73 UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) 73 UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
74 { 74 {
75 if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0) 75 if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0)
76 { 76 {
77 m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); 77 m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
78 return null; 78 return null;
79 } 79 }
@@ -111,6 +111,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
111 tree.Scale = new Vector3(4, 4, 4); 111 tree.Scale = new Vector3(4, 4, 4);
112 break; 112 break;
113 } 113 }
114 } 114 }
115 } 115 }
116} 116}
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
index 41d2071..9d47e19 100644
--- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
46 46
47 private float m_avgStrength = 5.0f; // Average magnitude of the wind vector 47 private float m_avgStrength = 5.0f; // Average magnitude of the wind vector
48 private float m_avgDirection = 0.0f; // Average direction of the wind in degrees 48 private float m_avgDirection = 0.0f; // Average direction of the wind in degrees
49 private float m_varStrength = 5.0f; // Max Strength Variance 49 private float m_varStrength = 5.0f; // Max Strength Variance
50 private float m_varDirection = 30.0f;// Max Direction Variance 50 private float m_varDirection = 30.0f;// Max Direction Variance
51 private float m_rateChange = 1.0f; // 51 private float m_rateChange = 1.0f; //
52 52
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
141 { 141 {
142 m_windSpeeds[y * 16 + x] = m_curPredominateWind; 142 m_windSpeeds[y * 16 + x] = m_curPredominateWind;
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 public Vector3 WindSpeed(float fX, float fY, float fZ) 147 public Vector3 WindSpeed(float fX, float fY, float fZ)
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
index 2c371da..071e20b 100644
--- a/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/SimpleRandomWind.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
95 m_windSpeeds[y * 16 + x].Y *= m_strength; 95 m_windSpeeds[y * 16 + x].Y *= m_strength;
96 } 96 }
97 } 97 }
98 } 98 }
99 } 99 }
100 100
101 public Vector3 WindSpeed(float fX, float fY, float fZ) 101 public Vector3 WindSpeed(float fX, float fY, float fZ)
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index b442f6f..3283c1f 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules
418 } 418 }
419 419
420 avatar.ControllingClient.SendWindData(windSpeeds); 420 avatar.ControllingClient.SendWindData(windSpeeds);
421 } 421 }
422 } 422 }
423 423
424 private void SendWindAllClients() 424 private void SendWindAllClients()
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 4783b35..436f332 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -33,6 +33,8 @@ using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35using OpenSim.Region.Framework.Scenes.Hypergrid; 35using OpenSim.Region.Framework.Scenes.Hypergrid;
36using OpenSim.Services.Interfaces;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
36 38
37namespace OpenSim.Region.CoreModules.World.WorldMap 39namespace OpenSim.Region.CoreModules.World.WorldMap
38{ 40{
@@ -92,13 +94,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
92 } 94 }
93 95
94 // try to fetch from GridServer 96 // try to fetch from GridServer
95 List<RegionInfo> regionInfos = m_scene.SceneGridService.RequestNamedRegions(mapName, 20); 97 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20);
96 if (regionInfos == null) 98 if (regionInfos == null)
97 { 99 {
98 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); 100 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?");
99 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region 101 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
100 regionInfos = new List<RegionInfo>(); 102 regionInfos = new List<GridRegion>();
101 RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); 103 GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName);
102 if (info != null) regionInfos.Add(info); 104 if (info != null) regionInfos.Add(info);
103 } 105 }
104 106
@@ -109,11 +111,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
109 if (mapName.Contains(".") && mapName.Contains(":")) 111 if (mapName.Contains(".") && mapName.Contains(":"))
110 { 112 {
111 // It probably is a domain name. Try to link to it. 113 // It probably is a domain name. Try to link to it.
112 RegionInfo regInfo; 114 GridRegion regInfo;
113 Scene cScene = GetClientScene(remoteClient); 115 Scene cScene = GetClientScene(remoteClient);
114 regInfo = HGHyperlink.TryLinkRegion(cScene, remoteClient, mapName); 116 IHyperlinkService hyperService = cScene.RequestModuleInterface<IHyperlinkService>();
115 if (regInfo != null) 117 if (hyperService != null)
116 regionInfos.Add(regInfo); 118 {
119 regInfo = hyperService.TryLinkRegion(remoteClient, mapName);
120 if (regInfo != null)
121 regionInfos.Add(regInfo);
122 }
117 } 123 }
118 } 124 }
119 125
@@ -122,17 +128,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
122 MapBlockData data; 128 MapBlockData data;
123 if (regionInfos.Count > 0) 129 if (regionInfos.Count > 0)
124 { 130 {
125 foreach (RegionInfo info in regionInfos) 131 foreach (GridRegion info in regionInfos)
126 { 132 {
127 data = new MapBlockData(); 133 data = new MapBlockData();
128 data.Agents = 0; 134 data.Agents = 0;
129 data.Access = info.AccessLevel; 135 data.Access = info.Access;
130 data.MapImageId = info.RegionSettings.TerrainImageID; 136 data.MapImageId = info.TerrainImage;
131 data.Name = info.RegionName; 137 data.Name = info.RegionName;
132 data.RegionFlags = 0; // TODO not used? 138 data.RegionFlags = 0; // TODO not used?
133 data.WaterHeight = 0; // not used 139 data.WaterHeight = 0; // not used
134 data.X = (ushort)info.RegionLocX; 140 data.X = (ushort)(info.RegionLocX / Constants.RegionSize);
135 data.Y = (ushort)info.RegionLocY; 141 data.Y = (ushort)(info.RegionLocY / Constants.RegionSize);
136 blocks.Add(data); 142 blocks.Add(data);
137 } 143 }
138 } 144 }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 1f25f28..05ed70a 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -48,6 +48,7 @@ using OpenSim.Region.Framework.Scenes;
48using Caps=OpenSim.Framework.Capabilities.Caps; 48using Caps=OpenSim.Framework.Capabilities.Caps;
49using OSDArray=OpenMetaverse.StructuredData.OSDArray; 49using OSDArray=OpenMetaverse.StructuredData.OSDArray;
50using OSDMap=OpenMetaverse.StructuredData.OSDMap; 50using OSDMap=OpenMetaverse.StructuredData.OSDMap;
51using GridRegion = OpenSim.Services.Interfaces.GridRegion;
51 52
52namespace OpenSim.Region.CoreModules.World.WorldMap 53namespace OpenSim.Region.CoreModules.World.WorldMap
53{ 54{
@@ -232,10 +233,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
232 } 233 }
233 if (lookup) 234 if (lookup)
234 { 235 {
235 List<MapBlockData> mapBlocks; 236 List<MapBlockData> mapBlocks = new List<MapBlockData>(); ;
236 237
237 mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); 238 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
238 avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); 239 (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize,
240 (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize,
241 (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize,
242 (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize);
243 foreach (GridRegion r in regions)
244 {
245 MapBlockData block = new MapBlockData();
246 MapBlockFromGridRegion(block, r);
247 mapBlocks.Add(block);
248 }
249 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
239 250
240 lock (cachedMapBlocks) 251 lock (cachedMapBlocks)
241 cachedMapBlocks = mapBlocks; 252 cachedMapBlocks = mapBlocks;
@@ -579,7 +590,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
579 } 590 }
580 if (httpserver.Length == 0) 591 if (httpserver.Length == 0)
581 { 592 {
582 RegionInfo mreg = m_scene.SceneGridService.RequestNeighbouringRegionInfo(regionhandle); 593 uint x = 0, y = 0;
594 Utils.LongToUInts(regionhandle, out x, out y);
595 GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
583 596
584 if (mreg != null) 597 if (mreg != null)
585 { 598 {
@@ -719,15 +732,25 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
719 { 732 {
720 List<MapBlockData> response = new List<MapBlockData>(); 733 List<MapBlockData> response = new List<MapBlockData>();
721 734
722 // this should return one mapblock at most. But make sure: Look whether the one we requested is in there 735 // this should return one mapblock at most.
723 List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); 736 // (diva note: why?? in that case we should GetRegionByPosition)
724 if (mapBlocks != null) 737 // But make sure: Look whether the one we requested is in there
738 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
739 minX * (int)Constants.RegionSize,
740 maxX * (int)Constants.RegionSize,
741 minY * (int)Constants.RegionSize,
742 maxY * (int)Constants.RegionSize);
743
744 if (regions != null)
725 { 745 {
726 foreach (MapBlockData block in mapBlocks) 746 foreach (GridRegion r in regions)
727 { 747 {
728 if (block.X == minX && block.Y == minY) 748 if ((r.RegionLocX == minX * (int)Constants.RegionSize) &&
749 (r.RegionLocY == minY * (int)Constants.RegionSize))
729 { 750 {
730 // found it => add it to response 751 // found it => add it to response
752 MapBlockData block = new MapBlockData();
753 MapBlockFromGridRegion(block, r);
731 response.Add(block); 754 response.Add(block);
732 break; 755 break;
733 } 756 }
@@ -754,10 +777,30 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
754 777
755 protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 778 protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
756 { 779 {
757 List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, maxX + 4, maxY + 4); 780 List<MapBlockData> mapBlocks = new List<MapBlockData>();
781 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
782 (minX - 4) * (int)Constants.RegionSize,
783 (maxX + 4) * (int)Constants.RegionSize,
784 (minY - 4) * (int)Constants.RegionSize,
785 (maxY + 4) * (int)Constants.RegionSize);
786 foreach (GridRegion r in regions)
787 {
788 MapBlockData block = new MapBlockData();
789 MapBlockFromGridRegion(block, r);
790 mapBlocks.Add(block);
791 }
758 remoteClient.SendMapBlock(mapBlocks, flag); 792 remoteClient.SendMapBlock(mapBlocks, flag);
759 } 793 }
760 794
795 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r)
796 {
797 block.Access = r.Access;
798 block.MapImageId = r.TerrainImage;
799 block.Name = r.RegionName;
800 block.X = (ushort)(r.RegionLocX / Constants.RegionSize);
801 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
802 }
803
761 public Hashtable OnHTTPGetMapImage(Hashtable keysvals) 804 public Hashtable OnHTTPGetMapImage(Hashtable keysvals)
762 { 805 {
763 m_log.Debug("[WORLD MAP]: Sending map image jpeg"); 806 m_log.Debug("[WORLD MAP]: Sending map image jpeg");
@@ -874,31 +917,34 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
874 m_log.InfoFormat( 917 m_log.InfoFormat(
875 "[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath); 918 "[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath);
876 919
877 List<MapBlockData> mapBlocks = 920 List<MapBlockData> mapBlocks = new List<MapBlockData>();
878 m_scene.CommsManager.GridService.RequestNeighbourMapBlocks( 921 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
879 (int)(m_scene.RegionInfo.RegionLocX - 9), 922 (int)(m_scene.RegionInfo.RegionLocX - 9) * (int)Constants.RegionSize,
880 (int)(m_scene.RegionInfo.RegionLocY - 9), 923 (int)(m_scene.RegionInfo.RegionLocX + 9) * (int)Constants.RegionSize,
881 (int)(m_scene.RegionInfo.RegionLocX + 9), 924 (int)(m_scene.RegionInfo.RegionLocY - 9) * (int)Constants.RegionSize,
882 (int)(m_scene.RegionInfo.RegionLocY + 9)); 925 (int)(m_scene.RegionInfo.RegionLocY + 9) * (int)Constants.RegionSize);
883 List<AssetBase> textures = new List<AssetBase>(); 926 List<AssetBase> textures = new List<AssetBase>();
884 List<Image> bitImages = new List<Image>(); 927 List<Image> bitImages = new List<Image>();
885 928
886 foreach (MapBlockData mapBlock in mapBlocks) 929 foreach (GridRegion r in regions)
887 { 930 {
931 MapBlockData mapBlock = new MapBlockData();
932 MapBlockFromGridRegion(mapBlock, r);
888 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); 933 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString());
889 934
890 if (texAsset != null) 935 if (texAsset != null)
891 { 936 {
892 textures.Add(texAsset); 937 textures.Add(texAsset);
893 } 938 }
894 else 939 //else
895 { 940 //{
896 texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); 941 // // WHAT?!? This doesn't seem right. Commenting (diva)
897 if (texAsset != null) 942 // texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString());
898 { 943 // if (texAsset != null)
899 textures.Add(texAsset); 944 // {
900 } 945 // textures.Add(texAsset);
901 } 946 // }
947 //}
902 } 948 }
903 949
904 foreach (AssetBase asset in textures) 950 foreach (AssetBase asset in textures)
diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
index b45b923..5fff89f 100644
--- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
67 67
68 if (userInfo != null) 68 if (userInfo != null)
69 { 69 {
70 UserProfileData userProfile = userInfo.UserProfile; 70 UserProfileData userProfile = userInfo.UserProfile;
71 firstname = userProfile.FirstName; 71 firstname = userProfile.FirstName;
72 lastname = userProfile.SurName; 72 lastname = userProfile.SurName;
73 73
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 31222df..8ad4844 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -789,7 +789,7 @@ namespace OpenSim.Region.Examples.SimpleModule
789 789
790 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) 790 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
791 { 791 {
792 } 792 }
793 793
794 public void SendViewerTime(int phase) 794 public void SendViewerTime(int phase)
795 { 795 {
diff --git a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
index c1ed1ac..0cc8fb6 100644
--- a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces
41 sbyte type, byte wearableType, uint nextOwnerMask); 41 sbyte type, byte wearableType, uint nextOwnerMask);
42 42
43 void HandleTaskItemUpdateFromTransaction( 43 void HandleTaskItemUpdateFromTransaction(
44 IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item); 44 IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item);
45 45
46 void RemoveAgentAssetTransactions(UUID userID); 46 void RemoveAgentAssetTransactions(UUID userID);
47 } 47 }
diff --git a/OpenSim/Region/Framework/Interfaces/ICommander.cs b/OpenSim/Region/Framework/Interfaces/ICommander.cs
index 9371bea..6b872c1 100644
--- a/OpenSim/Region/Framework/Interfaces/ICommander.cs
+++ b/OpenSim/Region/Framework/Interfaces/ICommander.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Framework.Interfaces
33 { 33 {
34 /// <value> 34 /// <value>
35 /// The name of this commander 35 /// The name of this commander
36 /// </value> 36 /// </value>
37 string Name { get; } 37 string Name { get; }
38 38
39 /// <value> 39 /// <value>
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Interfaces
44 /// <summary> 44 /// <summary>
45 /// The commands available for this commander 45 /// The commands available for this commander
46 /// </summary> 46 /// </summary>
47 Dictionary<string, ICommand> Commands { get; } 47 Dictionary<string, ICommand> Commands { get; }
48 48
49 void ProcessConsoleCommand(string function, string[] args); 49 void ProcessConsoleCommand(string function, string[] args);
50 void RegisterCommand(string commandName, ICommand command); 50 void RegisterCommand(string commandName, ICommand command);
diff --git a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
index a6ca7f1..ce57c44 100644
--- a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
@@ -37,15 +37,15 @@ namespace OpenSim.Region.Framework.Interfaces
37 /// small interval. 37 /// small interval.
38 /// </summary> 38 /// </summary>
39 /// <param name="client"></param> 39 /// <param name="client"></param>
40 /// <param name="message"></param> 40 /// <param name="message"></param>
41 void SendAlertToUser(IClientAPI client, string message); 41 void SendAlertToUser(IClientAPI client, string message);
42 42
43 /// <summary> 43 /// <summary>
44 /// Send an alert message to a particular user. 44 /// Send an alert message to a particular user.
45 /// </summary> 45 /// </summary>
46 /// <param name="client"></param> 46 /// <param name="client"></param>
47 /// <param name="message"></param> 47 /// <param name="message"></param>
48 /// <param name="modal"></param> 48 /// <param name="modal"></param>
49 void SendAlertToUser(IClientAPI client, string message, bool modal); 49 void SendAlertToUser(IClientAPI client, string message, bool modal);
50 50
51 /// <summary> 51 /// <summary>
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Interfaces
73 void SendAlertToUser(string firstName, string lastName, string message, bool modal); 73 void SendAlertToUser(string firstName, string lastName, string message, bool modal);
74 74
75 /// <summary> 75 /// <summary>
76 /// Send an alert message to all users in the scene. 76 /// Send an alert message to all users in the scene.
77 /// </summary> 77 /// </summary>
78 /// <param name="message"></param> 78 /// <param name="message"></param>
79 void SendGeneralAlert(string message); 79 void SendGeneralAlert(string message);
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Framework.Interfaces
104 /// <param name="message"></param> 104 /// <param name="message"></param>
105 /// <param name="url"></param> 105 /// <param name="url"></param>
106 void SendUrlToUser( 106 void SendUrlToUser(
107 UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url); 107 UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url);
108 108
109 /// <summary> 109 /// <summary>
110 /// Send a notification to all users in the scene. This notification should remain around until the 110 /// Send a notification to all users in the scene. This notification should remain around until the
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Interfaces
116 /// 116 ///
117 /// <param name="fromAvatarID">The user sending the message</param> 117 /// <param name="fromAvatarID">The user sending the message</param>
118 /// <param name="fromAvatarName">The name of the user doing the sending</param> 118 /// <param name="fromAvatarName">The name of the user doing the sending</param>
119 /// <param name="message">The message being sent to the user</param> 119 /// <param name="message">The message being sent to the user</param>
120 void SendNotificationToUsersInRegion(UUID fromAvatarID, string fromAvatarName, string message); 120 void SendNotificationToUsersInRegion(UUID fromAvatarID, string fromAvatarName, string message);
121 121
122 /// <summary> 122 /// <summary>
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Interfaces
129 /// 129 ///
130 /// <param name="fromAvatarID">The user sending the message</param> 130 /// <param name="fromAvatarID">The user sending the message</param>
131 /// <param name="fromAvatarName">The name of the user doing the sending</param> 131 /// <param name="fromAvatarName">The name of the user doing the sending</param>
132 /// <param name="message">The message being sent to the user</param> 132 /// <param name="message">The message being sent to the user</param>
133 void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message); 133 void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message);
134 } 134 }
135} 135}
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
index f3a3747..c39627c 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
@@ -29,13 +29,13 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// Interface to a class that is capable of creating entities 35 /// Interface to a class that is capable of creating entities
36 /// </summary> 36 /// </summary>
37 public interface IEntityCreator 37 public interface IEntityCreator
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// The entities that this class is capable of creating. These match the PCode format. 40 /// The entities that this class is capable of creating. These match the PCode format.
41 /// </summary> 41 /// </summary>
@@ -51,6 +51,6 @@ namespace OpenSim.Region.Framework.Interfaces
51 /// <param name="rot"></param> 51 /// <param name="rot"></param>
52 /// <param name="shape"></param> 52 /// <param name="shape"></param>
53 /// <returns>The entity created, or null if the creation failed</returns> 53 /// <returns>The entity created, or null if the creation failed</returns>
54 SceneObjectGroup CreateEntity(UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape); 54 SceneObjectGroup CreateEntity(UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape);
55 } 55 }
56} 56}
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 1ed92fb..2c906a2 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Interfaces
64 /// <summary> 64 /// <summary>
65 /// Change every item in this inventory to a new group. 65 /// Change every item in this inventory to a new group.
66 /// </summary> 66 /// </summary>
67 /// <param name="groupID"></param> 67 /// <param name="groupID"></param>
68 void ChangeInventoryGroup(UUID groupID); 68 void ChangeInventoryGroup(UUID groupID);
69 69
70 /// <summary> 70 /// <summary>
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Framework.Interfaces
94 /// <param name="startParam"></param> 94 /// <param name="startParam"></param>
95 /// <param name="postOnRez"></param> 95 /// <param name="postOnRez"></param>
96 /// <param name="engine"></param> 96 /// <param name="engine"></param>
97 /// <param name="stateSource"></param> 97 /// <param name="stateSource"></param>
98 void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource); 98 void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
99 99
100 /// <summary> 100 /// <summary>
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Interfaces
150 150
151 /// <summary> 151 /// <summary>
152 /// Return the name with which a client can request a xfer of this prim's inventory metadata 152 /// Return the name with which a client can request a xfer of this prim's inventory metadata
153 /// </summary> 153 /// </summary>
154 string GetInventoryFileName(); 154 string GetInventoryFileName();
155 155
156 bool GetInventoryFileName(IClientAPI client, uint localID); 156 bool GetInventoryFileName(IClientAPI client, uint localID);
diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
index af54c76..7a8aba2 100644
--- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface IFriendsModule 33 public interface IFriendsModule
34 { 34 {
35 /// <summary> 35 /// <summary>
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
43 /// FIXME: This is somewhat too tightly coupled - it should arguably be possible to offer friendships even if the 43 /// FIXME: This is somewhat too tightly coupled - it should arguably be possible to offer friendships even if the
44 /// receiving user is not currently online. 44 /// receiving user is not currently online.
45 /// </param> 45 /// </param>
46 /// <param name="offerMessage"></param> 46 /// <param name="offerMessage"></param>
47 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage); 47 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage);
48 } 48 }
49} 49}
diff --git a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
index 02abb05..552ce01 100644
--- a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// This interface provides god related methods 34 /// This interface provides god related methods
35 /// </summary> 35 /// </summary>
@@ -53,6 +53,6 @@ namespace OpenSim.Region.Framework.Interfaces
53 /// <param name="agentID">the person that is being kicked</param> 53 /// <param name="agentID">the person that is being kicked</param>
54 /// <param name="kickflags">This isn't used apparently</param> 54 /// <param name="kickflags">This isn't used apparently</param>
55 /// <param name="reason">The message to send to the user after it's been turned into a field</param> 55 /// <param name="reason">The message to send to the user after it's been turned into a field</param>
56 void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason); 56 void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason);
57 } 57 }
58} 58}
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
index 1622564..2d038ce 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
@@ -30,7 +30,7 @@ using System.IO;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// Used for the OnInventoryArchiveSaved event. 35 /// Used for the OnInventoryArchiveSaved event.
36 /// </summary> 36 /// </summary>
@@ -43,11 +43,11 @@ namespace OpenSim.Region.Framework.Interfaces
43 public delegate void InventoryArchiveSaved( 43 public delegate void InventoryArchiveSaved(
44 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException); 44 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException);
45 45
46 public interface IInventoryArchiverModule 46 public interface IInventoryArchiverModule
47 { 47 {
48 /// <summary> 48 /// <summary>
49 /// Fired when an archive inventory save has been completed. 49 /// Fired when an archive inventory save has been completed.
50 /// </summary> 50 /// </summary>
51 event InventoryArchiveSaved OnInventoryArchiveSaved; 51 event InventoryArchiveSaved OnInventoryArchiveSaved;
52 52
53 /// <summary> 53 /// <summary>
@@ -69,6 +69,6 @@ namespace OpenSim.Region.Framework.Interfaces
69 /// <param name="invPath">The inventory path from which the inventory should be saved.</param> 69 /// <param name="invPath">The inventory path from which the inventory should be saved.</param>
70 /// <param name="saveStream">The stream to which the inventory archive will be saved</param> 70 /// <param name="saveStream">The stream to which the inventory archive will be saved</param>
71 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns> 71 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
72 bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream); 72 bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream);
73 } 73 }
74} 74}
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
index 19b8574..74f404f 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces
41 /// </summary> 41 /// </summary>
42 /// <param name="x">Value between 0 - 256 on the x axis of the point</param> 42 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
44 /// <returns>Land object at the point supplied</returns> 44 /// <returns>Land object at the point supplied</returns>
45 ILandObject GetLandObject(int x, int y); 45 ILandObject GetLandObject(int x, int y);
46 46
47 ILandObject GetLandObject(int localID); 47 ILandObject GetLandObject(int localID);
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces
51 /// </summary> 51 /// </summary>
52 /// <param name="x">Value between 0 - 256 on the x axis of the point</param> 52 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
53 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 53 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
54 /// <returns>Land object at the point supplied</returns> 54 /// <returns>Land object at the point supplied</returns>
55 ILandObject GetLandObject(float x, float y); 55 ILandObject GetLandObject(float x, float y);
56 56
57 bool IsLandPrimCountTainted(); 57 bool IsLandPrimCountTainted();
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
index 78b5322..9ad2036 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
@@ -52,9 +52,9 @@ namespace OpenSim.Region.Framework.Interfaces
52 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to 52 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
53 /// the EventManager.OnOarFileSaved event. 53 /// the EventManager.OnOarFileSaved event.
54 /// 54 ///
55 /// <param name="savePath"></param> 55 /// <param name="savePath"></param>
56 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 56 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
57 void ArchiveRegion(string savePath, Guid requestId); 57 void ArchiveRegion(string savePath, Guid requestId);
58 58
59 /// <summary> 59 /// <summary>
60 /// Archive the region to a stream. 60 /// Archive the region to a stream.
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Interfaces
88 /// settings in the archive will be ignored. 88 /// settings in the archive will be ignored.
89 /// </param> 89 /// </param>
90 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 90 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
91 void DearchiveRegion(string loadPath, bool merge, Guid requestId); 91 void DearchiveRegion(string loadPath, bool merge, Guid requestId);
92 92
93 /// <summary> 93 /// <summary>
94 /// Dearchive a region from a stream. This replaces the existing scene. 94 /// Dearchive a region from a stream. This replaces the existing scene.
@@ -109,8 +109,8 @@ namespace OpenSim.Region.Framework.Interfaces
109 /// <param name="merge"> 109 /// <param name="merge">
110 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region 110 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
111 /// settings in the archive will be ignored. 111 /// settings in the archive will be ignored.
112 /// </param> 112 /// </param>
113 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 113 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
114 void DearchiveRegion(Stream loadStream, bool merge, Guid requestId); 114 void DearchiveRegion(Stream loadStream, bool merge, Guid requestId);
115 } 115 }
116} 116}
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
index 41a1e51..78bd622 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
@@ -71,21 +71,21 @@ namespace OpenSim.Region.Framework.Interfaces
71 /// Load persisted objects from region storage. 71 /// Load persisted objects from region storage.
72 /// </summary> 72 /// </summary>
73 /// <param name="regionUUID">the Region UUID</param> 73 /// <param name="regionUUID">the Region UUID</param>
74 /// <returns>List of loaded groups</returns> 74 /// <returns>List of loaded groups</returns>
75 List<SceneObjectGroup> LoadObjects(UUID regionUUID); 75 List<SceneObjectGroup> LoadObjects(UUID regionUUID);
76 76
77 /// <summary> 77 /// <summary>
78 /// Store a terrain revision in region storage 78 /// Store a terrain revision in region storage
79 /// </summary> 79 /// </summary>
80 /// <param name="ter">HeightField data</param> 80 /// <param name="ter">HeightField data</param>
81 /// <param name="regionID">region UUID</param> 81 /// <param name="regionID">region UUID</param>
82 void StoreTerrain(double[,] terrain, UUID regionID); 82 void StoreTerrain(double[,] terrain, UUID regionID);
83 83
84 /// <summary> 84 /// <summary>
85 /// Load the latest terrain revision from region storage 85 /// Load the latest terrain revision from region storage
86 /// </summary> 86 /// </summary>
87 /// <param name="regionID">the region UUID</param> 87 /// <param name="regionID">the region UUID</param>
88 /// <returns>Heightfield data</returns> 88 /// <returns>Heightfield data</returns>
89 double[,] LoadTerrain(UUID regionID); 89 double[,] LoadTerrain(UUID regionID);
90 90
91 void StoreLandObject(ILandObject Parcel); 91 void StoreLandObject(ILandObject Parcel);
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Framework.Interfaces
96 /// <item>delete from landaccesslist where LandUUID=globalID</item> 96 /// <item>delete from landaccesslist where LandUUID=globalID</item>
97 /// </list> 97 /// </list>
98 /// </summary> 98 /// </summary>
99 /// <param name="globalID"></param> 99 /// <param name="globalID"></param>
100 void RemoveLandObject(UUID globalID); 100 void RemoveLandObject(UUID globalID);
101 101
102 List<LandData> LoadLandObjects(UUID regionUUID); 102 List<LandData> LoadLandObjects(UUID regionUUID);
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
index bfd25d3..e7562a5 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
@@ -117,6 +117,6 @@ namespace OpenSim.Region.Framework.Interfaces
117 /// </summary> 117 /// </summary>
118 /// <param name="grp"></param> 118 /// <param name="grp"></param>
119 /// <returns></returns> 119 /// <returns></returns>
120 string SerializeGroupToXml2(SceneObjectGroup grp); 120 string SerializeGroupToXml2(SceneObjectGroup grp);
121 } 121 }
122} 122}
diff --git a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
index 3d803ee..379fabd 100644
--- a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
@@ -29,12 +29,12 @@ using System;
29using OpenMetaverse; 29using OpenMetaverse;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface ISoundModule 33 public interface ISoundModule
34 { 34 {
35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags); 35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags);
36 36
37 void TriggerSound( 37 void TriggerSound(
38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle); 38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle);
39 } 39 }
40} \ No newline at end of file 40} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs b/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
index 344601f..403d542 100644
--- a/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Region.Framework.Scenes; 29using OpenSim.Region.Framework.Scenes;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface IVegetationModule : IEntityCreator 33 public interface IVegetationModule : IEntityCreator
34 { 34 {
35 /// <summary> 35 /// <summary>
@@ -44,6 +44,6 @@ namespace OpenSim.Region.Framework.Interfaces
44 /// <param name="newTree"></param> 44 /// <param name="newTree"></param>
45 /// <returns></returns> 45 /// <returns></returns>
46 SceneObjectGroup AddTree( 46 SceneObjectGroup AddTree(
47 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree); 47 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree);
48 } 48 }
49} 49}
diff --git a/OpenSim/Framework/Communications/IHyperlink.cs b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs
index 5057386..2e555fa 100644
--- a/OpenSim/Framework/Communications/IHyperlink.cs
+++ b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs
@@ -25,14 +25,21 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28namespace OpenSim.Framework.Communications 28
29using System.IO;
30using OpenMetaverse;
31
32namespace OpenSim.Region.Framework.Interfaces
29{ 33{
30 public interface IHyperlink 34 public interface IVoiceModule
31 { 35 {
32 bool IsHyperlinkRegion(ulong handle); 36
33 RegionInfo GetHyperlinkRegion(ulong handle); 37 /// <summary>
34 ulong FindRegionHandle(ulong handle); 38 /// Set the SIP url to be used by a parcel, this will allow manual setting of a SIP address
35 bool SendUserInformation(RegionInfo region, AgentCircuitData aCircuit); 39 /// for a particular piece of land, allowing region owners to use preconfigured SIP conference channels.
36 void AdjustUserInformation(AgentCircuitData aCircuit); 40 /// This is used by osSetParcelSIPAddress
41 /// </summary>
42 void setLandSIPAddress(string SIPAddress,UUID GlobalID);
43
37 } 44 }
38} 45}
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index a0b0888..de1bcd4 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -26,9 +26,9 @@
26 */ 26 */
27 27
28namespace OpenSim.Region.Framework.Interfaces 28namespace OpenSim.Region.Framework.Interfaces
29{ 29{
30 public interface IWorldMapModule 30 public interface IWorldMapModule
31 { 31 {
32 void LazySaveGeneratedMaptile(byte[] data, bool temporary); 32 void LazySaveGeneratedMaptile(byte[] data, bool temporary);
33 } 33 }
34} 34}
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 7ac1e7e..5b571c7 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -34,7 +34,7 @@ using OpenMetaverse;
34using OpenSim.Framework; 34using OpenSim.Framework;
35 35
36namespace OpenSim.Region.Framework.Scenes 36namespace OpenSim.Region.Framework.Scenes
37{ 37{
38 class DeleteToInventoryHolder 38 class DeleteToInventoryHolder
39 { 39 {
40 public DeRezAction action; 40 public DeRezAction action;
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Scenes
49 /// up the main client thread. 49 /// up the main client thread.
50 /// </summary> 50 /// </summary>
51 public class AsyncSceneObjectGroupDeleter 51 public class AsyncSceneObjectGroupDeleter
52 { 52 {
53 private static readonly ILog m_log 53 private static readonly ILog m_log
54 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
@@ -58,16 +58,16 @@ namespace OpenSim.Region.Framework.Scenes
58 /// </value> 58 /// </value>
59 public bool Enabled; 59 public bool Enabled;
60 60
61 private Timer m_inventoryTicker = new Timer(2000); 61 private Timer m_inventoryTicker = new Timer(2000);
62 private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>(); 62 private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>();
63 private Scene m_scene; 63 private Scene m_scene;
64 64
65 public AsyncSceneObjectGroupDeleter(Scene scene) 65 public AsyncSceneObjectGroupDeleter(Scene scene)
66 { 66 {
67 m_scene = scene; 67 m_scene = scene;
68 68
69 m_inventoryTicker.AutoReset = false; 69 m_inventoryTicker.AutoReset = false;
70 m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; 70 m_inventoryTicker.Elapsed += InventoryRunDeleteTimer;
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Scenes
113 { 113 {
114 //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing..."); 114 //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing...");
115 } 115 }
116 } 116 }
117 117
118 /// <summary> 118 /// <summary>
119 /// Move the next object in the queue to inventory. Then delete it properly from the scene. 119 /// Move the next object in the queue to inventory. Then delete it properly from the scene.
@@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Scenes
121 /// <returns></returns> 121 /// <returns></returns>
122 public bool InventoryDeQueueAndDelete() 122 public bool InventoryDeQueueAndDelete()
123 { 123 {
124 DeleteToInventoryHolder x = null; 124 DeleteToInventoryHolder x = null;
125 125
126 try 126 try
127 { 127 {
@@ -142,9 +142,9 @@ namespace OpenSim.Region.Framework.Scenes
142 142
143 try 143 try
144 { 144 {
145 m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient); 145 m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient);
146 if (x.permissionToDelete) 146 if (x.permissionToDelete)
147 m_scene.DeleteSceneObject(x.objectGroup, false); 147 m_scene.DeleteSceneObject(x.objectGroup, false);
148 } 148 }
149 catch (Exception e) 149 catch (Exception e)
150 { 150 {
@@ -166,6 +166,6 @@ namespace OpenSim.Region.Framework.Scenes
166 166
167 m_log.Debug("[SCENE]: No objects left in inventory send queue."); 167 m_log.Debug("[SCENE]: No objects left in inventory send queue.");
168 return false; 168 return false;
169 } 169 }
170 } 170 }
171} 171}
diff --git a/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
index 06b1d22..72d599a 100644
--- a/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
47 { 47 {
48 if (nod.Attributes["name"] != null) 48 if (nod.Attributes["name"] != null)
49 { 49 {
50 string name = (string)nod.Attributes["name"].Value; 50 string name = (string)nod.Attributes["name"].Value;
51 UUID id = (UUID)nod.InnerText; 51 UUID id = (UUID)nod.InnerText;
52 string animState = (string)nod.Attributes["state"].Value; 52 string animState = (string)nod.Attributes["state"].Value;
53 53
diff --git a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
index 1dd9613..5f2eb0d 100644
--- a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
+++ b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Framework.Scenes
234 234
235 235
236 /// <summary> 236 /// <summary>
237 /// Variable length strings seem to be null terminated in the animation asset.. but.. 237 /// Variable length strings seem to be null terminated in the animation asset.. but..
238 /// use with caution, home grown. 238 /// use with caution, home grown.
239 /// advances the index. 239 /// advances the index.
240 /// </summary> 240 /// </summary>
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Framework.Scenes
273 byte[] interm = new byte[endpos-i]; 273 byte[] interm = new byte[endpos-i];
274 for (; i<endpos; i++) 274 for (; i<endpos; i++)
275 { 275 {
276 interm[i-startpos] = data[i]; 276 interm[i-startpos] = data[i];
277 } 277 }
278 i++; // advance past the null character 278 i++; // advance past the null character
279 279
@@ -624,7 +624,7 @@ switch (jointname)
624 case "mWristLeft": 624 case "mWristLeft":
625 case "mWristRight": 625 case "mWristRight":
626 case "mShoulderLeft": 626 case "mShoulderLeft":
627 case "mShoulderRight": 627 case "mShoulderRight":
628 // ZYX->ZXY 628 // ZYX->ZXY
629 t = y; 629 t = y;
630 y = z; 630 y = z;
diff --git a/OpenSim/Region/Framework/Scenes/Border.cs b/OpenSim/Region/Framework/Scenes/Border.cs
index 1488c5b..c6a6511 100644
--- a/OpenSim/Region/Framework/Scenes/Border.cs
+++ b/OpenSim/Region/Framework/Scenes/Border.cs
@@ -55,11 +55,11 @@ namespace OpenSim.Region.Framework.Scenes
55 /// Creates a Border. The line is perpendicular to the direction cardinal. 55 /// Creates a Border. The line is perpendicular to the direction cardinal.
56 /// IE: if the direction cardinal is South, the line is West->East 56 /// IE: if the direction cardinal is South, the line is West->East
57 /// </summary> 57 /// </summary>
58 /// <param name="lineStart">The starting point for the line of the border. 58 /// <param name="lineStart">The starting point for the line of the border.
59 /// The position of an object must be greater then this for this border to trigger. 59 /// The position of an object must be greater then this for this border to trigger.
60 /// Perpendicular to the direction cardinal</param> 60 /// Perpendicular to the direction cardinal</param>
61 /// <param name="lineEnd">The ending point for the line of the border. 61 /// <param name="lineEnd">The ending point for the line of the border.
62 /// The position of an object must be less then this for this border to trigger. 62 /// The position of an object must be less then this for this border to trigger.
63 /// Perpendicular to the direction cardinal</param> 63 /// Perpendicular to the direction cardinal</param>
64 /// <param name="triggerCoordinate">The position that triggers border the border 64 /// <param name="triggerCoordinate">The position that triggers border the border
65 /// cross parallel to the direction cardinal. On the North cardinal, this 65 /// cross parallel to the direction cardinal. On the North cardinal, this
diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs
index 00c99c5..c2ec6a5 100644
--- a/OpenSim/Region/Framework/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes
130 public abstract void UpdateMovement(); 130 public abstract void UpdateMovement();
131 131
132 /// <summary> 132 /// <summary>
133 /// Performs any updates that need to be done at each frame, as opposed to immediately. 133 /// Performs any updates that need to be done at each frame, as opposed to immediately.
134 /// These included scheduled updates and updates that occur due to physics processing. 134 /// These included scheduled updates and updates that occur due to physics processing.
135 /// </summary> 135 /// </summary>
136 public abstract void Update(); 136 public abstract void Update();
diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs
index 504b90a..0ceef39 100644
--- a/OpenSim/Region/Framework/Scenes/EntityManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
144 { 144 {
145 m_log.ErrorFormat("Remove Entity failed for {0}", localID, e); 145 m_log.ErrorFormat("Remove Entity failed for {0}", localID, e);
146 return false; 146 return false;
147 } 147 }
148 } 148 }
149 } 149 }
150 150
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 287d8d9..753344d 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -32,6 +32,7 @@ using OpenSim.Framework;
32using OpenSim.Framework.Client; 32using OpenSim.Framework.Client;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using Caps=OpenSim.Framework.Capabilities.Caps; 34using Caps=OpenSim.Framework.Capabilities.Caps;
35using GridRegion = OpenSim.Services.Interfaces.GridRegion;
35 36
36namespace OpenSim.Region.Framework.Scenes 37namespace OpenSim.Region.Framework.Scenes
37{ 38{
@@ -289,7 +290,7 @@ namespace OpenSim.Region.Framework.Scenes
289 /// Guid.Empty is returned. 290 /// Guid.Empty is returned.
290 /// </summary> 291 /// </summary>
291 public delegate void OarFileSaved(Guid guid, string message); 292 public delegate void OarFileSaved(Guid guid, string message);
292 public event OarFileSaved OnOarFileSaved; 293 public event OarFileSaved OnOarFileSaved;
293 294
294 /// <summary> 295 /// <summary>
295 /// Called when the script compile queue becomes empty 296 /// Called when the script compile queue becomes empty
@@ -305,6 +306,9 @@ namespace OpenSim.Region.Framework.Scenes
305 public delegate void Attach(uint localID, UUID itemID, UUID avatarID); 306 public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
306 public event Attach OnAttach; 307 public event Attach OnAttach;
307 308
309 public delegate void RegionUp(GridRegion region);
310 public event RegionUp OnRegionUp;
311
308 public class MoneyTransferArgs : EventArgs 312 public class MoneyTransferArgs : EventArgs
309 { 313 {
310 public UUID sender; 314 public UUID sender;
@@ -446,6 +450,7 @@ namespace OpenSim.Region.Framework.Scenes
446 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null; 450 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null;
447 451
448 private Attach handlerOnAttach = null; 452 private Attach handlerOnAttach = null;
453 private RegionUp handlerOnRegionUp = null;
449 454
450 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) 455 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
451 { 456 {
@@ -999,7 +1004,7 @@ namespace OpenSim.Region.Framework.Scenes
999 handlerOarFileSaved = OnOarFileSaved; 1004 handlerOarFileSaved = OnOarFileSaved;
1000 if (handlerOarFileSaved != null) 1005 if (handlerOarFileSaved != null)
1001 handlerOarFileSaved(requestId, message); 1006 handlerOarFileSaved(requestId, message);
1002 } 1007 }
1003 1008
1004 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) 1009 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
1005 { 1010 {
@@ -1035,5 +1040,13 @@ namespace OpenSim.Region.Framework.Scenes
1035 if (handlerSetRootAgentScene != null) 1040 if (handlerSetRootAgentScene != null)
1036 handlerSetRootAgentScene(agentID, scene); 1041 handlerSetRootAgentScene(agentID, scene);
1037 } 1042 }
1043
1044 public void TriggerOnRegionUp(GridRegion otherRegion)
1045 {
1046 handlerOnRegionUp = OnRegionUp;
1047 if (handlerOnRegionUp != null)
1048 handlerOnRegionUp(otherRegion);
1049 }
1050
1038 } 1051 }
1039} 1052}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 5d65f98..b6fa41d 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Communications.Clients; 36using OpenSim.Framework.Communications.Clients;
37using OpenSim.Region.Framework.Scenes.Serialization; 37using OpenSim.Region.Framework.Scenes.Serialization;
38using OpenSim.Services.Interfaces;
38 39
39//using HyperGrid.Framework; 40//using HyperGrid.Framework;
40//using OpenSim.Region.Communications.Hypergrid; 41//using OpenSim.Region.Communications.Hypergrid;
@@ -47,10 +48,21 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 // This maps between inventory server urls and inventory server clients 50 // This maps between inventory server urls and inventory server clients
50 private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>(); 51// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
51
52 52
53 private Scene m_scene; 53 private Scene m_scene;
54
55 private IHyperlinkService m_hyper;
56 IHyperlinkService HyperlinkService
57 {
58 get
59 {
60 if (m_hyper == null)
61 m_hyper = m_scene.RequestModuleInterface<IHyperlinkService>();
62 return m_hyper;
63 }
64 }
65
54 #endregion 66 #endregion
55 67
56 #region Constructor 68 #region Constructor
@@ -72,30 +84,14 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
72 return null; 84 return null;
73 } 85 }
74 86
75 private string UserInventoryURL(UUID userID) 87// private string UserInventoryURL(UUID userID)
76 { 88// {
77 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); 89// CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
78 if (uinfo != null) 90// if (uinfo != null)
79 return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI; 91// return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI;
80 return null; 92// return null;
81 } 93// }
82 94
83 private bool IsLocalUser(UUID userID)
84 {
85 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
86
87 if (uinfo != null)
88 {
89 if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile))
90 {
91 m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
92 return true;
93 }
94 }
95
96 m_log.Debug("[HGScene]: Foreign user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
97 return false;
98 }
99 95
100 public AssetBase FetchAsset(string url, UUID assetID) 96 public AssetBase FetchAsset(string url, UUID assetID)
101 { 97 {
@@ -171,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
171 167
172 public void Get(UUID assetID, UUID ownerID) 168 public void Get(UUID assetID, UUID ownerID)
173 { 169 {
174 if (!IsLocalUser(ownerID)) 170 if (!HyperlinkService.IsLocalUser(ownerID))
175 { 171 {
176 // Get the item from the remote asset server onto the local AssetCache 172 // Get the item from the remote asset server onto the local AssetCache
177 // and place an entry in m_assetMap 173 // and place an entry in m_assetMap
@@ -229,7 +225,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
229 225
230 public void Post(UUID assetID, UUID ownerID) 226 public void Post(UUID assetID, UUID ownerID)
231 { 227 {
232 if (!IsLocalUser(ownerID)) 228 if (!HyperlinkService.IsLocalUser(ownerID))
233 { 229 {
234 // Post the item from the local AssetCache onto the remote asset server 230 // Post the item from the local AssetCache onto the remote asset server
235 // and place an entry in m_assetMap 231 // and place an entry in m_assetMap
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs
deleted file mode 100644
index a576feb..0000000
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs
+++ /dev/null
@@ -1,232 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Net;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using OpenSim.Framework;
34
35namespace OpenSim.Region.Framework.Scenes.Hypergrid
36{
37 public class HGHyperlink
38 {
39 private static readonly ILog m_log =
40 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 private static Random random = new Random();
42
43 public static RegionInfo TryLinkRegionToCoords(Scene m_scene, IClientAPI client, string mapName, uint xloc, uint yloc)
44 {
45 string host = "127.0.0.1";
46 string portstr;
47 string regionName = "";
48 uint port = 9000;
49 string[] parts = mapName.Split(new char[] { ':' });
50 if (parts.Length >= 1)
51 {
52 host = parts[0];
53 }
54 if (parts.Length >= 2)
55 {
56 portstr = parts[1];
57 if (!UInt32.TryParse(portstr, out port))
58 regionName = parts[1];
59 }
60 // always take the last one
61 if (parts.Length >= 3)
62 {
63 regionName = parts[2];
64 }
65
66 // Sanity check. Don't ever link to this sim.
67 IPAddress ipaddr = null;
68 try
69 {
70 ipaddr = Util.GetHostFromDNS(host);
71 }
72 catch { }
73
74 if ((ipaddr != null) &&
75 !((m_scene.RegionInfo.ExternalEndPoint.Address.Equals(ipaddr)) && (m_scene.RegionInfo.HttpPort == port)))
76 {
77 RegionInfo regInfo;
78 bool success = TryCreateLink(m_scene, client, xloc, yloc, regionName, port, host, out regInfo);
79 if (success)
80 {
81 regInfo.RegionName = mapName;
82 return regInfo;
83 }
84 }
85
86 return null;
87 }
88
89 public static RegionInfo TryLinkRegion(Scene m_scene, IClientAPI client, string mapName)
90 {
91 uint xloc = (uint)(random.Next(0, Int16.MaxValue));
92 return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0);
93 }
94
95 public static bool TryCreateLink(Scene m_scene, IClientAPI client, uint xloc, uint yloc,
96 string externalRegionName, uint externalPort, string externalHostName, out RegionInfo regInfo)
97 {
98 m_log.DebugFormat("[HGrid]: Link to {0}:{1}, in {2}-{3}", externalHostName, externalPort, xloc, yloc);
99
100 regInfo = new RegionInfo();
101 regInfo.RegionName = externalRegionName;
102 regInfo.HttpPort = externalPort;
103 regInfo.ExternalHostName = externalHostName;
104 regInfo.RegionLocX = xloc;
105 regInfo.RegionLocY = yloc;
106
107 try
108 {
109 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
110 }
111 catch (Exception e)
112 {
113 m_log.Warn("[HGrid]: Wrong format for link-region: " + e.Message);
114 return false;
115 }
116 regInfo.RemotingAddress = regInfo.ExternalEndPoint.Address.ToString();
117
118 // Finally, link it
119 try
120 {
121 m_scene.CommsManager.GridService.RegisterRegion(regInfo);
122 }
123 catch (Exception e)
124 {
125 m_log.Warn("[HGrid]: Unable to link region: " + e.Message);
126 return false;
127 }
128
129 uint x, y;
130 if (!Check4096(m_scene, regInfo, out x, out y))
131 {
132 m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
133 if (client != null)
134 client.SendAlertMessage("Region is too far (" + x + ", " + y + ")");
135 m_log.Info("[HGrid]: Unable to link, region is too far (" + x + ", " + y + ")");
136 return false;
137 }
138
139 if (!CheckCoords(m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, x, y))
140 {
141 m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
142 if (client != null)
143 client.SendAlertMessage("Region has incompatible coordinates (" + x + ", " + y + ")");
144 m_log.Info("[HGrid]: Unable to link, region has incompatible coordinates (" + x + ", " + y + ")");
145 return false;
146 }
147
148 m_log.Debug("[HGrid]: link region succeeded");
149 return true;
150 }
151
152 public static bool TryUnlinkRegion(Scene m_scene, string mapName)
153 {
154 RegionInfo regInfo = null;
155 if (mapName.Contains(":"))
156 {
157 string host = "127.0.0.1";
158 //string portstr;
159 //string regionName = "";
160 uint port = 9000;
161 string[] parts = mapName.Split(new char[] { ':' });
162 if (parts.Length >= 1)
163 {
164 host = parts[0];
165 }
166// if (parts.Length >= 2)
167// {
168// portstr = parts[1];
169// if (!UInt32.TryParse(portstr, out port))
170// regionName = parts[1];
171// }
172 // always take the last one
173// if (parts.Length >= 3)
174// {
175// regionName = parts[2];
176// }
177 regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(host, port);
178 }
179 else
180 {
181 regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(mapName);
182 }
183 if (regInfo != null)
184 {
185 return m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
186 }
187 else
188 {
189 m_log.InfoFormat("[HGrid]: Region {0} not found", mapName);
190 return false;
191 }
192 }
193
194 /// <summary>
195 /// Cope with this viewer limitation.
196 /// </summary>
197 /// <param name="regInfo"></param>
198 /// <returns></returns>
199 public static bool Check4096(Scene m_scene, RegionInfo regInfo, out uint x, out uint y)
200 {
201 ulong realHandle;
202 if (UInt64.TryParse(regInfo.regionSecret, out realHandle))
203 {
204 Utils.LongToUInts(realHandle, out x, out y);
205 x = x / Constants.RegionSize;
206 y = y / Constants.RegionSize;
207
208 if ((Math.Abs((int)m_scene.RegionInfo.RegionLocX - (int)x) >= 4096) ||
209 (Math.Abs((int)m_scene.RegionInfo.RegionLocY - (int)y) >= 4096))
210 {
211 return false;
212 }
213 return true;
214 }
215 else
216 {
217 m_scene.CommsManager.GridService.RegisterRegion(regInfo);
218 m_log.Debug("[HGrid]: Gnomes. Region deregistered.");
219 x = y = 0;
220 return false;
221 }
222 }
223
224 public static bool CheckCoords(uint thisx, uint thisy, uint x, uint y)
225 {
226 if ((thisx == x) && (thisy == y))
227 return false;
228 return true;
229 }
230
231 }
232}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
index bf55df7..b1981b6 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
@@ -29,6 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 31using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion;
32 33
33namespace OpenSim.Region.Framework.Scenes.Hypergrid 34namespace OpenSim.Region.Framework.Scenes.Hypergrid
34{ 35{
@@ -50,7 +51,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
50 51
51 if (UserProfile != null) 52 if (UserProfile != null)
52 { 53 {
53 RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); 54 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
54 //if (regionInfo != null) 55 //if (regionInfo != null)
55 //{ 56 //{
56 // UserProfile.HomeRegionID = regionInfo.RegionID; 57 // UserProfile.HomeRegionID = regionInfo.RegionID;
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
index 5c99d73..d7e62a8 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -38,6 +38,8 @@ using OpenSim.Framework.Communications;
38using OpenSim.Framework.Communications.Cache; 38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Framework.Capabilities; 39using OpenSim.Framework.Capabilities;
40using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Services.Interfaces;
42using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 43
42namespace OpenSim.Region.Framework.Scenes.Hypergrid 44namespace OpenSim.Region.Framework.Scenes.Hypergrid
43{ 45{
@@ -45,11 +47,19 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
45 { 47 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 49
48 public readonly IHyperlink m_hg; 50 private IHyperlinkService m_hg;
51 IHyperlinkService HyperlinkService
52 {
53 get
54 {
55 if (m_hg == null)
56 m_hg = m_scene.RequestModuleInterface<IHyperlinkService>();
57 return m_hg;
58 }
59 }
49 60
50 public HGSceneCommunicationService(CommunicationsManager commsMan, IHyperlink hg) : base(commsMan) 61 public HGSceneCommunicationService(CommunicationsManager commsMan) : base(commsMan)
51 { 62 {
52 m_hg = hg;
53 } 63 }
54 64
55 65
@@ -77,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
77 if (regionHandle == m_regionInfo.RegionHandle) 87 if (regionHandle == m_regionInfo.RegionHandle)
78 { 88 {
79 // Teleport within the same region 89 // Teleport within the same region
80 if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) 90 if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0)
81 { 91 {
82 Vector3 emergencyPos = new Vector3(128, 128, 128); 92 Vector3 emergencyPos = new Vector3(128, 128, 128);
83 93
@@ -89,7 +99,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
89 // TODO: Get proper AVG Height 99 // TODO: Get proper AVG Height
90 float localAVHeight = 1.56f; 100 float localAVHeight = 1.56f;
91 101
92 float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; 102 float posZLimit = 22;
103
104 if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize)
105 {
106 posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y];
107 }
108
93 float newPosZ = posZLimit + localAVHeight; 109 float newPosZ = posZLimit + localAVHeight;
94 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 110 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
95 { 111 {
@@ -106,7 +122,10 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
106 } 122 }
107 else 123 else
108 { 124 {
109 RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); 125 uint x = 0, y = 0;
126 Utils.LongToUInts(regionHandle, out x, out y);
127 GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
128
110 if (reg != null) 129 if (reg != null)
111 { 130 {
112 131
@@ -119,13 +138,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
119 /// Hypergrid mod start 138 /// Hypergrid mod start
120 /// 139 ///
121 /// 140 ///
122 bool isHyperLink = m_hg.IsHyperlinkRegion(reg.RegionHandle); 141 bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null);
123 bool isHomeUser = true; 142 bool isHomeUser = true;
124 ulong realHandle = regionHandle; 143 ulong realHandle = regionHandle;
125 CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); 144 CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID);
126 if (uinfo != null) 145 if (uinfo != null)
127 { 146 {
128 isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); 147 isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID);
129 realHandle = m_hg.FindRegionHandle(regionHandle); 148 realHandle = m_hg.FindRegionHandle(regionHandle);
130 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); 149 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
131 } 150 }
@@ -338,7 +357,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
338 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID); 357 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
339 m_log.DebugFormat( 358 m_log.DebugFormat(
340 "[HGSceneCommService]: User {0} is going to another region, profile cache removed", 359 "[HGSceneCommService]: User {0} is going to another region, profile cache removed",
341 avatar.UUID); 360 avatar.UUID);
342 } 361 }
343 } 362 }
344 else 363 else
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 7c02f9a..73f918e 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
53 53
54 54
55 public class RegionStatsHandler : IStreamedRequestHandler 55 public class RegionStatsHandler : IStreamedRequestHandler
56 { 56 {
57 private string osRXStatsURI = String.Empty; 57 private string osRXStatsURI = String.Empty;
58 private string osXStatsURI = String.Empty; 58 private string osXStatsURI = String.Empty;
59 //private string osSecret = String.Empty; 59 //private string osSecret = String.Empty;
@@ -87,13 +87,13 @@ namespace OpenSim.Region.Framework.Scenes
87 } 87 }
88 88
89 public string Path 89 public string Path
90 { 90 {
91 // This is for the region and is the regionSecret hashed 91 // This is for the region and is the regionSecret hashed
92 get { return "/" + osRXStatsURI + "/"; } 92 get { return "/" + osRXStatsURI + "/"; }
93 } 93 }
94 94
95 private string Report() 95 private string Report()
96 { 96 {
97 OSDMap args = new OSDMap(30); 97 OSDMap args = new OSDMap(30);
98 //int time = Util.ToUnixTime(DateTime.Now); 98 //int time = Util.ToUnixTime(DateTime.Now);
99 args["OSStatsURI"] = OSD.FromString("http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/" + osXStatsURI + "/"); 99 args["OSStatsURI"] = OSD.FromString("http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/" + osXStatsURI + "/");
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index eb397f6..a4460e4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1015,7 +1015,7 @@ namespace OpenSim.Region.Framework.Scenes
1015 return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId); 1015 return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId);
1016 } 1016 }
1017 else 1017 else
1018 { 1018 {
1019 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId); 1019 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId);
1020 1020
1021 if (agentItem == null) 1021 if (agentItem == null)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index fddba86..e561efb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
413 remoteClient.SendInventoryItemDetails(ownerID, item); 413 remoteClient.SendInventoryItemDetails(ownerID, item);
414 } 414 }
415 // else shouldn't we send an alert message? 415 // else shouldn't we send an alert message?
416 } 416 }
417 417
418 /// <summary> 418 /// <summary>
419 /// Tell the client about the various child items and folders contained in the requested folder. 419 /// Tell the client about the various child items and folders contained in the requested folder.
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Framework.Scenes
485 485
486 // TODO: This code for looking in the folder for the library should be folded back into the 486 // TODO: This code for looking in the folder for the library should be folded back into the
487 // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc. 487 // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
488 // can be handled transparently). 488 // can be handled transparently).
489 InventoryFolderImpl fold; 489 InventoryFolderImpl fold;
490 if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null) 490 if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null)
491 { 491 {
@@ -515,7 +515,7 @@ namespace OpenSim.Region.Framework.Scenes
515 515
516 return contents; 516 return contents;
517 517
518 } 518 }
519 519
520 /// <summary> 520 /// <summary>
521 /// Handle an inventory folder creation request from the client. 521 /// Handle an inventory folder creation request from the client.
@@ -535,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes
535 "[AGENT INVENTORY]: Failed to move create folder for user {0} {1}", 535 "[AGENT INVENTORY]: Failed to move create folder for user {0} {1}",
536 remoteClient.Name, remoteClient.AgentId); 536 remoteClient.Name, remoteClient.AgentId);
537 } 537 }
538 } 538 }
539 539
540 /// <summary> 540 /// <summary>
541 /// Handle a client request to update the inventory folder 541 /// Handle a client request to update the inventory folder
@@ -544,7 +544,7 @@ namespace OpenSim.Region.Framework.Scenes
544 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE 544 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
545 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, 545 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
546 /// and needs to be changed. 546 /// and needs to be changed.
547 /// 547 ///
548 /// <param name="remoteClient"></param> 548 /// <param name="remoteClient"></param>
549 /// <param name="folderID"></param> 549 /// <param name="folderID"></param>
550 /// <param name="type"></param> 550 /// <param name="type"></param>
@@ -570,7 +570,7 @@ namespace OpenSim.Region.Framework.Scenes
570 remoteClient.Name, remoteClient.AgentId); 570 remoteClient.Name, remoteClient.AgentId);
571 } 571 }
572 } 572 }
573 } 573 }
574 574
575 public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) 575 public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
576 { 576 {
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Framework.Scenes
588 { 588 {
589 m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID); 589 m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID);
590 } 590 }
591 } 591 }
592 592
593 /// <summary> 593 /// <summary>
594 /// This should delete all the items and folders in the given directory. 594 /// This should delete all the items and folders in the given directory.
@@ -609,7 +609,7 @@ namespace OpenSim.Region.Framework.Scenes
609 { 609 {
610 m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message); 610 m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message);
611 } 611 }
612 } 612 }
613 613
614 614
615 private void PurgeFolderAsync(UUID userID, UUID folderID) 615 private void PurgeFolderAsync(UUID userID, UUID folderID)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 226ec15..d01cef7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -805,7 +805,7 @@ namespace OpenSim.Region.Framework.Scenes
805 /// <param name="invType"></param> 805 /// <param name="invType"></param>
806 /// <param name="objectID"></param> 806 /// <param name="objectID"></param>
807 /// <param name="userID"></param> 807 /// <param name="userID"></param>
808 /// <returns></returns> 808 /// <returns></returns>
809 public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID) 809 public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID)
810 { 810 {
811 CreateObjectInventoryHandler handler = OnCreateObjectInventory; 811 CreateObjectInventoryHandler handler = OnCreateObjectInventory;
@@ -856,7 +856,7 @@ namespace OpenSim.Region.Framework.Scenes
856 /// </summary> 856 /// </summary>
857 /// <param name="invType"></param> 857 /// <param name="invType"></param>
858 /// <param name="userID"></param> 858 /// <param name="userID"></param>
859 /// <returns></returns> 859 /// <returns></returns>
860 public bool CanCreateUserInventory(int invType, UUID userID) 860 public bool CanCreateUserInventory(int invType, UUID userID)
861 { 861 {
862 CreateUserInventoryHandler handler = OnCreateUserInventory; 862 CreateUserInventoryHandler handler = OnCreateUserInventory;
@@ -877,7 +877,7 @@ namespace OpenSim.Region.Framework.Scenes
877 /// </summary> 877 /// </summary>
878 /// <param name="itemID"></param> 878 /// <param name="itemID"></param>
879 /// <param name="userID"></param> 879 /// <param name="userID"></param>
880 /// <returns></returns> 880 /// <returns></returns>
881 public bool CanEditUserInventory(UUID itemID, UUID userID) 881 public bool CanEditUserInventory(UUID itemID, UUID userID)
882 { 882 {
883 EditUserInventoryHandler handler = OnEditUserInventory; 883 EditUserInventoryHandler handler = OnEditUserInventory;
@@ -891,14 +891,14 @@ namespace OpenSim.Region.Framework.Scenes
891 } 891 }
892 } 892 }
893 return true; 893 return true;
894 } 894 }
895 895
896 /// <summary> 896 /// <summary>
897 /// Check whether the specified user is allowed to copy the given inventory item from their own inventory. 897 /// Check whether the specified user is allowed to copy the given inventory item from their own inventory.
898 /// </summary> 898 /// </summary>
899 /// <param name="itemID"></param> 899 /// <param name="itemID"></param>
900 /// <param name="userID"></param> 900 /// <param name="userID"></param>
901 /// <returns></returns> 901 /// <returns></returns>
902 public bool CanCopyUserInventory(UUID itemID, UUID userID) 902 public bool CanCopyUserInventory(UUID itemID, UUID userID)
903 { 903 {
904 CopyUserInventoryHandler handler = OnCopyUserInventory; 904 CopyUserInventoryHandler handler = OnCopyUserInventory;
@@ -912,14 +912,14 @@ namespace OpenSim.Region.Framework.Scenes
912 } 912 }
913 } 913 }
914 return true; 914 return true;
915 } 915 }
916 916
917 /// <summary> 917 /// <summary>
918 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. 918 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory.
919 /// </summary> 919 /// </summary>
920 /// <param name="itemID"></param> 920 /// <param name="itemID"></param>
921 /// <param name="userID"></param> 921 /// <param name="userID"></param>
922 /// <returns></returns> 922 /// <returns></returns>
923 public bool CanDeleteUserInventory(UUID itemID, UUID userID) 923 public bool CanDeleteUserInventory(UUID itemID, UUID userID)
924 { 924 {
925 DeleteUserInventoryHandler handler = OnDeleteUserInventory; 925 DeleteUserInventoryHandler handler = OnDeleteUserInventory;
@@ -933,7 +933,7 @@ namespace OpenSim.Region.Framework.Scenes
933 } 933 }
934 } 934 }
935 return true; 935 return true;
936 } 936 }
937 937
938 public bool CanTeleport(UUID userID) 938 public bool CanTeleport(UUID userID)
939 { 939 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d8478a2..05a6f13 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -49,6 +49,7 @@ using OpenSim.Region.Framework.Scenes.Serialization;
49using OpenSim.Region.Physics.Manager; 49using OpenSim.Region.Physics.Manager;
50using Timer=System.Timers.Timer; 50using Timer=System.Timers.Timer;
51using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 51using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
52using GridRegion = OpenSim.Services.Interfaces.GridRegion;
52 53
53namespace OpenSim.Region.Framework.Scenes 54namespace OpenSim.Region.Framework.Scenes
54{ 55{
@@ -193,6 +194,26 @@ namespace OpenSim.Region.Framework.Scenes
193 } 194 }
194 } 195 }
195 196
197 protected IGridService m_GridService = null;
198
199 public IGridService GridService
200 {
201 get
202 {
203 if (m_GridService == null)
204 {
205 m_GridService = RequestModuleInterface<IGridService>();
206
207 if (m_GridService == null)
208 {
209 throw new Exception("No IGridService available. This could happen if the config_include folder doesn't exist or if the OpenSim.ini [Architecture] section isn't set. Please also check that you have the correct version of your inventory service dll. Sometimes old versions of this dll will still exist. Do a clean checkout and re-create the opensim.ini from the opensim.ini.example.");
210 }
211 }
212
213 return m_GridService;
214 }
215 }
216
196 protected IXMLRPC m_xmlrpcModule; 217 protected IXMLRPC m_xmlrpcModule;
197 protected IWorldComm m_worldCommModule; 218 protected IWorldComm m_worldCommModule;
198 protected IAvatarFactory m_AvatarFactory; 219 protected IAvatarFactory m_AvatarFactory;
@@ -566,10 +587,7 @@ namespace OpenSim.Region.Framework.Scenes
566 } 587 }
567 588
568 /// <summary> 589 /// <summary>
569 /// Another region is up. Gets called from Grid Comms: 590 /// Another region is up.
570 /// (OGS1 -> LocalBackEnd -> RegionListened -> SceneCommunicationService)
571 /// We have to tell all our ScenePresences about it, and add it to the
572 /// neighbor list.
573 /// 591 ///
574 /// We only add it to the neighbor list if it's within 1 region from here. 592 /// We only add it to the neighbor list if it's within 1 region from here.
575 /// Agents may have draw distance values that cross two regions though, so 593 /// Agents may have draw distance values that cross two regions though, so
@@ -578,47 +596,30 @@ namespace OpenSim.Region.Framework.Scenes
578 /// </summary> 596 /// </summary>
579 /// <param name="otherRegion">RegionInfo handle for the new region.</param> 597 /// <param name="otherRegion">RegionInfo handle for the new region.</param>
580 /// <returns>True after all operations complete, throws exceptions otherwise.</returns> 598 /// <returns>True after all operations complete, throws exceptions otherwise.</returns>
581 public override bool OtherRegionUp(RegionInfo otherRegion) 599 public override void OtherRegionUp(GridRegion otherRegion)
582 { 600 {
583 m_log.InfoFormat("[SCENE]: Region {0} up in coords {1}-{2}", otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); 601 uint xcell = (uint)((int)otherRegion.RegionLocX / (int)Constants.RegionSize);
602 uint ycell = (uint)((int)otherRegion.RegionLocY / (int)Constants.RegionSize);
603 m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
604 RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell);
584 605
585 if (RegionInfo.RegionHandle != otherRegion.RegionHandle) 606 if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
586 { 607 {
587 for (int i = 0; i < m_neighbours.Count; i++)
588 {
589 // The purpose of this loop is to re-update the known neighbors
590 // when another region comes up on top of another one.
591 // The latest region in that location ends up in the
592 // 'known neighbors list'
593 // Additionally, the commFailTF property gets reset to false.
594 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle)
595 {
596 lock (m_neighbours)
597 {
598 m_neighbours[i] = otherRegion;
599
600 }
601 }
602 }
603
604 // If the value isn't in the neighbours, add it.
605 // If the RegionInfo isn't exact but is for the same XY World location,
606 // then the above loop will fix that.
607
608 if (!(CheckNeighborRegion(otherRegion)))
609 {
610 lock (m_neighbours)
611 {
612 m_neighbours.Add(otherRegion);
613 //m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
614 }
615 }
616 608
617 // If these are cast to INT because long + negative values + abs returns invalid data 609 // If these are cast to INT because long + negative values + abs returns invalid data
618 int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); 610 int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX);
619 int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); 611 int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY);
620 if (resultX <= 1 && resultY <= 1) 612 if (resultX <= 1 && resultY <= 1)
621 { 613 {
614 // Let the grid service module know, so this can be cached
615 m_eventManager.TriggerOnRegionUp(otherRegion);
616
617 RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName);
618 regInfo.RegionID = otherRegion.RegionID;
619 regInfo.RegionName = otherRegion.RegionName;
620 regInfo.ScopeID = otherRegion.ScopeID;
621 regInfo.ExternalHostName = otherRegion.ExternalHostName;
622
622 try 623 try
623 { 624 {
624 ForEachScenePresence(delegate(ScenePresence agent) 625 ForEachScenePresence(delegate(ScenePresence agent)
@@ -632,7 +633,7 @@ namespace OpenSim.Region.Framework.Scenes
632 List<ulong> old = new List<ulong>(); 633 List<ulong> old = new List<ulong>();
633 old.Add(otherRegion.RegionHandle); 634 old.Add(otherRegion.RegionHandle);
634 agent.DropOldNeighbours(old); 635 agent.DropOldNeighbours(old);
635 InformClientOfNeighbor(agent, otherRegion); 636 InformClientOfNeighbor(agent, regInfo);
636 } 637 }
637 } 638 }
638 ); 639 );
@@ -643,6 +644,7 @@ namespace OpenSim.Region.Framework.Scenes
643 // This shouldn't happen too often anymore. 644 // This shouldn't happen too often anymore.
644 m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception"); 645 m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception");
645 } 646 }
647
646 } 648 }
647 else 649 else
648 { 650 {
@@ -651,7 +653,6 @@ namespace OpenSim.Region.Framework.Scenes
651 otherRegion.RegionLocY.ToString() + ")"); 653 otherRegion.RegionLocY.ToString() + ")");
652 } 654 }
653 } 655 }
654 return true;
655 } 656 }
656 657
657 public void AddNeighborRegion(RegionInfo region) 658 public void AddNeighborRegion(RegionInfo region)
@@ -683,9 +684,10 @@ namespace OpenSim.Region.Framework.Scenes
683 } 684 }
684 685
685 // Alias IncomingHelloNeighbour OtherRegionUp, for now 686 // Alias IncomingHelloNeighbour OtherRegionUp, for now
686 public bool IncomingHelloNeighbour(RegionInfo neighbour) 687 public GridRegion IncomingHelloNeighbour(RegionInfo neighbour)
687 { 688 {
688 return OtherRegionUp(neighbour); 689 OtherRegionUp(new GridRegion(neighbour));
690 return new GridRegion(RegionInfo);
689 } 691 }
690 692
691 /// <summary> 693 /// <summary>
@@ -994,7 +996,7 @@ namespace OpenSim.Region.Framework.Scenes
994 996
995 // Loop it 997 // Loop it
996 if (m_frame == Int32.MaxValue) 998 if (m_frame == Int32.MaxValue)
997 m_frame = 0; 999 m_frame = 0;
998 1000
999 otherMS = Environment.TickCount; 1001 otherMS = Environment.TickCount;
1000 // run through all entities looking for updates (slow) 1002 // run through all entities looking for updates (slow)
@@ -1336,24 +1338,31 @@ namespace OpenSim.Region.Framework.Scenes
1336 RegisterCommsEvents(); 1338 RegisterCommsEvents();
1337 1339
1338 // These two 'commands' *must be* next to each other or sim rebooting fails. 1340 // These two 'commands' *must be* next to each other or sim rebooting fails.
1339 m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1341 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1342
1343 GridRegion region = new GridRegion(RegionInfo);
1344 bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1345 if (!success)
1346 throw new Exception("Can't register with grid");
1347
1348 m_sceneGridService.SetScene(this);
1340 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); 1349 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1341 1350
1342 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); 1351 //Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
1343 1352
1344 if (dGridSettings.ContainsKey("allow_forceful_banlines")) 1353 //if (dGridSettings.ContainsKey("allow_forceful_banlines"))
1345 { 1354 //{
1346 if (dGridSettings["allow_forceful_banlines"] != "TRUE") 1355 // if (dGridSettings["allow_forceful_banlines"] != "TRUE")
1347 { 1356 // {
1348 m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); 1357 // m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
1349 EventManager.TriggerSetAllowForcefulBan(false); 1358 // EventManager.TriggerSetAllowForcefulBan(false);
1350 } 1359 // }
1351 else 1360 // else
1352 { 1361 // {
1353 m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); 1362 // m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
1354 EventManager.TriggerSetAllowForcefulBan(true); 1363 // EventManager.TriggerSetAllowForcefulBan(true);
1355 } 1364 // }
1356 } 1365 //}
1357 } 1366 }
1358 1367
1359 /// <summary> 1368 /// <summary>
@@ -2014,12 +2023,12 @@ namespace OpenSim.Region.Framework.Scenes
2014 return true; 2023 return true;
2015 } 2024 }
2016 break; 2025 break;
2017 case Cardinals.W: 2026 case Cardinals.W:
2018 foreach (Border b in WestBorders) 2027 foreach (Border b in WestBorders)
2019 { 2028 {
2020 if (b.TestCross(position)) 2029 if (b.TestCross(position))
2021 return true; 2030 return true;
2022 } 2031 }
2023 break; 2032 break;
2024 } 2033 }
2025 } 2034 }
@@ -2717,10 +2726,12 @@ namespace OpenSim.Region.Framework.Scenes
2717 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); 2726 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
2718 if (UserProfile != null) 2727 if (UserProfile != null)
2719 { 2728 {
2720 RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegionID); 2729 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
2721 if (regionInfo == null) 2730 if (regionInfo == null)
2722 { 2731 {
2723 regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); 2732 uint x = 0, y = 0;
2733 Utils.LongToUInts(UserProfile.HomeRegion, out x, out y);
2734 regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
2724 if (regionInfo != null) // home region can be away temporarily, too 2735 if (regionInfo != null) // home region can be away temporarily, too
2725 { 2736 {
2726 UserProfile.HomeRegionID = regionInfo.RegionID; 2737 UserProfile.HomeRegionID = regionInfo.RegionID;
@@ -3074,7 +3085,7 @@ namespace OpenSim.Region.Framework.Scenes
3074 m_sceneGridService.OnExpectUser += HandleNewUserConnection; 3085 m_sceneGridService.OnExpectUser += HandleNewUserConnection;
3075 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; 3086 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
3076 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; 3087 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
3077 m_sceneGridService.OnRegionUp += OtherRegionUp; 3088 //m_eventManager.OnRegionUp += OtherRegionUp;
3078 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; 3089 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
3079 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; 3090 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup;
3080 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; 3091 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
@@ -3102,7 +3113,7 @@ namespace OpenSim.Region.Framework.Scenes
3102 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; 3113 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
3103 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; 3114 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup;
3104 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; 3115 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3105 m_sceneGridService.OnRegionUp -= OtherRegionUp; 3116 //m_eventManager.OnRegionUp -= OtherRegionUp;
3106 m_sceneGridService.OnExpectUser -= HandleNewUserConnection; 3117 m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
3107 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; 3118 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
3108 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent; 3119 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent;
@@ -3111,7 +3122,11 @@ namespace OpenSim.Region.Framework.Scenes
3111 if (m_interregionCommsIn != null) 3122 if (m_interregionCommsIn != null)
3112 m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; 3123 m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3113 3124
3125 // this does nothing; should be removed
3114 m_sceneGridService.Close(); 3126 m_sceneGridService.Close();
3127
3128 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
3129 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3115 } 3130 }
3116 3131
3117 /// <summary> 3132 /// <summary>
@@ -3255,7 +3270,7 @@ namespace OpenSim.Region.Framework.Scenes
3255 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", 3270 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region",
3256 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 3271 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
3257 //reason = String.Format("You are not currently on the access list for {0}",RegionInfo.RegionName); 3272 //reason = String.Format("You are not currently on the access list for {0}",RegionInfo.RegionName);
3258 return false; 3273 return false;
3259 } 3274 }
3260 } 3275 }
3261 3276
@@ -3404,7 +3419,7 @@ namespace OpenSim.Region.Framework.Scenes
3404 /// We've got an update about an agent that sees into this region, 3419 /// We've got an update about an agent that sees into this region,
3405 /// send it to ScenePresence for processing It's the full data. 3420 /// send it to ScenePresence for processing It's the full data.
3406 /// </summary> 3421 /// </summary>
3407 /// <param name="cAgentData">Agent that contains all of the relevant things about an agent. 3422 /// <param name="cAgentData">Agent that contains all of the relevant things about an agent.
3408 /// Appearance, animations, position, etc.</param> 3423 /// Appearance, animations, position, etc.</param>
3409 /// <returns>true if we handled it.</returns> 3424 /// <returns>true if we handled it.</returns>
3410 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) 3425 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData)
@@ -3557,30 +3572,6 @@ namespace OpenSim.Region.Framework.Scenes
3557 } 3572 }
3558 3573
3559 /// <summary> 3574 /// <summary>
3560 /// Requests information about this region from gridcomms
3561 /// </summary>
3562 /// <param name="regionHandle"></param>
3563 /// <returns></returns>
3564 public RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
3565 {
3566 return m_sceneGridService.RequestNeighbouringRegionInfo(regionHandle);
3567 }
3568
3569 /// <summary>
3570 /// Requests textures for map from minimum region to maximum region in world cordinates
3571 /// </summary>
3572 /// <param name="remoteClient"></param>
3573 /// <param name="minX"></param>
3574 /// <param name="minY"></param>
3575 /// <param name="maxX"></param>
3576 /// <param name="maxY"></param>
3577 public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY)
3578 {
3579 m_log.DebugFormat("[MAPBLOCK]: {0}-{1}, {2}-{3}", minX, minY, maxX, maxY);
3580 m_sceneGridService.RequestMapBlocks(remoteClient, minX, minY, maxX, maxY);
3581 }
3582
3583 /// <summary>
3584 /// Tries to teleport agent to other region. 3575 /// Tries to teleport agent to other region.
3585 /// </summary> 3576 /// </summary>
3586 /// <param name="remoteClient"></param> 3577 /// <param name="remoteClient"></param>
@@ -3591,7 +3582,7 @@ namespace OpenSim.Region.Framework.Scenes
3591 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, 3582 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
3592 Vector3 lookat, uint teleportFlags) 3583 Vector3 lookat, uint teleportFlags)
3593 { 3584 {
3594 RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName); 3585 GridRegion regionInfo = GridService.GetRegionByName(UUID.Zero, regionName);
3595 if (regionInfo == null) 3586 if (regionInfo == null)
3596 { 3587 {
3597 // can't find the region: Tell viewer and abort 3588 // can't find the region: Tell viewer and abort
@@ -3680,7 +3671,7 @@ namespace OpenSim.Region.Framework.Scenes
3680 /// <param name="position"></param> 3671 /// <param name="position"></param>
3681 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position) 3672 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position)
3682 { 3673 {
3683 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); 3674 GridRegion info = GridService.GetRegionByUUID(UUID.Zero, regionID);
3684 3675
3685 if (info == null) 3676 if (info == null)
3686 { 3677 {
@@ -3864,10 +3855,6 @@ namespace OpenSim.Region.Framework.Scenes
3864 return LandChannel.GetLandObject((int)x, (int)y).landData; 3855 return LandChannel.GetLandObject((int)x, (int)y).landData;
3865 } 3856 }
3866 3857
3867 public RegionInfo RequestClosestRegion(string name)
3868 {
3869 return m_sceneGridService.RequestClosestRegion(name);
3870 }
3871 3858
3872 #endregion 3859 #endregion
3873 3860
@@ -4154,6 +4141,11 @@ namespace OpenSim.Region.Framework.Scenes
4154 m_sceneGraph.ForEachClient(action); 4141 m_sceneGraph.ForEachClient(action);
4155 } 4142 }
4156 4143
4144 public void ForEachSOG(Action<SceneObjectGroup> action)
4145 {
4146 m_sceneGraph.ForEachSOG(action);
4147 }
4148
4157 /// <summary> 4149 /// <summary>
4158 /// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself 4150 /// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself
4159 /// will not affect the original list of objects in the scene. 4151 /// will not affect the original list of objects in the scene.
@@ -4178,14 +4170,18 @@ namespace OpenSim.Region.Framework.Scenes
4178 4170
4179 public void RegionHandleRequest(IClientAPI client, UUID regionID) 4171 public void RegionHandleRequest(IClientAPI client, UUID regionID)
4180 { 4172 {
4181 RegionInfo info; 4173 ulong handle = 0;
4182 if (regionID == RegionInfo.RegionID) 4174 if (regionID == RegionInfo.RegionID)
4183 info = RegionInfo; 4175 handle = RegionInfo.RegionHandle;
4184 else 4176 else
4185 info = CommsManager.GridService.RequestNeighbourInfo(regionID); 4177 {
4178 GridRegion r = GridService.GetRegionByUUID(UUID.Zero, regionID);
4179 if (r != null)
4180 handle = r.RegionHandle;
4181 }
4186 4182
4187 if (info != null) 4183 if (handle != 0)
4188 client.SendRegionHandle(regionID, info.RegionHandle); 4184 client.SendRegionHandle(regionID, handle);
4189 } 4185 }
4190 4186
4191 public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) 4187 public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 2a82237..0ac4ed4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Communications.Cache; 37using OpenSim.Framework.Communications.Cache;
38using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40namespace OpenSim.Region.Framework.Scenes 41namespace OpenSim.Region.Framework.Scenes
41{ 42{
@@ -91,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes
91 /// <value> 92 /// <value>
92 /// Registered classes that are capable of creating entities. 93 /// Registered classes that are capable of creating entities.
93 /// </value> 94 /// </value>
94 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); 95 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>();
95 96
96 /// <summary> 97 /// <summary>
97 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is 98 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
@@ -227,7 +228,7 @@ namespace OpenSim.Region.Framework.Scenes
227 return false; 228 return false;
228 } 229 }
229 230
230 public abstract bool OtherRegionUp(RegionInfo thisRegion); 231 public abstract void OtherRegionUp(GridRegion otherRegion);
231 232
232 public virtual string GetSimulatorVersion() 233 public virtual string GetSimulatorVersion()
233 { 234 {
@@ -278,7 +279,7 @@ namespace OpenSim.Region.Framework.Scenes
278 _primAllocateMutex.ReleaseMutex(); 279 _primAllocateMutex.ReleaseMutex();
279 280
280 return myID; 281 return myID;
281 } 282 }
282 283
283 #region Module Methods 284 #region Module Methods
284 285
@@ -472,7 +473,7 @@ namespace OpenSim.Region.Framework.Scenes
472 /// <summary> 473 /// <summary>
473 /// Shows various details about the sim based on the parameters supplied by the console command in openSimMain. 474 /// Shows various details about the sim based on the parameters supplied by the console command in openSimMain.
474 /// </summary> 475 /// </summary>
475 /// <param name="showParams">What to show</param> 476 /// <param name="showParams">What to show</param>
476 public virtual void Show(string[] showParams) 477 public virtual void Show(string[] showParams)
477 { 478 {
478 switch (showParams[0]) 479 switch (showParams[0])
@@ -488,7 +489,7 @@ namespace OpenSim.Region.Framework.Scenes
488 } 489 }
489 break; 490 break;
490 } 491 }
491 } 492 }
492 493
493 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 494 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
494 { 495 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 204c319..4a2db5e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -41,6 +41,7 @@ using OpenSim.Framework.Capabilities;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43using OSD = OpenMetaverse.StructuredData.OSD; 43using OSD = OpenMetaverse.StructuredData.OSD;
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
44 45
45namespace OpenSim.Region.Framework.Scenes 46namespace OpenSim.Region.Framework.Scenes
46{ 47{
@@ -58,11 +59,19 @@ namespace OpenSim.Region.Framework.Scenes
58 protected CommunicationsManager m_commsProvider; 59 protected CommunicationsManager m_commsProvider;
59 protected IInterregionCommsOut m_interregionCommsOut; 60 protected IInterregionCommsOut m_interregionCommsOut;
60 protected RegionInfo m_regionInfo; 61 protected RegionInfo m_regionInfo;
62 protected Scene m_scene;
61 63
62 protected RegionCommsListener regionCommsHost; 64 protected RegionCommsListener regionCommsHost;
63 65
64 protected List<UUID> m_agentsInTransit; 66 protected List<UUID> m_agentsInTransit;
65 67
68 public bool RegionLoginsEnabled
69 {
70 get { return m_regionLoginsEnabled; }
71 set { m_regionLoginsEnabled = value; }
72 }
73 private bool m_regionLoginsEnabled = false;
74
66 /// <summary> 75 /// <summary>
67 /// An agent is crossing into this region 76 /// An agent is crossing into this region
68 /// </summary> 77 /// </summary>
@@ -84,10 +93,10 @@ namespace OpenSim.Region.Framework.Scenes
84 /// </summary> 93 /// </summary>
85 public event PrimCrossing OnPrimCrossingIntoRegion; 94 public event PrimCrossing OnPrimCrossingIntoRegion;
86 95
87 /// <summary> 96 ///// <summary>
88 /// A New Region is up and available 97 ///// A New Region is up and available
89 /// </summary> 98 ///// </summary>
90 public event RegionUp OnRegionUp; 99 //public event RegionUp OnRegionUp;
91 100
92 /// <summary> 101 /// <summary>
93 /// We have a child agent for this avatar and we're getting a status update about it 102 /// We have a child agent for this avatar and we're getting a status update about it
@@ -110,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
110 private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; 119 private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
111 private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; 120 private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
112 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; 121 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
113 private RegionUp handlerRegionUp = null; // OnRegionUp; 122 //private RegionUp handlerRegionUp = null; // OnRegionUp;
114 private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; 123 private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
115 //private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; 124 //private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar;
116 private LogOffUser handlerLogOffUser = null; 125 private LogOffUser handlerLogOffUser = null;
@@ -124,6 +133,13 @@ namespace OpenSim.Region.Framework.Scenes
124 m_agentsInTransit = new List<UUID>(); 133 m_agentsInTransit = new List<UUID>();
125 } 134 }
126 135
136 public void SetScene(Scene s)
137 {
138 m_scene = s;
139 m_regionInfo = s.RegionInfo;
140 m_interregionCommsOut = m_scene.RequestModuleInterface<IInterregionCommsOut>();
141 }
142
127 /// <summary> 143 /// <summary>
128 /// Register a region with the grid 144 /// Register a region with the grid
129 /// </summary> 145 /// </summary>
@@ -131,40 +147,30 @@ namespace OpenSim.Region.Framework.Scenes
131 /// <exception cref="System.Exception">Thrown if region registration fails.</exception> 147 /// <exception cref="System.Exception">Thrown if region registration fails.</exception>
132 public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos) 148 public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
133 { 149 {
134 m_interregionCommsOut = comms_out; 150 //m_interregionCommsOut = comms_out;
135 151
136 m_regionInfo = regionInfos; 152 //m_regionInfo = regionInfos;
137 m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName; 153 //m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName;
138 regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo); 154 //regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo);
139 155
140 if (regionCommsHost != null) 156 //if (regionCommsHost != null)
141 { 157 //{
142 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); 158 // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
143 159
144 regionCommsHost.debugRegionName = regionInfos.RegionName; 160 // regionCommsHost.debugRegionName = regionInfos.RegionName;
145 regionCommsHost.OnExpectPrim += IncomingPrimCrossing; 161 // regionCommsHost.OnExpectPrim += IncomingPrimCrossing;
146 regionCommsHost.OnExpectUser += NewUserConnection; 162 // regionCommsHost.OnExpectUser += NewUserConnection;
147 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 163 // regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
148 regionCommsHost.OnCloseAgentConnection += CloseConnection; 164 // regionCommsHost.OnCloseAgentConnection += CloseConnection;
149 regionCommsHost.OnRegionUp += newRegionUp; 165 // regionCommsHost.OnRegionUp += newRegionUp;
150 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; 166 // regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
151 regionCommsHost.OnLogOffUser += GridLogOffUser; 167 // regionCommsHost.OnLogOffUser += GridLogOffUser;
152 regionCommsHost.OnGetLandData += FetchLandData; 168 // regionCommsHost.OnGetLandData += FetchLandData;
153 } 169 //}
154 else 170 //else
155 { 171 //{
156 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null"); 172 // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
157 } 173 //}
158 }
159
160 /// <summary>
161 /// Returns a region with the name closest to string provided
162 /// </summary>
163 /// <param name="name">Partial Region Name for matching</param>
164 /// <returns>Region Information for the region</returns>
165 public RegionInfo RequestClosestRegion(string name)
166 {
167 return m_commsProvider.GridService.RequestClosestRegion(name);
168 } 174 }
169 175
170 /// <summary> 176 /// <summary>
@@ -173,30 +179,31 @@ namespace OpenSim.Region.Framework.Scenes
173 /// </summary> 179 /// </summary>
174 public void Close() 180 public void Close()
175 { 181 {
176 if (regionCommsHost != null) 182
177 { 183 //if (regionCommsHost != null)
178 regionCommsHost.OnLogOffUser -= GridLogOffUser; 184 //{
179 regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate; 185 // regionCommsHost.OnLogOffUser -= GridLogOffUser;
180 regionCommsHost.OnRegionUp -= newRegionUp; 186 // regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
181 regionCommsHost.OnExpectUser -= NewUserConnection; 187 // regionCommsHost.OnRegionUp -= newRegionUp;
182 regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; 188 // regionCommsHost.OnExpectUser -= NewUserConnection;
183 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; 189 // regionCommsHost.OnExpectPrim -= IncomingPrimCrossing;
184 regionCommsHost.OnCloseAgentConnection -= CloseConnection; 190 // regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
185 regionCommsHost.OnGetLandData -= FetchLandData; 191 // regionCommsHost.OnCloseAgentConnection -= CloseConnection;
192 // regionCommsHost.OnGetLandData -= FetchLandData;
186 193
187 try 194 // try
188 { 195 // {
189 m_commsProvider.GridService.DeregisterRegion(m_regionInfo); 196 // m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
190 } 197 // }
191 catch (Exception e) 198 // catch (Exception e)
192 { 199 // {
193 m_log.ErrorFormat( 200 // m_log.ErrorFormat(
194 "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing", 201 // "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
195 m_regionInfo.RegionName, e); 202 // m_regionInfo.RegionName, e);
196 } 203 // }
197 204
198 regionCommsHost = null; 205 // regionCommsHost = null;
199 } 206 //}
200 } 207 }
201 208
202 #region CommsManager Event handlers 209 #region CommsManager Event handlers
@@ -232,22 +239,6 @@ namespace OpenSim.Region.Framework.Scenes
232 } 239 }
233 240
234 /// <summary> 241 /// <summary>
235 /// A New Region is now available. Inform the scene that there is a new region available.
236 /// </summary>
237 /// <param name="region">Information about the new region that is available</param>
238 /// <returns>True if the event was handled</returns>
239 protected bool newRegionUp(RegionInfo region)
240 {
241 handlerRegionUp = OnRegionUp;
242 if (handlerRegionUp != null)
243 {
244 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName);
245 handlerRegionUp(region);
246 }
247 return true;
248 }
249
250 /// <summary>
251 /// Inform the scene that we've got an update about a child agent that we have 242 /// Inform the scene that we've got an update about a child agent that we have
252 /// </summary> 243 /// </summary>
253 /// <param name="cAgentData"></param> 244 /// <param name="cAgentData"></param>
@@ -330,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes
330 #region Inform Client of Neighbours 321 #region Inform Client of Neighbours
331 322
332 private delegate void InformClientOfNeighbourDelegate( 323 private delegate void InformClientOfNeighbourDelegate(
333 ScenePresence avatar, AgentCircuitData a, SimpleRegionInfo reg, IPEndPoint endPoint, bool newAgent); 324 ScenePresence avatar, AgentCircuitData a, GridRegion reg, IPEndPoint endPoint, bool newAgent);
334 325
335 private void InformClientOfNeighbourCompleted(IAsyncResult iar) 326 private void InformClientOfNeighbourCompleted(IAsyncResult iar)
336 { 327 {
@@ -348,7 +339,7 @@ namespace OpenSim.Region.Framework.Scenes
348 /// <param name="a"></param> 339 /// <param name="a"></param>
349 /// <param name="regionHandle"></param> 340 /// <param name="regionHandle"></param>
350 /// <param name="endPoint"></param> 341 /// <param name="endPoint"></param>
351 private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, SimpleRegionInfo reg, 342 private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, GridRegion reg,
352 IPEndPoint endPoint, bool newAgent) 343 IPEndPoint endPoint, bool newAgent)
353 { 344 {
354 // Let's wait just a little to give time to originating regions to catch up with closing child agents 345 // Let's wait just a little to give time to originating regions to catch up with closing child agents
@@ -366,8 +357,7 @@ namespace OpenSim.Region.Framework.Scenes
366 357
367 string reason = String.Empty; 358 string reason = String.Empty;
368 359
369 //bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, a); 360
370
371 bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason); 361 bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason);
372 362
373 if (regionAccepted && newAgent) 363 if (regionAccepted && newAgent)
@@ -400,17 +390,7 @@ namespace OpenSim.Region.Framework.Scenes
400 390
401 } 391 }
402 392
403 public void RequestNeighbors(RegionInfo region) 393 public List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY)
404 {
405 // List<SimpleRegionInfo> neighbours =
406 m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
407 //IPEndPoint blah = new IPEndPoint();
408
409 //blah.Address = region.RemotingAddress;
410 //blah.Port = region.RemotingPort;
411 }
412
413 public List<SimpleRegionInfo> RequestNeighbors(Scene pScene, uint pRegionLocX, uint pRegionLocY)
414 { 394 {
415 Border[] northBorders = pScene.NorthBorders.ToArray(); 395 Border[] northBorders = pScene.NorthBorders.ToArray();
416 Border[] southBorders = pScene.SouthBorders.ToArray(); 396 Border[] southBorders = pScene.SouthBorders.ToArray();
@@ -420,50 +400,34 @@ namespace OpenSim.Region.Framework.Scenes
420 // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement. 400 // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement.
421 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) 401 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1)
422 { 402 {
423 return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); 403 return m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
424 } 404 }
425 else 405 else
426 { 406 {
427 Vector2 extent = Vector2.Zero; 407 Vector2 extent = Vector2.Zero;
428 for (int i=0;i<eastBorders.Length;i++) 408 for (int i = 0; i < eastBorders.Length; i++)
429 { 409 {
430 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X; 410 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
431 } 411 }
432 for (int i=0;i<northBorders.Length;i++) 412 for (int i = 0; i < northBorders.Length; i++)
433 { 413 {
434 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y; 414 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
435 } 415 }
436 416
437 List<SimpleRegionInfo> neighbourList = new List<SimpleRegionInfo>();
438
439 // Loss of fraction on purpose 417 // Loss of fraction on purpose
440 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1; 418 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1;
441 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1; 419 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1;
442 420
443 int startX = (int) pRegionLocX - 1; 421 int startX = (int)(pRegionLocX - 1) * (int)Constants.RegionSize;
444 int startY = (int) pRegionLocY - 1; 422 int startY = (int)(pRegionLocY - 1) * (int)Constants.RegionSize;
445 423
446 int endX = (int) pRegionLocX + (int)extent.X; 424 int endX = ((int)pRegionLocX + (int)extent.X) * (int)Constants.RegionSize;
447 int endY = (int) pRegionLocY + (int)extent.Y; 425 int endY = ((int)pRegionLocY + (int)extent.Y) * (int)Constants.RegionSize;
448 426
449 for (int i=startX;i<endX;i++) 427 List<GridRegion> neighbours = m_scene.GridService.GetRegionRange(m_regionInfo.ScopeID, startX, endX, startY, endY);
450 { 428 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
451 for (int j=startY;j<endY;j++) 429
452 { 430 return neighbours;
453 // Skip CurrentRegion
454 if (i == (int)pRegionLocX && j == (int)pRegionLocY)
455 continue;
456
457 ulong regionHandle = Util.UIntsToLong((uint)(i * Constants.RegionSize),
458 (uint)(j * Constants.RegionSize));
459 RegionInfo neighborreg = m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
460 if (neighborreg != null)
461 {
462 neighbourList.Add(neighborreg);
463 }
464 }
465 }
466 return neighbourList;
467 //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo() 431 //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo()
468 //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); 432 //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY);
469 } 433 }
@@ -475,29 +439,28 @@ namespace OpenSim.Region.Framework.Scenes
475 /// </summary> 439 /// </summary>
476 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours) 440 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours)
477 { 441 {
478 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>(); 442 //List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
443 List<GridRegion> neighbours = new List<GridRegion>();
479 444
480 //m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 445 ////m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
481 for (int i = 0; i < lstneighbours.Count; i++) 446 //for (int i = 0; i < lstneighbours.Count; i++)
482 { 447 //{
483 // We don't want to keep sending to regions that consistently fail on comms. 448 // // We don't want to keep sending to regions that consistently fail on comms.
484 if (!(lstneighbours[i].commFailTF)) 449 // if (!(lstneighbours[i].commFailTF))
485 { 450 // {
486 neighbours.Add(new SimpleRegionInfo(lstneighbours[i])); 451 // neighbours.Add(new SimpleRegionInfo(lstneighbours[i]));
487 } 452 // }
488 } 453 //}
489 // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be 454 // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be
490 // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/ 455 // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/
491 if (m_regionInfo != null) 456 if (m_regionInfo != null)
492 { 457 {
493 neighbours = 458 neighbours = RequestNeighbours(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
494 RequestNeighbors(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
495 } 459 }
496 else 460 else
497 { 461 {
498 m_log.Debug("[ENABLENEIGHBOURCHILDAGENTS]: m_regionInfo was null in EnableNeighbourChildAgents, is this a NPC?"); 462 m_log.Debug("[ENABLENEIGHBOURCHILDAGENTS]: m_regionInfo was null in EnableNeighbourChildAgents, is this a NPC?");
499 } 463 }
500
501 464
502 /// We need to find the difference between the new regions where there are no child agents 465 /// We need to find the difference between the new regions where there are no child agents
503 /// and the regions where there are already child agents. We only send notification to the former. 466 /// and the regions where there are already child agents. We only send notification to the former.
@@ -540,8 +503,9 @@ namespace OpenSim.Region.Framework.Scenes
540 503
541 /// Create the necessary child agents 504 /// Create the necessary child agents
542 List<AgentCircuitData> cagents = new List<AgentCircuitData>(); 505 List<AgentCircuitData> cagents = new List<AgentCircuitData>();
543 foreach (SimpleRegionInfo neighbour in neighbours) 506 //foreach (SimpleRegionInfo neighbour in neighbours)
544 { 507 foreach (GridRegion neighbour in neighbours)
508 {
545 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle) 509 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle)
546 { 510 {
547 511
@@ -581,7 +545,7 @@ namespace OpenSim.Region.Framework.Scenes
581 545
582 bool newAgent = false; 546 bool newAgent = false;
583 int count = 0; 547 int count = 0;
584 foreach (SimpleRegionInfo neighbour in neighbours) 548 foreach (GridRegion neighbour in neighbours)
585 { 549 {
586 // Don't do it if there's already an agent in that region 550 // Don't do it if there's already an agent in that region
587 if (newRegions.Contains(neighbour.RegionHandle)) 551 if (newRegions.Contains(neighbour.RegionHandle))
@@ -634,7 +598,7 @@ namespace OpenSim.Region.Framework.Scenes
634 /// This informs a single neighboring region about agent "avatar". 598 /// This informs a single neighboring region about agent "avatar".
635 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 599 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
636 /// </summary> 600 /// </summary>
637 public void InformNeighborChildAgent(ScenePresence avatar, SimpleRegionInfo region) 601 public void InformNeighborChildAgent(ScenePresence avatar, GridRegion region)
638 { 602 {
639 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 603 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
640 agent.BaseFolder = UUID.Zero; 604 agent.BaseFolder = UUID.Zero;
@@ -665,61 +629,63 @@ namespace OpenSim.Region.Framework.Scenes
665 /// <param name="regionhandle"></param> 629 /// <param name="regionhandle"></param>
666 private void InformNeighboursThatRegionIsUpAsync(INeighbourService neighbourService, RegionInfo region, ulong regionhandle) 630 private void InformNeighboursThatRegionIsUpAsync(INeighbourService neighbourService, RegionInfo region, ulong regionhandle)
667 { 631 {
668 m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here"); 632 uint x = 0, y = 0;
669 //RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); 633 Utils.LongToUInts(regionhandle, out x, out y);
670 634
671 //bool regionAccepted = 635 GridRegion neighbour = null;
672 // m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle);
673
674 //bool regionAccepted = m_interregionCommsOut.SendHelloNeighbour(regionhandle, region);
675 bool regionAccepted = false;
676 if (neighbourService != null) 636 if (neighbourService != null)
677 regionAccepted = neighbourService.HelloNeighbour(regionhandle, region); 637 neighbour = neighbourService.HelloNeighbour(regionhandle, region);
678 else 638 else
679 m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region"); 639 m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region");
680 640
681 if (regionAccepted) 641 if (neighbour != null)
682 { 642 {
683 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here"); 643 m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
684 handlerRegionUp = OnRegionUp; 644 m_scene.EventManager.TriggerOnRegionUp(neighbour);
685
686 // yes, we're notifying ourselves.
687 if (handlerRegionUp != null)
688 handlerRegionUp(region);
689 } 645 }
690 else 646 else
691 { 647 {
692 m_log.Warn("[INTERGRID]: Failed to inform neighbors that I'm here."); 648 m_log.WarnFormat("[INTERGRID]: Failed to inform neighbour {0}-{1} that I'm here.", x / Constants.RegionSize, y / Constants.RegionSize);
693 } 649 }
694 } 650 }
695 651
696 /// <summary> 652
697 /// Called by scene when region is initialized (not always when it's listening for agents)
698 /// This is an inter-region message that informs the surrounding neighbors that the sim is up.
699 /// </summary>
700 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region) 653 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region)
701 { 654 {
702 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 655 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
703 656
704 657 for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++)
705 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>(); 658 for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++)
706 // This stays uncached because we don't already know about our neighbors at this point. 659 if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region
707 neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 660 {
708 if (neighbours != null) 661 ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
709 { 662 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
710 for (int i = 0; i < neighbours.Count; i++)
711 {
712 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
713 663
714 d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle, 664 d.BeginInvoke(neighbourService, region, handle,
715 InformNeighborsThatRegionisUpCompleted, 665 InformNeighborsThatRegionisUpCompleted,
716 d); 666 d);
717 } 667 }
718 } 668
669 //List<GridRegion> neighbours = new List<GridRegion>();
670 //// This stays uncached because we don't already know about our neighbors at this point.
671
672 //neighbours = m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
673 //if (neighbours != null)
674 //{
675 // for (int i = 0; i < neighbours.Count; i++)
676 // {
677 // InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
678
679 // d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle,
680 // InformNeighborsThatRegionisUpCompleted,
681 // d);
682 // }
683 //}
719 684
720 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region)); 685 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region));
721 } 686 }
722 687
688
723 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); 689 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle);
724 690
725 /// <summary> 691 /// <summary>
@@ -815,41 +781,6 @@ namespace OpenSim.Region.Framework.Scenes
815 } 781 }
816 } 782 }
817 783
818 /// <summary>
819 /// Helper function to request neighbors from grid-comms
820 /// </summary>
821 /// <param name="regionHandle"></param>
822 /// <returns></returns>
823 public virtual RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
824 {
825 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionHandle.ToString());
826 return m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
827 }
828
829 /// <summary>
830 /// Helper function to request neighbors from grid-comms
831 /// </summary>
832 /// <param name="regionID"></param>
833 /// <returns></returns>
834 public virtual RegionInfo RequestNeighbouringRegionInfo(UUID regionID)
835 {
836 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID);
837 return m_commsProvider.GridService.RequestNeighbourInfo(regionID);
838 }
839
840 /// <summary>
841 /// Requests map blocks in area of minX, maxX, minY, MaxY in world cordinates
842 /// </summary>
843 /// <param name="minX"></param>
844 /// <param name="minY"></param>
845 /// <param name="maxX"></param>
846 /// <param name="maxY"></param>
847 public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY)
848 {
849 List<MapBlockData> mapBlocks;
850 mapBlocks = m_commsProvider.GridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, minX + 4, minY + 4);
851 remoteClient.SendMapBlock(mapBlocks, 0);
852 }
853 784
854 /// <summary> 785 /// <summary>
855 /// Try to teleport an agent to a new region. 786 /// Try to teleport an agent to a new region.
@@ -914,7 +845,10 @@ namespace OpenSim.Region.Framework.Scenes
914 } 845 }
915 else 846 else
916 { 847 {
917 RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); 848 uint x = 0, y = 0;
849 Utils.LongToUInts(regionHandle, out x, out y);
850 GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
851
918 if (reg != null) 852 if (reg != null)
919 { 853 {
920 m_log.DebugFormat( 854 m_log.DebugFormat(
@@ -1163,7 +1097,7 @@ namespace OpenSim.Region.Framework.Scenes
1163 } 1097 }
1164 } 1098 }
1165 1099
1166 private bool IsOutsideRegion(Scene s, Vector3 pos) 1100 protected bool IsOutsideRegion(Scene s, Vector3 pos)
1167 { 1101 {
1168 1102
1169 if (s.TestBorderCross(pos,Cardinals.N)) 1103 if (s.TestBorderCross(pos,Cardinals.N))
@@ -1221,10 +1155,10 @@ namespace OpenSim.Region.Framework.Scenes
1221 return false; 1155 return false;
1222 } 1156 }
1223 1157
1224 private List<ulong> NeighbourHandles(List<SimpleRegionInfo> neighbours) 1158 private List<ulong> NeighbourHandles(List<GridRegion> neighbours)
1225 { 1159 {
1226 List<ulong> handles = new List<ulong>(); 1160 List<ulong> handles = new List<ulong>();
1227 foreach (SimpleRegionInfo reg in neighbours) 1161 foreach (GridRegion reg in neighbours)
1228 { 1162 {
1229 handles.Add(reg.RegionHandle); 1163 handles.Add(reg.RegionHandle);
1230 } 1164 }
@@ -1475,7 +1409,10 @@ namespace OpenSim.Region.Framework.Scenes
1475 m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury); 1409 m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury);
1476 1410
1477 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 1411 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
1478 SimpleRegionInfo neighbourRegion = RequestNeighbouringRegionInfo(neighbourHandle); 1412
1413 int x = (int)(neighbourx * Constants.RegionSize), y = (int)(neighboury * Constants.RegionSize);
1414 GridRegion neighbourRegion = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
1415
1479 if (neighbourRegion != null && agent.ValidateAttachments()) 1416 if (neighbourRegion != null && agent.ValidateAttachments())
1480 { 1417 {
1481 pos = pos + (agent.Velocity); 1418 pos = pos + (agent.Velocity);
@@ -1602,11 +1539,6 @@ namespace OpenSim.Region.Framework.Scenes
1602 } 1539 }
1603 1540
1604 1541
1605 public Dictionary<string, string> GetGridSettings()
1606 {
1607 return m_commsProvider.GridService.GetGridSettings();
1608 }
1609
1610 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) 1542 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
1611 { 1543 {
1612 m_commsProvider.LogOffUser(userid, regionid, regionhandle, position, lookat); 1544 m_commsProvider.LogOffUser(userid, regionid, regionhandle, position, lookat);
@@ -1643,19 +1575,14 @@ namespace OpenSim.Region.Framework.Scenes
1643 return m_commsProvider.GetUserFriendList(friendlistowner); 1575 return m_commsProvider.GetUserFriendList(friendlistowner);
1644 } 1576 }
1645 1577
1646 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
1647 {
1648 return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
1649 }
1650
1651 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query) 1578 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
1652 { 1579 {
1653 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); 1580 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
1654 } 1581 }
1655 1582
1656 public List<RegionInfo> RequestNamedRegions(string name, int maxNumber) 1583 public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
1657 { 1584 {
1658 return m_commsProvider.GridService.RequestNamedRegions(name, maxNumber); 1585 return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
1659 } 1586 }
1660 1587
1661 //private void Dump(string msg, List<ulong> handles) 1588 //private void Dump(string msg, List<ulong> handles)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 48dea07..54ac792 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -845,7 +845,7 @@ namespace OpenSim.Region.Framework.Scenes
845 ScenePresence sp; 845 ScenePresence sp;
846 846
847 lock (ScenePresences) 847 lock (ScenePresences)
848 { 848 {
849 ScenePresences.TryGetValue(agentID, out sp); 849 ScenePresences.TryGetValue(agentID, out sp);
850 } 850 }
851 851
@@ -1134,6 +1134,23 @@ namespace OpenSim.Region.Framework.Scenes
1134 } 1134 }
1135 } 1135 }
1136 1136
1137 protected internal void ForEachSOG(Action<SceneObjectGroup> action)
1138 {
1139 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
1140 foreach (SceneObjectGroup obj in objlist)
1141 {
1142 try
1143 {
1144 action(obj);
1145 }
1146 catch (Exception e)
1147 {
1148 // Catch it and move on. This includes situations where splist has inconsistent info
1149 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message);
1150 }
1151 }
1152 }
1153
1137 #endregion 1154 #endregion
1138 1155
1139 #region Client Event handlers 1156 #region Client Event handlers
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 1843e2c..3097929 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
192 public void SaveCurrentSceneToXml(string filename) 192 public void SaveCurrentSceneToXml(string filename)
193 { 193 {
194 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 194 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
195 if (serialiser != null) 195 if (serialiser != null)
196 serialiser.SavePrimsToXml(CurrentOrFirstScene, filename); 196 serialiser.SavePrimsToXml(CurrentOrFirstScene, filename);
197 } 197 }
198 198
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Framework.Scenes
205 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset) 205 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset)
206 { 206 {
207 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 207 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
208 if (serialiser != null) 208 if (serialiser != null)
209 serialiser.LoadPrimsFromXml(CurrentOrFirstScene, filename, generateNewIDs, loadOffset); 209 serialiser.LoadPrimsFromXml(CurrentOrFirstScene, filename, generateNewIDs, loadOffset);
210 } 210 }
211 211
@@ -216,14 +216,14 @@ namespace OpenSim.Region.Framework.Scenes
216 public void SaveCurrentSceneToXml2(string filename) 216 public void SaveCurrentSceneToXml2(string filename)
217 { 217 {
218 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 218 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
219 if (serialiser != null) 219 if (serialiser != null)
220 serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename); 220 serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename);
221 } 221 }
222 222
223 public void SaveNamedPrimsToXml2(string primName, string filename) 223 public void SaveNamedPrimsToXml2(string primName, string filename)
224 { 224 {
225 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 225 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
226 if (serialiser != null) 226 if (serialiser != null)
227 serialiser.SaveNamedPrimsToXml2(CurrentOrFirstScene, primName, filename); 227 serialiser.SaveNamedPrimsToXml2(CurrentOrFirstScene, primName, filename);
228 } 228 }
229 229
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Framework.Scenes
233 public void LoadCurrentSceneFromXml2(string filename) 233 public void LoadCurrentSceneFromXml2(string filename)
234 { 234 {
235 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 235 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
236 if (serialiser != null) 236 if (serialiser != null)
237 serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename); 237 serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
238 } 238 }
239 239
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Framework.Scenes
257 public void LoadArchiveToCurrentScene(string filename) 257 public void LoadArchiveToCurrentScene(string filename)
258 { 258 {
259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>(); 259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
260 if (archiver != null) 260 if (archiver != null)
261 archiver.DearchiveRegion(filename); 261 archiver.DearchiveRegion(filename);
262 } 262 }
263 263
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3c17bbe..25489d8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Framework.Scenes
133 /// Is this scene object acting as an attachment? 133 /// Is this scene object acting as an attachment?
134 /// 134 ///
135 /// We return false if the group has already been deleted. 135 /// We return false if the group has already been deleted.
136 /// 136 ///
137 /// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I 137 /// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I
138 /// presume either all or no parts in a linkset can be part of an attachment (in which 138 /// presume either all or no parts in a linkset can be part of an attachment (in which
139 /// case the value would get proprogated down into all the descendent parts). 139 /// case the value would get proprogated down into all the descendent parts).
@@ -245,6 +245,11 @@ namespace OpenSim.Region.Framework.Scenes
245 } 245 }
246 } 246 }
247 247
248 private bool IsAttachmentCheckFull()
249 {
250 return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0));
251 }
252
248 /// <summary> 253 /// <summary>
249 /// The absolute position of this scene object in the scene 254 /// The absolute position of this scene object in the scene
250 /// </summary> 255 /// </summary>
@@ -257,8 +262,8 @@ namespace OpenSim.Region.Framework.Scenes
257 262
258 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) 263 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
259 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) 264 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
260 && !IsAttachment) 265 && !IsAttachmentCheckFull())
261 { 266 {
262 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 267 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
263 } 268 }
264 269
@@ -449,7 +454,7 @@ namespace OpenSim.Region.Framework.Scenes
449 /// <param name="scene"></param> 454 /// <param name="scene"></param>
450 public void AttachToScene(Scene scene) 455 public void AttachToScene(Scene scene)
451 { 456 {
452 m_scene = scene; 457 m_scene = scene;
453 RegionHandle = m_scene.RegionInfo.RegionHandle; 458 RegionHandle = m_scene.RegionInfo.RegionHandle;
454 459
455 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) 460 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
@@ -474,9 +479,9 @@ namespace OpenSim.Region.Framework.Scenes
474 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); 479 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
475 } 480 }
476 481
477 ApplyPhysics(m_scene.m_physicalPrim); 482 ApplyPhysics(m_scene.m_physicalPrim);
478 483
479 ScheduleGroupForFullUpdate(); 484 ScheduleGroupForFullUpdate();
480 } 485 }
481 486
482 public Vector3 GroupScale() 487 public Vector3 GroupScale()
@@ -1032,12 +1037,12 @@ namespace OpenSim.Region.Framework.Scenes
1032 m_rootPart = part; 1037 m_rootPart = part;
1033 if (!IsAttachment) 1038 if (!IsAttachment)
1034 part.ParentID = 0; 1039 part.ParentID = 0;
1035 part.LinkNum = 0; 1040 part.LinkNum = 0;
1036 1041
1037 // No locking required since the SOG should not be in the scene yet - one can't change root parts after 1042 // No locking required since the SOG should not be in the scene yet - one can't change root parts after
1038 // the scene object has been attached to the scene 1043 // the scene object has been attached to the scene
1039 m_parts.Add(m_rootPart.UUID, m_rootPart); 1044 m_parts.Add(m_rootPart.UUID, m_rootPart);
1040 } 1045 }
1041 1046
1042 /// <summary> 1047 /// <summary>
1043 /// Add a new part to this scene object. The part must already be correctly configured. 1048 /// Add a new part to this scene object. The part must already be correctly configured.
@@ -1155,7 +1160,7 @@ namespace OpenSim.Region.Framework.Scenes
1155 1160
1156 /// <summary> 1161 /// <summary>
1157 /// Delete this group from its scene and tell all the scene presences about that deletion. 1162 /// Delete this group from its scene and tell all the scene presences about that deletion.
1158 /// </summary> 1163 /// </summary>
1159 /// <param name="silent">Broadcast deletions to all clients.</param> 1164 /// <param name="silent">Broadcast deletions to all clients.</param>
1160 public void DeleteGroup(bool silent) 1165 public void DeleteGroup(bool silent)
1161 { 1166 {
@@ -1262,11 +1267,11 @@ namespace OpenSim.Region.Framework.Scenes
1262 if (part.LocalId != m_rootPart.LocalId) 1267 if (part.LocalId != m_rootPart.LocalId)
1263 { 1268 {
1264 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); 1269 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
1265 } 1270 }
1266 } 1271 }
1267 1272
1268 // Hack to get the physics scene geometries in the right spot 1273 // Hack to get the physics scene geometries in the right spot
1269 ResetChildPrimPhysicsPositions(); 1274 ResetChildPrimPhysicsPositions();
1270 } 1275 }
1271 else 1276 else
1272 { 1277 {
@@ -1489,7 +1494,7 @@ namespace OpenSim.Region.Framework.Scenes
1489 List<SceneObjectPart> partList; 1494 List<SceneObjectPart> partList;
1490 1495
1491 lock (m_parts) 1496 lock (m_parts)
1492 { 1497 {
1493 partList = new List<SceneObjectPart>(m_parts.Values); 1498 partList = new List<SceneObjectPart>(m_parts.Values);
1494 } 1499 }
1495 1500
@@ -1739,7 +1744,7 @@ namespace OpenSim.Region.Framework.Scenes
1739 rootpart.PhysActor.PIDHoverActive = false; 1744 rootpart.PhysActor.PIDHoverActive = false;
1740 } 1745 }
1741 } 1746 }
1742 } 1747 }
1743 } 1748 }
1744 1749
1745 /// <summary> 1750 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 51bb114..ea6bc9c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -42,7 +42,7 @@ using OpenSim.Region.Framework.Scenes.Scripting;
42using OpenSim.Region.Physics.Manager; 42using OpenSim.Region.Physics.Manager;
43 43
44namespace OpenSim.Region.Framework.Scenes 44namespace OpenSim.Region.Framework.Scenes
45{ 45{
46 #region Enumerations 46 #region Enumerations
47 47
48 [Flags] 48 [Flags]
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes
142 public UUID FromItemID = UUID.Zero; 142 public UUID FromItemID = UUID.Zero;
143 143
144 /// <value> 144 /// <value>
145 /// The UUID of the user inventory item from which this object was rezzed if this is a root part. 145 /// The UUID of the user inventory item from which this object was rezzed if this is a root part.
146 /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item. 146 /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item.
147 /// </value> 147 /// </value>
148 private UUID m_fromUserInventoryItemID = UUID.Zero; 148 private UUID m_fromUserInventoryItemID = UUID.Zero;
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Framework.Scenes
187 public IEntityInventory Inventory 187 public IEntityInventory Inventory
188 { 188 {
189 get { return m_inventory; } 189 get { return m_inventory; }
190 } 190 }
191 protected SceneObjectPartInventory m_inventory; 191 protected SceneObjectPartInventory m_inventory;
192 192
193 [XmlIgnore] 193 [XmlIgnore]
@@ -309,9 +309,9 @@ namespace OpenSim.Region.Framework.Scenes
309 RotationOffset = rotationOffset; 309 RotationOffset = rotationOffset;
310 Velocity = new Vector3(0, 0, 0); 310 Velocity = new Vector3(0, 0, 0);
311 AngularVelocity = new Vector3(0, 0, 0); 311 AngularVelocity = new Vector3(0, 0, 0);
312 Acceleration = new Vector3(0, 0, 0); 312 Acceleration = new Vector3(0, 0, 0);
313 m_TextureAnimation = new byte[0]; 313 m_TextureAnimation = new byte[0];
314 m_particleSystem = new byte[0]; 314 m_particleSystem = new byte[0];
315 315
316 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 316 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
317 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from 317 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
@@ -363,7 +363,7 @@ namespace OpenSim.Region.Framework.Scenes
363 363
364 /// <summary> 364 /// <summary>
365 /// A relic from when we we thought that prims contained folder objects. In 365 /// A relic from when we we thought that prims contained folder objects. In
366 /// reality, prim == folder 366 /// reality, prim == folder
367 /// Exposing this is not particularly good, but it's one of the least evils at the moment to see 367 /// Exposing this is not particularly good, but it's one of the least evils at the moment to see
368 /// folder id from prim inventory item data, since it's not (yet) actually stored with the prim. 368 /// folder id from prim inventory item data, since it's not (yet) actually stored with the prim.
369 /// </summary> 369 /// </summary>
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Framework.Scenes
384 384
385 /// <value> 385 /// <value>
386 /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes 386 /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
387 /// </value> 387 /// </value>
388 public TaskInventoryDictionary TaskInventory 388 public TaskInventoryDictionary TaskInventory
389 { 389 {
390 get { return m_inventory.Items; } 390 get { return m_inventory.Items; }
@@ -3386,7 +3386,7 @@ if (m_shape != null) {
3386 } 3386 }
3387 else 3387 else
3388 { 3388 {
3389 IsPhantom = false; 3389 IsPhantom = false;
3390 // If volumedetect is active we don't want phantom to be applied. 3390 // If volumedetect is active we don't want phantom to be applied.
3391 // If this is a new call to VD out of the state "phantom" 3391 // If this is a new call to VD out of the state "phantom"
3392 // this will also cause the prim to be visible to physics 3392 // this will also cause the prim to be visible to physics
@@ -3455,6 +3455,7 @@ if (m_shape != null) {
3455 RotationOffset, 3455 RotationOffset,
3456 UsePhysics); 3456 UsePhysics);
3457 3457
3458 pa = PhysActor;
3458 if (pa != null) 3459 if (pa != null)
3459 { 3460 {
3460 pa.LocalID = LocalId; 3461 pa.LocalID = LocalId;
@@ -3483,7 +3484,7 @@ if (m_shape != null) {
3483 } 3484 }
3484 else // it already has a physical representation 3485 else // it already has a physical representation
3485 { 3486 {
3486 pa.IsPhysical = UsePhysics; 3487 pa.IsPhysical = UsePhysics;
3487 3488
3488 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim 3489 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim
3489 if (m_parentGroup != null) 3490 if (m_parentGroup != null)
@@ -3513,11 +3514,10 @@ if (m_shape != null) {
3513 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active 3514 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active
3514 this.VolumeDetectActive = true; 3515 this.VolumeDetectActive = true;
3515 } 3516 }
3516
3517 } 3517 }
3518 else 3518 else
3519 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like 3519 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
3520 // (mumbles, well, at least if you have infinte CPU powers :-) ) 3520 // (mumbles, well, at least if you have infinte CPU powers :-))
3521 PhysicsActor pa = this.PhysActor; 3521 PhysicsActor pa = this.PhysActor;
3522 if (pa != null) 3522 if (pa != null)
3523 { 3523 {
@@ -3775,7 +3775,7 @@ if (m_shape != null) {
3775 public override string ToString() 3775 public override string ToString()
3776 { 3776 {
3777 return String.Format("{0} {1} (parent {2}))", Name, UUID, ParentGroup); 3777 return String.Format("{0} {1} (parent {2}))", Name, UUID, ParentGroup);
3778 } 3778 }
3779 3779
3780 #endregion Public Methods 3780 #endregion Public Methods
3781 3781
@@ -3823,11 +3823,11 @@ if (m_shape != null) {
3823 _everyoneMask &= _nextOwnerMask; 3823 _everyoneMask &= _nextOwnerMask;
3824 3824
3825 Inventory.ApplyNextOwnerPermissions(); 3825 Inventory.ApplyNextOwnerPermissions();
3826 } 3826 }
3827 3827
3828 public bool CanBeDeleted() 3828 public bool CanBeDeleted()
3829 { 3829 {
3830 return Inventory.CanBeDeleted(); 3830 return Inventory.CanBeDeleted();
3831 } 3831 }
3832 } 3832 }
3833} 3833}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 76bcd7e..098e010 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes
105 public void ForceInventoryPersistence() 105 public void ForceInventoryPersistence()
106 { 106 {
107 HasInventoryChanged = true; 107 HasInventoryChanged = true;
108 } 108 }
109 109
110 /// <summary> 110 /// <summary>
111 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating 111 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes
164 /// <summary> 164 /// <summary>
165 /// Change every item in this inventory to a new group. 165 /// Change every item in this inventory to a new group.
166 /// </summary> 166 /// </summary>
167 /// <param name="groupID"></param> 167 /// <param name="groupID"></param>
168 public void ChangeInventoryGroup(UUID groupID) 168 public void ChangeInventoryGroup(UUID groupID)
169 { 169 {
170 lock (Items) 170 lock (Items)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ea5240e..3996cdc 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework.Communications.Cache;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes.Types; 37using OpenSim.Region.Framework.Scenes.Types;
38using OpenSim.Region.Physics.Manager; 38using OpenSim.Region.Physics.Manager;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40namespace OpenSim.Region.Framework.Scenes 41namespace OpenSim.Region.Framework.Scenes
41{ 42{
@@ -777,7 +778,7 @@ namespace OpenSim.Region.Framework.Scenes
777 // Moved this from SendInitialData to ensure that m_appearance is initialized 778 // Moved this from SendInitialData to ensure that m_appearance is initialized
778 // before the inventory is processed in MakeRootAgent. This fixes a race condition 779 // before the inventory is processed in MakeRootAgent. This fixes a race condition
779 // related to the handling of attachments 780 // related to the handling of attachments
780 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 781 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
781 if (m_scene.TestBorderCross(pos, Cardinals.E)) 782 if (m_scene.TestBorderCross(pos, Cardinals.E))
782 { 783 {
783 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E); 784 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E);
@@ -1236,7 +1237,7 @@ namespace OpenSim.Region.Framework.Scenes
1236 if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) 1237 if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
1237 { 1238 {
1238 StandUp(); 1239 StandUp();
1239 } 1240 }
1240 1241
1241 // Check if Client has camera in 'follow cam' or 'build' mode. 1242 // Check if Client has camera in 'follow cam' or 'build' mode.
1242 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); 1243 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation);
@@ -1490,7 +1491,7 @@ namespace OpenSim.Region.Framework.Scenes
1490 { 1491 {
1491// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); 1492// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
1492// m_log.DebugFormat( 1493// m_log.DebugFormat(
1493// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); 1494// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
1494 1495
1495 AddNewMovement(agent_control_v3, q); 1496 AddNewMovement(agent_control_v3, q);
1496 1497
@@ -2271,7 +2272,7 @@ namespace OpenSim.Region.Framework.Scenes
2271 { 2272 {
2272 //Record the time we enter this state so we know whether to "land" or not 2273 //Record the time we enter this state so we know whether to "land" or not
2273 m_animPersistUntil = DateTime.Now.Ticks; 2274 m_animPersistUntil = DateTime.Now.Ticks;
2274 return "FALLDOWN"; 2275 return "FALLDOWN"; // this falling animation is invoked too frequently when capsule tilt correction is used - why?
2275 } 2276 }
2276 } 2277 }
2277 } 2278 }
@@ -2307,14 +2308,14 @@ namespace OpenSim.Region.Framework.Scenes
2307 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector 2308 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector
2308 /// </summary> 2309 /// </summary>
2309 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param> 2310 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
2310 /// <param name="rotation">The direction in which this avatar should now face. 2311 /// <param name="rotation">The direction in which this avatar should now face.
2311 public void AddNewMovement(Vector3 vec, Quaternion rotation) 2312 public void AddNewMovement(Vector3 vec, Quaternion rotation)
2312 { 2313 {
2313 if (m_isChildAgent) 2314 if (m_isChildAgent)
2314 { 2315 {
2315 m_log.Debug("DEBUG: AddNewMovement: child agent, Making root agent!"); 2316 m_log.Debug("DEBUG: AddNewMovement: child agent, Making root agent!");
2316 2317
2317 // we have to reset the user's child agent connections. 2318 // we have to reset the user's child agent connections.
2318 // Likely, here they've lost the eventqueue for other regions so border 2319 // Likely, here they've lost the eventqueue for other regions so border
2319 // crossings will fail at this point unless we reset them. 2320 // crossings will fail at this point unless we reset them.
2320 2321
@@ -2650,7 +2651,7 @@ namespace OpenSim.Region.Framework.Scenes
2650 /// Tell the client for this scene presence what items it should be wearing now 2651 /// Tell the client for this scene presence what items it should be wearing now
2651 /// </summary> 2652 /// </summary>
2652 public void SendWearables() 2653 public void SendWearables()
2653 { 2654 {
2654 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 2655 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
2655 } 2656 }
2656 2657
@@ -2959,8 +2960,9 @@ namespace OpenSim.Region.Framework.Scenes
2959 else if (dir > 3 && dir < 7) // Heading Sout 2960 else if (dir > 3 && dir < 7) // Heading Sout
2960 neighboury--; 2961 neighboury--;
2961 2962
2962 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 2963 int x = (int)(neighbourx * Constants.RegionSize);
2963 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 2964 int y = (int)(neighboury * Constants.RegionSize);
2965 GridRegion neighbourRegion = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, x, y);
2964 2966
2965 if (neighbourRegion == null) 2967 if (neighbourRegion == null)
2966 { 2968 {
@@ -3198,7 +3200,7 @@ namespace OpenSim.Region.Framework.Scenes
3198 else 3200 else
3199 { 3201 {
3200 wears[i++] = UUID.Zero; 3202 wears[i++] = UUID.Zero;
3201 wears[i++] = UUID.Zero; 3203 wears[i++] = UUID.Zero;
3202 } 3204 }
3203 } 3205 }
3204 cAgent.Wearables = wears; 3206 cAgent.Wearables = wears;
@@ -3510,7 +3512,7 @@ namespace OpenSim.Region.Framework.Scenes
3510 3512
3511 public bool HasAttachments() 3513 public bool HasAttachments()
3512 { 3514 {
3513 return m_attachments.Count > 0; 3515 return m_attachments.Count > 0;
3514 } 3516 }
3515 3517
3516 public bool HasScriptedAttachments() 3518 public bool HasScriptedAttachments()
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index fe74158..f7544ac 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -122,13 +122,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
122 "[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData); 122 "[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
123 return null; 123 return null;
124 } 124 }
125 } 125 }
126 126
127 /// <summary> 127 /// <summary>
128 /// Serialize a scene object to the original xml format 128 /// Serialize a scene object to the original xml format
129 /// </summary> 129 /// </summary>
130 /// <param name="sceneObject"></param> 130 /// <param name="sceneObject"></param>
131 /// <returns></returns> 131 /// <returns></returns>
132 public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject) 132 public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject)
133 { 133 {
134 using (StringWriter sw = new StringWriter()) 134 using (StringWriter sw = new StringWriter())
@@ -140,13 +140,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
140 140
141 return sw.ToString(); 141 return sw.ToString();
142 } 142 }
143 } 143 }
144 144
145 /// <summary> 145 /// <summary>
146 /// Serialize a scene object to the original xml format 146 /// Serialize a scene object to the original xml format
147 /// </summary> 147 /// </summary>
148 /// <param name="sceneObject"></param> 148 /// <param name="sceneObject"></param>
149 /// <returns></returns> 149 /// <returns></returns>
150 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer) 150 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer)
151 { 151 {
152 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name); 152 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name);
@@ -238,13 +238,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
238 m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData); 238 m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
239 return null; 239 return null;
240 } 240 }
241 } 241 }
242 242
243 /// <summary> 243 /// <summary>
244 /// Serialize a scene object to the 'xml2' format. 244 /// Serialize a scene object to the 'xml2' format.
245 /// </summary> 245 /// </summary>
246 /// <param name="sceneObject"></param> 246 /// <param name="sceneObject"></param>
247 /// <returns></returns> 247 /// <returns></returns>
248 public static string ToXml2Format(SceneObjectGroup sceneObject) 248 public static string ToXml2Format(SceneObjectGroup sceneObject)
249 { 249 {
250 using (StringWriter sw = new StringWriter()) 250 using (StringWriter sw = new StringWriter())
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
262 /// Serialize a scene object to the 'xml2' format. 262 /// Serialize a scene object to the 'xml2' format.
263 /// </summary> 263 /// </summary>
264 /// <param name="sceneObject"></param> 264 /// <param name="sceneObject"></param>
265 /// <returns></returns> 265 /// <returns></returns>
266 public static void ToXml2Format(SceneObjectGroup sceneObject, XmlTextWriter writer) 266 public static void ToXml2Format(SceneObjectGroup sceneObject, XmlTextWriter writer)
267 { 267 {
268 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of SOG {0} to XML2", Name); 268 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of SOG {0} to XML2", Name);
@@ -288,6 +288,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
288 writer.WriteEndElement(); // End of SceneObjectGroup 288 writer.WriteEndElement(); // End of SceneObjectGroup
289 289
290 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0} to XML2, {1}ms", Name, System.Environment.TickCount - time); 290 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0} to XML2, {1}ms", Name, System.Environment.TickCount - time);
291 } 291 }
292 } 292 }
293} 293}
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 7fa1b8c..cf0f345 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
236 } 236 }
237 237
238 SavePrimListToXml2(primList, fileName); 238 SavePrimListToXml2(primList, fileName);
239 } 239 }
240 240
241 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName) 241 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
242 { 242 {
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 7f44bf1..ee288b3 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Framework.Scenes
450 { 450 {
451 addFrameMS(ms); 451 addFrameMS(ms);
452 addAgentMS(ms); 452 addAgentMS(ms);
453 } 453 }
454 454
455 #endregion 455 #endregion
456 } 456 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index 3b0e77f..fc66c85 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 [TestFixture, LongRunning] 45 [TestFixture, LongRunning]
46 public class EntityManagerTests 46 public class EntityManagerTests
47 { 47 {
48 static public Random random; 48 static public Random random;
49 SceneObjectGroup found; 49 SceneObjectGroup found;
50 Scene scene = SceneSetupHelpers.SetupScene(); 50 Scene scene = SceneSetupHelpers.SetupScene();
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
81 81
82 Assert.That(entman.ContainsKey(obj1), Is.False); 82 Assert.That(entman.ContainsKey(obj1), Is.False);
83 Assert.That(entman.ContainsKey(li1), Is.False); 83 Assert.That(entman.ContainsKey(li1), Is.False);
84 Assert.That(entman.ContainsKey(obj2), Is.False); 84 Assert.That(entman.ContainsKey(obj2), Is.False);
85 Assert.That(entman.ContainsKey(li2), Is.False); 85 Assert.That(entman.ContainsKey(li2), Is.False);
86 } 86 }
87 87
88 [Test] 88 [Test]
89 public void T011_ThreadAddRemoveTest() 89 public void T011_ThreadAddRemoveTest()
90 { 90 {
91 TestHelper.InMethod(); 91 TestHelper.InMethod();
92 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 92 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
93 93
@@ -148,12 +148,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
148 int size = random.Next(40,80); 148 int size = random.Next(40,80);
149 char ch ; 149 char ch ;
150 for (int i=0; i<size; i++) 150 for (int i=0; i<size; i++)
151 { 151 {
152 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; 152 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
153 name.Append(ch); 153 name.Append(ch);
154 } 154 }
155 return name.ToString(); 155 return name.ToString();
156 } 156 }
157 } 157 }
158 158
159 public class NewTestThreads 159 public class NewTestThreads
@@ -179,4 +179,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
179 entman.Remove(sog.UUID); 179 entman.Remove(sog.UUID);
180 } 180 }
181 } 181 }
182} \ No newline at end of file 182} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
index f6737a5..5c9e66f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
@@ -29,6 +29,7 @@ using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion;
32 33
33namespace OpenSim.Region.Framework.Scenes.Tests 34namespace OpenSim.Region.Framework.Scenes.Tests
34{ 35{
@@ -65,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
65 throw new NotImplementedException(); 66 throw new NotImplementedException();
66 } 67 }
67 68
68 public override bool OtherRegionUp(RegionInfo thisRegion) 69 public override void OtherRegionUp(GridRegion otherRegion)
69 { 70 {
70 throw new NotImplementedException(); 71 throw new NotImplementedException();
71 } 72 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 105446d..0ed00de 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -46,13 +46,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
46 /// </summary> 46 /// </summary>
47 [TestFixture] 47 [TestFixture]
48 public class SceneObjectBasicTests 48 public class SceneObjectBasicTests
49 { 49 {
50 /// <summary> 50 /// <summary>
51 /// Test adding an object to a scene. 51 /// Test adding an object to a scene.
52 /// </summary> 52 /// </summary>
53 [Test, LongRunning] 53 [Test, LongRunning]
54 public void TestAddSceneObject() 54 public void TestAddSceneObject()
55 { 55 {
56 TestHelper.InMethod(); 56 TestHelper.InMethod();
57 57
58 Scene scene = SceneSetupHelpers.SetupScene(); 58 Scene scene = SceneSetupHelpers.SetupScene();
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 61
62 //m_log.Debug("retrievedPart : {0}", retrievedPart); 62 //m_log.Debug("retrievedPart : {0}", retrievedPart);
63 // If the parts have the same UUID then we will consider them as one and the same 63 // If the parts have the same UUID then we will consider them as one and the same
64 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); 64 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
65 } 65 }
66 66
67 /// <summary> 67 /// <summary>
@@ -72,11 +72,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
72 { 72 {
73 TestHelper.InMethod(); 73 TestHelper.InMethod();
74 74
75 TestScene scene = SceneSetupHelpers.SetupScene(); 75 TestScene scene = SceneSetupHelpers.SetupScene();
76 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); 76 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
77 scene.DeleteSceneObject(part.ParentGroup, false); 77 scene.DeleteSceneObject(part.ParentGroup, false);
78 78
79 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 79 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
80 Assert.That(retrievedPart, Is.Null); 80 Assert.That(retrievedPart, Is.Null);
81 } 81 }
82 82
@@ -115,19 +115,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests
115 //[Test] 115 //[Test]
116 //public void TestDeleteSceneObjectAsyncToUserInventory() 116 //public void TestDeleteSceneObjectAsyncToUserInventory()
117 //{ 117 //{
118 // TestHelper.InMethod(); 118 // TestHelper.InMethod();
119 // //log4net.Config.XmlConfigurator.Configure(); 119 // //log4net.Config.XmlConfigurator.Configure();
120 120
121 // UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 121 // UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
122 // string myObjectName = "Fred"; 122 // string myObjectName = "Fred";
123 123
124 // TestScene scene = SceneSetupHelpers.SetupScene(); 124 // TestScene scene = SceneSetupHelpers.SetupScene();
125 // SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName); 125 // SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName);
126 126
127 // Assert.That( 127 // Assert.That(
128 // scene.CommsManager.UserAdminService.AddUser( 128 // scene.CommsManager.UserAdminService.AddUser(
129 // "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), 129 // "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId),
130 // Is.EqualTo(agentId)); 130 // Is.EqualTo(agentId));
131 131
132 // IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); 132 // IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
133 133
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index bf13607..aa2f53f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
45 /// <summary> 45 /// <summary>
46 /// Linking tests 46 /// Linking tests
47 /// </summary> 47 /// </summary>
48 [TestFixture] 48 [TestFixture]
49 public class SceneObjectLinkingTests 49 public class SceneObjectLinkingTests
50 { 50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
94 } 94 }
95 95
96 // root part should have no offset position or rotation 96 // root part should have no offset position or rotation
97 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); 97 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity,
98 "root part should have no offset position or rotation");
98 99
99 // offset position should be root part position - part2.absolute position. 100 // offset position should be root part position - part2.absolute position.
100 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); 101 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10),
102 "offset position should be root part position - part2.absolute position.");
101 103
102 float roll = 0; 104 float roll = 0;
103 float pitch = 0; 105 float pitch = 0;
@@ -116,7 +118,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
116 if (debugtest) 118 if (debugtest)
117 m_log.Debug(rotEuler2); 119 m_log.Debug(rotEuler2);
118 120
119 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 121 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f),
122 "Not exactly sure what this is asserting...");
120 123
121 // Delink part 2 124 // Delink part 2
122 grp1.DelinkFromGroup(part2.LocalId); 125 grp1.DelinkFromGroup(part2.LocalId);
@@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
125 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); 128 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset);
126 129
127 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); 130 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
128 Assert.That(part2.AbsolutePosition == Vector3.Zero); 131 Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero");
129 } 132 }
130 133
131 [Test] 134 [Test]
@@ -174,13 +177,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
174 // Link grp4 to grp3. 177 // Link grp4 to grp3.
175 grp3.LinkToGroup(grp4); 178 grp3.LinkToGroup(grp4);
176 179
177 // At this point we should have 4 parts total in two groups. 180 // At this point we should have 4 parts total in two groups.
178 Assert.That(grp1.Children.Count == 2); 181 Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2");
179 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); 182 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link.");
180 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); 183 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
181 Assert.That(grp3.Children.Count == 2); 184 Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2");
182 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); 185 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link.");
183 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); 186 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
184 187
185 if (debugtest) 188 if (debugtest)
186 { 189 {
@@ -194,17 +197,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests
194 m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation); 197 m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation);
195 m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset); 198 m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset);
196 m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset); 199 m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset);
197 } 200 }
198 201
199 // Required for linking 202 // Required for linking
200 grp1.RootPart.UpdateFlag = 0; 203 grp1.RootPart.UpdateFlag = 0;
201 grp3.RootPart.UpdateFlag = 0; 204 grp3.RootPart.UpdateFlag = 0;
202 205
203 // root part should have no offset position or rotation 206 // root part should have no offset position or rotation
204 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); 207 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity,
208 "root part should have no offset position or rotation (again)");
205 209
206 // offset position should be root part position - part2.absolute position. 210 // offset position should be root part position - part2.absolute position.
207 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); 211 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10),
212 "offset position should be root part position - part2.absolute position (again)");
208 213
209 float roll = 0; 214 float roll = 0;
210 float pitch = 0; 215 float pitch = 0;
@@ -223,7 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
223 if (debugtest) 228 if (debugtest)
224 m_log.Debug(rotEuler2); 229 m_log.Debug(rotEuler2);
225 230
226 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 231 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f),
232 "Not sure what this assertion is all about...");
227 233
228 // Now we're linking the first group to the third group. This will make the first group child parts of the third one. 234 // Now we're linking the first group to the third group. This will make the first group child parts of the third one.
229 grp3.LinkToGroup(grp1); 235 grp3.LinkToGroup(grp1);
@@ -246,13 +252,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
246 m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); 252 m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset);
247 } 253 }
248 254
249 Assert.That(part2.AbsolutePosition == Vector3.Zero); 255 Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1");
250 Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20)); 256 Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2");
251 Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); 257 Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f);
252 Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) 258 Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003)
253 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) 259 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
254 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) 260 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
255 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); 261 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003),
256 } 262 "Badness 3");
263 }
257 } 264 }
258} 265}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 1c9bce4..8a27b7b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -41,11 +41,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
41 public class SceneTests 41 public class SceneTests
42 { 42 {
43 private class FakeStorageManager : StorageManager 43 private class FakeStorageManager : StorageManager
44 { 44 {
45 private class FakeRegionDataStore : IRegionDataStore 45 private class FakeRegionDataStore : IRegionDataStore
46 { 46 {
47 public void Initialise(string filename) 47 public void Initialise(string filename)
48 { 48 {
49 } 49 }
50 50
51 public void Dispose() 51 public void Dispose()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index 1d460dd..b46eb8e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// Teleport tests in a standalone OpenSim 46 /// Teleport tests in a standalone OpenSim
47 /// </summary> 47 /// </summary>
48 [TestFixture] 48 [TestFixture]
49 public class StandaloneTeleportTests 49 public class StandaloneTeleportTests
50 { 50 {
@@ -52,7 +52,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common. 52 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
53 /// </summary> 53 /// </summary>
54 /// Does not yet do what is says on the tin. 54 /// Does not yet do what is says on the tin.
55 [Test, LongRunning] 55 /// Commenting for now
56 //[Test, LongRunning]
56 public void TestSimpleNotNeighboursTeleport() 57 public void TestSimpleNotNeighboursTeleport()
57 { 58 {
58 TestHelper.InMethod(); 59 TestHelper.InMethod();
@@ -117,14 +118,15 @@ namespace OpenSim.Region.Framework.Scenes.Tests
117 // shared module 118 // shared module
118 ISharedRegionModule interregionComms = new RESTInterregionComms(); 119 ISharedRegionModule interregionComms = new RESTInterregionComms();
119 120
120 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
121 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
122 sceneA.RegisterRegionWithGrid();
123 121
124 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); 122 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm, "grid");
125 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 123 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
126 sceneB.RegisterRegionWithGrid(); 124 sceneB.RegisterRegionWithGrid();
127 125
126 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm, "grid");
127 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
128 sceneA.RegisterRegionWithGrid();
129
128 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 130 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
129 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); 131 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId);
130 132
diff --git a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs
index 21cda09..213e954 100644
--- a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs
+++ b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Scenes.Types
38 { 38 {
39 private Queue<SceneObjectPart> m_queue; 39 private Queue<SceneObjectPart> m_queue;
40 40
41 private List<UUID> m_ids; 41 private Dictionary<UUID, bool> m_ids;
42 42
43 private object m_syncObject = new object(); 43 private object m_syncObject = new object();
44 44
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Types
50 public UpdateQueue() 50 public UpdateQueue()
51 { 51 {
52 m_queue = new Queue<SceneObjectPart>(); 52 m_queue = new Queue<SceneObjectPart>();
53 m_ids = new List<UUID>(); 53 m_ids = new Dictionary<UUID, bool>();
54 } 54 }
55 55
56 public void Clear() 56 public void Clear()
@@ -66,9 +66,8 @@ namespace OpenSim.Region.Framework.Scenes.Types
66 { 66 {
67 lock (m_syncObject) 67 lock (m_syncObject)
68 { 68 {
69 if (!m_ids.Contains(part.UUID)) 69 if (!m_ids.ContainsKey(part.UUID)) {
70 { 70 m_ids.Add(part.UUID, true);
71 m_ids.Add(part.UUID);
72 m_queue.Enqueue(part); 71 m_queue.Enqueue(part);
73 } 72 }
74 } 73 }
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index f449e18..525a93a 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes
41{ 41{
42 /// <summary> 42 /// <summary>
43 /// Gather uuids for a given entity. 43 /// Gather uuids for a given entity.
44 /// </summary> 44 /// </summary>
45 /// 45 ///
46 /// This does a deep inspection of the entity to retrieve all the assets it uses (whether as textures, as scripts 46 /// This does a deep inspection of the entity to retrieve all the assets it uses (whether as textures, as scripts
47 /// contained in inventory, as scripts contained in objects contained in another object's inventory, etc. Assets 47 /// contained in inventory, as scripts contained in objects contained in another object's inventory, etc. Assets
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Framework.Scenes
82 /// 82 ///
83 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param> 83 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param>
84 /// <param name="assetType">The type of the asset for the uuid given</param> 84 /// <param name="assetType">The type of the asset for the uuid given</param>
85 /// <param name="assetUuids">The assets gathered</param> 85 /// <param name="assetUuids">The assets gathered</param>
86 public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, int> assetUuids) 86 public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, int> assetUuids)
87 { 87 {
88 assetUuids[assetUuid] = 1; 88 assetUuids[assetUuid] = 1;
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes
142 142
143 // If the prim is a sculpt then preserve this information too 143 // If the prim is a sculpt then preserve this information too
144 if (part.Shape.SculptTexture != UUID.Zero) 144 if (part.Shape.SculptTexture != UUID.Zero)
145 assetUuids[part.Shape.SculptTexture] = 1; 145 assetUuids[part.Shape.SculptTexture] = 1;
146 146
147 TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone(); 147 TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();
148 148
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
167 167
168 /// <summary> 168 /// <summary>
169 /// The callback made when we request the asset for an object from the asset service. 169 /// The callback made when we request the asset for an object from the asset service.
170 /// </summary> 170 /// </summary>
171 protected void AssetReceived(string id, Object sender, AssetBase asset) 171 protected void AssetReceived(string id, Object sender, AssetBase asset)
172 { 172 {
173 lock (this) 173 lock (this)
@@ -242,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
242 AssetBase assetBase = GetAsset(wearableAssetUuid); 242 AssetBase assetBase = GetAsset(wearableAssetUuid);
243 243
244 if (null != assetBase) 244 if (null != assetBase)
245 { 245 {
246 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); 246 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data));
247 AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data); 247 AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data);
248 wearableAsset.Decode(); 248 wearableAsset.Decode();
@@ -275,6 +275,6 @@ namespace OpenSim.Region.Framework.Scenes
275 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml); 275 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml);
276 GatherAssetUuids(sog, assetUuids); 276 GatherAssetUuids(sog, assetUuids);
277 } 277 }
278 } 278 }
279 } 279 }
280} \ No newline at end of file 280} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 57f5d29..ee2d2db 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -601,7 +601,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
601 if (names.Length > 1) 601 if (names.Length > 1)
602 return names[1]; 602 return names[1];
603 return names[0]; 603 return names[0];
604 } 604 }
605 } 605 }
606 606
607 public IScene Scene 607 public IScene Scene
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
index c49d942..773507c 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
@@ -351,7 +351,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
351 { 351 {
352 m_log.DebugFormat("[IRC-Region {0}] dropping message {1} on channel {2}", Region, msg, msg.Channel); 352 m_log.DebugFormat("[IRC-Region {0}] dropping message {1} on channel {2}", Region, msg, msg.Channel);
353 return; 353 return;
354 } 354 }
355 355
356 ScenePresence avatar = null; 356 ScenePresence avatar = null;
357 string fromName = msg.From; 357 string fromName = msg.From;
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs
index 9ba09ed..46ad30f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs
@@ -97,8 +97,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
97 </document>", Context, Realm); 97 </document>", Context, Realm);
98 } 98 }
99 99
100 return response; 100 return response;
101 } 101 }
102 } 102 }
103 103
104} 104}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
index 5d90a8f..17cdf74 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
93 { 93 {
94 response = HandleRegister(Context, Realm, request); 94 response = HandleRegister(Context, Realm, request);
95 } 95 }
96 else if (sipAuthMethod == "INVITE") 96 else if (sipAuthMethod == "INVITE")
97 { 97 {
98 response = HandleInvite(Context, Realm, request); 98 response = HandleInvite(Context, Realm, request);
99 } 99 }
@@ -138,7 +138,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
138 response["str_response_string"] = ""; 138 response["str_response_string"] = "";
139 } 139 }
140 } 140 }
141 return response; 141 return response;
142 } 142 }
143 143
144 private Hashtable HandleRegister(string Context, string Realm, Hashtable request) 144 private Hashtable HandleRegister(string Context, string Realm, Hashtable request)
@@ -309,17 +309,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
309 "</document>\r\n", 309 "</document>\r\n",
310 domain, Context); 310 domain, Context);
311 311
312 return response; 312 return response;
313 } 313 }
314 314
315 315
316// private Hashtable HandleLoadNetworkLists(Hashtable request) 316// private Hashtable HandleLoadNetworkLists(Hashtable request)
317// { 317// {
318// m_log.Info("[FreeSwitchDirectory] HandleLoadNetworkLists called"); 318// m_log.Info("[FreeSwitchDirectory] HandleLoadNetworkLists called");
319// 319//
320// // TODO the password we return needs to match that sent in the request, this is hard coded for now 320// // TODO the password we return needs to match that sent in the request, this is hard coded for now
321// string domain = (string) request["domain"]; 321// string domain = (string) request["domain"];
322// 322//
323// Hashtable response = new Hashtable(); 323// Hashtable response = new Hashtable();
324// response["content_type"] = "text/xml"; 324// response["content_type"] = "text/xml";
325// response["keepalive"] = false; 325// response["keepalive"] = false;
@@ -340,9 +340,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
340// "</section>\r\n" + 340// "</section>\r\n" +
341// "</document>\r\n", 341// "</document>\r\n",
342// domain); 342// domain);
343// 343//
344// 344//
345// return response; 345// return response;
346// } 346// }
347 } 347 }
348} 348}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 65c5274..c7bb56a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -53,7 +53,7 @@ using System.Text.RegularExpressions;
53 53
54namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice 54namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
55{ 55{
56 public class FreeSwitchVoiceModule : IRegionModule 56 public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule
57 { 57 {
58 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 59
@@ -101,13 +101,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
101 private FreeSwitchDialplan m_FreeSwitchDialplan; 101 private FreeSwitchDialplan m_FreeSwitchDialplan;
102 102
103 private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>(); 103 private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>();
104 private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>();
105
106 private Scene m_scene;
104 107
105 108
106 private IConfig m_config; 109 private IConfig m_config;
107 110
108 public void Initialise(Scene scene, IConfigSource config) 111 public void Initialise(Scene scene, IConfigSource config)
109 { 112 {
110 113 m_scene = scene;
111 m_config = config.Configs["FreeSwitchVoice"]; 114 m_config = config.Configs["FreeSwitchVoice"];
112 115
113 if (null == m_config) 116 if (null == m_config)
@@ -230,6 +233,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
230 { 233 {
231 OnRegisterCaps(scene, agentID, caps); 234 OnRegisterCaps(scene, agentID, caps);
232 }; 235 };
236
237
233 238
234 try 239 try
235 { 240 {
@@ -255,6 +260,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
255 260
256 public void PostInitialise() 261 public void PostInitialise()
257 { 262 {
263 if (m_pluginEnabled)
264 {
265 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
266
267 // register the voice interface for this module, so the script engine can call us
268 m_scene.RegisterModuleInterface<IVoiceModule>(this);
269 }
258 } 270 }
259 271
260 public void Close() 272 public void Close()
@@ -270,7 +282,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
270 { 282 {
271 get { return true; } 283 get { return true; }
272 } 284 }
273 285
286 // <summary>
287 // implementation of IVoiceModule, called by osSetParcelSIPAddress script function
288 // </summary>
289 public void setLandSIPAddress(string SIPAddress,UUID GlobalID)
290 {
291 m_log.DebugFormat("[FreeSwitchVoice]: setLandSIPAddress parcel id {0}: setting sip address {1}",
292 GlobalID, SIPAddress);
293
294 lock (m_ParcelAddress)
295 {
296 if (m_ParcelAddress.ContainsKey(GlobalID.ToString()))
297 {
298 m_ParcelAddress[GlobalID.ToString()] = SIPAddress;
299 }
300 else
301 {
302 m_ParcelAddress.Add(GlobalID.ToString(), SIPAddress);
303 }
304 }
305 }
274 306
275 // <summary> 307 // <summary>
276 // OnRegisterCaps is invoked via the scene.EventManager 308 // OnRegisterCaps is invoked via the scene.EventManager
@@ -776,6 +808,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
776 808
777 // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same 809 // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
778 // as the directory ID. Otherwise, it reflects the parcel's ID. 810 // as the directory ID. Otherwise, it reflects the parcel's ID.
811
812 lock (m_ParcelAddress)
813 {
814 if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
815 {
816 m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
817 land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]);
818 return m_ParcelAddress[land.GlobalID.ToString()];
819 }
820 }
779 821
780 if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0) 822 if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0)
781 { 823 {
@@ -797,6 +839,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
797 // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator. 839 // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator.
798 channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm); 840 channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm);
799 841
842 lock (m_ParcelAddress)
843 {
844 if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
845 {
846 m_ParcelAddress.Add(land.GlobalID.ToString(),channelUri);
847 }
848 }
800 849
801 return channelUri; 850 return channelUri;
802 } 851 }
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index febb491..cb76200 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
226 m_log.DebugFormat("[VivoxVoice] plugin initialization failed: {0}", e.ToString()); 226 m_log.DebugFormat("[VivoxVoice] plugin initialization failed: {0}", e.ToString());
227 return; 227 return;
228 } 228 }
229 } 229 }
230 230
231 231
232 // Called to indicate that the module has been added to the region 232 // Called to indicate that the module has been added to the region
@@ -1144,7 +1144,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1144 // Otherwise prepare the request 1144 // Otherwise prepare the request
1145 m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); 1145 m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl);
1146 1146
1147 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); 1147 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
1148 HttpWebResponse rsp = null; 1148 HttpWebResponse rsp = null;
1149 1149
1150 // We are sending just parameters, no content 1150 // We are sending just parameters, no content
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index d5cbfd4..2e89a24 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -477,7 +477,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
477 foreach (string key in binBucketOSD.Keys) 477 foreach (string key in binBucketOSD.Keys)
478 { 478 {
479 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); 479 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString());
480 } 480 }
481 } 481 }
482 482
483 // treat as if no attachment 483 // treat as if no attachment
@@ -1261,7 +1261,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1261 { 1261 {
1262 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1262 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1263 1263
1264 // TODO: Probably isn't nessesary to update every client in every scene. 1264 // TODO: Probably isn't nessesary to update every client in every scene.
1265 // Need to examine client updates and do only what's nessesary. 1265 // Need to examine client updates and do only what's nessesary.
1266 lock (m_sceneList) 1266 lock (m_sceneList)
1267 { 1267 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index 805c3d4..964d0bb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -871,7 +871,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
871 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); 871 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
872 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); 872 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
873 873
874 foreach( string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) 874 foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None))
875 { 875 {
876 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); 876 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine);
877 } 877 }
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
index b5da6f7..7202601 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
@@ -208,7 +208,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
208 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened 208 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
209 m_log.ErrorFormat( 209 m_log.ErrorFormat(
210 "[CONTENT MANAGEMENT]: Content management thread terminating with exception. PLEASE REBOOT YOUR SIM - CONTENT MANAGEMENT WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", 210 "[CONTENT MANAGEMENT]: Content management thread terminating with exception. PLEASE REBOOT YOUR SIM - CONTENT MANAGEMENT WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
211 e); 211 e);
212 } 212 }
213 } 213 }
214 214
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs
index 52c4e03..0dc78c0 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
102 { 102 {
103 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID)) 103 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
104 continue; 104 continue;
105 newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart)); 105 newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart));
106 } 106 }
107 m_log.Info("Number of missing objects found: " + newList.Count); 107 m_log.Info("Number of missing objects found: " + newList.Count);
108 return newList; 108 return newList;
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
index bf523dd..ce50f9e 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
136 /// </exception> 136 /// </exception>
137 /// <returns>AppDomain with a restricted security policy</returns> 137 /// <returns>AppDomain with a restricted security policy</returns>
138 /// <remarks>Substantial portions of this function from: http://blogs.msdn.com/shawnfa/archive/2004/10/25/247379.aspx 138 /// <remarks>Substantial portions of this function from: http://blogs.msdn.com/shawnfa/archive/2004/10/25/247379.aspx
139 /// Valid permissionSetName values are: 139 /// Valid permissionSetName values are:
140 /// * FullTrust 140 /// * FullTrust
141 /// * SkipVerification 141 /// * SkipVerification
142 /// * Execution 142 /// * Execution
diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
index c539280..fc1c608 100644
--- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
+++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
117 public void LoadRegion(Scene scene) 117 public void LoadRegion(Scene scene)
118 { 118 {
119 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>(); 119 IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
120 if (serialiser != null) 120 if (serialiser != null)
121 { 121 {
122 serialiser.LoadPrimsFromXml2( 122 serialiser.LoadPrimsFromXml2(
123 scene, 123 scene,
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index d4bba10..3044b17 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
92 this.m_maximum_scale = cp.m_maximum_scale; 92 this.m_maximum_scale = cp.m_maximum_scale;
93 this.m_initial_scale = cp.m_initial_scale; 93 this.m_initial_scale = cp.m_initial_scale;
94 this.m_rate = cp.m_rate; 94 this.m_rate = cp.m_rate;
95 this.m_planted = planted; 95 this.m_planted = planted;
96 this.m_trees = new List<UUID>(); 96 this.m_trees = new List<UUID>();
97 } 97 }
98 98
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
index 7ab8b98..f22ea71 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
@@ -204,7 +204,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
204 tempAngularVelocity2 = new btVector3(0, 0, 0); 204 tempAngularVelocity2 = new btVector3(0, 0, 0);
205 tempInertia1 = new btVector3(0, 0, 0); 205 tempInertia1 = new btVector3(0, 0, 0);
206 tempInertia2 = new btVector3(0, 0, 0); 206 tempInertia2 = new btVector3(0, 0, 0);
207 tempOrientation1 = new btQuaternion(0,0,0,1); 207 tempOrientation1 = new btQuaternion(0, 0, 0, 1);
208 tempOrientation2 = new btQuaternion(0, 0, 0, 1); 208 tempOrientation2 = new btQuaternion(0, 0, 0, 1);
209 _parent_scene = parent_scene; 209 _parent_scene = parent_scene;
210 tempTransform1 = new btTransform(_parent_scene.QuatIdentity, _parent_scene.VectorZero); 210 tempTransform1 = new btTransform(_parent_scene.QuatIdentity, _parent_scene.VectorZero);
@@ -216,10 +216,10 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
216 tempMotionState2 = new btDefaultMotionState(_parent_scene.TransZero); 216 tempMotionState2 = new btDefaultMotionState(_parent_scene.TransZero);
217 tempMotionState3 = new btDefaultMotionState(_parent_scene.TransZero); 217 tempMotionState3 = new btDefaultMotionState(_parent_scene.TransZero);
218 218
219 219
220 AxisLockLinearLow = new btVector3(-1 * (int)Constants.RegionSize, -1 * (int)Constants.RegionSize, -1 * (int)Constants.RegionSize); 220 AxisLockLinearLow = new btVector3(-1 * (int)Constants.RegionSize, -1 * (int)Constants.RegionSize, -1 * (int)Constants.RegionSize);
221 int regionsize = (int) Constants.RegionSize; 221 int regionsize = (int)Constants.RegionSize;
222 222
223 if (regionsize == 256) 223 if (regionsize == 256)
224 regionsize = 512; 224 regionsize = 512;
225 225
@@ -611,7 +611,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
611 DisableAxisMotor(); 611 DisableAxisMotor();
612 DisposeOfBody(); 612 DisposeOfBody();
613 SetCollisionShape(null); 613 SetCollisionShape(null);
614 614
615 if (tempMotionState3 != null && tempMotionState3.Handle != IntPtr.Zero) 615 if (tempMotionState3 != null && tempMotionState3.Handle != IntPtr.Zero)
616 { 616 {
617 tempMotionState3.Dispose(); 617 tempMotionState3.Dispose();
@@ -677,8 +677,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
677 tempInertia2.Dispose(); 677 tempInertia2.Dispose();
678 tempInertia1 = null; 678 tempInertia1 = null;
679 } 679 }
680 680
681 681
682 if (tempAngularVelocity2 != null && tempAngularVelocity2.Handle != IntPtr.Zero) 682 if (tempAngularVelocity2 != null && tempAngularVelocity2.Handle != IntPtr.Zero)
683 { 683 {
684 tempAngularVelocity2.Dispose(); 684 tempAngularVelocity2.Dispose();
@@ -802,7 +802,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
802 changesize(timestep); 802 changesize(timestep);
803 } 803 }
804 804
805 // 805 //
806 806
807 if (m_taintshape) 807 if (m_taintshape)
808 { 808 {
@@ -1001,7 +1001,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1001 else 1001 else
1002 SetBody(0); 1002 SetBody(0);
1003 changeSelectedStatus(timestep); 1003 changeSelectedStatus(timestep);
1004 1004
1005 resetCollisionAccounting(); 1005 resetCollisionAccounting();
1006 m_taintPhysics = m_isphysical; 1006 m_taintPhysics = m_isphysical;
1007 } 1007 }
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1012 { 1012 {
1013 if (_parent_scene.needsMeshing(_pbs)) 1013 if (_parent_scene.needsMeshing(_pbs))
1014 { 1014 {
1015 ProcessGeomCreationAsTriMesh(PhysicsVector.Zero,Quaternion.Identity); 1015 ProcessGeomCreationAsTriMesh(PhysicsVector.Zero, Quaternion.Identity);
1016 // createmesh returns null when it doesn't mesh. 1016 // createmesh returns null when it doesn't mesh.
1017 CreateGeom(IntPtr.Zero, _mesh); 1017 CreateGeom(IntPtr.Zero, _mesh);
1018 } 1018 }
@@ -1038,32 +1038,32 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1038 meshlod = _parent_scene.MeshSculptphysicalLOD; 1038 meshlod = _parent_scene.MeshSculptphysicalLOD;
1039 1039
1040 IMesh mesh = _parent_scene.mesher.CreateMesh(SOPName, _pbs, _size, meshlod, IsPhysical); 1040 IMesh mesh = _parent_scene.mesher.CreateMesh(SOPName, _pbs, _size, meshlod, IsPhysical);
1041 if (!positionOffset.IsIdentical(PhysicsVector.Zero,0.001f) || orientation != Quaternion.Identity) 1041 if (!positionOffset.IsIdentical(PhysicsVector.Zero, 0.001f) || orientation != Quaternion.Identity)
1042 { 1042 {
1043 1043
1044 float[] xyz = new float[3]; 1044 float[] xyz = new float[3];
1045 xyz[0] = positionOffset.X; 1045 xyz[0] = positionOffset.X;
1046 xyz[1] = positionOffset.Y; 1046 xyz[1] = positionOffset.Y;
1047 xyz[2] = positionOffset.Z; 1047 xyz[2] = positionOffset.Z;
1048 1048
1049 Matrix4 m4 = Matrix4.CreateFromQuaternion(orientation); 1049 Matrix4 m4 = Matrix4.CreateFromQuaternion(orientation);
1050 1050
1051 float[,] matrix = new float[3,3]; 1051 float[,] matrix = new float[3, 3];
1052 1052
1053 matrix[0, 0] = m4.M11; 1053 matrix[0, 0] = m4.M11;
1054 matrix[0, 1] = m4.M12; 1054 matrix[0, 1] = m4.M12;
1055 matrix[0, 2] = m4.M13; 1055 matrix[0, 2] = m4.M13;
1056 matrix[1, 0] = m4.M21; 1056 matrix[1, 0] = m4.M21;
1057 matrix[1, 1] = m4.M22; 1057 matrix[1, 1] = m4.M22;
1058 matrix[1, 2] = m4.M23; 1058 matrix[1, 2] = m4.M23;
1059 matrix[2, 0] = m4.M31; 1059 matrix[2, 0] = m4.M31;
1060 matrix[2, 1] = m4.M32; 1060 matrix[2, 1] = m4.M32;
1061 matrix[2, 2] = m4.M33; 1061 matrix[2, 2] = m4.M33;
1062 1062
1063 1063
1064 mesh.TransformLinear(matrix, xyz); 1064 mesh.TransformLinear(matrix, xyz);
1065 1065
1066 1066
1067 1067
1068 } 1068 }
1069 1069
@@ -1088,12 +1088,12 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1088 SetCollisionShape(null); 1088 SetCollisionShape(null);
1089 // Construction of new prim 1089 // Construction of new prim
1090 ProcessGeomCreation(); 1090 ProcessGeomCreation();
1091 1091
1092 if (IsPhysical) 1092 if (IsPhysical)
1093 SetBody(Mass); 1093 SetBody(Mass);
1094 else 1094 else
1095 SetBody(0); 1095 SetBody(0);
1096 1096
1097 m_taintsize = _size; 1097 m_taintsize = _size;
1098 1098
1099 } 1099 }
@@ -1136,7 +1136,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1136 //prim_geom = IntPtr.Zero; 1136 //prim_geom = IntPtr.Zero;
1137 m_log.Error("[PHYSICS]: PrimGeom dead"); 1137 m_log.Error("[PHYSICS]: PrimGeom dead");
1138 } 1138 }
1139 1139
1140 // we don't need to do space calculation because the client sends a position update also. 1140 // we don't need to do space calculation because the client sends a position update also.
1141 if (_size.X <= 0) _size.X = 0.01f; 1141 if (_size.X <= 0) _size.X = 0.01f;
1142 if (_size.Y <= 0) _size.Y = 0.01f; 1142 if (_size.Y <= 0) _size.Y = 0.01f;
@@ -1153,8 +1153,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1153 tempTransform1.Dispose(); 1153 tempTransform1.Dispose();
1154 tempTransform1 = new btTransform(tempOrientation1, tempPosition1); 1154 tempTransform1 = new btTransform(tempOrientation1, tempPosition1);
1155 1155
1156 1156
1157 1157
1158 1158
1159 //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); 1159 //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
1160 if (IsPhysical) 1160 if (IsPhysical)
@@ -1162,7 +1162,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1162 SetBody(Mass); 1162 SetBody(Mass);
1163 // Re creates body on size. 1163 // Re creates body on size.
1164 // EnableBody also does setMass() 1164 // EnableBody also does setMass()
1165 1165
1166 } 1166 }
1167 else 1167 else
1168 { 1168 {
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1179 } 1179 }
1180 } 1180 }
1181 resetCollisionAccounting(); 1181 resetCollisionAccounting();
1182 1182
1183 m_taintshape = false; 1183 m_taintshape = false;
1184 } 1184 }
1185 1185
@@ -1291,7 +1291,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1291 { 1291 {
1292 Body.setCollisionFlags((int)ContactFlags.CF_NO_CONTACT_RESPONSE); 1292 Body.setCollisionFlags((int)ContactFlags.CF_NO_CONTACT_RESPONSE);
1293 disableBodySoft(); 1293 disableBodySoft();
1294 1294
1295 } 1295 }
1296 else 1296 else
1297 { 1297 {
@@ -1299,7 +1299,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1299 enableBodySoft(); 1299 enableBodySoft();
1300 } 1300 }
1301 m_isSelected = m_taintselected; 1301 m_isSelected = m_taintselected;
1302 1302
1303 } 1303 }
1304 1304
1305 private void changevelocity(float timestep) 1305 private void changevelocity(float timestep)
@@ -1368,7 +1368,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1368 _parent = m_taintparent; 1368 _parent = m_taintparent;
1369 1369
1370 m_taintPhysics = m_isphysical; 1370 m_taintPhysics = m_isphysical;
1371 1371
1372 } 1372 }
1373 1373
1374 private void changefloatonwater(float timestep) 1374 private void changefloatonwater(float timestep)
@@ -1627,7 +1627,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1627 { 1627 {
1628 if (m_zeroPosition == null) 1628 if (m_zeroPosition == null)
1629 m_zeroPosition = new PhysicsVector(0, 0, 0); 1629 m_zeroPosition = new PhysicsVector(0, 0, 0);
1630 m_zeroPosition.setValues(_position.X,_position.Y,_position.Z); 1630 m_zeroPosition.setValues(_position.X, _position.Y, _position.Z);
1631 return; 1631 return;
1632 } 1632 }
1633 } 1633 }
@@ -1981,7 +1981,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1981 //_mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); 1981 //_mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
1982 _mesh = p_mesh; 1982 _mesh = p_mesh;
1983 setMesh(_parent_scene, _mesh); 1983 setMesh(_parent_scene, _mesh);
1984 1984
1985 } 1985 }
1986 else 1986 else
1987 { 1987 {
@@ -1994,15 +1994,15 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
1994 //SetGeom to a Regular Sphere 1994 //SetGeom to a Regular Sphere
1995 if (tempSize1 == null) 1995 if (tempSize1 == null)
1996 tempSize1 = new btVector3(0, 0, 0); 1996 tempSize1 = new btVector3(0, 0, 0);
1997 tempSize1.setValue(_size.X * 0.5f,_size.Y * 0.5f, _size.Z * 0.5f); 1997 tempSize1.setValue(_size.X * 0.5f, _size.Y * 0.5f, _size.Z * 0.5f);
1998 SetCollisionShape(new btSphereShape(_size.X*0.5f)); 1998 SetCollisionShape(new btSphereShape(_size.X * 0.5f));
1999 } 1999 }
2000 else 2000 else
2001 { 2001 {
2002 // uses halfextents 2002 // uses halfextents
2003 if (tempSize1 == null) 2003 if (tempSize1 == null)
2004 tempSize1 = new btVector3(0, 0, 0); 2004 tempSize1 = new btVector3(0, 0, 0);
2005 tempSize1.setValue(_size.X*0.5f, _size.Y*0.5f, _size.Z*0.5f); 2005 tempSize1.setValue(_size.X * 0.5f, _size.Y * 0.5f, _size.Z * 0.5f);
2006 SetCollisionShape(new btBoxShape(tempSize1)); 2006 SetCollisionShape(new btBoxShape(tempSize1));
2007 } 2007 }
2008 } 2008 }
@@ -2052,14 +2052,24 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2052 } 2052 }
2053 } 2053 }
2054 2054
2055 //IMesh oldMesh = primMesh;
2056
2057 //primMesh = mesh;
2058
2059 //float[] vertexList = primMesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory
2060 //int[] indexList = primMesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage
2061 ////Array.Reverse(indexList);
2062 //primMesh.releaseSourceMeshData(); // free up the original mesh data to save memory
2063
2055 IMesh oldMesh = primMesh; 2064 IMesh oldMesh = primMesh;
2056 2065
2057 primMesh = mesh; 2066 primMesh = mesh;
2058 2067
2059 float[] vertexList = primMesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory 2068 float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory
2060 int[] indexList = primMesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage 2069 int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage
2061 //Array.Reverse(indexList); 2070 //Array.Reverse(indexList);
2062 primMesh.releaseSourceMeshData(); // free up the original mesh data to save memory 2071 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
2072
2063 2073
2064 int VertexCount = vertexList.GetLength(0) / 3; 2074 int VertexCount = vertexList.GetLength(0) / 3;
2065 int IndexCount = indexList.GetLength(0); 2075 int IndexCount = indexList.GetLength(0);
@@ -2068,17 +2078,17 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2068 btshapeArray.Dispose(); 2078 btshapeArray.Dispose();
2069 //Array.Reverse(indexList); 2079 //Array.Reverse(indexList);
2070 btshapeArray = new btTriangleIndexVertexArray(IndexCount / 3, indexList, (3 * sizeof(int)), 2080 btshapeArray = new btTriangleIndexVertexArray(IndexCount / 3, indexList, (3 * sizeof(int)),
2071 VertexCount, vertexList, 3*sizeof (float)); 2081 VertexCount, vertexList, 3 * sizeof(float));
2072 SetCollisionShape(new btGImpactMeshShape(btshapeArray)); 2082 SetCollisionShape(new btGImpactMeshShape(btshapeArray));
2073 //((btGImpactMeshShape) prim_geom).updateBound(); 2083 //((btGImpactMeshShape) prim_geom).updateBound();
2074 ((btGImpactMeshShape)prim_geom).setLocalScaling(new btVector3(1,1, 1)); 2084 ((btGImpactMeshShape)prim_geom).setLocalScaling(new btVector3(1, 1, 1));
2075 ((btGImpactMeshShape)prim_geom).updateBound(); 2085 ((btGImpactMeshShape)prim_geom).updateBound();
2076 _parent_scene.SetUsingGImpact(); 2086 _parent_scene.SetUsingGImpact();
2077 if (oldMesh != null) 2087 //if (oldMesh != null)
2078 { 2088 //{
2079 oldMesh.releasePinned(); 2089 // oldMesh.releasePinned();
2080 oldMesh = null; 2090 // oldMesh = null;
2081 } 2091 //}
2082 2092
2083 } 2093 }
2084 2094
@@ -2102,7 +2112,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2102 } 2112 }
2103 */ 2113 */
2104 prim_geom = shape; 2114 prim_geom = shape;
2105 2115
2106 //Body.set 2116 //Body.set
2107 } 2117 }
2108 2118
@@ -2143,8 +2153,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2143 2153
2144 if (prim_geom is btGImpactMeshShape) 2154 if (prim_geom is btGImpactMeshShape)
2145 { 2155 {
2146 ((btGImpactMeshShape) prim_geom).setLocalScaling(new btVector3(1, 1, 1)); 2156 ((btGImpactMeshShape)prim_geom).setLocalScaling(new btVector3(1, 1, 1));
2147 ((btGImpactMeshShape) prim_geom).updateBound(); 2157 ((btGImpactMeshShape)prim_geom).updateBound();
2148 } 2158 }
2149 //Body.setCollisionFlags(Body.getCollisionFlags() | (int)ContactFlags.CF_CUSTOM_MATERIAL_CALLBACK); 2159 //Body.setCollisionFlags(Body.getCollisionFlags() | (int)ContactFlags.CF_CUSTOM_MATERIAL_CALLBACK);
2150 //Body.setUserPointer((IntPtr) (int)m_localID); 2160 //Body.setUserPointer((IntPtr) (int)m_localID);
@@ -2159,7 +2169,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2159 { 2169 {
2160 if (chld == null) 2170 if (chld == null)
2161 continue; 2171 continue;
2162 2172
2163 // if (chld.NeedsMeshing()) 2173 // if (chld.NeedsMeshing())
2164 // hasTrimesh = true; 2174 // hasTrimesh = true;
2165 } 2175 }
@@ -2167,40 +2177,40 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2167 2177
2168 //if (hasTrimesh) 2178 //if (hasTrimesh)
2169 //{ 2179 //{
2170 ProcessGeomCreationAsTriMesh(PhysicsVector.Zero, Quaternion.Identity); 2180 ProcessGeomCreationAsTriMesh(PhysicsVector.Zero, Quaternion.Identity);
2171 // createmesh returns null when it doesn't mesh. 2181 // createmesh returns null when it doesn't mesh.
2172
2173 /*
2174 if (_mesh is Mesh)
2175 {
2176 }
2177 else
2178 {
2179 m_log.Warn("[PHYSICS]: Can't link a OpenSim.Region.Physics.Meshing.Mesh object");
2180 return;
2181 }
2182 */
2183 2182
2184 2183 /*
2185 2184 if (_mesh is Mesh)
2186 foreach (BulletDotNETPrim chld in childrenPrim) 2185 {
2187 { 2186 }
2188 if (chld == null) 2187 else
2189 continue; 2188 {
2190 PhysicsVector offset = chld.Position - Position; 2189 m_log.Warn("[PHYSICS]: Can't link a OpenSim.Region.Physics.Meshing.Mesh object");
2191 Vector3 pos = new Vector3(offset.X, offset.Y, offset.Z); 2190 return;
2192 pos *= Quaternion.Inverse(Orientation); 2191 }
2193 //pos *= Orientation; 2192 */
2194 offset.setValues(pos.X, pos.Y, pos.Z);
2195 chld.ProcessGeomCreationAsTriMesh(offset, chld.Orientation);
2196
2197 _mesh.Append(chld._mesh);
2198
2199 2193
2200 } 2194
2201 setMesh(_parent_scene, _mesh); 2195
2202 2196 foreach (BulletDotNETPrim chld in childrenPrim)
2203 //} 2197 {
2198 if (chld == null)
2199 continue;
2200 PhysicsVector offset = chld.Position - Position;
2201 Vector3 pos = new Vector3(offset.X, offset.Y, offset.Z);
2202 pos *= Quaternion.Inverse(Orientation);
2203 //pos *= Orientation;
2204 offset.setValues(pos.X, pos.Y, pos.Z);
2205 chld.ProcessGeomCreationAsTriMesh(offset, chld.Orientation);
2206
2207 _mesh.Append(chld._mesh);
2208
2209
2210 }
2211 setMesh(_parent_scene, _mesh);
2212
2213 //}
2204 2214
2205 if (tempMotionState1 != null && tempMotionState1.Handle != IntPtr.Zero) 2215 if (tempMotionState1 != null && tempMotionState1.Handle != IntPtr.Zero)
2206 tempMotionState1.Dispose(); 2216 tempMotionState1.Dispose();
@@ -2238,7 +2248,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2238 ((btGImpactMeshShape)prim_geom).updateBound(); 2248 ((btGImpactMeshShape)prim_geom).updateBound();
2239 } 2249 }
2240 _parent_scene.AddPrimToScene(this); 2250 _parent_scene.AddPrimToScene(this);
2241 2251
2242 } 2252 }
2243 2253
2244 if (IsPhysical) 2254 if (IsPhysical)
@@ -2252,7 +2262,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2252 if (Body.Handle != IntPtr.Zero) 2262 if (Body.Handle != IntPtr.Zero)
2253 { 2263 {
2254 DisableAxisMotor(); 2264 DisableAxisMotor();
2255 _parent_scene.removeFromWorld(this,Body); 2265 _parent_scene.removeFromWorld(this, Body);
2256 Body.Dispose(); 2266 Body.Dispose();
2257 } 2267 }
2258 Body = null; 2268 Body = null;
@@ -2305,7 +2315,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2305 return; 2315 return;
2306 2316
2307 2317
2308 2318
2309 lock (childrenPrim) 2319 lock (childrenPrim)
2310 { 2320 {
2311 if (!childrenPrim.Contains(prm)) 2321 if (!childrenPrim.Contains(prm))
@@ -2313,8 +2323,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2313 childrenPrim.Add(prm); 2323 childrenPrim.Add(prm);
2314 } 2324 }
2315 } 2325 }
2316 2326
2317 2327
2318 } 2328 }
2319 2329
2320 public void disableBody() 2330 public void disableBody()
@@ -2386,7 +2396,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2386 { 2396 {
2387 Body.clearForces(); 2397 Body.clearForces();
2388 Body.forceActivationState(0); 2398 Body.forceActivationState(0);
2389 2399
2390 } 2400 }
2391 2401
2392 } 2402 }
@@ -2400,7 +2410,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2400 Body.clearForces(); 2410 Body.clearForces();
2401 Body.forceActivationState(4); 2411 Body.forceActivationState(4);
2402 forceenable = true; 2412 forceenable = true;
2403 2413
2404 } 2414 }
2405 m_disabled = false; 2415 m_disabled = false;
2406 } 2416 }
@@ -2415,7 +2425,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2415 SetBody(Mass); 2425 SetBody(Mass);
2416 else 2426 else
2417 SetBody(0); 2427 SetBody(0);
2418 2428
2419 // TODO: Set Collision Category Bits and Flags 2429 // TODO: Set Collision Category Bits and Flags
2420 // TODO: Set Auto Disable data 2430 // TODO: Set Auto Disable data
2421 2431
@@ -2587,10 +2597,10 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2587 _velocity.Y = tempLinearVelocity1.getY(); 2597 _velocity.Y = tempLinearVelocity1.getY();
2588 _velocity.Z = tempLinearVelocity1.getZ(); 2598 _velocity.Z = tempLinearVelocity1.getZ();
2589 2599
2590 _acceleration = ((_velocity - m_lastVelocity)/0.1f); 2600 _acceleration = ((_velocity - m_lastVelocity) / 0.1f);
2591 _acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X/0.1f, 2601 _acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X / 0.1f,
2592 _velocity.Y - m_lastVelocity.Y/0.1f, 2602 _velocity.Y - m_lastVelocity.Y / 0.1f,
2593 _velocity.Z - m_lastVelocity.Z/0.1f); 2603 _velocity.Z - m_lastVelocity.Z / 0.1f);
2594 //m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString()); 2604 //m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString());
2595 2605
2596 if (_velocity.IsIdentical(pv, 0.5f)) 2606 if (_velocity.IsIdentical(pv, 0.5f))
@@ -2669,7 +2679,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2669 if (AxisLockAngleHigh != null && AxisLockAngleHigh.Handle != IntPtr.Zero) 2679 if (AxisLockAngleHigh != null && AxisLockAngleHigh.Handle != IntPtr.Zero)
2670 AxisLockAngleHigh.Dispose(); 2680 AxisLockAngleHigh.Dispose();
2671 2681
2672 2682
2673 2683
2674 m_aMotor = new btGeneric6DofConstraint(Body, _parent_scene.TerrainBody, _parent_scene.TransZero, 2684 m_aMotor = new btGeneric6DofConstraint(Body, _parent_scene.TerrainBody, _parent_scene.TransZero,
2675 _parent_scene.TransZero, false); 2685 _parent_scene.TransZero, false);
@@ -2683,7 +2693,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2683 m_aMotor.setLinearUpperLimit(AxisLockLinearHigh); 2693 m_aMotor.setLinearUpperLimit(AxisLockLinearHigh);
2684 _parent_scene.getBulletWorld().addConstraint((btTypedConstraint)m_aMotor); 2694 _parent_scene.getBulletWorld().addConstraint((btTypedConstraint)m_aMotor);
2685 //m_aMotor. 2695 //m_aMotor.
2686 2696
2687 2697
2688 } 2698 }
2689 internal void DisableAxisMotor() 2699 internal void DisableAxisMotor()
@@ -2698,4 +2708,4 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
2698 2708
2699 } 2709 }
2700} 2710}
2701 2711
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
index e0f856a..18d4bab 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
@@ -528,7 +528,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
528 { 528 {
529 // Teravus: Kitto, this code causes recurring errors that stall physics permenantly unless 529 // Teravus: Kitto, this code causes recurring errors that stall physics permenantly unless
530 // the values are checked, so checking below. 530 // the values are checked, so checking below.
531 // Is there any reason that we don't do this in ScenePresence? 531 // Is there any reason that we don't do this in ScenePresence?
532 // The only physics engine that benefits from it in the physics plugin is this one 532 // The only physics engine that benefits from it in the physics plugin is this one
533 533
534 if (x > (int)Constants.RegionSize || y > (int)Constants.RegionSize || 534 if (x > (int)Constants.RegionSize || y > (int)Constants.RegionSize ||
@@ -650,7 +650,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
650 650
651 if (iPropertiesNotSupportedDefault == 0) 651 if (iPropertiesNotSupportedDefault == 0)
652 { 652 {
653#if SPAM 653#if SPAM
654 m_log.Warn("NonMesh"); 654 m_log.Warn("NonMesh");
655#endif 655#endif
656 return false; 656 return false;
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index ce52744..7130a3e 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Physics.Manager
55 plugHard = new ZeroMesherPlugin(); 55 plugHard = new ZeroMesherPlugin();
56 _MeshPlugins.Add(plugHard.GetName(), plugHard); 56 _MeshPlugins.Add(plugHard.GetName(), plugHard);
57 57
58 m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName()); 58 m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName());
59 } 59 }
60 60
61 /// <summary> 61 /// <summary>
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 8a07f71..6dd26bb 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -178,12 +178,12 @@ namespace OpenSim.Region.Physics.Manager
178 } 178 }
179 179
180 /// <summary> 180 /// <summary>
181 /// Queue a raycast against the physics scene. 181 /// Queue a raycast against the physics scene.
182 /// The provided callback method will be called when the raycast is complete 182 /// The provided callback method will be called when the raycast is complete
183 /// 183 ///
184 /// Many physics engines don't support collision testing at the same time as 184 /// Many physics engines don't support collision testing at the same time as
185 /// manipulating the physics scene, so we queue the request up and callback 185 /// manipulating the physics scene, so we queue the request up and callback
186 /// a custom method when the raycast is complete. 186 /// a custom method when the raycast is complete.
187 /// This allows physics engines that give an immediate result to callback immediately 187 /// This allows physics engines that give an immediate result to callback immediately
188 /// and ones that don't, to callback when it gets a result back. 188 /// and ones that don't, to callback when it gets a result back.
189 /// 189 ///
diff --git a/OpenSim/Region/Physics/Manager/VehicleConstants.cs b/OpenSim/Region/Physics/Manager/VehicleConstants.cs
index 97f66d3..532e55e 100644
--- a/OpenSim/Region/Physics/Manager/VehicleConstants.cs
+++ b/OpenSim/Region/Physics/Manager/VehicleConstants.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Physics.Manager
93 BANKING_TIMESCALE = 40, 93 BANKING_TIMESCALE = 40,
94 REFERENCE_FRAME = 44 94 REFERENCE_FRAME = 44
95 95
96 } 96 }
97 97
98 [Flags] 98 [Flags]
99 public enum VehicleFlag 99 public enum VehicleFlag
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index ceafaad..aae8871 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -40,7 +40,6 @@ namespace OpenSim.Region.Physics.Meshing
40 private List<Triangle> triangles; 40 private List<Triangle> triangles;
41 GCHandle pinnedVirtexes; 41 GCHandle pinnedVirtexes;
42 GCHandle pinnedIndex; 42 GCHandle pinnedIndex;
43 public PrimMesh primMesh = null;
44 public float[] normals; 43 public float[] normals;
45 44
46 public Mesh() 45 public Mesh()
@@ -63,6 +62,8 @@ namespace OpenSim.Region.Physics.Meshing
63 62
64 public void Add(Triangle triangle) 63 public void Add(Triangle triangle)
65 { 64 {
65 if (pinnedIndex.IsAllocated || pinnedVirtexes.IsAllocated)
66 throw new NotSupportedException("Attempt to Add to a pinned Mesh");
66 // If a vertex of the triangle is not yet in the vertices list, 67 // If a vertex of the triangle is not yet in the vertices list,
67 // add it and set its index to the current index count 68 // add it and set its index to the current index count
68 if (!vertices.ContainsKey(triangle.v1)) 69 if (!vertices.ContainsKey(triangle.v1))
@@ -148,40 +149,22 @@ namespace OpenSim.Region.Physics.Meshing
148 149
149 public float[] getVertexListAsFloatLocked() 150 public float[] getVertexListAsFloatLocked()
150 { 151 {
152 if (pinnedVirtexes.IsAllocated)
153 return (float[])(pinnedVirtexes.Target);
151 float[] result; 154 float[] result;
152 155
153 if (primMesh == null) 156 //m_log.WarnFormat("vertices.Count = {0}", vertices.Count);
157 result = new float[vertices.Count * 3];
158 foreach (KeyValuePair<Vertex, int> kvp in vertices)
154 { 159 {
155 //m_log.WarnFormat("vertices.Count = {0}", vertices.Count); 160 Vertex v = kvp.Key;
156 result = new float[vertices.Count * 3]; 161 int i = kvp.Value;
157 foreach (KeyValuePair<Vertex, int> kvp in vertices) 162 //m_log.WarnFormat("kvp.Value = {0}", i);
158 { 163 result[3 * i + 0] = v.X;
159 Vertex v = kvp.Key; 164 result[3 * i + 1] = v.Y;
160 int i = kvp.Value; 165 result[3 * i + 2] = v.Z;
161 //m_log.WarnFormat("kvp.Value = {0}", i);
162 result[3 * i + 0] = v.X;
163 result[3 * i + 1] = v.Y;
164 result[3 * i + 2] = v.Z;
165 }
166 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
167 }
168 else
169 {
170 int count = primMesh.coords.Count;
171 result = new float[count * 3];
172 for (int i = 0; i < count; i++)
173 {
174 Coord c = primMesh.coords[i];
175 {
176 int resultIndex = 3 * i;
177 result[resultIndex] = c.X;
178 result[resultIndex + 1] = c.Y;
179 result[resultIndex + 2] = c.Z;
180 }
181
182 }
183 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
184 } 166 }
167 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
185 return result; 168 return result;
186 } 169 }
187 170
@@ -189,33 +172,13 @@ namespace OpenSim.Region.Physics.Meshing
189 { 172 {
190 int[] result; 173 int[] result;
191 174
192 if (primMesh == null) 175 result = new int[triangles.Count * 3];
193 { 176 for (int i = 0; i < triangles.Count; i++)
194 result = new int[triangles.Count * 3];
195 for (int i = 0; i < triangles.Count; i++)
196 {
197 Triangle t = triangles[i];
198 result[3 * i + 0] = vertices[t.v1];
199 result[3 * i + 1] = vertices[t.v2];
200 result[3 * i + 2] = vertices[t.v3];
201 }
202 }
203 else
204 { 177 {
205 int numFaces = primMesh.faces.Count; 178 Triangle t = triangles[i];
206 result = new int[numFaces * 3]; 179 result[3 * i + 0] = vertices[t.v1];
207 for (int i = 0; i < numFaces; i++) 180 result[3 * i + 1] = vertices[t.v2];
208 { 181 result[3 * i + 2] = vertices[t.v3];
209 Face f = primMesh.faces[i];
210// Coord c1 = primMesh.coords[f.v1];
211// Coord c2 = primMesh.coords[f.v2];
212// Coord c3 = primMesh.coords[f.v3];
213
214 int resultIndex = i * 3;
215 result[resultIndex] = f.v1;
216 result[resultIndex + 1] = f.v2;
217 result[resultIndex + 2] = f.v3;
218 }
219 } 182 }
220 return result; 183 return result;
221 } 184 }
@@ -226,6 +189,9 @@ namespace OpenSim.Region.Physics.Meshing
226 /// <returns></returns> 189 /// <returns></returns>
227 public int[] getIndexListAsIntLocked() 190 public int[] getIndexListAsIntLocked()
228 { 191 {
192 if (pinnedIndex.IsAllocated)
193 return (int[])(pinnedIndex.Target);
194
229 int[] result = getIndexListAsInt(); 195 int[] result = getIndexListAsInt();
230 pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); 196 pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned);
231 197
@@ -245,11 +211,13 @@ namespace OpenSim.Region.Physics.Meshing
245 { 211 {
246 triangles = null; 212 triangles = null;
247 vertices = null; 213 vertices = null;
248 primMesh = null;
249 } 214 }
250 215
251 public void Append(IMesh newMesh) 216 public void Append(IMesh newMesh)
252 { 217 {
218 if (pinnedIndex.IsAllocated || pinnedVirtexes.IsAllocated)
219 throw new NotSupportedException("Attempt to Append to a pinned Mesh");
220
253 if (!(newMesh is Mesh)) 221 if (!(newMesh is Mesh))
254 return; 222 return;
255 223
@@ -260,6 +228,9 @@ namespace OpenSim.Region.Physics.Meshing
260 // Do a linear transformation of mesh. 228 // Do a linear transformation of mesh.
261 public void TransformLinear(float[,] matrix, float[] offset) 229 public void TransformLinear(float[,] matrix, float[] offset)
262 { 230 {
231 if (pinnedIndex.IsAllocated || pinnedVirtexes.IsAllocated)
232 throw new NotSupportedException("Attempt to TransformLinear a pinned Mesh");
233
263 foreach (Vertex v in vertices.Keys) 234 foreach (Vertex v in vertices.Keys)
264 { 235 {
265 if (v == null) 236 if (v == null)
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index aa8df23..d56ddc8 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -76,6 +76,7 @@ namespace OpenSim.Region.Physics.Meshing
76 76
77 private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh 77 private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh
78 78
79 private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>();
79 80
80 public Meshmerizer() 81 public Meshmerizer()
81 { 82 {
@@ -184,9 +185,62 @@ namespace OpenSim.Region.Physics.Meshing
184 185
185 } 186 }
186 187
187 public Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) 188 private ulong GetMeshKey(PrimitiveBaseShape pbs, PhysicsVector size, float lod)
189 {
190 ulong hash = 5381;
191
192 hash = djb2(hash, pbs.PathCurve);
193 hash = djb2(hash, (byte)((byte)pbs.HollowShape | (byte)pbs.ProfileShape));
194 hash = djb2(hash, pbs.PathBegin);
195 hash = djb2(hash, pbs.PathEnd);
196 hash = djb2(hash, pbs.PathScaleX);
197 hash = djb2(hash, pbs.PathScaleY);
198 hash = djb2(hash, pbs.PathShearX);
199 hash = djb2(hash, pbs.PathShearY);
200 hash = djb2(hash, (byte)pbs.PathTwist);
201 hash = djb2(hash, (byte)pbs.PathTwistBegin);
202 hash = djb2(hash, (byte)pbs.PathRadiusOffset);
203 hash = djb2(hash, (byte)pbs.PathTaperX);
204 hash = djb2(hash, (byte)pbs.PathTaperY);
205 hash = djb2(hash, pbs.PathRevolutions);
206 hash = djb2(hash, (byte)pbs.PathSkew);
207 hash = djb2(hash, pbs.ProfileBegin);
208 hash = djb2(hash, pbs.ProfileEnd);
209 hash = djb2(hash, pbs.ProfileHollow);
210
211 // TODO: Separate scale out from the primitive shape data (after
212 // scaling is supported at the physics engine level)
213 byte[] scaleBytes = size.GetBytes();
214 for (int i = 0; i < scaleBytes.Length; i++)
215 hash = djb2(hash, scaleBytes[i]);
216
217 // Include LOD in hash, accounting for endianness
218 byte[] lodBytes = new byte[4];
219 Buffer.BlockCopy(BitConverter.GetBytes(lod), 0, lodBytes, 0, 4);
220 if (!BitConverter.IsLittleEndian)
221 {
222 Array.Reverse(lodBytes, 0, 4);
223 }
224 for (int i = 0; i < lodBytes.Length; i++)
225 hash = djb2(hash, lodBytes[i]);
226
227 return hash;
228 }
229
230 private ulong djb2(ulong hash, byte c)
231 {
232 return ((hash << 5) + hash) + (ulong)c;
233 }
234
235 private ulong djb2(ulong hash, ushort c)
236 {
237 hash = ((hash << 5) + hash) + (ulong)((byte)c);
238 return ((hash << 5) + hash) + (ulong)(c >> 8);
239 }
240
241
242 private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod)
188 { 243 {
189 Mesh mesh = new Mesh();
190 PrimMesh primMesh; 244 PrimMesh primMesh;
191 PrimMesher.SculptMesh sculptMesh; 245 PrimMesher.SculptMesh sculptMesh;
192 246
@@ -399,8 +453,6 @@ namespace OpenSim.Region.Physics.Meshing
399 453
400 coords = primMesh.coords; 454 coords = primMesh.coords;
401 faces = primMesh.faces; 455 faces = primMesh.faces;
402
403
404 } 456 }
405 457
406 458
@@ -415,13 +467,13 @@ namespace OpenSim.Region.Physics.Meshing
415 vertices.Add(new Vertex(c.X, c.Y, c.Z)); 467 vertices.Add(new Vertex(c.X, c.Y, c.Z));
416 } 468 }
417 469
470 Mesh mesh = new Mesh();
418 // Add the corresponding triangles to the mesh 471 // Add the corresponding triangles to the mesh
419 for (int i = 0; i < numFaces; i++) 472 for (int i = 0; i < numFaces; i++)
420 { 473 {
421 Face f = faces[i]; 474 Face f = faces[i];
422 mesh.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3])); 475 mesh.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3]));
423 } 476 }
424
425 return mesh; 477 return mesh;
426 } 478 }
427 479
@@ -432,7 +484,12 @@ namespace OpenSim.Region.Physics.Meshing
432 484
433 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod, bool isPhysical) 485 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod, bool isPhysical)
434 { 486 {
487 // If this mesh has been created already, return it instead of creating another copy
488 // For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory
489 ulong key = GetMeshKey(primShape, size, lod);
435 Mesh mesh = null; 490 Mesh mesh = null;
491 if (m_uniqueMeshes.TryGetValue(key, out mesh))
492 return mesh;
436 493
437 if (size.X < 0.01f) size.X = 0.01f; 494 if (size.X < 0.01f) size.X = 0.01f;
438 if (size.Y < 0.01f) size.Y = 0.01f; 495 if (size.Y < 0.01f) size.Y = 0.01f;
@@ -455,7 +512,7 @@ namespace OpenSim.Region.Physics.Meshing
455 // trim the vertex and triangle lists to free up memory 512 // trim the vertex and triangle lists to free up memory
456 mesh.TrimExcess(); 513 mesh.TrimExcess();
457 } 514 }
458 515 m_uniqueMeshes.Add(key, mesh);
459 return mesh; 516 return mesh;
460 } 517 }
461 } 518 }
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
index 0d19c01..abfd400 100644
--- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs
+++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
@@ -345,6 +345,21 @@ namespace PrimMesher
345 this.v3.Z *= z; 345 this.v3.Z *= z;
346 } 346 }
347 347
348 public void AddPos(float x, float y, float z)
349 {
350 this.v1.X += x;
351 this.v2.X += x;
352 this.v3.X += x;
353
354 this.v1.Y += y;
355 this.v2.Y += y;
356 this.v3.Y += y;
357
358 this.v1.Z += z;
359 this.v2.Z += z;
360 this.v3.Z += z;
361 }
362
348 public void AddRot(Quat q) 363 public void AddRot(Quat q)
349 { 364 {
350 this.v1 *= q; 365 this.v1 *= q;
@@ -2141,6 +2156,18 @@ namespace PrimMesher
2141 vert.Z += z; 2156 vert.Z += z;
2142 this.coords[i] = vert; 2157 this.coords[i] = vert;
2143 } 2158 }
2159
2160 if (this.viewerFaces != null)
2161 {
2162 int numViewerFaces = this.viewerFaces.Count;
2163
2164 for (i = 0; i < numViewerFaces; i++)
2165 {
2166 ViewerFace v = this.viewerFaces[i];
2167 v.AddPos(x, y, z);
2168 this.viewerFaces[i] = v;
2169 }
2170 }
2144 } 2171 }
2145 2172
2146 /// <summary> 2173 /// <summary>
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
index bf42fee..bd63aef 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
@@ -494,6 +494,18 @@ namespace PrimMesher
494 vert.Z += z; 494 vert.Z += z;
495 this.coords[i] = vert; 495 this.coords[i] = vert;
496 } 496 }
497
498 if (this.viewerFaces != null)
499 {
500 int numViewerFaces = this.viewerFaces.Count;
501
502 for (i = 0; i < numViewerFaces; i++)
503 {
504 ViewerFace v = this.viewerFaces[i];
505 v.AddPos(x, y, z);
506 this.viewerFaces[i] = v;
507 }
508 }
497 } 509 }
498 510
499 /// <summary> 511 /// <summary>
@@ -556,7 +568,7 @@ namespace PrimMesher
556 if (path == null) 568 if (path == null)
557 return; 569 return;
558 String fileName = name + "_" + title + ".raw"; 570 String fileName = name + "_" + title + ".raw";
559 String completePath = Path.Combine(path, fileName); 571 String completePath = System.IO.Path.Combine(path, fileName);
560 StreamWriter sw = new StreamWriter(completePath); 572 StreamWriter sw = new StreamWriter(completePath);
561 573
562 for (int i = 0; i < this.faces.Count; i++) 574 for (int i = 0; i < this.faces.Count; i++)
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index dd58a4e..a00ba11 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -107,6 +107,7 @@ namespace OpenSim.Region.Physics.OdePlugin
107 public float MinimumGroundFlightOffset = 3f; 107 public float MinimumGroundFlightOffset = 3f;
108 108
109 private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. 109 private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
110 private float m_tiltMagnitudeWhenProjectedOnXYPlane = 0.1131371f; // used to introduce a fixed tilt because a straight-up capsule falls through terrain, probably a bug in terrain collider
110 111
111 112
112 private float m_buoyancy = 0f; 113 private float m_buoyancy = 0f;
@@ -477,7 +478,71 @@ namespace OpenSim.Region.Physics.OdePlugin
477 } 478 }
478 } 479 }
479 } 480 }
480 481
482 private void AlignAvatarTiltWithCurrentDirectionOfMovement(PhysicsVector movementVector)
483 {
484 movementVector.Z = 0f;
485 float magnitude = (float)Math.Sqrt((double)(movementVector.X * movementVector.X + movementVector.Y * movementVector.Y));
486 if (magnitude < 0.1f) return;
487
488 // normalize the velocity vector
489 float invMagnitude = 1.0f / magnitude;
490 movementVector.X *= invMagnitude;
491 movementVector.Y *= invMagnitude;
492
493 // if we change the capsule heading too often, the capsule can fall down
494 // therefore we snap movement vector to just 1 of 4 predefined directions (ne, nw, se, sw),
495 // meaning only 4 possible capsule tilt orientations
496 if (movementVector.X > 0)
497 {
498 // east
499 if (movementVector.Y > 0)
500 {
501 // northeast
502 movementVector.X = (float)Math.Sqrt(2.0);
503 movementVector.Y = (float)Math.Sqrt(2.0);
504 }
505 else
506 {
507 // southeast
508 movementVector.X = (float)Math.Sqrt(2.0);
509 movementVector.Y = -(float)Math.Sqrt(2.0);
510 }
511 }
512 else
513 {
514 // west
515 if (movementVector.Y > 0)
516 {
517 // northwest
518 movementVector.X = -(float)Math.Sqrt(2.0);
519 movementVector.Y = (float)Math.Sqrt(2.0);
520 }
521 else
522 {
523 // southwest
524 movementVector.X = -(float)Math.Sqrt(2.0);
525 movementVector.Y = -(float)Math.Sqrt(2.0);
526 }
527 }
528
529
530 // movementVector.Z is zero
531
532 // calculate tilt components based on desired amount of tilt and current (snapped) heading.
533 // the "-" sign is to force the tilt to be OPPOSITE the direction of movement.
534 float xTiltComponent = -movementVector.X * m_tiltMagnitudeWhenProjectedOnXYPlane;
535 float yTiltComponent = -movementVector.Y * m_tiltMagnitudeWhenProjectedOnXYPlane;
536
537 //m_log.Debug("[PHYSICS] changing avatar tilt");
538 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, xTiltComponent);
539 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, xTiltComponent); // must be same as lowstop, else a different, spurious tilt is introduced
540 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, yTiltComponent);
541 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, yTiltComponent); // same as lowstop
542 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, 0f);
543 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop
544 }
545
481 /// <summary> 546 /// <summary>
482 /// This creates the Avatar's physical Surrogate at the position supplied 547 /// This creates the Avatar's physical Surrogate at the position supplied
483 /// </summary> 548 /// </summary>
@@ -576,71 +641,13 @@ namespace OpenSim.Region.Physics.OdePlugin
576 // (with -0..0 motor stops) falls into the terrain for reasons yet 641 // (with -0..0 motor stops) falls into the terrain for reasons yet
577 // to be comprehended in their entirety. 642 // to be comprehended in their entirety.
578 #endregion 643 #endregion
644 AlignAvatarTiltWithCurrentDirectionOfMovement(new PhysicsVector(0,0,0));
579 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f); 645 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f);
580 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f); 646 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f);
581 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f); 647 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f);
582 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced 648 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced
583 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop 649 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop
584 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop 650 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop
585 #region Documentation of capsule motor StopERP and StopCFM parameters
586 // In addition to the above tilt, we allow a dynamic tilt, or
587 // wobble, to emerge as the capsule is pushed around the environment.
588 // We do this with an experimentally determined combination of
589 // StopERP and StopCFM which make the above motor stops soft.
590 // The softness of the stops should be tweaked according to two
591 // requirements:
592 //
593 // 1. Motor stops should be weak enough to allow enough wobble such
594 // that the capsule can tilt slightly more when moving, to allow
595 // "gliding" over obstacles:
596 //
597 //
598 // .-.
599 // / /
600 // / /
601 // _ / / _
602 // / \ .-. / / / \
603 // | | ----> / / / / | |
604 // | | / / `-' | |
605 // | | / / +------+ | |
606 // | | / / | | | |
607 // | | / / | | | |
608 // \_/ `-' +------+ \_/
609 // ----------------------------------------------------------
610 //
611 // Note that requirement 1 is made complicated by the ever-present
612 // slight avatar tilt (assigned in the above code to prevent avatar
613 // from falling through terrain), which introduces a direction-dependent
614 // bias into the wobble (wobbling against the existing tilt is harder
615 // than wobbling with the tilt), which makes it easier to walk over
616 // prims from some directions. I have tried to minimize this effect by
617 // minimizing the avatar tilt to the minimum that prevents the avatar from
618 // falling through the terrain.
619 //
620 // 2. Motor stops should be strong enough to prevent the capsule
621 // from being forced all the way to the ground; otherwise the
622 // capsule could slip underneath obstacles like this:
623 // _ _
624 // / \ +------+ / \
625 // | | ----> | | | |
626 // | | | | | |
627 // | | .--.___ +------+ | |
628 // | | `--.__`--.__ | |
629 // | | `--.__`--. | |
630 // \_/ `--' \_/
631 // ----------------------------------------------------------
632 //
633 //
634 // It is strongly recommended you enable USE_DRAWSTUFF if you want to
635 // tweak these values, to see how the capsule is reacting in various
636 // situations.
637 #endregion
638 d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM, 0.0035f);
639 d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM2, 0.0035f);
640 d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM3, 0.0035f);
641 d.JointSetAMotorParam(Amotor, (int)dParam.StopERP, 0.8f);
642 d.JointSetAMotorParam(Amotor, (int)dParam.StopERP2, 0.8f);
643 d.JointSetAMotorParam(Amotor, (int)dParam.StopERP3, 0.8f);
644 } 651 }
645 652
646 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the 653 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the
@@ -939,6 +946,7 @@ namespace OpenSim.Region.Physics.OdePlugin
939 946
940 PhysicsVector vec = new PhysicsVector(); 947 PhysicsVector vec = new PhysicsVector();
941 d.Vector3 vel = d.BodyGetLinearVel(Body); 948 d.Vector3 vel = d.BodyGetLinearVel(Body);
949
942 float movementdivisor = 1f; 950 float movementdivisor = 1f;
943 951
944 if (!m_alwaysRun) 952 if (!m_alwaysRun)
@@ -1052,6 +1060,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1052 if (PhysicsVector.isFinite(vec)) 1060 if (PhysicsVector.isFinite(vec))
1053 { 1061 {
1054 doForce(vec); 1062 doForce(vec);
1063 if (!_zeroFlag)
1064 {
1065 AlignAvatarTiltWithCurrentDirectionOfMovement(new PhysicsVector(vec.X, vec.Y, vec.Z));
1066 }
1055 } 1067 }
1056 else 1068 else
1057 { 1069 {
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 673ae39..032b5df 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -82,7 +82,6 @@ namespace OpenSim.Region.Physics.OdePlugin
82 82
83 // private float m_tensor = 5f; 83 // private float m_tensor = 5f;
84 private int body_autodisable_frames = 20; 84 private int body_autodisable_frames = 20;
85 private IMesh primMesh = null;
86 85
87 86
88 private const CollisionCategories m_default_collisionFlags = (CollisionCategories.Geom 87 private const CollisionCategories m_default_collisionFlags = (CollisionCategories.Geom
@@ -814,14 +813,10 @@ namespace OpenSim.Region.Physics.OdePlugin
814 } 813 }
815 } 814 }
816 815
817 IMesh oldMesh = primMesh; 816 float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory
817 int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage
818 818
819 primMesh = mesh; 819 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
820
821 float[] vertexList = primMesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory
822 int[] indexList = primMesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage
823
824 primMesh.releaseSourceMeshData(); // free up the original mesh data to save memory
825 820
826 int VertexCount = vertexList.GetLength(0)/3; 821 int VertexCount = vertexList.GetLength(0)/3;
827 int IndexCount = indexList.GetLength(0); 822 int IndexCount = indexList.GetLength(0);
@@ -847,12 +842,6 @@ namespace OpenSim.Region.Physics.OdePlugin
847 return; 842 return;
848 } 843 }
849 844
850 if (oldMesh != null)
851 {
852 oldMesh.releasePinned();
853 oldMesh = null;
854 }
855
856 // if (IsPhysical && Body == (IntPtr) 0) 845 // if (IsPhysical && Body == (IntPtr) 0)
857 // { 846 // {
858 // Recreate the body 847 // Recreate the body
diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
index d9f4951..c8ae229 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Physics.OdePlugin
228 mono [0x81d28b6] 228 mono [0x81d28b6]
229 mono [0x81ea2c6] 229 mono [0x81ea2c6]
230 /lib/i686/cmov/libpthread.so.0 [0xb7e744c0] 230 /lib/i686/cmov/libpthread.so.0 [0xb7e744c0]
231 /lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7dcd6de] 231 /lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7dcd6de]
232 */ 232 */
233 233
234 // Exclude heightfield geom 234 // Exclude heightfield geom
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 94223d8..0769c90 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -2536,7 +2536,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2536 2536
2537 if (iPropertiesNotSupportedDefault == 0) 2537 if (iPropertiesNotSupportedDefault == 0)
2538 { 2538 {
2539#if SPAM 2539#if SPAM
2540 m_log.Warn("NonMesh"); 2540 m_log.Warn("NonMesh");
2541#endif 2541#endif
2542 return false; 2542 return false;
@@ -3334,7 +3334,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3334 { 3334 {
3335 // this._heightmap[i] = (double)heightMap[i]; 3335 // this._heightmap[i] = (double)heightMap[i];
3336 // dbm (danx0r) -- creating a buffer zone of one extra sample all around 3336 // dbm (danx0r) -- creating a buffer zone of one extra sample all around
3337 //_origheightmap = heightMap; 3337 //_origheightmap = heightMap;
3338 3338
3339 float[] _heightmap; 3339 float[] _heightmap;
3340 3340
@@ -3520,16 +3520,16 @@ namespace OpenSim.Region.Physics.OdePlugin
3520 3520
3521 d.GeomDestroy(g); 3521 d.GeomDestroy(g);
3522 //removingHeightField = new float[0]; 3522 //removingHeightField = new float[0];
3523 } 3523 }
3524 } 3524 }
3525 } 3525 }
3526 else 3526 else
3527 { 3527 {
3528 m_log.Warn("[PHYSICS]: Couldn't proceed with UnCombine. Region has inconsistant data."); 3528 m_log.Warn("[PHYSICS]: Couldn't proceed with UnCombine. Region has inconsistant data.");
3529 } 3529 }
3530 } 3530 }
3531 } 3531 }
3532 } 3532 }
3533 3533
3534 public override void SetWaterLevel(float baseheight) 3534 public override void SetWaterLevel(float baseheight)
3535 { 3535 {
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
index 569009e..0feb967 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs
@@ -225,7 +225,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
225 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened 225 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
226 m_log.ErrorFormat( 226 m_log.ErrorFormat(
227 "[{0}]: Event queue thread terminating with exception. PLEASE REBOOT YOUR SIM - SCRIPT EVENTS WILL NOT WORK UNTIL YOU DO. Exception is {1}", 227 "[{0}]: Event queue thread terminating with exception. PLEASE REBOOT YOUR SIM - SCRIPT EVENTS WILL NOT WORK UNTIL YOU DO. Exception is {1}",
228 ScriptEngineName, e); 228 ScriptEngineName, e);
229 } 229 }
230 } 230 }
231 231
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index 8ad916c..3c91b29 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -418,7 +418,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
418 { 418 {
419 InstanceData id = m_ScriptManager.GetScript(localID, itemID); 419 InstanceData id = m_ScriptManager.GetScript(localID, itemID);
420 if (id == null) 420 if (id == null)
421 return; 421 return;
422 422
423 if (!id.Disabled) 423 if (!id.Disabled)
424 id.Running = true; 424 id.Running = true;
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
428 { 428 {
429 InstanceData id = m_ScriptManager.GetScript(localID, itemID); 429 InstanceData id = m_ScriptManager.GetScript(localID, itemID);
430 if (id == null) 430 if (id == null)
431 return; 431 return;
432 432
433 id.Running = false; 433 id.Running = false;
434 } 434 }
@@ -442,7 +442,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
442 442
443 InstanceData id = m_ScriptManager.GetScript(localID, itemID); 443 InstanceData id = m_ScriptManager.GetScript(localID, itemID);
444 if (id == null) 444 if (id == null)
445 return; 445 return;
446 446
447 IEventQueue eq = World.RequestModuleInterface<IEventQueue>(); 447 IEventQueue eq = World.RequestModuleInterface<IEventQueue>();
448 if (eq == null) 448 if (eq == null)
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 9c1cd4d..6ac209e 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -520,13 +520,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
520 ExeStage = 5; // ;^) Ewe Loon, for debuging 520 ExeStage = 5; // ;^) Ewe Loon, for debuging
521 } 521 }
522 catch (Exception e) // ;^) Ewe Loon, From here down tis fix 522 catch (Exception e) // ;^) Ewe Loon, From here down tis fix
523 { 523 {
524 if ((ExeStage == 3)&&(qParams.Length>0)) 524 if ((ExeStage == 3)&&(qParams.Length>0))
525 detparms.Remove(id); 525 detparms.Remove(id);
526 SceneObjectPart ob = m_scriptEngine.World.GetSceneObjectPart(localID); 526 SceneObjectPart ob = m_scriptEngine.World.GetSceneObjectPart(localID);
527 m_log.InfoFormat("[Script Error] ,{0},{1},@{2},{3},{4},{5}", ob.Name , FunctionName, ExeStage, e.Message, qParams.Length, detparms.Count); 527 m_log.InfoFormat("[Script Error] ,{0},{1},@{2},{3},{4},{5}", ob.Name , FunctionName, ExeStage, e.Message, qParams.Length, detparms.Count);
528 if (ExeStage != 2) throw e; 528 if (ExeStage != 2) throw e;
529 } 529 }
530 } 530 }
531 531
532 public uint GetLocalID(UUID itemID) 532 public uint GetLocalID(UUID itemID)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ba42678..0bd6546 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -24,7 +24,7 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
@@ -50,6 +50,9 @@ using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
50using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 50using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
51using OpenSim.Region.ScriptEngine.Interfaces; 51using OpenSim.Region.ScriptEngine.Interfaces;
52using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 52using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
53using OpenSim.Services.Interfaces;
54
55using GridRegion = OpenSim.Services.Interfaces.GridRegion;
53 56
54using AssetLandmark = OpenSim.Framework.AssetLandmark; 57using AssetLandmark = OpenSim.Framework.AssetLandmark;
55 58
@@ -4996,6 +4999,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4996 if (end > src.Length) 4999 if (end > src.Length)
4997 end = src.Length; 5000 end = src.Length;
4998 5001
5002 if (stride == 0)
5003 stride = 1;
5004
4999 // There may be one or two ranges to be considered 5005 // There may be one or two ranges to be considered
5000 5006
5001 if (start != end) 5007 if (start != end)
@@ -5022,9 +5028,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5022 // A negative stride reverses the direction of the 5028 // A negative stride reverses the direction of the
5023 // scan producing an inverted list as a result. 5029 // scan producing an inverted list as a result.
5024 5030
5025 if (stride == 0)
5026 stride = 1;
5027
5028 if (stride > 0) 5031 if (stride > 0)
5029 { 5032 {
5030 for (int i = 0; i < src.Length; i += stride) 5033 for (int i = 0; i < src.Length; i += stride)
@@ -5048,7 +5051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5048 } 5051 }
5049 else 5052 else
5050 { 5053 {
5051 result.Add(src.Data[start]); 5054 if (start%stride == 0)
5055 {
5056 result.Add(src.Data[start]);
5057 }
5052 } 5058 }
5053 5059
5054 return result; 5060 return result;
@@ -5226,12 +5232,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5226 } 5232 }
5227 } 5233 }
5228 5234
5229 List<SimpleRegionInfo> neighbors = World.CommsManager.GridService.RequestNeighbours(World.RegionInfo.RegionLocX, World.RegionInfo.RegionLocY); 5235 List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID);
5230 5236
5231 uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; 5237 uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x;
5232 uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; 5238 uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y;
5233 5239
5234 foreach (SimpleRegionInfo sri in neighbors) 5240 foreach (GridRegion sri in neighbors)
5235 { 5241 {
5236 if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY) 5242 if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY)
5237 return 0; 5243 return 0;
@@ -6321,9 +6327,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6321 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); 6327 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero);
6322 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>(); 6328 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>();
6323 if (xmlRpcRouter != null) 6329 if (xmlRpcRouter != null)
6330 {
6331 string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName;
6332
6324 xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, 6333 xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID,
6325 m_itemID, String.Format("http://{0}:{1}/", System.Environment.MachineName, 6334 m_itemID, String.Format("http://{0}:{1}/", ExternalHostName,
6326 xmlrpcMod.Port.ToString())); 6335 xmlrpcMod.Port.ToString()));
6336 }
6327 object[] resobj = new object[] 6337 object[] resobj = new object[]
6328 { 6338 {
6329 new LSL_Integer(1), 6339 new LSL_Integer(1),
@@ -7834,8 +7844,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7834 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) 7844 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header)
7835 { 7845 {
7836 m_host.AddScriptLPS(1); 7846 m_host.AddScriptLPS(1);
7837 NotImplemented("llGetHTTPHeader"); 7847
7838 return String.Empty; 7848 if (m_UrlModule != null)
7849 return m_UrlModule.GetHttpHeader(new UUID(request_id), header);
7850 return String.Empty;
7839 } 7851 }
7840 7852
7841 7853
@@ -8175,7 +8187,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8175 8187
8176 string reply = String.Empty; 8188 string reply = String.Empty;
8177 8189
8178 RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator); 8190 GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
8179 8191
8180 switch (data) 8192 switch (data)
8181 { 8193 {
@@ -8202,7 +8214,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8202 ConditionalScriptSleep(1000); 8214 ConditionalScriptSleep(1000);
8203 return UUID.Zero.ToString(); 8215 return UUID.Zero.ToString();
8204 } 8216 }
8205 int access = info.RegionSettings.Maturity; 8217 int access = info.Maturity;
8206 if (access == 0) 8218 if (access == 0)
8207 reply = "PG"; 8219 reply = "PG";
8208 else if (access == 1) 8220 else if (access == 1)
@@ -9113,13 +9125,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9113 } 9125 }
9114 9126
9115 9127
9116 public void llHTTPResponse(string url, int status, string body) 9128 public void llHTTPResponse(LSL_Key id, int status, string body)
9117 { 9129 {
9118 // Partial implementation: support for parameter flags needed 9130 // Partial implementation: support for parameter flags needed
9119 // see http://wiki.secondlife.com/wiki/llHTTPResponse 9131 // see http://wiki.secondlife.com/wiki/llHTTPResponse
9120 9132
9121 m_host.AddScriptLPS(1); 9133 m_host.AddScriptLPS(1);
9122 NotImplemented("llHTTPResponse"); 9134
9135 if (m_UrlModule != null)
9136 m_UrlModule.HttpResponse(new UUID(id), status,body);
9123 } 9137 }
9124 9138
9125 public void llResetLandBanList() 9139 public void llResetLandBanList()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 726b37a..0b95abc 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -48,6 +48,8 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
48using OpenSim.Region.ScriptEngine.Interfaces; 48using OpenSim.Region.ScriptEngine.Interfaces;
49using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 49using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
50using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 50using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
51using OpenSim.Services.Interfaces;
52using GridRegion = OpenSim.Services.Interfaces.GridRegion;
51using System.Text.RegularExpressions; 53using System.Text.RegularExpressions;
52 54
53using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; 55using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
@@ -599,17 +601,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
599 if (regionName.Contains(".") && regionName.Contains(":")) 601 if (regionName.Contains(".") && regionName.Contains(":"))
600 { 602 {
601 // Try to link the region 603 // Try to link the region
602 RegionInfo regInfo = HGHyperlink.TryLinkRegion(World, 604 IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>();
603 presence.ControllingClient, 605 if (hyperService != null)
604 regionName);
605 // Get the region name
606 if (regInfo != null)
607 { 606 {
608 regionName = regInfo.RegionName; 607 GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient,
609 } 608 regionName);
610 else 609 // Get the region name
611 { 610 if (regInfo != null)
612 // Might need to ping the client here in case of failure?? 611 {
612 regionName = regInfo.RegionName;
613 }
614 else
615 {
616 // Might need to ping the client here in case of failure??
617 }
613 } 618 }
614 } 619 }
615 presence.ControllingClient.SendTeleportLocationStart(); 620 presence.ControllingClient.SendTeleportLocationStart();
@@ -1164,6 +1169,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1164 1169
1165 land.SetMediaUrl(url); 1170 land.SetMediaUrl(url);
1166 } 1171 }
1172
1173 public void osSetParcelSIPAddress(string SIPAddress)
1174 {
1175 // What actually is the difference to the LL function?
1176 //
1177 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
1178
1179 m_host.AddScriptLPS(1);
1180
1181
1182 ILandObject land
1183 = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
1184
1185 if (land.landData.OwnerID != m_host.ObjectOwner)
1186 {
1187 OSSLError("osSetParcelSIPAddress: Sorry, you need to own the land to use this function");
1188 return;
1189 }
1190
1191 // get the voice module
1192 IVoiceModule voiceModule = World.RequestModuleInterface<IVoiceModule>();
1193
1194 if (voiceModule != null)
1195 voiceModule.setLandSIPAddress(SIPAddress,land.landData.GlobalID);
1196 else
1197 OSSLError("osSetParcelSIPAddress: No voice module enabled for this land");
1198
1199
1200 }
1167 1201
1168 public string osGetScriptEngineName() 1202 public string osGetScriptEngineName()
1169 { 1203 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 41358e5..a74e8da 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -201,7 +201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
201 void llGroundRepel(double height, int water, double tau); 201 void llGroundRepel(double height, int water, double tau);
202 LSL_Vector llGroundSlope(LSL_Vector offset); 202 LSL_Vector llGroundSlope(LSL_Vector offset);
203 LSL_String llHTTPRequest(string url, LSL_List parameters, string body); 203 LSL_String llHTTPRequest(string url, LSL_List parameters, string body);
204 void llHTTPResponse(string url, int status, string body); 204 void llHTTPResponse(LSL_Key id, int status, string body);
205 LSL_String llInsertString(string dst, int position, string src); 205 LSL_String llInsertString(string dst, int position, string src);
206 void llInstantMessage(string user, string message); 206 void llInstantMessage(string user, string message);
207 LSL_String llIntegerToBase64(int number); 207 LSL_String llIntegerToBase64(int number);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 49aa45a..d8d3c31 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -75,6 +75,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
75 bool osConsoleCommand(string Command); 75 bool osConsoleCommand(string Command);
76 void osSetParcelMediaURL(string url); 76 void osSetParcelMediaURL(string url);
77 void osSetPrimFloatOnWater(int floatYN); 77 void osSetPrimFloatOnWater(int floatYN);
78 void osSetParcelSIPAddress(string SIPAddress);
78 79
79 // Avatar Info Commands 80 // Avatar Info Commands
80 string osGetAgentIP(string agent); 81 string osGetAgentIP(string agent);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 02ae281..a28e97b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -864,9 +864,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
864 return m_LSL_Functions.llHTTPRequest(url, parameters, body); 864 return m_LSL_Functions.llHTTPRequest(url, parameters, body);
865 } 865 }
866 866
867 public void llHTTPResponse(string url, int status, string body) 867 public void llHTTPResponse(LSL_Key id, int status, string body)
868 { 868 {
869 m_LSL_Functions.llHTTPResponse(url, status, body); 869 m_LSL_Functions.llHTTPResponse(id, status, body);
870 } 870 }
871 871
872 public LSL_String llInsertString(string dst, int position, string src) 872 public LSL_String llInsertString(string dst, int position, string src)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 8f52d99..8dcb1f5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
95 return m_OSSL_Functions.osWindActiveModelPluginName(); 95 return m_OSSL_Functions.osWindActiveModelPluginName();
96 } 96 }
97 97
98// Not yet plugged in as available OSSL functions, so commented out 98// Not yet plugged in as available OSSL functions, so commented out
99// void osWindParamSet(string plugin, string param, float value) 99// void osWindParamSet(string plugin, string param, float value)
100// { 100// {
101// m_OSSL_Functions.osWindParamSet(plugin, param, value); 101// m_OSSL_Functions.osWindParamSet(plugin, param, value);
@@ -183,6 +183,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
183 { 183 {
184 m_OSSL_Functions.osSetParcelMediaURL(url); 184 m_OSSL_Functions.osSetParcelMediaURL(url);
185 } 185 }
186
187 public void osSetParcelSIPAddress(string SIPAddress)
188 {
189 m_OSSL_Functions.osSetParcelSIPAddress(SIPAddress);
190 }
186 191
187 public void osSetPrimFloatOnWater(int floatYN) 192 public void osSetPrimFloatOnWater(int floatYN)
188 { 193 {
@@ -324,7 +329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
324 329
325 public string osGetSimulatorVersion() 330 public string osGetSimulatorVersion()
326 { 331 {
327 return m_OSSL_Functions.osGetSimulatorVersion(); 332 return m_OSSL_Functions.osGetSimulatorVersion();
328 } 333 }
329 334
330 public Hashtable osParseJSON(string JSON) 335 public Hashtable osParseJSON(string JSON)
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index cb5664b..fe26429 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -542,23 +542,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
542 break; 542 break;
543 case enumCompileType.cs: 543 case enumCompileType.cs:
544 case enumCompileType.lsl: 544 case enumCompileType.lsl:
545 lock (CScodeProvider) 545 bool complete = false;
546 bool retried = false;
547 do
546 { 548 {
547 results = CScodeProvider.CompileAssemblyFromSource( 549 lock (CScodeProvider)
550 {
551 results = CScodeProvider.CompileAssemblyFromSource(
548 parameters, Script); 552 parameters, Script);
549 } 553 }
554 // Deal with an occasional segv in the compiler.
555 // Rarely, if ever, occurs twice in succession.
556 // Line # == 0 and no file name are indications that
557 // this is a native stack trace rather than a normal
558 // error log.
559 if (results.Errors.Count > 0)
560 {
561 if (!retried && (results.Errors[0].FileName == null || results.Errors[0].FileName == String.Empty) &&
562 results.Errors[0].Line == 0)
563 {
564 // System.Console.WriteLine("retrying failed compilation");
565 retried = true;
566 }
567 else
568 {
569 complete = true;
570 }
571 }
572 else
573 {
574 complete = true;
575 }
576 } while (!complete);
550 break; 577 break;
551 case enumCompileType.js: 578 case enumCompileType.js:
552 results = JScodeProvider.CompileAssemblyFromSource( 579 results = JScodeProvider.CompileAssemblyFromSource(
553 parameters, Script); 580 parameters, Script);
554 break; 581 break;
555 case enumCompileType.yp: 582 case enumCompileType.yp:
556 results = YPcodeProvider.CompileAssemblyFromSource( 583 results = YPcodeProvider.CompileAssemblyFromSource(
557 parameters, Script); 584 parameters, Script);
558 break; 585 break;
559 default: 586 default:
560 throw new Exception("Compiler is not able to recongnize "+ 587 throw new Exception("Compiler is not able to recongnize "+
561 "language type \"" + lang.ToString() + "\""); 588 "language type \"" + lang.ToString() + "\"");
562 } 589 }
563 590
564 // Check result 591 // Check result
@@ -567,56 +594,62 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
567 // 594 //
568 // WARNINGS AND ERRORS 595 // WARNINGS AND ERRORS
569 // 596 //
570 int display = 5; 597 bool hadErrors = false;
598 string errtext = String.Empty;
599
571 if (results.Errors.Count > 0) 600 if (results.Errors.Count > 0)
572 { 601 {
573 string errtext = String.Empty;
574 foreach (CompilerError CompErr in results.Errors) 602 foreach (CompilerError CompErr in results.Errors)
575 { 603 {
576 // Show 5 errors max 604 string severity = CompErr.IsWarning ? "Warning" : "Error";
577 //
578 if (display <= 0)
579 break;
580 display--;
581
582 string severity = "Error";
583 if (CompErr.IsWarning)
584 {
585 severity = "Warning";
586 }
587 605
588 KeyValuePair<int, int> lslPos; 606 KeyValuePair<int, int> lslPos;
589 607
590 lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); 608 // Show 5 errors max, but check entire list for errors
591 609
592 string text = CompErr.ErrorText; 610 if (severity == "Error")
611 {
612 lslPos = FindErrorPosition(CompErr.Line, CompErr.Column);
613 string text = CompErr.ErrorText;
614
615 // Use LSL type names
616 if (lang == enumCompileType.lsl)
617 text = ReplaceTypes(CompErr.ErrorText);
618
619 // The Second Life viewer's script editor begins
620 // countingn lines and columns at 0, so we subtract 1.
621 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
622 lslPos.Key - 1, lslPos.Value - 1,
623 CompErr.ErrorNumber, text, severity);
624 hadErrors = true;
625 }
626 }
627 }
628
629 if (hadErrors)
630 {
631 throw new Exception(errtext);
632 }
593 633
594 // Use LSL type names 634 // On today's highly asynchronous systems, the result of
595 if (lang == enumCompileType.lsl) 635 // the compile may not be immediately apparent. Wait a
596 text = ReplaceTypes(CompErr.ErrorText); 636 // reasonable amount of time before giving up on it.
597 637
598 // The Second Life viewer's script editor begins 638 if (!File.Exists(OutFile))
599 // countingn lines and columns at 0, so we subtract 1. 639 {
600 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", 640 for (int i=0; i<20 && !File.Exists(OutFile); i++)
601 lslPos.Key - 1, lslPos.Value - 1, 641 {
602 CompErr.ErrorNumber, text, severity); 642 System.Threading.Thread.Sleep(250);
603 } 643 }
604 644 // One final chance...
605 if (!File.Exists(OutFile)) 645 if (!File.Exists(OutFile))
606 { 646 {
647 errtext = String.Empty;
648 errtext += "No compile error. But not able to locate compiled file.";
607 throw new Exception(errtext); 649 throw new Exception(errtext);
608 } 650 }
609 } 651 }
610 652
611 //
612 // NO ERRORS, BUT NO COMPILED FILE
613 //
614 if (!File.Exists(OutFile))
615 {
616 string errtext = String.Empty;
617 errtext += "No compile error. But not able to locate compiled file.";
618 throw new Exception(errtext);
619 }
620// m_log.DebugFormat("[Compiler] Compiled new assembly "+ 653// m_log.DebugFormat("[Compiler] Compiled new assembly "+
621// "for {0}", asset); 654// "for {0}", asset);
622 655
@@ -629,7 +662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
629 662
630 if (fi == null) 663 if (fi == null)
631 { 664 {
632 string errtext = String.Empty; 665 errtext = String.Empty;
633 errtext += "No compile error. But not able to stat file."; 666 errtext += "No compile error. But not able to stat file.";
634 throw new Exception(errtext); 667 throw new Exception(errtext);
635 } 668 }
@@ -644,7 +677,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
644 } 677 }
645 catch (Exception) 678 catch (Exception)
646 { 679 {
647 string errtext = String.Empty; 680 errtext = String.Empty;
648 errtext += "No compile error. But not able to open file."; 681 errtext += "No compile error. But not able to open file.";
649 throw new Exception(errtext); 682 throw new Exception(errtext);
650 } 683 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 650d9fa..97166cf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
261 "SecondLife.Script"); 261 "SecondLife.Script");
262 262
263 //ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); 263 //ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
264 RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); 264 RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
265// lease.Register(this); 265// lease.Register(this);
266 } 266 }
267 catch (Exception) 267 catch (Exception)
@@ -430,7 +430,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
430 430
431 permsGranter = part.TaskInventory[m_ItemID].PermsGranter; 431 permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
432 permsMask = part.TaskInventory[m_ItemID].PermsMask; 432 permsMask = part.TaskInventory[m_ItemID].PermsMask;
433 } 433 }
434 434
435 if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0) 435 if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
436 { 436 {
@@ -630,7 +630,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
630 /// <summary> 630 /// <summary>
631 /// Process the next event queued for this script 631 /// Process the next event queued for this script
632 /// </summary> 632 /// </summary>
633 /// <returns></returns> 633 /// <returns></returns>
634 public object EventProcessor() 634 public object EventProcessor()
635 { 635 {
636 lock (m_Script) 636 lock (m_Script)
@@ -925,7 +925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
925 925
926 public override string ToString() 926 public override string ToString()
927 { 927 {
928 return String.Format("{0} {1} on {2}", m_ScriptName, m_ItemID, m_PrimName); 928 return String.Format("{0} {1} on {2}", m_ScriptName, m_ItemID, m_PrimName);
929 } 929 }
930 930
931 string FormatException(Exception e) 931 string FormatException(Exception e)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 9a972c2..e695133 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -554,7 +554,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
554 554
555 // We must look for the part outside the m_Scripts lock because GetSceneObjectPart later triggers the 555 // We must look for the part outside the m_Scripts lock because GetSceneObjectPart later triggers the
556 // m_parts lock on SOG. At the same time, a scene object that is being deleted will take the m_parts lock 556 // m_parts lock on SOG. At the same time, a scene object that is being deleted will take the m_parts lock
557 // and then later on try to take the m_scripts lock in this class when it calls OnRemoveScript() 557 // and then later on try to take the m_scripts lock in this class when it calls OnRemoveScript()
558 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); 558 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
559 if (part == null) 559 if (part == null)
560 { 560 {
@@ -562,7 +562,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
562 m_ScriptErrorMessage += "SceneObjectPart unavailable. Script NOT started.\n"; 562 m_ScriptErrorMessage += "SceneObjectPart unavailable. Script NOT started.\n";
563 m_ScriptFailCount++; 563 m_ScriptFailCount++;
564 return false; 564 return false;
565 } 565 }
566 566
567 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); 567 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
568 if (item == null) 568 if (item == null)
@@ -692,7 +692,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
692 AppDomain.CreateDomain( 692 AppDomain.CreateDomain(
693 m_Scene.RegionInfo.RegionID.ToString(), 693 m_Scene.RegionInfo.RegionID.ToString(),
694 evidence, appSetup); 694 evidence, appSetup);
695/* 695/*
696 PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel(); 696 PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
697 AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition(); 697 AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
698 PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet"); 698 PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
@@ -925,7 +925,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
925 return new XWorkItem(m_ThreadPool.QueueWorkItem( 925 return new XWorkItem(m_ThreadPool.QueueWorkItem(
926 new WorkItemCallback(this.ProcessEventHandler), 926 new WorkItemCallback(this.ProcessEventHandler),
927 parms)); 927 parms));
928 } 928 }
929 929
930 /// <summary> 930 /// <summary>
931 /// Process a previously posted script event. 931 /// Process a previously posted script event.
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 519668a..a03cc4c 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.UserStatistics
76 try 76 try
77 { 77 {
78 cnfg = config.Configs["WebStats"]; 78 cnfg = config.Configs["WebStats"];
79 enabled = cnfg.GetBoolean("enabled", false); 79 enabled = cnfg.GetBoolean("enabled", false);
80 } 80 }
81 catch (Exception) 81 catch (Exception)
82 { 82 {
@@ -137,7 +137,7 @@ namespace OpenSim.Region.UserStatistics
137 137
138 m_simstatsCounters.Add(scene.RegionInfo.RegionID, new USimStatsData(scene.RegionInfo.RegionID)); 138 m_simstatsCounters.Add(scene.RegionInfo.RegionID, new USimStatsData(scene.RegionInfo.RegionID));
139 scene.StatsReporter.OnSendStatsResult += ReceiveClassicSimStatsPacket; 139 scene.StatsReporter.OnSendStatsResult += ReceiveClassicSimStatsPacket;
140 } 140 }
141 } 141 }
142 142
143 public void ReceiveClassicSimStatsPacket(SimStats stats) 143 public void ReceiveClassicSimStatsPacket(SimStats stats)
diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs
index 2db9661..3d2d9d2 100644
--- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs
+++ b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs
@@ -179,7 +179,7 @@ namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers
179 } 179 }
180 } 180 }
181 181
182 // TODO: Process errors 182 // TODO: Process errors
183 return OutFile; 183 return OutFile;
184 } 184 }
185 185
diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs
index 3259686..afa2300 100644
--- a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs
+++ b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs
@@ -36,7 +36,7 @@ using OpenSim.ScriptEngine.Shared;
36namespace OpenSim.ScriptEngine.Components.DotNetEngine.Scheduler 36namespace OpenSim.ScriptEngine.Components.DotNetEngine.Scheduler
37{ 37{
38 public class BaseClassFactory 38 public class BaseClassFactory
39 { 39 {
40 40
41 41
42 public static void MakeBaseClass(ScriptStructure script) 42 public static void MakeBaseClass(ScriptStructure script)
diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/ScriptLoader.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/ScriptLoader.cs
index f3b1496..3c20f20 100644
--- a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/ScriptLoader.cs
+++ b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/ScriptLoader.cs
@@ -115,7 +115,7 @@ namespace OpenSim.ScriptEngine.Components.DotNetEngine.Scheduler
115 script.AppDomain = FreeAppDomain.CurrentAppDomain; 115 script.AppDomain = FreeAppDomain.CurrentAppDomain;
116 116
117 // Create instance of script 117 // Create instance of script
118 ScriptAssemblies.IScript mbrt = (ScriptAssemblies.IScript) 118 ScriptAssemblies.IScript mbrt = (ScriptAssemblies.IScript)
119 FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap( 119 FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(
120 script.AssemblyFileName, "ScriptAssemblies.Script"); 120 script.AssemblyFileName, "ScriptAssemblies.Script");
121 //, true, BindingFlags.CreateInstance, null); 121 //, true, BindingFlags.CreateInstance, null);
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 791e1ef..ed0210f 100644
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Threading; 30using System.Threading;
30using System.Reflection; 31using System.Reflection;
31using OpenSim.Framework; 32using OpenSim.Framework;
@@ -40,17 +41,40 @@ namespace OpenSim.Server.Base
40 { 41 {
41 // Logger 42 // Logger
42 // 43 //
43 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 45
45 // The http server instance 46 // The http server instance
46 // 47 //
47 protected BaseHttpServer m_HttpServer = null; 48 protected BaseHttpServer m_HttpServer = null;
49 protected uint m_Port = 0;
50 protected Dictionary<uint, BaseHttpServer> m_Servers =
51 new Dictionary<uint, BaseHttpServer>();
48 52
49 public IHttpServer HttpServer 53 public IHttpServer HttpServer
50 { 54 {
51 get { return m_HttpServer; } 55 get { return m_HttpServer; }
52 } 56 }
53 57
58 public uint DefaultPort
59 {
60 get { return m_Port; }
61 }
62
63 public IHttpServer GetHttpServer(uint port)
64 {
65 m_Log.InfoFormat("[SERVER]: Requested port {0}", port);
66 if (port == m_Port)
67 return HttpServer;
68
69 if (m_Servers.ContainsKey(port))
70 return m_Servers[port];
71
72 m_Servers[port] = new BaseHttpServer(port);
73 m_Servers[port].Start();
74
75 return m_Servers[port];
76 }
77
54 // Handle all the automagical stuff 78 // Handle all the automagical stuff
55 // 79 //
56 public HttpServerBase(string prompt, string[] args) : base(prompt, args) 80 public HttpServerBase(string prompt, string[] args) : base(prompt, args)
@@ -74,6 +98,8 @@ namespace OpenSim.Server.Base
74 Thread.CurrentThread.Abort(); 98 Thread.CurrentThread.Abort();
75 } 99 }
76 100
101 m_Port = port;
102
77 m_HttpServer = new BaseHttpServer(port); 103 m_HttpServer = new BaseHttpServer(port);
78 104
79 MainServer.Instance = m_HttpServer; 105 MainServer.Instance = m_HttpServer;
diff --git a/OpenSim/Server/Base/ProtocolVersions.cs b/OpenSim/Server/Base/ProtocolVersions.cs
new file mode 100644
index 0000000..8db5bb6
--- /dev/null
+++ b/OpenSim/Server/Base/ProtocolVersions.cs
@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28namespace OpenSim.Server.Base
29{
30 public class ProtocolVersions
31 {
32 /// <value>
33 /// This is the external protocol versions. It is separate from the OpenSimulator project version.
34 ///
35 /// These version numbers should be increased by 1 every time a code
36 /// change in the Service.Connectors and Server.Handlers, espectively,
37 /// makes the previous OpenSimulator revision incompatible
38 /// with the new revision.
39 ///
40 /// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality
41 /// but not outright failure) do not need a version number increment.
42 ///
43 /// Having this version number allows the grid service to reject connections from regions running a version
44 /// of the code that is too old.
45 ///
46 /// </value>
47
48 // The range of acceptable servers for client-side connectors
49 public readonly static int ClientProtocolVersionMin = 0;
50 public readonly static int ClientProtocolVersionMax = 0;
51
52 // The range of acceptable clients in server-side handlers
53 public readonly static int ServerProtocolVersionMin = 0;
54 public readonly static int ServerProtocolVersionMax = 0;
55 }
56}
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 0a36bbe..9beadd8 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -141,7 +141,9 @@ namespace OpenSim.Server.Base
141 } 141 }
142 catch (Exception e) 142 catch (Exception e)
143 { 143 {
144 m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException); 144 if (!(e is System.MissingMethodException))
145 m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
146 return null;
145 } 147 }
146 148
147 return plug; 149 return plug;
@@ -183,5 +185,121 @@ namespace OpenSim.Server.Base
183 185
184 return result; 186 return result;
185 } 187 }
188
189 public static string BuildQueryString(Dictionary<string, string> data)
190 {
191 string qstring = String.Empty;
192
193 foreach (KeyValuePair<string, string> kvp in data)
194 {
195 string part;
196 if (kvp.Value != String.Empty)
197 {
198 part = System.Web.HttpUtility.UrlEncode(kvp.Key) +
199 "=" + System.Web.HttpUtility.UrlEncode(kvp.Value);
200 }
201 else
202 {
203 part = System.Web.HttpUtility.UrlEncode(kvp.Key);
204 }
205
206 if (qstring != String.Empty)
207 qstring += "&";
208
209 qstring += part;
210 }
211
212 return qstring;
213 }
214
215 public static string BuildXmlResponse(Dictionary<string, object> data)
216 {
217 XmlDocument doc = new XmlDocument();
218
219 XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration,
220 "", "");
221
222 doc.AppendChild(xmlnode);
223
224 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
225 "");
226
227 doc.AppendChild(rootElement);
228
229 BuildXmlData(rootElement, data);
230
231 return doc.InnerXml;
232 }
233
234 private static void BuildXmlData(XmlElement parent, Dictionary<string, object> data)
235 {
236 foreach (KeyValuePair<string, object> kvp in data)
237 {
238 XmlElement elem = parent.OwnerDocument.CreateElement("",
239 kvp.Key, "");
240
241 if (kvp.Value is Dictionary<string, object>)
242 {
243 XmlAttribute type = parent.OwnerDocument.CreateAttribute("",
244 "type", "");
245 type.Value = "List";
246
247 elem.Attributes.Append(type);
248
249 BuildXmlData(elem, (Dictionary<string, object>)kvp.Value);
250 }
251 else
252 {
253 elem.AppendChild(parent.OwnerDocument.CreateTextNode(
254 kvp.Value.ToString()));
255 }
256
257 parent.AppendChild(elem);
258 }
259 }
260
261 public static Dictionary<string, object> ParseXmlResponse(string data)
262 {
263 //m_log.DebugFormat("[XXX]: received xml string: {0}", data);
264
265 Dictionary<string, object> ret = new Dictionary<string, object>();
266
267 XmlDocument doc = new XmlDocument();
268
269 doc.LoadXml(data);
270
271 XmlNodeList rootL = doc.GetElementsByTagName("ServerResponse");
272
273 if (rootL.Count != 1)
274 return ret;
275
276 XmlNode rootNode = rootL[0];
277
278 ret = ParseElement(rootNode);
279
280 return ret;
281 }
282
283 private static Dictionary<string, object> ParseElement(XmlNode element)
284 {
285 Dictionary<string, object> ret = new Dictionary<string, object>();
286
287 XmlNodeList partL = element.ChildNodes;
288
289 foreach (XmlNode part in partL)
290 {
291 XmlNode type = part.Attributes.GetNamedItem("type");
292 if (type == null || type.Value != "List")
293 {
294 ret[part.Name] = part.InnerText;
295 }
296 else
297 {
298 ret[part.Name] = ParseElement(part);
299 }
300 }
301
302 return ret;
303 }
186 } 304 }
187} 305}
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index 7c74e05..f7eb292 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -37,13 +37,17 @@ namespace OpenSim.Server.Handlers.Asset
37 public class AssetServiceConnector : ServiceConnector 37 public class AssetServiceConnector : ServiceConnector
38 { 38 {
39 private IAssetService m_AssetService; 39 private IAssetService m_AssetService;
40 private string m_ConfigName = "AssetService";
40 41
41 public AssetServiceConnector(IConfigSource config, IHttpServer server) : 42 public AssetServiceConnector(IConfigSource config, IHttpServer server, string configName) :
42 base(config, server) 43 base(config, server, configName)
43 { 44 {
44 IConfig serverConfig = config.Configs["AssetService"]; 45 if (configName != String.Empty)
46 m_ConfigName = configName;
47
48 IConfig serverConfig = config.Configs[m_ConfigName];
45 if (serverConfig == null) 49 if (serverConfig == null)
46 throw new Exception("No section 'Server' in config file"); 50 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
47 51
48 string assetService = serverConfig.GetString("LocalServiceModule", 52 string assetService = serverConfig.GetString("LocalServiceModule",
49 String.Empty); 53 String.Empty);
@@ -55,7 +59,6 @@ namespace OpenSim.Server.Handlers.Asset
55 m_AssetService = 59 m_AssetService =
56 ServerUtils.LoadPlugin<IAssetService>(assetService, args); 60 ServerUtils.LoadPlugin<IAssetService>(assetService, args);
57 61
58 //System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no"));
59 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); 62 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
60 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); 63 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
61 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService)); 64 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService));
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
index 589dc3b..2abef0a 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
@@ -37,13 +37,17 @@ namespace OpenSim.Server.Handlers.Authentication
37 public class AuthenticationServiceConnector : ServiceConnector 37 public class AuthenticationServiceConnector : ServiceConnector
38 { 38 {
39 private IAuthenticationService m_AuthenticationService; 39 private IAuthenticationService m_AuthenticationService;
40 private string m_ConfigName = "AuthenticationService";
40 41
41 public AuthenticationServiceConnector(IConfigSource config, IHttpServer server) : 42 public AuthenticationServiceConnector(IConfigSource config, IHttpServer server, string configName) :
42 base(config, server) 43 base(config, server, configName)
43 { 44 {
44 IConfig serverConfig = config.Configs["AuthenticationService"]; 45 if (configName != String.Empty)
46 m_ConfigName = configName;
47
48 IConfig serverConfig = config.Configs[m_ConfigName];
45 if (serverConfig == null) 49 if (serverConfig == null)
46 throw new Exception("No section 'Server' in config file"); 50 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
47 51
48 string authenticationService = serverConfig.GetString("AuthenticationServiceModule", 52 string authenticationService = serverConfig.GetString("AuthenticationServiceModule",
49 String.Empty); 53 String.Empty);
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 6cf7d56..490a13a 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -157,7 +157,7 @@ namespace OpenSim.Server.Handlers.Authentication
157 157
158 doc.AppendChild(xmlnode); 158 doc.AppendChild(xmlnode);
159 159
160 XmlElement rootElement = doc.CreateElement("", "Authentication", 160 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
161 ""); 161 "");
162 162
163 doc.AppendChild(rootElement); 163 doc.AppendChild(rootElement);
@@ -179,7 +179,7 @@ namespace OpenSim.Server.Handlers.Authentication
179 179
180 doc.AppendChild(xmlnode); 180 doc.AppendChild(xmlnode);
181 181
182 XmlElement rootElement = doc.CreateElement("", "Authentication", 182 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
183 ""); 183 "");
184 184
185 doc.AppendChild(rootElement); 185 doc.AppendChild(rootElement);
@@ -201,7 +201,7 @@ namespace OpenSim.Server.Handlers.Authentication
201 201
202 doc.AppendChild(xmlnode); 202 doc.AppendChild(xmlnode);
203 203
204 XmlElement rootElement = doc.CreateElement("", "Authentication", 204 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
205 ""); 205 "");
206 206
207 doc.AppendChild(rootElement); 207 doc.AppendChild(rootElement);
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerConnector.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerConnector.cs
index 0d9f239..20fd0f7 100644
--- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerConnector.cs
@@ -37,13 +37,16 @@ namespace OpenSim.Server.Handlers.Authorization
37 public class AuthorizationServerConnector : ServiceConnector 37 public class AuthorizationServerConnector : ServiceConnector
38 { 38 {
39 private IAuthorizationService m_AuthorizationService; 39 private IAuthorizationService m_AuthorizationService;
40 private string m_ConfigName = "AuthorizationService";
40 41
41 public AuthorizationServerConnector(IConfigSource config, IHttpServer server) : 42 public AuthorizationServerConnector(IConfigSource config, IHttpServer server, string configName) :
42 base(config, server) 43 base(config, server, configName)
43 { 44 {
44 IConfig serverConfig = config.Configs["AuthorizationService"]; 45 if (configName != String.Empty)
46 m_ConfigName = configName;
47 IConfig serverConfig = config.Configs[m_ConfigName];
45 if (serverConfig == null) 48 if (serverConfig == null)
46 throw new Exception("No section 'Server' in config file"); 49 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
47 50
48 string authorizationService = serverConfig.GetString("LocalServiceModule", 51 string authorizationService = serverConfig.GetString("LocalServiceModule",
49 String.Empty); 52 String.Empty);
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
index 69acd25..f987de4 100644
--- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Server.Handlers.Authorization
44{ 44{
45 public class AuthorizationServerPostHandler : BaseStreamHandler 45 public class AuthorizationServerPostHandler : BaseStreamHandler
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private IAuthorizationService m_AuthorizationService; 49 private IAuthorizationService m_AuthorizationService;
50 50
diff --git a/OpenSim/Server/Handlers/Base/ServerConnector.cs b/OpenSim/Server/Handlers/Base/ServerConnector.cs
index 62fe773..71876da 100644
--- a/OpenSim/Server/Handlers/Base/ServerConnector.cs
+++ b/OpenSim/Server/Handlers/Base/ServerConnector.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Server.Handlers.Base
39 39
40 public class ServiceConnector : IServiceConnector 40 public class ServiceConnector : IServiceConnector
41 { 41 {
42 public ServiceConnector(IConfigSource config, IHttpServer server) 42 public ServiceConnector(IConfigSource config, IHttpServer server, string configName)
43 { 43 {
44 } 44 }
45 } 45 }
diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs
index a4ab0d3..07bafc8 100644
--- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs
+++ b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs
@@ -37,19 +37,23 @@ namespace OpenSim.Server.Handlers.Freeswitch
37 public class FreeswitchServerConnector : ServiceConnector 37 public class FreeswitchServerConnector : ServiceConnector
38 { 38 {
39 private IFreeswitchService m_FreeswitchService; 39 private IFreeswitchService m_FreeswitchService;
40 private string m_ConfigName = "FreeswitchService";
40 41
41 public FreeswitchServerConnector(IConfigSource config, IHttpServer server) : 42 public FreeswitchServerConnector(IConfigSource config, IHttpServer server, string configName) :
42 base(config, server) 43 base(config, server, configName)
43 { 44 {
44 IConfig serverConfig = config.Configs["FreeswitchService"]; 45 if (configName != String.Empty)
46 m_ConfigName = configName;
47
48 IConfig serverConfig = config.Configs[m_ConfigName];
45 if (serverConfig == null) 49 if (serverConfig == null)
46 throw new Exception("No section 'Server' in config file"); 50 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
47 51
48 string freeswitchService = serverConfig.GetString("LocalServiceModule", 52 string freeswitchService = serverConfig.GetString("LocalServiceModule",
49 String.Empty); 53 String.Empty);
50 54
51 if (freeswitchService == String.Empty) 55 if (freeswitchService == String.Empty)
52 throw new Exception("No FreeswitchService in config file"); 56 throw new Exception("No LocalServiceModule in config file");
53 57
54 Object[] args = new Object[] { config }; 58 Object[] args = new Object[] { config };
55 m_FreeswitchService = 59 m_FreeswitchService =
diff --git a/OpenSim/Services/Grid/GridService.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs
index 47710d8..14daf12 100644
--- a/OpenSim/Services/Grid/GridService.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs
@@ -25,55 +25,37 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Collections.Generic; 28using System;
29using OpenMetaverse; 29using Nini.Config;
30using OpenSim.Server.Base;
30using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base;
31 34
32namespace OpenSim.Services.Interfaces 35namespace OpenSim.Server.Handlers.Grid
33{ 36{
34 public class GridService : IGridService 37 public class GridServiceConnector : ServiceConnector
35 { 38 {
36 bool RegisterRegion(UUID scopeID, RegionInfo regionInfos); 39 private IGridService m_GridService;
37 { 40 private string m_ConfigName = "GridService";
38 return false;
39 }
40
41 bool DeregisterRegion(UUID regionID);
42 {
43 return false;
44 }
45
46 List<SimpleRegionInfo> RequestNeighbours(UUID scopeID, uint x, uint y)
47 {
48 return new List<SimpleRegionInfo>()
49 }
50 41
51 RegionInfo RequestNeighbourInfo(UUID regionID) 42 public GridServiceConnector(IConfigSource config, IHttpServer server, string configName) :
43 base(config, server, configName)
52 { 44 {
53 return null; 45 IConfig serverConfig = config.Configs[m_ConfigName];
54 } 46 if (serverConfig == null)
47 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
55 48
56 RegionInfo RequestClosestRegion(UUID scopeID, string regionName) 49 string gridService = serverConfig.GetString("LocalServiceModule",
57 { 50 String.Empty);
58 return null;
59 }
60 51
61 List<MapBlockData> RequestNeighbourMapBlocks(UUID scopeID, int minX, 52 if (gridService == String.Empty)
62 int minY, int maxX, int maxY) 53 throw new Exception("No LocalServiceModule in config file");
63 {
64 return new List<MapBlockData>();
65 }
66 54
67 LandData RequestLandData(UUID scopeID, ulong regionHandle, 55 Object[] args = new Object[] { config };
68 uint x, uint y) 56 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
69 {
70 return null;
71 }
72 57
73 List<RegionInfo> RequestNamedRegions(UUID scopeID, string name, 58 server.AddStreamHandler(new GridServerPostHandler(m_GridService));
74 int maxNumber)
75 {
76 return new List<RegionInfo>();
77 } 59 }
78 } 60 }
79} 61}
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
new file mode 100644
index 0000000..e22328d
--- /dev/null
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -0,0 +1,451 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using Nini.Config;
29using log4net;
30using System;
31using System.Reflection;
32using System.IO;
33using System.Net;
34using System.Text;
35using System.Text.RegularExpressions;
36using System.Xml;
37using System.Xml.Serialization;
38using System.Collections.Generic;
39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
42using OpenSim.Framework;
43using OpenSim.Framework.Servers.HttpServer;
44using OpenMetaverse;
45
46namespace OpenSim.Server.Handlers.Grid
47{
48 public class GridServerPostHandler : BaseStreamHandler
49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
52 private IGridService m_GridService;
53
54 public GridServerPostHandler(IGridService service) :
55 base("POST", "/grid")
56 {
57 m_GridService = service;
58 }
59
60 public override byte[] Handle(string path, Stream requestData,
61 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
62 {
63 StreamReader sr = new StreamReader(requestData);
64 string body = sr.ReadToEnd();
65 sr.Close();
66 body = body.Trim();
67
68 //m_log.DebugFormat("[XXX]: query String: {0}", body);
69
70 Dictionary<string, string> request =
71 ServerUtils.ParseQueryString(body);
72
73 if (!request.ContainsKey("METHOD"))
74 return FailureResult();
75
76 string method = request["METHOD"];
77
78 switch (method)
79 {
80 case "register":
81 return Register(request);
82
83 case "deregister":
84 return Deregister(request);
85
86 case "get_neighbours":
87 return GetNeighbours(request);
88
89 case "get_region_by_uuid":
90 return GetRegionByUUID(request);
91
92 case "get_region_by_position":
93 return GetRegionByPosition(request);
94
95 case "get_region_by_name":
96 return GetRegionByName(request);
97
98 case "get_regions_by_name":
99 return GetRegionsByName(request);
100
101 case "get_region_range":
102 return GetRegionRange(request);
103
104 }
105
106 m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
107 return FailureResult();
108
109 }
110
111 #region Method-specific handlers
112
113 byte[] Register(Dictionary<string, string> request)
114 {
115 UUID scopeID = UUID.Zero;
116 if (request["SCOPEID"] != null)
117 UUID.TryParse(request["SCOPEID"], out scopeID);
118 else
119 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region");
120
121 int versionNumberMin = 0, versionNumberMax = 0;
122 if (request.ContainsKey("VERSIONMIN"))
123 Int32.TryParse(request["VERSIONMIN"], out versionNumberMin);
124 else
125 m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region");
126
127 if (request.ContainsKey("VERSIONMAX"))
128 Int32.TryParse(request["VERSIONMAX"], out versionNumberMax);
129 else
130 m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region");
131
132 // Check the protocol version
133 if ((versionNumberMin > ProtocolVersions.ServerProtocolVersionMax && versionNumberMax < ProtocolVersions.ServerProtocolVersionMax))
134 {
135 // Can't do, there is no overlap in the acceptable ranges
136 return FailureResult();
137 }
138
139 Dictionary<string, object> rinfoData = new Dictionary<string, object>();
140 foreach (KeyValuePair<string, string> kvp in request)
141 rinfoData[kvp.Key] = kvp.Value;
142 GridRegion rinfo = new GridRegion(rinfoData);
143
144 bool result = m_GridService.RegisterRegion(scopeID, rinfo);
145
146 if (result)
147 return SuccessResult();
148 else
149 return FailureResult();
150 }
151
152 byte[] Deregister(Dictionary<string, string> request)
153 {
154 UUID regionID = UUID.Zero;
155 if (request["REGIONID"] != null)
156 UUID.TryParse(request["REGIONID"], out regionID);
157 else
158 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region");
159
160 bool result = m_GridService.DeregisterRegion(regionID);
161
162 if (result)
163 return SuccessResult();
164 else
165 return FailureResult();
166
167 }
168
169 byte[] GetNeighbours(Dictionary<string, string> request)
170 {
171 UUID scopeID = UUID.Zero;
172 if (request["SCOPEID"] != null)
173 UUID.TryParse(request["SCOPEID"], out scopeID);
174 else
175 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
176
177 UUID regionID = UUID.Zero;
178 if (request["REGIONID"] != null)
179 UUID.TryParse(request["REGIONID"], out regionID);
180 else
181 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
182
183 List<GridRegion> rinfos = m_GridService.GetNeighbours(scopeID, regionID);
184 //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
185
186 Dictionary<string, object> result = new Dictionary<string, object>();
187 if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
188 result["result"] = "null";
189 else
190 {
191 int i = 0;
192 foreach (GridRegion rinfo in rinfos)
193 {
194 Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
195 result["region" + i] = rinfoDict;
196 i++;
197 }
198 }
199
200 string xmlString = ServerUtils.BuildXmlResponse(result);
201 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
202 UTF8Encoding encoding = new UTF8Encoding();
203 return encoding.GetBytes(xmlString);
204
205 }
206
207 byte[] GetRegionByUUID(Dictionary<string, string> request)
208 {
209 UUID scopeID = UUID.Zero;
210 if (request["SCOPEID"] != null)
211 UUID.TryParse(request["SCOPEID"], out scopeID);
212 else
213 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
214
215 UUID regionID = UUID.Zero;
216 if (request["REGIONID"] != null)
217 UUID.TryParse(request["REGIONID"], out regionID);
218 else
219 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
220
221 GridRegion rinfo = m_GridService.GetRegionByUUID(scopeID, regionID);
222 //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
223
224 Dictionary<string, object> result = new Dictionary<string, object>();
225 if (rinfo == null)
226 result["result"] = "null";
227 else
228 result["result"] = rinfo.ToKeyValuePairs();
229
230 string xmlString = ServerUtils.BuildXmlResponse(result);
231 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
232 UTF8Encoding encoding = new UTF8Encoding();
233 return encoding.GetBytes(xmlString);
234 }
235
236 byte[] GetRegionByPosition(Dictionary<string, string> request)
237 {
238 UUID scopeID = UUID.Zero;
239 if (request["SCOPEID"] != null)
240 UUID.TryParse(request["SCOPEID"], out scopeID);
241 else
242 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position");
243
244 int x = 0, y = 0;
245 if (request["X"] != null)
246 Int32.TryParse(request["X"], out x);
247 else
248 m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position");
249 if (request["Y"] != null)
250 Int32.TryParse(request["Y"], out y);
251 else
252 m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position");
253
254 GridRegion rinfo = m_GridService.GetRegionByPosition(scopeID, x, y);
255 //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
256
257 Dictionary<string, object> result = new Dictionary<string, object>();
258 if (rinfo == null)
259 result["result"] = "null";
260 else
261 result["result"] = rinfo.ToKeyValuePairs();
262
263 string xmlString = ServerUtils.BuildXmlResponse(result);
264 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
265 UTF8Encoding encoding = new UTF8Encoding();
266 return encoding.GetBytes(xmlString);
267 }
268
269 byte[] GetRegionByName(Dictionary<string, string> request)
270 {
271 UUID scopeID = UUID.Zero;
272 if (request["SCOPEID"] != null)
273 UUID.TryParse(request["SCOPEID"], out scopeID);
274 else
275 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name");
276
277 string regionName = string.Empty;
278 if (request["NAME"] != null)
279 regionName = request["NAME"];
280 else
281 m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name");
282
283 GridRegion rinfo = m_GridService.GetRegionByName(scopeID, regionName);
284 //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
285
286 Dictionary<string, object> result = new Dictionary<string, object>();
287 if (rinfo == null)
288 result["result"] = "null";
289 else
290 result["result"] = rinfo.ToKeyValuePairs();
291
292 string xmlString = ServerUtils.BuildXmlResponse(result);
293 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
294 UTF8Encoding encoding = new UTF8Encoding();
295 return encoding.GetBytes(xmlString);
296 }
297
298 byte[] GetRegionsByName(Dictionary<string, string> request)
299 {
300 UUID scopeID = UUID.Zero;
301 if (request["SCOPEID"] != null)
302 UUID.TryParse(request["SCOPEID"], out scopeID);
303 else
304 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name");
305
306 string regionName = string.Empty;
307 if (request["NAME"] != null)
308 regionName = request["NAME"];
309 else
310 m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name");
311
312 int max = 0;
313 if (request["MAX"] != null)
314 Int32.TryParse(request["MAX"], out max);
315 else
316 m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name");
317
318 List<GridRegion> rinfos = m_GridService.GetRegionsByName(scopeID, regionName, max);
319 //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
320
321 Dictionary<string, object> result = new Dictionary<string, object>();
322 if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
323 result["result"] = "null";
324 else
325 {
326 int i = 0;
327 foreach (GridRegion rinfo in rinfos)
328 {
329 Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
330 result["region" + i] = rinfoDict;
331 i++;
332 }
333 }
334
335 string xmlString = ServerUtils.BuildXmlResponse(result);
336 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
337 UTF8Encoding encoding = new UTF8Encoding();
338 return encoding.GetBytes(xmlString);
339 }
340
341 byte[] GetRegionRange(Dictionary<string, string> request)
342 {
343 //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange");
344 UUID scopeID = UUID.Zero;
345 if (request.ContainsKey("SCOPEID"))
346 UUID.TryParse(request["SCOPEID"], out scopeID);
347 else
348 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range");
349
350 int xmin = 0, xmax = 0, ymin = 0, ymax = 0;
351 if (request.ContainsKey("XMIN"))
352 Int32.TryParse(request["XMIN"], out xmin);
353 else
354 m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range");
355 if (request.ContainsKey("XMAX"))
356 Int32.TryParse(request["XMAX"], out xmax);
357 else
358 m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range");
359 if (request.ContainsKey("YMIN"))
360 Int32.TryParse(request["YMIN"], out ymin);
361 else
362 m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range");
363 if (request.ContainsKey("YMAX"))
364 Int32.TryParse(request["YMAX"], out ymax);
365 else
366 m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range");
367
368
369 List<GridRegion> rinfos = m_GridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
370
371 Dictionary<string, object> result = new Dictionary<string, object>();
372 if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
373 result["result"] = "null";
374 else
375 {
376 int i = 0;
377 foreach (GridRegion rinfo in rinfos)
378 {
379 Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
380 result["region" + i] = rinfoDict;
381 i++;
382 }
383 }
384 string xmlString = ServerUtils.BuildXmlResponse(result);
385 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
386 UTF8Encoding encoding = new UTF8Encoding();
387 return encoding.GetBytes(xmlString);
388 }
389
390 #endregion
391
392 #region Misc
393
394 private byte[] SuccessResult()
395 {
396 XmlDocument doc = new XmlDocument();
397
398 XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration,
399 "", "");
400
401 doc.AppendChild(xmlnode);
402
403 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
404 "");
405
406 doc.AppendChild(rootElement);
407
408 XmlElement result = doc.CreateElement("", "Result", "");
409 result.AppendChild(doc.CreateTextNode("Success"));
410
411 rootElement.AppendChild(result);
412
413 return DocToBytes(doc);
414 }
415
416 private byte[] FailureResult()
417 {
418 XmlDocument doc = new XmlDocument();
419
420 XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration,
421 "", "");
422
423 doc.AppendChild(xmlnode);
424
425 XmlElement rootElement = doc.CreateElement("", "ServerResponse",
426 "");
427
428 doc.AppendChild(rootElement);
429
430 XmlElement result = doc.CreateElement("", "Result", "");
431 result.AppendChild(doc.CreateTextNode("Failure"));
432
433 rootElement.AppendChild(result);
434
435 return DocToBytes(doc);
436 }
437
438 private byte[] DocToBytes(XmlDocument doc)
439 {
440 MemoryStream ms = new MemoryStream();
441 XmlTextWriter xw = new XmlTextWriter(ms, null);
442 xw.Formatting = Formatting.Indented;
443 doc.WriteTo(xw);
444 xw.Flush();
445
446 return ms.ToArray();
447 }
448
449 #endregion
450 }
451}
diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs
new file mode 100644
index 0000000..115ac29
--- /dev/null
+++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs
@@ -0,0 +1,208 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Reflection;
32using System.Net;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Server.Base;
36using OpenSim.Services.Interfaces;
37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Server.Handlers.Base;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
40
41using OpenMetaverse;
42using log4net;
43using Nwc.XmlRpc;
44
45namespace OpenSim.Server.Handlers.Grid
46{
47 public class HypergridServiceInConnector : ServiceConnector
48 {
49 private static readonly ILog m_log =
50 LogManager.GetLogger(
51 MethodBase.GetCurrentMethod().DeclaringType);
52
53 private List<GridRegion> m_RegionsOnSim = new List<GridRegion>();
54 private IHyperlinkService m_HyperlinkService;
55
56 public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) :
57 base(config, server, String.Empty)
58 {
59 m_HyperlinkService = hyperService;
60 server.AddXmlRPCHandler("link_region", LinkRegionRequest, false);
61 server.AddXmlRPCHandler("expect_hg_user", ExpectHGUser, false);
62 }
63
64 public void AddRegion(GridRegion rinfo)
65 {
66 m_RegionsOnSim.Add(rinfo);
67 }
68
69 public void RemoveRegion(GridRegion rinfo)
70 {
71 if (m_RegionsOnSim.Contains(rinfo))
72 m_RegionsOnSim.Remove(rinfo);
73 }
74
75 /// <summary>
76 /// Someone wants to link to us
77 /// </summary>
78 /// <param name="request"></param>
79 /// <returns></returns>
80 public XmlRpcResponse LinkRegionRequest(XmlRpcRequest request, IPEndPoint remoteClient)
81 {
82 Hashtable requestData = (Hashtable)request.Params[0];
83 //string host = (string)requestData["host"];
84 //string portstr = (string)requestData["port"];
85 string name = (string)requestData["region_name"];
86
87 m_log.DebugFormat("[HGrid]: Hyperlink request");
88
89 GridRegion regInfo = null;
90 foreach (GridRegion r in m_RegionsOnSim)
91 {
92 if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower()))
93 {
94 regInfo = r;
95 break;
96 }
97 }
98
99 if (regInfo == null)
100 regInfo = m_RegionsOnSim[0]; // Send out the first region
101
102 Hashtable hash = new Hashtable();
103 hash["uuid"] = regInfo.RegionID.ToString();
104 m_log.Debug(">> Here " + regInfo.RegionID);
105 hash["handle"] = regInfo.RegionHandle.ToString();
106 hash["region_image"] = regInfo.TerrainImage.ToString();
107 hash["region_name"] = regInfo.RegionName;
108 hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
109 //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port);
110
111
112 XmlRpcResponse response = new XmlRpcResponse();
113 response.Value = hash;
114 return response;
115 }
116
117 /// <summary>
118 /// Received from other HGrid nodes when a user wants to teleport here. This call allows
119 /// the region to prepare for direct communication from the client. Sends back an empty
120 /// xmlrpc response on completion.
121 /// This is somewhat similar to OGS1's ExpectUser, but with the additional task of
122 /// registering the user in the local user cache.
123 /// </summary>
124 /// <param name="request"></param>
125 /// <returns></returns>
126 public XmlRpcResponse ExpectHGUser(XmlRpcRequest request, IPEndPoint remoteClient)
127 {
128 Hashtable requestData = (Hashtable)request.Params[0];
129 ForeignUserProfileData userData = new ForeignUserProfileData();
130
131 userData.FirstName = (string)requestData["firstname"];
132 userData.SurName = (string)requestData["lastname"];
133 userData.ID = new UUID((string)requestData["agent_id"]);
134 UUID sessionID = new UUID((string)requestData["session_id"]);
135 userData.HomeLocation = new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]),
136 (float)Convert.ToDecimal((string)requestData["startpos_y"]),
137 (float)Convert.ToDecimal((string)requestData["startpos_z"]));
138
139 userData.UserServerURI = (string)requestData["userserver_id"];
140 userData.UserAssetURI = (string)requestData["assetserver_id"];
141 userData.UserInventoryURI = (string)requestData["inventoryserver_id"];
142
143 m_log.DebugFormat("[HGrid]: Prepare for connection from {0} {1} (@{2}) UUID={3}",
144 userData.FirstName, userData.SurName, userData.UserServerURI, userData.ID);
145
146 ulong userRegionHandle = 0;
147 int userhomeinternalport = 0;
148 if (requestData.ContainsKey("region_uuid"))
149 {
150 UUID uuid = UUID.Zero;
151 UUID.TryParse((string)requestData["region_uuid"], out uuid);
152 userData.HomeRegionID = uuid;
153 userRegionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
154 userData.UserHomeAddress = (string)requestData["home_address"];
155 userData.UserHomePort = (string)requestData["home_port"];
156 userhomeinternalport = Convert.ToInt32((string)requestData["internal_port"]);
157
158 m_log.Debug("[HGrid]: home_address: " + userData.UserHomeAddress +
159 "; home_port: " + userData.UserHomePort);
160 }
161 else
162 m_log.WarnFormat("[HGrid]: User has no home region information");
163
164 XmlRpcResponse resp = new XmlRpcResponse();
165
166 // Let's check if someone is trying to get in with a stolen local identity.
167 // The need for this test is a consequence of not having truly global names :-/
168 bool comingHome = false;
169 if (m_HyperlinkService.CheckUserAtEntry(userData.ID, sessionID, out comingHome) == false)
170 {
171 m_log.WarnFormat("[HGrid]: Access denied to foreign user.");
172 Hashtable respdata = new Hashtable();
173 respdata["success"] = "FALSE";
174 respdata["reason"] = "Foreign user has the same ID as a local user, or logins disabled.";
175 resp.Value = respdata;
176 return resp;
177 }
178
179 // Finally, everything looks ok
180 //m_log.Debug("XXX---- EVERYTHING OK ---XXX");
181
182 if (!comingHome)
183 {
184 // We don't do this if the user is coming to the home grid
185 GridRegion home = new GridRegion();
186 home.RegionID = userData.HomeRegionID;
187 home.ExternalHostName = userData.UserHomeAddress;
188 home.HttpPort = Convert.ToUInt32(userData.UserHomePort);
189 uint x = 0, y = 0;
190 Utils.LongToUInts(userRegionHandle, out x, out y);
191 home.RegionLocX = (int)x;
192 home.RegionLocY = (int)y;
193 home.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport);
194
195 m_HyperlinkService.AcceptUser(userData, home);
196 }
197 // else the user is coming to a non-home region of the home grid
198 // We simply drop this user information altogether
199
200 Hashtable respdata2 = new Hashtable();
201 respdata2["success"] = "TRUE";
202 resp.Value = respdata2;
203
204 return resp;
205 }
206
207 }
208}
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
index 998b322..ca45263 100644
--- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
@@ -54,19 +54,20 @@ namespace OpenSim.Server.Handlers.Inventory
54 //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME); 54 //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME);
55 55
56 private string m_userserver_url; 56 private string m_userserver_url;
57 private string m_ConfigName = "InventoryService";
57 58
58 public InventoryServiceInConnector(IConfigSource config, IHttpServer server) : 59 public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
59 base(config, server) 60 base(config, server, configName)
60 { 61 {
61 IConfig serverConfig = config.Configs["InventoryService"]; 62 IConfig serverConfig = config.Configs[m_ConfigName];
62 if (serverConfig == null) 63 if (serverConfig == null)
63 throw new Exception("No section 'InventoryService' in config file"); 64 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
64 65
65 string inventoryService = serverConfig.GetString("LocalServiceModule", 66 string inventoryService = serverConfig.GetString("LocalServiceModule",
66 String.Empty); 67 String.Empty);
67 68
68 if (inventoryService == String.Empty) 69 if (inventoryService == String.Empty)
69 throw new Exception("No InventoryService in config file"); 70 throw new Exception("No LocalServiceModule in config file");
70 71
71 Object[] args = new Object[] { config }; 72 Object[] args = new Object[] { config };
72 m_InventoryService = 73 m_InventoryService =
diff --git a/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs b/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
index 10e3b47..d368bd3 100644
--- a/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Land/LandServiceInConnector.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Land
46 // TODO : private IAuthenticationService m_AuthenticationService; 46 // TODO : private IAuthenticationService m_AuthenticationService;
47 47
48 public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) : 48 public LandServiceInConnector(IConfigSource source, IHttpServer server, ILandService service, IScene scene) :
49 base(source, server) 49 base(source, server, String.Empty)
50 { 50 {
51 m_LandService = service; 51 m_LandService = service;
52 if (m_LandService == null) 52 if (m_LandService == null)
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
index c0933a8..d6ef22e 100644
--- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
+++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
@@ -36,6 +36,7 @@ using OpenSim.Server.Handlers.Base;
36using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Servers.HttpServer; 38using OpenSim.Framework.Servers.HttpServer;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40using OpenMetaverse; 41using OpenMetaverse;
41using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
@@ -148,11 +149,14 @@ namespace OpenSim.Server.Handlers.Neighbour
148 } 149 }
149 150
150 // Finally! 151 // Finally!
151 bool success = m_NeighbourService.HelloNeighbour(regionhandle, aRegion); 152 GridRegion thisRegion = m_NeighbourService.HelloNeighbour(regionhandle, aRegion);
152 153
153 OSDMap resp = new OSDMap(1); 154 OSDMap resp = new OSDMap(1);
154 155
155 resp["success"] = OSD.FromBoolean(success); 156 if (thisRegion != null)
157 resp["success"] = OSD.FromBoolean(true);
158 else
159 resp["success"] = OSD.FromBoolean(false);
156 160
157 httpResponse.StatusCode = (int)HttpStatusCode.OK; 161 httpResponse.StatusCode = (int)HttpStatusCode.OK;
158 162
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourServiceInConnector.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourServiceInConnector.cs
index b3a91cf..ac2e75f 100644
--- a/OpenSim/Server/Handlers/Neighbour/NeighbourServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Neighbour/NeighbourServiceInConnector.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Neighbour
46 private IAuthenticationService m_AuthenticationService = null; 46 private IAuthenticationService m_AuthenticationService = null;
47 47
48 public NeighbourServiceInConnector(IConfigSource source, IHttpServer server, INeighbourService nService, IScene scene) : 48 public NeighbourServiceInConnector(IConfigSource source, IHttpServer server, INeighbourService nService, IScene scene) :
49 base(source, server) 49 base(source, server, String.Empty)
50 { 50 {
51 51
52 m_NeighbourService = nService; 52 m_NeighbourService = nService;
diff --git a/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
index 0bb4713..fe93fa5 100644
--- a/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Server.Handlers.Simulation
41 private IAuthenticationService m_AuthenticationService; 41 private IAuthenticationService m_AuthenticationService;
42 42
43 public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : 43 public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
44 base(config, server) 44 base(config, server, String.Empty)
45 { 45 {
46 IConfig serverConfig = config.Configs["SimulationService"]; 46 IConfig serverConfig = config.Configs["SimulationService"];
47 if (serverConfig == null) 47 if (serverConfig == null)
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 77dfebb..a7b33c9 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -30,6 +30,7 @@ using log4net;
30using System.Reflection; 30using System.Reflection;
31using System; 31using System;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Base; 34using OpenSim.Server.Base;
34using OpenSim.Server.Handlers.Base; 35using OpenSim.Server.Handlers.Base;
35 36
@@ -60,22 +61,59 @@ namespace OpenSim.Server
60 string connList = serverConfig.GetString("ServiceConnectors", String.Empty); 61 string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
61 string[] conns = connList.Split(new char[] {',', ' '}); 62 string[] conns = connList.Split(new char[] {',', ' '});
62 63
63 foreach (string conn in conns) 64 int i = 0;
65 foreach (string c in conns)
64 { 66 {
65 if (conn == String.Empty) 67 if (c == String.Empty)
66 continue; 68 continue;
67 69
70 string configName = String.Empty;
71 string conn = c;
72 uint port = 0;
73
74 string[] split1 = conn.Split(new char[] {'/'});
75 if (split1.Length > 1)
76 {
77 conn = split1[1];
78
79 string[] split2 = split1[0].Split(new char[] {'@'});
80 if (split2.Length > 1)
81 {
82 configName = split2[0];
83 port = Convert.ToUInt32(split2[1]);
84 }
85 else
86 {
87 port = Convert.ToUInt32(split1[0]);
88 }
89 }
68 string[] parts = conn.Split(new char[] {':'}); 90 string[] parts = conn.Split(new char[] {':'});
69 string friendlyName = parts[0]; 91 string friendlyName = parts[0];
70 if (parts.Length > 1) 92 if (parts.Length > 1)
71 friendlyName = parts[1]; 93 friendlyName = parts[1];
72 94
73 m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); 95 IHttpServer server = m_Server.HttpServer;
96 if (port != 0)
97 server = m_Server.GetHttpServer(port);
74 98
75 Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer }; 99 if (port != m_Server.DefaultPort)
76 IServiceConnector connector = 100 m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, port);
77 ServerUtils.LoadPlugin<IServiceConnector>(conn, 101 else
102 m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
103
104 IServiceConnector connector = null;
105
106 Object[] modargs = new Object[] { m_Server.Config, server,
107 configName };
108 connector = ServerUtils.LoadPlugin<IServiceConnector>(conn,
78 modargs); 109 modargs);
110 if (connector == null)
111 {
112 modargs = new Object[] { m_Server.Config, server };
113 connector =
114 ServerUtils.LoadPlugin<IServiceConnector>(conn,
115 modargs);
116 }
79 117
80 if (connector != null) 118 if (connector != null)
81 { 119 {
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 88a905c..ebfd47a 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Services.AssetService
155 AssetBase asset = Get(args[2]); 155 AssetBase asset = Get(args[2]);
156 156
157 if (asset == null || asset.Data.Length == 0) 157 if (asset == null || asset.Data.Length == 0)
158 { 158 {
159 MainConsole.Instance.Output("Asset not found"); 159 MainConsole.Instance.Output("Asset not found");
160 return; 160 return;
161 } 161 }
@@ -195,7 +195,7 @@ namespace OpenSim.Services.AssetService
195 AssetBase asset = Get(args[2]); 195 AssetBase asset = Get(args[2]);
196 196
197 if (asset == null || asset.Data.Length == 0) 197 if (asset == null || asset.Data.Length == 0)
198 { 198 {
199 MainConsole.Instance.Output("Asset not found"); 199 MainConsole.Instance.Output("Asset not found");
200 return; 200 return;
201 } 201 }
diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
index 8904461..dcf090e 100644
--- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
+++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs
@@ -43,9 +43,9 @@ namespace OpenSim.Services.AuthenticationService
43 // 43 //
44 public class AuthenticationServiceBase : ServiceBase 44 public class AuthenticationServiceBase : ServiceBase
45 { 45 {
46 private static readonly ILog m_log = 46// private static readonly ILog m_log =
47 LogManager.GetLogger( 47// LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48// MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected IAuthenticationData m_Database; 50 protected IAuthenticationData m_Database;
51 51
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
index 6c99b66..d65665a 100644
--- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
@@ -47,9 +47,9 @@ namespace OpenSim.Services.AuthenticationService
47 public class PasswordAuthenticationService : 47 public class PasswordAuthenticationService :
48 AuthenticationServiceBase, IAuthenticationService 48 AuthenticationServiceBase, IAuthenticationService
49 { 49 {
50 private static readonly ILog m_log = 50// private static readonly ILog m_log =
51 LogManager.GetLogger( 51// LogManager.GetLogger(
52 MethodBase.GetCurrentMethod().DeclaringType); 52// MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 public PasswordAuthenticationService(IConfigSource config) : 54 public PasswordAuthenticationService(IConfigSource config) :
55 base(config) 55 base(config)
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
index 8831c8a..d1a5b0f 100644
--- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
@@ -43,9 +43,9 @@ namespace OpenSim.Services.AuthenticationService
43 public class WebkeyAuthenticationService : 43 public class WebkeyAuthenticationService :
44 AuthenticationServiceBase, IAuthenticationService 44 AuthenticationServiceBase, IAuthenticationService
45 { 45 {
46 private static readonly ILog m_log = 46// private static readonly ILog m_log =
47 LogManager.GetLogger( 47// LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48// MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 public WebkeyAuthenticationService(IConfigSource config) : 50 public WebkeyAuthenticationService(IConfigSource config) :
51 base(config) 51 base(config)
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
new file mode 100644
index 0000000..50e817e
--- /dev/null
+++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
@@ -0,0 +1,150 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using log4net;
29using System;
30using System.Collections.Generic;
31using System.IO;
32using System.Reflection;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base;
39using OpenMetaverse;
40
41namespace OpenSim.Services.Connectors
42{
43 public class AuthenticationServicesConnector : IAuthenticationService
44 {
45 private static readonly ILog m_log =
46 LogManager.GetLogger(
47 MethodBase.GetCurrentMethod().DeclaringType);
48
49 private string m_ServerURI = String.Empty;
50
51 public AuthenticationServicesConnector()
52 {
53 }
54
55 public AuthenticationServicesConnector(string serverURI)
56 {
57 m_ServerURI = serverURI.TrimEnd('/');
58 }
59
60 public AuthenticationServicesConnector(IConfigSource source)
61 {
62 Initialise(source);
63 }
64
65 public virtual void Initialise(IConfigSource source)
66 {
67 IConfig assetConfig = source.Configs["AuthenticationService"];
68 if (assetConfig == null)
69 {
70 m_log.Error("[USER CONNECTOR]: AuthenticationService missing from OpanSim.ini");
71 throw new Exception("Authentication connector init error");
72 }
73
74 string serviceURI = assetConfig.GetString("AuthenticationServerURI",
75 String.Empty);
76
77 if (serviceURI == String.Empty)
78 {
79 m_log.Error("[USER CONNECTOR]: No Server URI named in section AuthenticationService");
80 throw new Exception("Authentication connector init error");
81 }
82 m_ServerURI = serviceURI;
83 }
84
85 public string Authenticate(UUID principalID, string password, int lifetime)
86 {
87 Dictionary<string, string> sendData = new Dictionary<string, string>();
88 sendData["LIFETIME"] = lifetime.ToString();
89 sendData["PRINCIPAL"] = principalID.ToString();
90 sendData["PASSWORD"] = password;
91
92 sendData["METHOD"] = "authenticate";
93
94 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
95 m_ServerURI + "/auth/plain",
96 ServerUtils.BuildQueryString(sendData));
97
98 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
99 reply);
100
101 if (replyData["Result"].ToString() != "Success")
102 return String.Empty;
103
104 return replyData["Token"].ToString();
105 }
106
107 public bool Verify(UUID principalID, string token, int lifetime)
108 {
109 Dictionary<string, string> sendData = new Dictionary<string, string>();
110 sendData["LIFETIME"] = lifetime.ToString();
111 sendData["PRINCIPAL"] = principalID.ToString();
112 sendData["TOKEN"] = token;
113
114 sendData["METHOD"] = "verify";
115
116 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
117 m_ServerURI + "/auth/plain",
118 ServerUtils.BuildQueryString(sendData));
119
120 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
121 reply);
122
123 if (replyData["Result"].ToString() != "Success")
124 return false;
125
126 return true;
127 }
128
129 public bool Release(UUID principalID, string token)
130 {
131 Dictionary<string, string> sendData = new Dictionary<string, string>();
132 sendData["PRINCIPAL"] = principalID.ToString();
133 sendData["TOKEN"] = token;
134
135 sendData["METHOD"] = "release";
136
137 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
138 m_ServerURI + "/auth/plain",
139 ServerUtils.BuildQueryString(sendData));
140
141 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
142 reply);
143
144 if (replyData["Result"].ToString() != "Success")
145 return false;
146
147 return true;
148 }
149 }
150}
diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
index 3167352..7926efb 100644
--- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors
113 message = response.Message; 113 message = response.Message;
114 114
115 return response.IsAuthorized; 115 return response.IsAuthorized;
116 } 116 }
117 117
118 } 118 }
119} 119}
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
new file mode 100644
index 0000000..ba46b0d
--- /dev/null
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -0,0 +1,449 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using log4net;
29using System;
30using System.Collections.Generic;
31using System.IO;
32using System.Reflection;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenSim.Server.Base;
40using OpenMetaverse;
41
42namespace OpenSim.Services.Connectors
43{
44 public class GridServicesConnector : IGridService
45 {
46 private static readonly ILog m_log =
47 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType);
49
50 private string m_ServerURI = String.Empty;
51
52 public GridServicesConnector()
53 {
54 }
55
56 public GridServicesConnector(string serverURI)
57 {
58 m_ServerURI = serverURI.TrimEnd('/');
59 }
60
61 public GridServicesConnector(IConfigSource source)
62 {
63 Initialise(source);
64 }
65
66 public virtual void Initialise(IConfigSource source)
67 {
68 IConfig gridConfig = source.Configs["GridService"];
69 if (gridConfig == null)
70 {
71 m_log.Error("[GRID CONNECTOR]: GridService missing from OpenSim.ini");
72 throw new Exception("Grid connector init error");
73 }
74
75 string serviceURI = gridConfig.GetString("GridServerURI",
76 String.Empty);
77
78 if (serviceURI == String.Empty)
79 {
80 m_log.Error("[GRID CONNECTOR]: No Server URI named in section GridService");
81 throw new Exception("Grid connector init error");
82 }
83 m_ServerURI = serviceURI;
84 }
85
86
87 #region IGridService
88
89 public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
90 {
91 Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs();
92 Dictionary<string, string> sendData = new Dictionary<string,string>();
93 foreach (KeyValuePair<string, object> kvp in rinfo)
94 sendData[kvp.Key] = (string)kvp.Value;
95
96 sendData["SCOPEID"] = scopeID.ToString();
97 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
98 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
99 sendData["METHOD"] = "register";
100
101 string reqString = ServerUtils.BuildQueryString(sendData);
102 //m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString);
103 try
104 {
105 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
106 m_ServerURI + "/grid",
107 reqString);
108 if (reply != string.Empty)
109 {
110 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
111
112 if ((replyData["Result"] != null) && (replyData["Result"].ToString().ToLower() == "success"))
113 return true;
114 }
115 else
116 m_log.DebugFormat("[GRID CONNECTOR]: RegisterRegion received null reply");
117 }
118 catch (Exception e)
119 {
120 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
121 }
122
123 return false;
124 }
125
126 public virtual bool DeregisterRegion(UUID regionID)
127 {
128 Dictionary<string, string> sendData = new Dictionary<string, string>();
129
130 sendData["REGIONID"] = regionID.ToString();
131
132 sendData["METHOD"] = "deregister";
133
134 try
135 {
136 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
137 m_ServerURI + "/grid",
138 ServerUtils.BuildQueryString(sendData));
139
140 if (reply != string.Empty)
141 {
142 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
143
144 if ((replyData["Result"] != null) && (replyData["Result"].ToString().ToLower() == "success"))
145 return true;
146 }
147 else
148 m_log.DebugFormat("[GRID CONNECTOR]: DeregisterRegion received null reply");
149 }
150 catch (Exception e)
151 {
152 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
153 }
154
155 return false;
156 }
157
158 public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
159 {
160 Dictionary<string, string> sendData = new Dictionary<string, string>();
161
162 sendData["SCOPEID"] = scopeID.ToString();
163 sendData["REGIONID"] = regionID.ToString();
164
165 sendData["METHOD"] = "get_neighbours";
166
167 List<GridRegion> rinfos = new List<GridRegion>();
168
169 string reqString = ServerUtils.BuildQueryString(sendData);
170 string reply = string.Empty;
171 try
172 {
173 reply = SynchronousRestFormsRequester.MakeRequest("POST",
174 m_ServerURI + "/grid",
175 reqString);
176 }
177 catch (Exception e)
178 {
179 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
180 return rinfos;
181 }
182
183 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
184
185 if (replyData != null)
186 {
187 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
188 //m_log.DebugFormat("[GRID CONNECTOR]: get neighbours returned {0} elements", rinfosList.Count);
189 foreach (object r in rinfosList)
190 {
191 if (r is Dictionary<string, object>)
192 {
193 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
194 rinfos.Add(rinfo);
195 }
196 else
197 m_log.DebugFormat("[GRID CONNECTOR]: GetNeighbours {0}, {1} received invalid response type {2}",
198 scopeID, regionID, r.GetType());
199 }
200 }
201 else
202 m_log.DebugFormat("[GRID CONNECTOR]: GetNeighbours {0}, {1} received null response",
203 scopeID, regionID);
204
205 return rinfos;
206 }
207
208 public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
209 {
210 Dictionary<string, string> sendData = new Dictionary<string, string>();
211
212 sendData["SCOPEID"] = scopeID.ToString();
213 sendData["REGIONID"] = regionID.ToString();
214
215 sendData["METHOD"] = "get_region_by_uuid";
216
217 string reply = string.Empty;
218 try
219 {
220 reply = SynchronousRestFormsRequester.MakeRequest("POST",
221 m_ServerURI + "/grid",
222 ServerUtils.BuildQueryString(sendData));
223 }
224 catch (Exception e)
225 {
226 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
227 return null;
228 }
229
230 GridRegion rinfo = null;
231
232 if (reply != string.Empty)
233 {
234 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
235
236 if ((replyData != null) && (replyData["result"] != null))
237 {
238 if (replyData["result"] is Dictionary<string, object>)
239 rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]);
240 //else
241 // m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByUUID {0}, {1} received null response",
242 // scopeID, regionID);
243 }
244 else
245 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByUUID {0}, {1} received null response",
246 scopeID, regionID);
247 }
248 else
249 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByUUID received null reply");
250
251 return rinfo;
252 }
253
254 public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
255 {
256 Dictionary<string, string> sendData = new Dictionary<string, string>();
257
258 sendData["SCOPEID"] = scopeID.ToString();
259 sendData["X"] = x.ToString();
260 sendData["Y"] = y.ToString();
261
262 sendData["METHOD"] = "get_region_by_position";
263 string reply = string.Empty;
264 try
265 {
266 reply = SynchronousRestFormsRequester.MakeRequest("POST",
267 m_ServerURI + "/grid",
268 ServerUtils.BuildQueryString(sendData));
269 }
270 catch (Exception e)
271 {
272 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
273 return null;
274 }
275
276 GridRegion rinfo = null;
277 if (reply != string.Empty)
278 {
279 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
280
281 if ((replyData != null) && (replyData["result"] != null))
282 {
283 if (replyData["result"] is Dictionary<string, object>)
284 rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]);
285 else
286 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received invalid response",
287 scopeID, x, y);
288 }
289 else
290 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received null response",
291 scopeID, x, y);
292 }
293 else
294 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply");
295
296 return rinfo;
297 }
298
299 public virtual GridRegion GetRegionByName(UUID scopeID, string regionName)
300 {
301 Dictionary<string, string> sendData = new Dictionary<string, string>();
302
303 sendData["SCOPEID"] = scopeID.ToString();
304 sendData["NAME"] = regionName;
305
306 sendData["METHOD"] = "get_region_by_name";
307 string reply = string.Empty;
308 try
309 {
310 reply = SynchronousRestFormsRequester.MakeRequest("POST",
311 m_ServerURI + "/grid",
312 ServerUtils.BuildQueryString(sendData));
313 }
314 catch (Exception e)
315 {
316 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
317 return null;
318 }
319
320 GridRegion rinfo = null;
321 if (reply != string.Empty)
322 {
323 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
324
325 if ((replyData != null) && (replyData["result"] != null))
326 {
327 if (replyData["result"] is Dictionary<string, object>)
328 rinfo = new GridRegion((Dictionary<string, object>)replyData["result"]);
329 }
330 else
331 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1} received null response",
332 scopeID, regionName);
333 }
334 else
335 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByName received null reply");
336
337 return rinfo;
338 }
339
340 public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
341 {
342 Dictionary<string, string> sendData = new Dictionary<string, string>();
343
344 sendData["SCOPEID"] = scopeID.ToString();
345 sendData["NAME"] = name;
346 sendData["MAX"] = maxNumber.ToString();
347
348 sendData["METHOD"] = "get_regions_by_name";
349 List<GridRegion> rinfos = new List<GridRegion>();
350 string reply = string.Empty;
351 try
352 {
353 reply = SynchronousRestFormsRequester.MakeRequest("POST",
354 m_ServerURI + "/grid",
355 ServerUtils.BuildQueryString(sendData));
356 }
357 catch (Exception e)
358 {
359 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
360 return rinfos;
361 }
362
363 if (reply != string.Empty)
364 {
365 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
366
367 if (replyData != null)
368 {
369 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
370 foreach (object r in rinfosList)
371 {
372 if (r is Dictionary<string, object>)
373 {
374 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
375 rinfos.Add(rinfo);
376 }
377 else
378 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionsByName {0}, {1}, {2} received invalid response",
379 scopeID, name, maxNumber);
380 }
381 }
382 else
383 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionsByName {0}, {1}, {2} received null response",
384 scopeID, name, maxNumber);
385 }
386 else
387 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionsByName received null reply");
388
389 return rinfos;
390 }
391
392 public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
393 {
394 Dictionary<string, string> sendData = new Dictionary<string, string>();
395
396 sendData["SCOPEID"] = scopeID.ToString();
397 sendData["XMIN"] = xmin.ToString();
398 sendData["XMAX"] = xmax.ToString();
399 sendData["YMIN"] = ymin.ToString();
400 sendData["YMAX"] = ymax.ToString();
401
402 sendData["METHOD"] = "get_region_range";
403
404 List<GridRegion> rinfos = new List<GridRegion>();
405 string reply = string.Empty;
406 try
407 {
408 reply = SynchronousRestFormsRequester.MakeRequest("POST",
409 m_ServerURI + "/grid",
410 ServerUtils.BuildQueryString(sendData));
411
412 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
413 }
414 catch (Exception e)
415 {
416 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
417 return rinfos;
418 }
419
420 if (reply != string.Empty)
421 {
422 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
423
424 if (replyData != null)
425 {
426 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
427 foreach (object r in rinfosList)
428 {
429 if (r is Dictionary<string, object>)
430 {
431 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
432 rinfos.Add(rinfo);
433 }
434 }
435 }
436 else
437 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionRange {0}, {1}-{2} {3}-{4} received null response",
438 scopeID, xmin, xmax, ymin, ymax);
439 }
440 else
441 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionRange received null reply");
442
443 return rinfos;
444 }
445
446 #endregion
447
448 }
449}
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
new file mode 100644
index 0000000..3d7f112
--- /dev/null
+++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
@@ -0,0 +1,252 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Text;
32using System.Drawing;
33using System.Net;
34using System.Reflection;
35using OpenSim.Services.Interfaces;
36using GridRegion = OpenSim.Services.Interfaces.GridRegion;
37
38using OpenSim.Framework;
39
40using OpenMetaverse;
41using OpenMetaverse.Imaging;
42using log4net;
43using Nwc.XmlRpc;
44
45namespace OpenSim.Services.Connectors.Grid
46{
47 public class HypergridServiceConnector
48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50
51 private IAssetService m_AssetService;
52
53 public HypergridServiceConnector(IAssetService assService)
54 {
55 m_AssetService = assService;
56 }
57
58 public UUID LinkRegion(GridRegion info, out ulong realHandle)
59 {
60 UUID uuid = UUID.Zero;
61 realHandle = 0;
62
63 Hashtable hash = new Hashtable();
64 hash["region_name"] = info.RegionName;
65
66 IList paramList = new ArrayList();
67 paramList.Add(hash);
68
69 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
70 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
71 m_log.Debug("[HGrid]: Linking to " + uri);
72 XmlRpcResponse response = null;
73 try
74 {
75 response = request.Send(uri, 10000);
76 }
77 catch (Exception e)
78 {
79 m_log.Debug("[HGrid]: Exception " + e.Message);
80 return uuid;
81 }
82
83 if (response.IsFault)
84 {
85 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
86 }
87 else
88 {
89 hash = (Hashtable)response.Value;
90 //foreach (Object o in hash)
91 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
92 try
93 {
94 UUID.TryParse((string)hash["uuid"], out uuid);
95 m_log.Debug(">> HERE, uuid: " + uuid);
96 info.RegionID = uuid;
97 if ((string)hash["handle"] != null)
98 {
99 realHandle = Convert.ToUInt64((string)hash["handle"]);
100 m_log.Debug(">> HERE, realHandle: " + realHandle);
101 }
102 //if (hash["region_image"] != null)
103 //{
104 // UUID img = UUID.Zero;
105 // UUID.TryParse((string)hash["region_image"], out img);
106 // info.RegionSettings.TerrainImageID = img;
107 //}
108 if (hash["region_name"] != null)
109 {
110 info.RegionName = (string)hash["region_name"];
111 //m_log.Debug(">> " + info.RegionName);
112 }
113 if (hash["internal_port"] != null)
114 {
115 int port = Convert.ToInt32((string)hash["internal_port"]);
116 info.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
117 //m_log.Debug(">> " + info.InternalEndPoint.ToString());
118 }
119
120 }
121 catch (Exception e)
122 {
123 m_log.Error("[HGrid]: Got exception while parsing hyperlink response " + e.StackTrace);
124 }
125 }
126 return uuid;
127 }
128
129 public void GetMapImage(GridRegion info)
130 {
131 try
132 {
133 string regionimage = "regionImage" + info.RegionID.ToString();
134 regionimage = regionimage.Replace("-", "");
135
136 WebClient c = new WebClient();
137 string uri = "http://" + info.ExternalHostName + ":" + info.HttpPort + "/index.php?method=" + regionimage;
138 //m_log.Debug("JPEG: " + uri);
139 c.DownloadFile(uri, info.RegionID.ToString() + ".jpg");
140 Bitmap m = new Bitmap(info.RegionID.ToString() + ".jpg");
141 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
142 byte[] imageData = OpenJPEG.EncodeFromImage(m, true);
143 AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString());
144
145 // !!! for now
146 //info.RegionSettings.TerrainImageID = ass.FullID;
147
148 ass.Type = (int)AssetType.Texture;
149 ass.Temporary = true;
150 ass.Local = true;
151 ass.Data = imageData;
152
153 m_AssetService.Store(ass);
154
155 }
156 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
157 {
158 m_log.Warn("[HGrid]: Failed getting/storing map image, because it is probably already in the cache");
159 }
160 }
161
162 public bool InformRegionOfUser(GridRegion regInfo, AgentCircuitData agentData, GridRegion home, string userServer, string assetServer, string inventoryServer)
163 {
164 string capsPath = agentData.CapsPath;
165 Hashtable loginParams = new Hashtable();
166 loginParams["session_id"] = agentData.SessionID.ToString();
167
168 loginParams["firstname"] = agentData.firstname;
169 loginParams["lastname"] = agentData.lastname;
170
171 loginParams["agent_id"] = agentData.AgentID.ToString();
172 loginParams["circuit_code"] = agentData.circuitcode.ToString();
173 loginParams["startpos_x"] = agentData.startpos.X.ToString();
174 loginParams["startpos_y"] = agentData.startpos.Y.ToString();
175 loginParams["startpos_z"] = agentData.startpos.Z.ToString();
176 loginParams["caps_path"] = capsPath;
177
178 if (home != null)
179 {
180 loginParams["region_uuid"] = home.RegionID.ToString();
181 loginParams["regionhandle"] = home.RegionHandle.ToString();
182 loginParams["home_address"] = home.ExternalHostName;
183 loginParams["home_port"] = home.HttpPort.ToString();
184 loginParams["internal_port"] = home.InternalEndPoint.Port.ToString();
185
186 m_log.Debug(" --------- Home -------");
187 m_log.Debug(" >> " + loginParams["home_address"] + " <<");
188 m_log.Debug(" >> " + loginParams["region_uuid"] + " <<");
189 m_log.Debug(" >> " + loginParams["regionhandle"] + " <<");
190 m_log.Debug(" >> " + loginParams["home_port"] + " <<");
191 m_log.Debug(" --------- ------------ -------");
192 }
193 else
194 m_log.WarnFormat("[HGrid]: Home region not found for {0} {1}", agentData.firstname, agentData.lastname);
195
196 loginParams["userserver_id"] = userServer;
197 loginParams["assetserver_id"] = assetServer;
198 loginParams["inventoryserver_id"] = inventoryServer;
199
200
201 ArrayList SendParams = new ArrayList();
202 SendParams.Add(loginParams);
203
204 // Send
205 string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/";
206 //m_log.Debug("XXX uri: " + uri);
207 XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams);
208 XmlRpcResponse reply;
209 try
210 {
211 reply = request.Send(uri, 6000);
212 }
213 catch (Exception e)
214 {
215 m_log.Warn("[HGrid]: Failed to notify region about user. Reason: " + e.Message);
216 return false;
217 }
218
219 if (!reply.IsFault)
220 {
221 bool responseSuccess = true;
222 if (reply.Value != null)
223 {
224 Hashtable resp = (Hashtable)reply.Value;
225 if (resp.ContainsKey("success"))
226 {
227 if ((string)resp["success"] == "FALSE")
228 {
229 responseSuccess = false;
230 }
231 }
232 }
233 if (responseSuccess)
234 {
235 m_log.Info("[HGrid]: Successfully informed remote region about user " + agentData.AgentID);
236 return true;
237 }
238 else
239 {
240 m_log.ErrorFormat("[HGrid]: Region responded that it is not available to receive clients");
241 return false;
242 }
243 }
244 else
245 {
246 m_log.ErrorFormat("[HGrid]: XmlRpc request to region failed with message {0}, code {1} ", reply.FaultString, reply.FaultCode);
247 return false;
248 }
249 }
250
251 }
252}
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index cef678d..5443891 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -236,42 +236,8 @@ namespace OpenSim.Services.Connectors
236 } 236 }
237 catch (Exception e) 237 catch (Exception e)
238 { 238 {
239 // Maybe we're talking to an old inventory server. Try this other thing. 239 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation failed, {0} {1} (old server?).",
240 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation failed, {0} {1} (old server?). Trying GetInventory.",
241 e.Source, e.Message); 240 e.Source, e.Message);
242
243 InventoryCollection inventory;
244 List<InventoryFolderBase> folders = null;
245 try
246 {
247 inventory = SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject(
248 "POST", m_ServerURI + "/GetInventory/", new Guid(userID), sessionID.ToString(), userID.ToString());
249 if (inventory != null)
250 folders = inventory.Folders;
251 }
252 catch (Exception ex)
253 {
254 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetInventory operation also failed, {0} {1}. Giving up.",
255 e.Source, ex.Message);
256 return new InventoryCollection();
257 }
258
259 if ((folders != null) && (folders.Count > 0))
260 {
261 m_log.DebugFormat("[INVENTORY CONNECTOR]: Received entire inventory ({0} folders) for user {1}",
262 folders.Count, userID);
263
264 folders = folders.FindAll(delegate(InventoryFolderBase f) { return f.ParentID == folderID; });
265 List<InventoryItemBase> items = inventory.Items;
266 if (items != null)
267 {
268 items = items.FindAll(delegate(InventoryItemBase i) { return i.Folder == folderID; });
269 }
270
271 inventory.Items = items;
272 inventory.Folders = folders;
273 return inventory;
274 }
275 } 241 }
276 242
277 InventoryCollection nullCollection = new InventoryCollection(); 243 InventoryCollection nullCollection = new InventoryCollection();
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index 0243f1f..06bc11c 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -38,6 +38,7 @@ using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
39using OpenMetaverse; 39using OpenMetaverse;
40using Nwc.XmlRpc; 40using Nwc.XmlRpc;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 42
42namespace OpenSim.Services.Connectors 43namespace OpenSim.Services.Connectors
43{ 44{
@@ -47,20 +48,20 @@ namespace OpenSim.Services.Connectors
47 LogManager.GetLogger( 48 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 49 MethodBase.GetCurrentMethod().DeclaringType);
49 50
50 protected IGridServices m_MapService = null; 51 protected IGridService m_GridService = null;
51 52
52 public LandServicesConnector() 53 public LandServicesConnector()
53 { 54 {
54 } 55 }
55 56
56 public LandServicesConnector(IGridServices gridServices) 57 public LandServicesConnector(IGridService gridServices)
57 { 58 {
58 Initialise(gridServices); 59 Initialise(gridServices);
59 } 60 }
60 61
61 public virtual void Initialise(IGridServices gridServices) 62 public virtual void Initialise(IGridService gridServices)
62 { 63 {
63 m_MapService = gridServices; 64 m_GridService = gridServices;
64 } 65 }
65 66
66 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) 67 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
@@ -76,7 +77,9 @@ namespace OpenSim.Services.Connectors
76 77
77 try 78 try
78 { 79 {
79 RegionInfo info = m_MapService.RequestNeighbourInfo(regionHandle); 80 uint xpos = 0, ypos = 0;
81 Utils.LongToUInts(regionHandle, out xpos, out ypos);
82 GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos);
80 if (info != null) // just to be sure 83 if (info != null) // just to be sure
81 { 84 {
82 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); 85 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
index 7fff537..145f212 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
@@ -41,6 +41,8 @@ using OpenSim.Services.Interfaces;
41using OpenMetaverse; 41using OpenMetaverse;
42using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
43 43
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45
44namespace OpenSim.Services.Connectors 46namespace OpenSim.Services.Connectors
45{ 47{
46 public class NeighbourServicesConnector : INeighbourService 48 public class NeighbourServicesConnector : INeighbourService
@@ -49,37 +51,39 @@ namespace OpenSim.Services.Connectors
49 LogManager.GetLogger( 51 LogManager.GetLogger(
50 MethodBase.GetCurrentMethod().DeclaringType); 52 MethodBase.GetCurrentMethod().DeclaringType);
51 53
52 protected IGridServices m_MapService = null; 54 protected IGridService m_GridService = null;
53 55
54 public NeighbourServicesConnector() 56 public NeighbourServicesConnector()
55 { 57 {
56 } 58 }
57 59
58 public NeighbourServicesConnector(IGridServices gridServices) 60 public NeighbourServicesConnector(IGridService gridServices)
59 { 61 {
60 Initialise(gridServices); 62 Initialise(gridServices);
61 } 63 }
62 64
63 public virtual void Initialise(IGridServices gridServices) 65 public virtual void Initialise(IGridService gridServices)
64 { 66 {
65 m_MapService = gridServices; 67 m_GridService = gridServices;
66 } 68 }
67 69
68 public virtual bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 70 public virtual GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
69 { 71 {
70 RegionInfo regInfo = m_MapService.RequestNeighbourInfo(regionHandle); 72 uint x = 0, y = 0;
73 Utils.LongToUInts(regionHandle, out x, out y);
74 GridRegion regInfo = m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
71 if ((regInfo != null) && 75 if ((regInfo != null) &&
72 // Don't remote-call this instance; that's a startup hickup 76 // Don't remote-call this instance; that's a startup hickup
73 !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) 77 !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort)))
74 { 78 {
75 return DoHelloNeighbourCall(regInfo, thisRegion); 79 DoHelloNeighbourCall(regInfo, thisRegion);
76 } 80 }
77 //else 81 //else
78 // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); 82 // m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
79 return false; 83 return regInfo;
80 } 84 }
81 85
82 public bool DoHelloNeighbourCall(RegionInfo region, RegionInfo thisRegion) 86 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
83 { 87 {
84 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; 88 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
85 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); 89 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
new file mode 100644
index 0000000..991acf2
--- /dev/null
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -0,0 +1,199 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Net;
31using System.Reflection;
32using Nini.Config;
33using log4net;
34using OpenSim.Framework;
35using OpenSim.Framework.Console;
36using OpenSim.Data;
37using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenMetaverse;
40
41namespace OpenSim.Services.GridService
42{
43 public class GridService : GridServiceBase, IGridService
44 {
45 private static readonly ILog m_log =
46 LogManager.GetLogger(
47 MethodBase.GetCurrentMethod().DeclaringType);
48
49 public GridService(IConfigSource config)
50 : base(config)
51 {
52 m_log.DebugFormat("[GRID SERVICE]: Starting...");
53 }
54
55 #region IGridService
56
57 public bool RegisterRegion(UUID scopeID, GridRegion regionInfos)
58 {
59 // This needs better sanity testing. What if regionInfo is registering in
60 // overlapping coords?
61 RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
62 if ((region != null) && (region.RegionID != regionInfos.RegionID))
63 {
64 m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.",
65 regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
66 return false;
67 }
68 if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
69 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
70 {
71 // Region reregistering in other coordinates. Delete the old entry
72 m_Database.Delete(regionInfos.RegionID);
73 }
74
75 // Everything is ok, let's register
76 RegionData rdata = RegionInfo2RegionData(regionInfos);
77 rdata.ScopeID = scopeID;
78 m_Database.Store(rdata);
79 return true;
80 }
81
82 public bool DeregisterRegion(UUID regionID)
83 {
84 return m_Database.Delete(regionID);
85 }
86
87 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
88 {
89 List<GridRegion> rinfos = new List<GridRegion>();
90 RegionData region = m_Database.Get(regionID, scopeID);
91 if (region != null)
92 {
93 // Not really? Maybe?
94 List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize,
95 region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID);
96
97 foreach (RegionData rdata in rdatas)
98 if (rdata.RegionID != regionID)
99 rinfos.Add(RegionData2RegionInfo(rdata));
100
101 }
102 return rinfos;
103 }
104
105 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
106 {
107 RegionData rdata = m_Database.Get(regionID, scopeID);
108 if (rdata != null)
109 return RegionData2RegionInfo(rdata);
110
111 return null;
112 }
113
114 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
115 {
116 int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize;
117 int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize;
118 RegionData rdata = m_Database.Get(snapX, snapY, scopeID);
119 if (rdata != null)
120 return RegionData2RegionInfo(rdata);
121
122 return null;
123 }
124
125 public GridRegion GetRegionByName(UUID scopeID, string regionName)
126 {
127 List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID);
128 if ((rdatas != null) && (rdatas.Count > 0))
129 return RegionData2RegionInfo(rdatas[0]); // get the first
130
131 return null;
132 }
133
134 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
135 {
136 List<RegionData> rdatas = m_Database.Get("%" + name + "%", scopeID);
137
138 int count = 0;
139 List<GridRegion> rinfos = new List<GridRegion>();
140
141 if (rdatas != null)
142 {
143 foreach (RegionData rdata in rdatas)
144 {
145 if (count++ < maxNumber)
146 rinfos.Add(RegionData2RegionInfo(rdata));
147 }
148 }
149
150 return rinfos;
151 }
152
153 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
154 {
155 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
156 int xmaxSnap = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize;
157 int yminSnap = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize;
158 int ymaxSnap = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize;
159
160 List<RegionData> rdatas = m_Database.Get(xminSnap, yminSnap, xmaxSnap, ymaxSnap, scopeID);
161 List<GridRegion> rinfos = new List<GridRegion>();
162 foreach (RegionData rdata in rdatas)
163 rinfos.Add(RegionData2RegionInfo(rdata));
164
165 return rinfos;
166 }
167
168 #endregion
169
170 #region Data structure conversions
171
172 protected RegionData RegionInfo2RegionData(GridRegion rinfo)
173 {
174 RegionData rdata = new RegionData();
175 rdata.posX = (int)rinfo.RegionLocX;
176 rdata.posY = (int)rinfo.RegionLocY;
177 rdata.RegionID = rinfo.RegionID;
178 rdata.RegionName = rinfo.RegionName;
179 rdata.Data = rinfo.ToKeyValuePairs();
180 rdata.Data["regionHandle"] = Utils.UIntsToLong((uint)rdata.posX, (uint)rdata.posY);
181 return rdata;
182 }
183
184 protected GridRegion RegionData2RegionInfo(RegionData rdata)
185 {
186 GridRegion rinfo = new GridRegion(rdata.Data);
187 rinfo.RegionLocX = rdata.posX;
188 rinfo.RegionLocY = rdata.posY;
189 rinfo.RegionID = rdata.RegionID;
190 rinfo.RegionName = rdata.RegionName;
191 rinfo.ScopeID = rdata.ScopeID;
192
193 return rinfo;
194 }
195
196 #endregion
197
198 }
199}
diff --git a/OpenSim/Services/GridService/GridServiceBase.cs b/OpenSim/Services/GridService/GridServiceBase.cs
new file mode 100644
index 0000000..444f79b
--- /dev/null
+++ b/OpenSim/Services/GridService/GridServiceBase.cs
@@ -0,0 +1,84 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Reflection;
30using Nini.Config;
31using OpenSim.Framework;
32using OpenSim.Data;
33using OpenSim.Services.Interfaces;
34using OpenSim.Services.Base;
35
36namespace OpenSim.Services.GridService
37{
38 public class GridServiceBase : ServiceBase
39 {
40 protected IRegionData m_Database = null;
41
42 public GridServiceBase(IConfigSource config)
43 : base(config)
44 {
45 string dllName = String.Empty;
46 string connString = String.Empty;
47 string realm = "regions";
48
49 //
50 // Try reading the [DatabaseService] section, if it exists
51 //
52 IConfig dbConfig = config.Configs["DatabaseService"];
53 if (dbConfig != null)
54 {
55 if (dllName == String.Empty)
56 dllName = dbConfig.GetString("StorageProvider", String.Empty);
57 if (connString == String.Empty)
58 connString = dbConfig.GetString("ConnectionString", String.Empty);
59 }
60
61 //
62 // [GridService] section overrides [DatabaseService], if it exists
63 //
64 IConfig gridConfig = config.Configs["GridService"];
65 if (gridConfig != null)
66 {
67 dllName = gridConfig.GetString("StorageProvider", dllName);
68 connString = gridConfig.GetString("ConnectionString", connString);
69 realm = gridConfig.GetString("Realm", realm);
70 }
71
72 //
73 // We tried, but this doesn't exist. We can't proceed.
74 //
75 if (dllName.Equals(String.Empty))
76 throw new Exception("No StorageProvider configured");
77
78 m_Database = LoadPlugin<IRegionData>(dllName, new Object[] { connString, realm });
79 if (m_Database == null)
80 throw new Exception("Could not find a storage interface in the given module");
81
82 }
83 }
84}
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index ac4539a..2290530 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -25,8 +25,11 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using OpenSim.Framework; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net;
31using System.Net.Sockets;
32using OpenSim.Framework;
30using OpenMetaverse; 33using OpenMetaverse;
31 34
32namespace OpenSim.Services.Interfaces 35namespace OpenSim.Services.Interfaces
@@ -39,7 +42,7 @@ namespace OpenSim.Services.Interfaces
39 /// <param name="regionInfos"> </param> 42 /// <param name="regionInfos"> </param>
40 /// <returns></returns> 43 /// <returns></returns>
41 /// <exception cref="System.Exception">Thrown if region registration failed</exception> 44 /// <exception cref="System.Exception">Thrown if region registration failed</exception>
42 bool RegisterRegion(UUID scopeID, RegionInfo regionInfos); 45 bool RegisterRegion(UUID scopeID, GridRegion regionInfos);
43 46
44 /// <summary> 47 /// <summary>
45 /// Deregister a region with the grid service. 48 /// Deregister a region with the grid service.
@@ -47,21 +50,28 @@ namespace OpenSim.Services.Interfaces
47 /// <param name="regionID"></param> 50 /// <param name="regionID"></param>
48 /// <returns></returns> 51 /// <returns></returns>
49 /// <exception cref="System.Exception">Thrown if region deregistration failed</exception> 52 /// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
50 bool DeregisterRegion(UUID regionID); 53 bool DeregisterRegion(UUID regionID);
51 54
52 /// <summary> 55 /// <summary>
53 /// Get information about the regions neighbouring the given co-ordinates. 56 /// Get information about the regions neighbouring the given co-ordinates (in meters).
54 /// </summary> 57 /// </summary>
55 /// <param name="x"></param> 58 /// <param name="x"></param>
56 /// <param name="y"></param> 59 /// <param name="y"></param>
57 /// <returns></returns> 60 /// <returns></returns>
58 List<SimpleRegionInfo> GetNeighbours(UUID scopeID, uint x, uint y); 61 List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID);
59 62
60 SimpleRegionInfo GetRegionByUUID(UUID scopeID, UUID regionID); 63 GridRegion GetRegionByUUID(UUID scopeID, UUID regionID);
64
65 /// <summary>
66 /// Get the region at the given position (in meters)
67 /// </summary>
68 /// <param name="scopeID"></param>
69 /// <param name="x"></param>
70 /// <param name="y"></param>
71 /// <returns></returns>
72 GridRegion GetRegionByPosition(UUID scopeID, int x, int y);
61 73
62 SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y); 74 GridRegion GetRegionByName(UUID scopeID, string regionName);
63
64 SimpleRegionInfo GetRegionByName(UUID scopeID, string regionName);
65 75
66 /// <summary> 76 /// <summary>
67 /// Get information about regions starting with the provided name. 77 /// Get information about regions starting with the provided name.
@@ -76,11 +86,266 @@ namespace OpenSim.Services.Interfaces
76 /// A list of <see cref="RegionInfo"/>s of regions with matching name. If the 86 /// A list of <see cref="RegionInfo"/>s of regions with matching name. If the
77 /// grid-server couldn't be contacted or returned an error, return null. 87 /// grid-server couldn't be contacted or returned an error, return null.
78 /// </returns> 88 /// </returns>
79 List<SimpleRegionInfo> GetRegionsByName(UUID scopeID, string name, int maxNumber); 89 List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber);
90
91 List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax);
92
93 }
94
95 public class GridRegion
96 {
97
98 /// <summary>
99 /// The port by which http communication occurs with the region
100 /// </summary>
101 public uint HttpPort
102 {
103 get { return m_httpPort; }
104 set { m_httpPort = value; }
105 }
106 protected uint m_httpPort;
107
108 /// <summary>
109 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
110 /// </summary>
111 public string ServerURI
112 {
113 get { return m_serverURI; }
114 set { m_serverURI = value; }
115 }
116 protected string m_serverURI;
117
118 public string RegionName
119 {
120 get { return m_regionName; }
121 set { m_regionName = value; }
122 }
123 protected string m_regionName = String.Empty;
124
125 protected string m_externalHostName;
126
127 protected IPEndPoint m_internalEndPoint;
128
129 public int RegionLocX
130 {
131 get { return m_regionLocX; }
132 set { m_regionLocX = value; }
133 }
134 protected int m_regionLocX;
135
136 public int RegionLocY
137 {
138 get { return m_regionLocY; }
139 set { m_regionLocY = value; }
140 }
141 protected int m_regionLocY;
142
143 public UUID RegionID = UUID.Zero;
144 public UUID ScopeID = UUID.Zero;
145
146 public UUID TerrainImage = UUID.Zero;
147 public byte Access;
148 public int Maturity;
149 public string RegionSecret;
150
151 public GridRegion()
152 {
153 }
154
155 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
156 {
157 m_regionLocX = regionLocX;
158 m_regionLocY = regionLocY;
80 159
160 m_internalEndPoint = internalEndPoint;
161 m_externalHostName = externalUri;
162 }
81 163
82 // Not sure about these two (diva) 164 public GridRegion(int regionLocX, int regionLocY, string externalUri, uint port)
165 {
166 m_regionLocX = regionLocX;
167 m_regionLocY = regionLocY;
83 168
169 m_externalHostName = externalUri;
84 170
171 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
172 }
173
174 public GridRegion(uint xcell, uint ycell)
175 {
176 m_regionLocX = (int)(xcell * Constants.RegionSize);
177 m_regionLocY = (int)(ycell * Constants.RegionSize);
178 }
179
180 public GridRegion(RegionInfo ConvertFrom)
181 {
182 m_regionName = ConvertFrom.RegionName;
183 m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize);
184 m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize);
185 m_internalEndPoint = ConvertFrom.InternalEndPoint;
186 m_externalHostName = ConvertFrom.ExternalHostName;
187 m_httpPort = ConvertFrom.HttpPort;
188 RegionID = ConvertFrom.RegionID;
189 ServerURI = ConvertFrom.ServerURI;
190 TerrainImage = ConvertFrom.RegionSettings.TerrainImageID;
191 Access = ConvertFrom.AccessLevel;
192 Maturity = ConvertFrom.RegionSettings.Maturity;
193 RegionSecret = ConvertFrom.regionSecret;
194 }
195
196 public GridRegion(GridRegion ConvertFrom)
197 {
198 m_regionName = ConvertFrom.RegionName;
199 m_regionLocX = ConvertFrom.RegionLocX;
200 m_regionLocY = ConvertFrom.RegionLocY;
201 m_internalEndPoint = ConvertFrom.InternalEndPoint;
202 m_externalHostName = ConvertFrom.ExternalHostName;
203 m_httpPort = ConvertFrom.HttpPort;
204 RegionID = ConvertFrom.RegionID;
205 ServerURI = ConvertFrom.ServerURI;
206 TerrainImage = ConvertFrom.TerrainImage;
207 Access = ConvertFrom.Access;
208 Maturity = ConvertFrom.Maturity;
209 RegionSecret = ConvertFrom.RegionSecret;
210 }
211
212 /// <value>
213 /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
214 ///
215 /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
216 /// </value>
217 public IPEndPoint ExternalEndPoint
218 {
219 get
220 {
221 // Old one defaults to IPv6
222 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
223
224 IPAddress ia = null;
225 // If it is already an IP, don't resolve it - just return directly
226 if (IPAddress.TryParse(m_externalHostName, out ia))
227 return new IPEndPoint(ia, m_internalEndPoint.Port);
228
229 // Reset for next check
230 ia = null;
231 try
232 {
233 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
234 {
235 if (ia == null)
236 ia = Adr;
237
238 if (Adr.AddressFamily == AddressFamily.InterNetwork)
239 {
240 ia = Adr;
241 break;
242 }
243 }
244 }
245 catch (SocketException e)
246 {
247 throw new Exception(
248 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
249 e + "' attached to this exception", e);
250 }
251
252 return new IPEndPoint(ia, m_internalEndPoint.Port);
253 }
254
255 set { m_externalHostName = value.ToString(); }
256 }
257
258 public string ExternalHostName
259 {
260 get { return m_externalHostName; }
261 set { m_externalHostName = value; }
262 }
263
264 public IPEndPoint InternalEndPoint
265 {
266 get { return m_internalEndPoint; }
267 set { m_internalEndPoint = value; }
268 }
269
270 public ulong RegionHandle
271 {
272 get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); }
273 }
274
275 public int getInternalEndPointPort()
276 {
277 return m_internalEndPoint.Port;
278 }
279
280 public Dictionary<string, object> ToKeyValuePairs()
281 {
282 Dictionary<string, object> kvp = new Dictionary<string, object>();
283 kvp["uuid"] = RegionID.ToString();
284 kvp["locX"] = RegionLocX.ToString();
285 kvp["locY"] = RegionLocY.ToString();
286 kvp["regionName"] = RegionName;
287 kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
288 kvp["serverHttpPort"] = HttpPort.ToString();
289 kvp["serverURI"] = ServerURI;
290 kvp["serverPort"] = InternalEndPoint.Port.ToString();
291 kvp["regionMapTexture"] = TerrainImage.ToString();
292 kvp["access"] = Access.ToString();
293 kvp["regionSecret"] = RegionSecret;
294 // Maturity doesn't seem to exist in the DB
295 return kvp;
296 }
297
298 public GridRegion(Dictionary<string, object> kvp)
299 {
300 if (kvp.ContainsKey("uuid"))
301 RegionID = new UUID((string)kvp["uuid"]);
302
303 if (kvp.ContainsKey("locX"))
304 RegionLocX = Convert.ToInt32((string)kvp["locX"]);
305
306 if (kvp.ContainsKey("locY"))
307 RegionLocY = Convert.ToInt32((string)kvp["locY"]);
308
309 if (kvp.ContainsKey("regionName"))
310 RegionName = (string)kvp["regionName"];
311
312 if (kvp.ContainsKey("serverIP"))
313 {
314 //int port = 0;
315 //Int32.TryParse((string)kvp["serverPort"], out port);
316 //IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["serverIP"]), port);
317 ExternalHostName = (string)kvp["serverIP"];
318 }
319 else
320 ExternalHostName = "127.0.0.1";
321
322 if (kvp.ContainsKey("serverPort"))
323 {
324 Int32 port = 0;
325 Int32.TryParse((string)kvp["serverPort"], out port);
326 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
327 }
328
329 if (kvp.ContainsKey("serverHttpPort"))
330 {
331 UInt32 port = 0;
332 UInt32.TryParse((string)kvp["serverHttpPort"], out port);
333 HttpPort = port;
334 }
335
336 if (kvp.ContainsKey("serverURI"))
337 ServerURI = (string)kvp["serverURI"];
338
339 if (kvp.ContainsKey("regionMapTexture"))
340 UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage);
341
342 if (kvp.ContainsKey("access"))
343 Access = Byte.Parse((string)kvp["access"]);
344
345 if (kvp.ContainsKey("regionSecret"))
346 RegionSecret =(string)kvp["regionSecret"];
347
348 }
85 } 349 }
350
86} 351}
diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Services/Interfaces/IHyperlink.cs
index ad5281d..ed3ff23 100644
--- a/OpenSim/Framework/Servers/CheckSumServer.cs
+++ b/OpenSim/Services/Interfaces/IHyperlink.cs
@@ -24,3 +24,26 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27
28using OpenSim.Framework;
29using GridRegion = OpenSim.Services.Interfaces.GridRegion;
30
31using OpenMetaverse;
32
33namespace OpenSim.Services.Interfaces
34{
35 public interface IHyperlinkService
36 {
37 GridRegion TryLinkRegion(IClientAPI client, string regionDescriptor);
38 GridRegion GetHyperlinkRegion(ulong handle);
39 ulong FindRegionHandle(ulong handle);
40
41 bool SendUserInformation(GridRegion region, AgentCircuitData aCircuit);
42 void AdjustUserInformation(AgentCircuitData aCircuit);
43
44 bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome);
45 void AcceptUser(ForeignUserProfileData user, GridRegion home);
46
47 bool IsLocalUser(UUID userID);
48 }
49}
diff --git a/OpenSim/Services/Interfaces/INeighbourService.cs b/OpenSim/Services/Interfaces/INeighbourService.cs
index 3944486..960e13d 100644
--- a/OpenSim/Services/Interfaces/INeighbourService.cs
+++ b/OpenSim/Services/Interfaces/INeighbourService.cs
@@ -28,11 +28,12 @@
28using System; 28using System;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using GridRegion = OpenSim.Services.Interfaces.GridRegion;
31 32
32namespace OpenSim.Services.Interfaces 33namespace OpenSim.Services.Interfaces
33{ 34{
34 public interface INeighbourService 35 public interface INeighbourService
35 { 36 {
36 bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion); 37 GridRegion HelloNeighbour(ulong regionHandle, RegionInfo otherRegion);
37 } 38 }
38} 39}
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index b98e256..70c55a5 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -251,7 +251,7 @@ namespace OpenSim.Services.InventoryService
251 251
252 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID); 252 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID);
253 253
254 return invCollection; 254 return invCollection;
255 } 255 }
256 256
257 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) 257 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs
new file mode 100644
index 0000000..8798c5e
--- /dev/null
+++ b/OpenSim/Tests/Clients/Grid/GridClient.cs
@@ -0,0 +1,204 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31using System.Reflection;
32
33using OpenMetaverse;
34using log4net;
35using log4net.Appender;
36using log4net.Layout;
37
38using OpenSim.Framework;
39using OpenSim.Services.Interfaces;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41using OpenSim.Services.Connectors;
42
43namespace OpenSim.Tests.Clients.GridClient
44{
45 public class GridClient
46 {
47 private static readonly ILog m_log =
48 LogManager.GetLogger(
49 MethodBase.GetCurrentMethod().DeclaringType);
50
51 public static void Main(string[] args)
52 {
53 ConsoleAppender consoleAppender = new ConsoleAppender();
54 consoleAppender.Layout =
55 new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline");
56 log4net.Config.BasicConfigurator.Configure(consoleAppender);
57
58 string serverURI = "http://127.0.0.1:8001";
59 GridServicesConnector m_Connector = new GridServicesConnector(serverURI);
60
61 GridRegion r1 = CreateRegion("Test Region 1", 1000, 1000);
62 GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000);
63 GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000);
64
65 Console.WriteLine("[GRID CLIENT]: *** Registering region 1");
66 bool success = m_Connector.RegisterRegion(UUID.Zero, r1);
67 if (success)
68 Console.WriteLine("[GRID CLIENT]: Successfully registered region 1");
69 else
70 Console.WriteLine("[GRID CLIENT]: region 1 failed to register");
71
72 Console.WriteLine("[GRID CLIENT]: *** Registering region 2");
73 success = m_Connector.RegisterRegion(UUID.Zero, r2);
74 if (success)
75 Console.WriteLine("[GRID CLIENT]: Successfully registered region 2");
76 else
77 Console.WriteLine("[GRID CLIENT]: region 2 failed to register");
78
79 Console.WriteLine("[GRID CLIENT]: *** Registering region 3");
80 success = m_Connector.RegisterRegion(UUID.Zero, r3);
81 if (success)
82 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3");
83 else
84 Console.WriteLine("[GRID CLIENT]: region 3 failed to register");
85
86
87 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3");
88 success = m_Connector.DeregisterRegion(r3.RegionID);
89 if (success)
90 Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3");
91 else
92 Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister");
93 Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again");
94 success = m_Connector.RegisterRegion(UUID.Zero, r3);
95 if (success)
96 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3");
97 else
98 Console.WriteLine("[GRID CLIENT]: region 3 failed to register");
99
100 Console.WriteLine("[GRID CLIENT]: *** GetNeighbours of region 1");
101 List<GridRegion> regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID);
102 if (regions == null)
103 Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed");
104 else if (regions.Count > 0)
105 {
106 if (regions.Count != 1)
107 Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned more neighbours than expected: " + regions.Count);
108 else
109 Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned the right neighbour " + regions[0].RegionName);
110 }
111 else
112 Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours");
113
114
115 Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of region 2 (this should succeed)");
116 GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID);
117 if (region == null)
118 Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null");
119 else
120 Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName);
121
122 Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of non-existent region (this should fail)");
123 region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random());
124 if (region == null)
125 Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null");
126 else
127 Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName);
128
129 Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of region 3 (this should succeed)");
130 region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName);
131 if (region == null)
132 Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null");
133 else
134 Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName);
135
136 Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of non-existent region (this should fail)");
137 region = m_Connector.GetRegionByName(UUID.Zero, "Foo");
138 if (region == null)
139 Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null");
140 else
141 Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName);
142
143 Console.WriteLine("[GRID CLIENT]: *** GetRegionsByName (this should return 3 regions)");
144 regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10);
145 if (regions == null)
146 Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned null");
147 else
148 Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions");
149
150 Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)");
151 regions = m_Connector.GetRegionRange(UUID.Zero,
152 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize,
153 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize);
154 if (regions == null)
155 Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null");
156 else
157 Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions");
158 Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)");
159 regions = m_Connector.GetRegionRange(UUID.Zero,
160 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize,
161 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize);
162 if (regions == null)
163 Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null");
164 else
165 Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions");
166
167 Console.Write("Proceed to deregister? Press enter...");
168 Console.ReadLine();
169
170 // Deregister them all
171 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 1");
172 success = m_Connector.DeregisterRegion(r1.RegionID);
173 if (success)
174 Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 1");
175 else
176 Console.WriteLine("[GRID CLIENT]: region 1 failed to deregister");
177 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 2");
178 success = m_Connector.DeregisterRegion(r2.RegionID);
179 if (success)
180 Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 2");
181 else
182 Console.WriteLine("[GRID CLIENT]: region 2 failed to deregister");
183 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3");
184 success = m_Connector.DeregisterRegion(r3.RegionID);
185 if (success)
186 Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3");
187 else
188 Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister");
189
190 }
191
192 private static GridRegion CreateRegion(string name, uint xcell, uint ycell)
193 {
194 GridRegion region = new GridRegion(xcell, ycell);
195 region.RegionName = name;
196 region.RegionID = UUID.Random();
197 region.ExternalHostName = "127.0.0.1";
198 region.HttpPort = 9000;
199 region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000);
200
201 return region;
202 }
203 }
204}
diff --git a/OpenSim/Tests/Clients/Grid/GridForm.html b/OpenSim/Tests/Clients/Grid/GridForm.html
new file mode 100644
index 0000000..252920f
--- /dev/null
+++ b/OpenSim/Tests/Clients/Grid/GridForm.html
@@ -0,0 +1,11 @@
1<html>
2
3<form name="input" action="http://127.0.0.1:8002/grid" method="post">
4xmin:<input type="text" name="XMIN" value="0">
5xmax:<input type="text" name="XMAX" value="0">
6ymin:<input type="text" name="YMIN" value="0">
7ymax:<input type="text" name="YMAX" value="0">
8<input type="hidden" name="METHOD" value="get_region_range">
9<input type="submit" value="Submit" />
10</form>
11</html>
diff --git a/OpenSim/Tests/Common/LongRunningAttribute.cs b/OpenSim/Tests/Common/LongRunningAttribute.cs
index 37cbbcd..9831ea8 100644
--- a/OpenSim/Tests/Common/LongRunningAttribute.cs
+++ b/OpenSim/Tests/Common/LongRunningAttribute.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common
43 } 43 }
44 44
45 protected LongRunningAttribute(string category) : base(category) 45 protected LongRunningAttribute(string category) : base(category)
46 { 46 {
47 } 47 }
48 } 48 }
49} 49}
diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
index 3981fe9..20ea18f 100644
--- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Tests.Common.Mock
39 /// tests are single threaded. 39 /// tests are single threaded.
40 /// </summary> 40 /// </summary>
41 public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin 41 public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin
42 { 42 {
43 public string Version { get { return "0"; } } 43 public string Version { get { return "0"; } }
44 public string Name { get { return "TestAssetDataPlugin"; } } 44 public string Name { get { return "TestAssetDataPlugin"; } }
45 45
@@ -59,6 +59,6 @@ namespace OpenSim.Tests.Common.Mock
59 assets.Add(asset); 59 assets.Add(asset);
60 } 60 }
61 61
62 public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } 62 public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); }
63 } 63 }
64} \ No newline at end of file 64} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs
index 81f123a..317ec06 100644
--- a/OpenSim/Tests/Common/Mock/TestAssetService.cs
+++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Tests.Common.Mock
49 if (Assets.ContainsKey(id)) 49 if (Assets.ContainsKey(id))
50 asset = Assets[id]; 50 asset = Assets[id];
51 else 51 else
52 asset = null; 52 asset = null;
53 53
54 return asset; 54 return asset;
55 } 55 }
@@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock
65 } 65 }
66 66
67 public bool Get(string id, object sender, AssetRetrieved handler) 67 public bool Get(string id, object sender, AssetRetrieved handler)
68 { 68 {
69 handler(id, sender, Get(id)); 69 handler(id, sender, Get(id));
70 70
71 return true; 71 return true;
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
index 4313c96..013462e 100644
--- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
+++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock
56 56
57 public TestCommunicationsManager(NetworkServersInfo serversInfo) 57 public TestCommunicationsManager(NetworkServersInfo serversInfo)
58 : base(serversInfo, null) 58 : base(serversInfo, null)
59 { 59 {
60 60
61 LocalUserServices lus = new LocalUserServices(991, 992, this); 61 LocalUserServices lus = new LocalUserServices(991, 992, this);
62 lus.AddPlugin(new TemporaryUserProfilePlugin()); 62 lus.AddPlugin(new TemporaryUserProfilePlugin());
@@ -65,8 +65,6 @@ namespace OpenSim.Tests.Common.Mock
65 m_userService = lus; 65 m_userService = lus;
66 m_userAdminService = lus; 66 m_userAdminService = lus;
67 67
68 LocalBackEndServices gs = new LocalBackEndServices();
69 m_gridService = gs;
70 } 68 }
71 } 69 }
72} 70}
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
index daef38b..0c7ebca 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Tests.Common.Mock
52 //// <value> 52 //// <value>
53 /// Inventory items 53 /// Inventory items
54 /// </value> 54 /// </value>
55 private Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>(); 55 private Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>();
56 56
57 /// <value> 57 /// <value>
58 /// User root folders 58 /// User root folders
@@ -120,7 +120,7 @@ namespace OpenSim.Tests.Common.Mock
120 } 120 }
121 121
122 return folders; 122 return folders;
123 } 123 }
124 124
125 public InventoryFolderBase getInventoryFolder(UUID folderId) 125 public InventoryFolderBase getInventoryFolder(UUID folderId)
126 { 126 {
@@ -191,7 +191,7 @@ namespace OpenSim.Tests.Common.Mock
191 public InventoryItemBase queryInventoryItem(UUID item) 191 public InventoryItemBase queryInventoryItem(UUID item)
192 { 192 {
193 return null; 193 return null;
194 } 194 }
195 195
196 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } 196 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; }
197 } 197 }
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
index f7eda68..01b5203 100644
--- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs
+++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
@@ -31,7 +31,7 @@ using OpenSim.Framework;
31using OpenSim.Region.Framework.Interfaces; 31using OpenSim.Region.Framework.Interfaces;
32 32
33namespace OpenSim.Tests.Common.Mock 33namespace OpenSim.Tests.Common.Mock
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// Land channel for test purposes 36 /// Land channel for test purposes
37 /// </summary> 37 /// </summary>
@@ -40,7 +40,7 @@ namespace OpenSim.Tests.Common.Mock
40 public List<ILandObject> ParcelsNearPoint(Vector3 position) { return null; } 40 public List<ILandObject> ParcelsNearPoint(Vector3 position) { return null; }
41 public List<ILandObject> AllParcels() { return null; } 41 public List<ILandObject> AllParcels() { return null; }
42 public ILandObject GetLandObject(int x, int y) { return null; } 42 public ILandObject GetLandObject(int x, int y) { return null; }
43 public ILandObject GetLandObject(int localID) { return null; } 43 public ILandObject GetLandObject(int localID) { return null; }
44 public ILandObject GetLandObject(float x, float y) { return null; } 44 public ILandObject GetLandObject(float x, float y) { return null; }
45 public bool IsLandPrimCountTainted() { return false; } 45 public bool IsLandPrimCountTainted() { return false; }
46 public bool IsForcefulBansAllowed() { return false; } 46 public bool IsForcefulBansAllowed() { return false; }
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs
index 3fc22ba..22cfa2c 100644
--- a/OpenSim/Tests/Common/Mock/TestScene.cs
+++ b/OpenSim/Tests/Common/Mock/TestScene.cs
@@ -35,9 +35,9 @@ using OpenSim.Region.Framework;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36 36
37namespace OpenSim.Tests.Common.Mock 37namespace OpenSim.Tests.Common.Mock
38{ 38{
39 public class TestScene : Scene 39 public class TestScene : Scene
40 { 40 {
41 public TestScene( 41 public TestScene(
42 RegionInfo regInfo, AgentCircuitManager authen, 42 RegionInfo regInfo, AgentCircuitManager authen,
43 CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, 43 CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager,
@@ -60,7 +60,7 @@ namespace OpenSim.Tests.Common.Mock
60 { 60 {
61 reason = String.Empty; 61 reason = String.Empty;
62 return true; 62 return true;
63 } 63 }
64 64
65 public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter 65 public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter
66 { 66 {
diff --git a/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs b/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs
new file mode 100644
index 0000000..eaf8b39
--- /dev/null
+++ b/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs
@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31using NUnit.Framework;
32using OpenSim.Framework;
33using OpenSim.Framework.Servers;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Tests.Common.Mock;
36
37namespace OpenSim.Tests.Common.Setup
38{
39 public class BaseRequestHandlerTestHelper
40 {
41 private static string[] m_emptyStringArray = new string[] { };
42
43 public static void BaseTestGetParams(BaseRequestHandler handler, string assetsPath)
44 {
45 Assert.AreEqual(String.Empty, handler.GetParam(null), "Failed on null path.");
46 Assert.AreEqual(String.Empty, handler.GetParam(""), "Failed on empty path.");
47 Assert.AreEqual(String.Empty, handler.GetParam("s"), "Failed on short url.");
48 Assert.AreEqual(String.Empty, handler.GetParam("corruptUrl"), "Failed on corruptUrl.");
49
50 Assert.AreEqual(String.Empty, handler.GetParam(assetsPath));
51 Assert.AreEqual("/", handler.GetParam(assetsPath + "/"));
52 Assert.AreEqual("/a", handler.GetParam(assetsPath + "/a"));
53 Assert.AreEqual("/b/", handler.GetParam(assetsPath + "/b/"));
54 Assert.AreEqual("/c/d", handler.GetParam(assetsPath + "/c/d"));
55 Assert.AreEqual("/e/f/", handler.GetParam(assetsPath + "/e/f/"));
56 }
57
58 public static void BaseTestSplitParams(BaseRequestHandler handler, string assetsPath)
59 {
60 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(null), "Failed on null.");
61 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(""), "Failed on empty path.");
62 Assert.AreEqual(m_emptyStringArray, handler.SplitParams("corruptUrl"), "Failed on corrupt url.");
63
64 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath), "Failed on empty params.");
65 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath + "/"), "Failed on single slash.");
66
67 Assert.AreEqual(new string[] { "a" }, handler.SplitParams(assetsPath + "/a"), "Failed on first segment.");
68 Assert.AreEqual(new string[] { "b" }, handler.SplitParams(assetsPath + "/b/"), "Failed on second slash.");
69 Assert.AreEqual(new string[] { "c", "d" }, handler.SplitParams(assetsPath + "/c/d"), "Failed on second segment.");
70 Assert.AreEqual(new string[] { "e", "f" }, handler.SplitParams(assetsPath + "/e/f/"), "Failed on trailing slash.");
71 }
72
73 public static byte[] EmptyByteArray = new byte[] {};
74
75 }
76}
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 0d8baad..53f24d9 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -44,6 +44,7 @@ using OpenSim.Region.CoreModules.Agent.Capabilities;
44using OpenSim.Region.CoreModules.Avatar.Gods; 44using OpenSim.Region.CoreModules.Avatar.Gods;
45using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; 45using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset;
46using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; 46using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory;
47using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
47using OpenSim.Services.Interfaces; 48using OpenSim.Services.Interfaces;
48using OpenSim.Tests.Common.Mock; 49using OpenSim.Tests.Common.Mock;
49 50
@@ -58,6 +59,7 @@ namespace OpenSim.Tests.Common.Setup
58 // CommunicationsManager. 59 // CommunicationsManager.
59 private static ISharedRegionModule m_assetService = null; 60 private static ISharedRegionModule m_assetService = null;
60 private static ISharedRegionModule m_inventoryService = null; 61 private static ISharedRegionModule m_inventoryService = null;
62 private static ISharedRegionModule m_gridService = null;
61 private static TestCommunicationsManager commsManager = null; 63 private static TestCommunicationsManager commsManager = null;
62 64
63 /// <summary> 65 /// <summary>
@@ -110,6 +112,7 @@ namespace OpenSim.Tests.Common.Setup
110 return SetupScene(name, id, x, y, cm, ""); 112 return SetupScene(name, id, x, y, cm, "");
111 } 113 }
112 114
115
113 /// <summary> 116 /// <summary>
114 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions 117 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
115 /// or a different, to get a brand new scene with new shared region modules. 118 /// or a different, to get a brand new scene with new shared region modules.
@@ -176,6 +179,9 @@ namespace OpenSim.Tests.Common.Setup
176 StartInventoryService(testScene, true); 179 StartInventoryService(testScene, true);
177 else 180 else
178 StartInventoryService(testScene, false); 181 StartInventoryService(testScene, false);
182 if (realServices.Contains("grid"))
183 StartGridService(testScene, true);
184
179 } 185 }
180 // If not, make sure the shared module gets references to this new scene 186 // If not, make sure the shared module gets references to this new scene
181 else 187 else
@@ -241,6 +247,29 @@ namespace OpenSim.Tests.Common.Setup
241 m_inventoryService = inventoryService; 247 m_inventoryService = inventoryService;
242 } 248 }
243 249
250 private static void StartGridService(Scene testScene, bool real)
251 {
252 IConfigSource config = new IniConfigSource();
253 config.AddConfig("Modules");
254 config.AddConfig("GridService");
255 config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
256 config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
257 if (real)
258 config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
259 if (m_gridService == null)
260 {
261 ISharedRegionModule gridService = new LocalGridServicesConnector();
262 gridService.Initialise(config);
263 m_gridService = gridService;
264 }
265 //else
266 // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
267 m_gridService.AddRegion(testScene);
268 m_gridService.RegionLoaded(testScene);
269 //testScene.AddRegionModule(m_gridService.Name, m_gridService);
270 }
271
272
244 /// <summary> 273 /// <summary>
245 /// Setup modules for a scene using their default settings. 274 /// Setup modules for a scene using their default settings.
246 /// </summary> 275 /// </summary>
diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
index 3528072..7e0c567 100644
--- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
@@ -31,10 +31,10 @@ using OpenSim.Framework;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32 32
33namespace OpenSim.Tests.Common 33namespace OpenSim.Tests.Common
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// Utility functions for carrying out user inventory related tests. 36 /// Utility functions for carrying out user inventory related tests.
37 /// </summary> 37 /// </summary>
38 public static class UserInventoryTestUtils 38 public static class UserInventoryTestUtils
39 { 39 {
40 public static readonly string PATH_DELIMITER = "/"; 40 public static readonly string PATH_DELIMITER = "/";
@@ -78,7 +78,7 @@ namespace OpenSim.Tests.Common
78 /// </param> 78 /// </param>
79 /// <returns> 79 /// <returns>
80 /// The folder created. If the path contains multiple folders then the last one created is returned. 80 /// The folder created. If the path contains multiple folders then the last one created is returned.
81 /// </returns> 81 /// </returns>
82 public static InventoryFolderBase CreateInventoryFolder( 82 public static InventoryFolderBase CreateInventoryFolder(
83 IInventoryService inventoryService, InventoryFolderBase parentFolder, string path) 83 IInventoryService inventoryService, InventoryFolderBase parentFolder, string path)
84 { 84 {
@@ -91,7 +91,7 @@ namespace OpenSim.Tests.Common
91 if (components.Length > 1) 91 if (components.Length > 1)
92 return CreateInventoryFolder(inventoryService, newFolder, components[1]); 92 return CreateInventoryFolder(inventoryService, newFolder, components[1]);
93 else 93 else
94 return newFolder; 94 return newFolder;
95 } 95 }
96 } 96 }
97} \ No newline at end of file 97} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
index 4ad9926..3ca44a1 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
@@ -31,12 +31,12 @@ using OpenSim.Framework.Communications.Cache;
31using OpenSim.Region.Communications.Local; 31using OpenSim.Region.Communications.Local;
32 32
33namespace OpenSim.Tests.Common.Setup 33namespace OpenSim.Tests.Common.Setup
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// Utility functions for carrying out user profile related tests. 36 /// Utility functions for carrying out user profile related tests.
37 /// </summary> 37 /// </summary>
38 public static class UserProfileTestUtils 38 public static class UserProfileTestUtils
39 { 39 {
40 /// <summary> 40 /// <summary>
41 /// Create a test user with a standard inventory 41 /// Create a test user with a standard inventory
42 /// </summary> 42 /// </summary>
@@ -51,7 +51,7 @@ namespace OpenSim.Tests.Common.Setup
51 { 51 {
52 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); 52 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
53 return CreateUserWithInventory(commsManager, userId, callback); 53 return CreateUserWithInventory(commsManager, userId, callback);
54 } 54 }
55 55
56 /// <summary> 56 /// <summary>
57 /// Create a test user with a standard inventory 57 /// Create a test user with a standard inventory
@@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Setup
65 /// <returns></returns> 65 /// <returns></returns>
66 public static CachedUserInfo CreateUserWithInventory( 66 public static CachedUserInfo CreateUserWithInventory(
67 CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback) 67 CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback)
68 { 68 {
69 return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback); 69 return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback);
70 } 70 }
71 71
@@ -84,8 +84,8 @@ namespace OpenSim.Tests.Common.Setup
84 public static CachedUserInfo CreateUserWithInventory( 84 public static CachedUserInfo CreateUserWithInventory(
85 CommunicationsManager commsManager, string firstName, string lastName, 85 CommunicationsManager commsManager, string firstName, string lastName,
86 UUID userId, OnInventoryReceivedDelegate callback) 86 UUID userId, OnInventoryReceivedDelegate callback)
87 { 87 {
88 LocalUserServices lus = (LocalUserServices)commsManager.UserService; 88 LocalUserServices lus = (LocalUserServices)commsManager.UserService;
89 lus.AddUser(firstName, lastName, "troll", "bill@bailey.com", 1000, 1000, userId); 89 lus.AddUser(firstName, lastName, "troll", "bill@bailey.com", 1000, 1000, userId);
90 90
91 CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); 91 CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
@@ -93,6 +93,6 @@ namespace OpenSim.Tests.Common.Setup
93 userInfo.FetchInventory(); 93 userInfo.FetchInventory();
94 94
95 return userInfo; 95 return userInfo;
96 } 96 }
97 } 97 }
98} 98}
diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs
index 0141f48..b18e029 100644
--- a/OpenSim/Tools/Compiler/Program.cs
+++ b/OpenSim/Tools/Compiler/Program.cs
@@ -1,3 +1,29 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
1 27
2using System; 28using System;
3using System.Collections.Generic; 29using System.Collections.Generic;
@@ -11,19 +37,19 @@ namespace OpenSim.Tools.LSL.Compiler
11 class Program 37 class Program
12 { 38 {
13 private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; 39 private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
14 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 40 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
15 41
16 static void Main(string[] args) 42 static void Main(string[] args)
17 { 43 {
18 string source = null; 44 string source = null;
19 45
20 if(args.Length == 0) 46 if (args.Length == 0)
21 { 47 {
22 Console.WriteLine("No input file specified"); 48 Console.WriteLine("No input file specified");
23 Environment.Exit(1); 49 Environment.Exit(1);
24 } 50 }
25 51
26 if(!File.Exists(args[0])) 52 if (!File.Exists(args[0]))
27 { 53 {
28 Console.WriteLine("Input file does not exist"); 54 Console.WriteLine("Input file does not exist");
29 Environment.Exit(1); 55 Environment.Exit(1);
@@ -110,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler
110 string errtext = String.Empty; 136 string errtext = String.Empty;
111 foreach (CompilerError CompErr in results.Errors) 137 foreach (CompilerError CompErr in results.Errors)
112 { 138 {
113 string severity = "Error"; 139 string severity = CompErr.IsWarning ? "Warning" : "Error";
114 if ( CompErr.IsWarning )
115 {
116 severity = "Warning";
117 }
118 140
119 KeyValuePair<int, int> lslPos; 141 KeyValuePair<int, int> lslPos;
120 142
@@ -127,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler
127 // The Second Life viewer's script editor begins 149 // The Second Life viewer's script editor begins
128 // countingn lines and columns at 0, so we subtract 1. 150 // countingn lines and columns at 0, so we subtract 1.
129 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", 151 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
130 lslPos.Key - 1, lslPos.Value - 1, 152 lslPos.Key - 1, lslPos.Value - 1,
131 CompErr.ErrorNumber, text, severity); 153 CompErr.ErrorNumber, text, severity);
132 } 154 }
133 155
134 disp = "Completed with errors"; 156 disp = "Completed with errors";
@@ -211,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler
211 private static string ReplaceTypes(string message) 233 private static string ReplaceTypes(string message)
212 { 234 {
213 message = message.Replace( 235 message = message.Replace(
214 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", 236 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString",
215 "string"); 237 "string");
216 238
217 message = message.Replace( 239 message = message.Replace(
218 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", 240 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger",
219 "integer"); 241 "integer");
220 242
221 message = message.Replace( 243 message = message.Replace(
222 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", 244 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat",
223 "float"); 245 "float");
224 246
225 message = message.Replace( 247 message = message.Replace(
226 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", 248 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list",
227 "list"); 249 "list");
228 250
229 return message; 251 return message;
230 } 252 }
@@ -237,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler
237 private class kvpSorter : IComparer<KeyValuePair<int,int>> 259 private class kvpSorter : IComparer<KeyValuePair<int,int>>
238 { 260 {
239 public int Compare(KeyValuePair<int,int> a, 261 public int Compare(KeyValuePair<int,int> a,
240 KeyValuePair<int,int> b) 262 KeyValuePair<int,int> b)
241 { 263 {
242 return a.Key.CompareTo(b.Key); 264 return a.Key.CompareTo(b.Key);
243 } 265 }
diff --git a/bin/OpenSim.Example.xml b/bin/OpenSim.Example.xml
deleted file mode 100644
index 12133e6..0000000
--- a/bin/OpenSim.Example.xml
+++ /dev/null
@@ -1,48 +0,0 @@
1<Nini>
2 <Section Name="Startup">
3 <Key Name="gridmode" Value="False" />
4 <Key Name="physics" Value="basicphysics" />
5 <Key Name="physical_prim" Value="True" />
6 <Key Name="see_into_this_sim_from_neighbor" Value="True" />
7 <Key Name="serverside_object_permissions" Value="False" />
8 <Key Name="storage_plugin" Value="OpenSim.Data.SQLite.dll" />
9 <Key Name="storage_connection_string" Value="URI=file:OpenSim.db,version=3" />
10 <Key Name="storage_prim_inventories" Value="True" />
11 <Key Name="startup_console_commands_file" Value="" />
12 <Key Name="shutdown_console_commands_file" Value="" />
13 <Key Name="script_engine" Value="OpenSim.Region.ScriptEngine.DotNetEngine.dll" />
14 <Key Name="asset_database" Value="sqlite" />
15 <Key Name="clientstack_plugin" Value="OpenSim.Region.ClientStack.LindenUDP.dll" />
16 </Section>
17 <Section Name="StandAlone">
18 <Key Name="accounts_authenticate" Value="False" />
19 <Key Name="welcome_message" Value="Welcome to OpenSimulator" />
20 <Key Name="inventory_plugin" Value="OpenSim.Data.SQLite.dll" />
21 <Key Name="inventory_source" Value="" />
22 <Key Name="userDatabase_plugin" Value="OpenSim.Data.SQLite.dll" />
23 <Key Name="user_source" Value="" />
24 <Key Name="asset_plugin" Value="OpenSim.Data.SQLite.dll" />
25 <Key Name="asset_source" Value="" />
26 <Key Name="dump_assets_to_file" Value="False" />
27 </Section>
28 <Section Name="Network">
29 <Key Name="default_location_x" Value="1000" />
30 <Key Name="default_location_y" Value="1000" />
31 <Key Name="http_listener_port" Value="9000" />
32 <Key Name="remoting_listener_port" Value="8895" />
33 <Key Name="grid_server_url" Value="http://127.0.0.1:8001" />
34 <Key Name="grid_send_key" Value="null" />
35 <Key Name="grid_recv_key" Value="null" />
36 <Key Name="user_server_url" Value="http://127.0.0.1:8002" />
37 <Key Name="user_send_key" Value="null" />
38 <Key Name="user_recv_key" Value="null" />
39 <Key Name="asset_server_url" Value="http://127.0.0.1:8003" />
40 <Key Name="inventory_server_url" Value="http://127.0.0.1:8004" />
41 </Section>
42 <Section Name="RemoteAdmin">
43 <Key Name="enabled" Value="false" />
44 </Section>
45 <Section Name="Voice">
46 <Key Name="enabled" Value="false" />
47 </Section>
48</Nini> \ No newline at end of file
diff --git a/bin/OpenSim.Grid.AssetServer.exe.config b/bin/OpenSim.Grid.AssetServer.exe.config
deleted file mode 100644
index 58404fd..0000000
--- a/bin/OpenSim.Grid.AssetServer.exe.config
+++ /dev/null
@@ -1,35 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.AssetServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <!-- if you'd like to know what NHibernate is doing more set value="DEBUG" -->
23 <logger name="NHibernate" additivity="false">
24 <level value="INFO"/>
25 <appender-ref ref="NHibernateFileLog"/>
26 </logger>
27
28
29 <root>
30 <level value="DEBUG" />
31 <appender-ref ref="Console" />
32 <appender-ref ref="LogFileAppender" />
33 </root>
34 </log4net>
35</configuration>
diff --git a/bin/OpenSim.Grid.InventoryServer.exe.config b/bin/OpenSim.Grid.InventoryServer.exe.config
deleted file mode 100644
index b1315c1..0000000
--- a/bin/OpenSim.Grid.InventoryServer.exe.config
+++ /dev/null
@@ -1,35 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.InventoryServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <!-- if you'd like to know what NHibernate is doing more set value="DEBUG" -->
23 <logger name="NHibernate" additivity="false">
24 <level value="INFO"/>
25 <appender-ref ref="NHibernateFileLog"/>
26 </logger>
27
28
29 <root>
30 <level value="DEBUG" />
31 <appender-ref ref="Console" />
32 <appender-ref ref="LogFileAppender" />
33 </root>
34 </log4net>
35</configuration>
diff --git a/bin/OpenSim.GridServer.ini.example b/bin/OpenSim.GridServer.ini.example
new file mode 100644
index 0000000..8bd126f
--- /dev/null
+++ b/bin/OpenSim.GridServer.ini.example
@@ -0,0 +1,35 @@
1; * The startup section lists all the connectors to start up in this server
2; * instance. This may be only one, or it may be the entire server suite.
3; * Multiple connectors should be seaprated by commas.
4; *
5; * These are the IN connectors the server uses, the in connectors
6; * read this config file and load the needed OUT and database connectors
7; *
8; *
9[Startup]
10 ServiceConnectors = "OpenSim.Server.Handlers.dll:GridServiceConnector"
11
12; * This is common for all services, it's the network setup for the entire
13; * server instance
14; *
15[Network]
16 port = 8001
17
18; * The following are for the remote console
19; * They have no effect for the local or basic console types
20; * Leave commented to diable logins to the console
21;ConsoleUser = Test
22;ConsolePass = secret
23
24; * As an example, the below configuration precisely mimicks the legacy
25; * asset server. It is read by the asset IN connector (defined above)
26; * and it then loads the OUT connector (a local database module). That,
27; * in turn, reads the asset loader and database connection information
28; *
29[GridService]
30 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
31 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
32 ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
33 ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
34 Realm = "regions"
35
diff --git a/bin/OpenSim.Server.ini.example b/bin/OpenSim.Server.ini.example
index 5696f07..635ba1e 100644
--- a/bin/OpenSim.Server.ini.example
+++ b/bin/OpenSim.Server.ini.example
@@ -9,7 +9,7 @@
9; * enable the experimental authentication service 9; * enable the experimental authentication service
10; * 10; *
11[Startup] 11[Startup]
12ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.Server.Handlers.dll:InventoryServiceInConnector,OpenSim.Server.Handlers.dll:FreeswitchServerConnector" 12ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.Server.Handlers.dll:InventoryServiceInConnector,OpenSim.Server.Handlers.dll:FreeswitchServerConnector,OpenSim.Server.Handlers.dll:GridServiceConnector"
13 13
14; * This is common for all services, it's the network setup for the entire 14; * This is common for all services, it's the network setup for the entire
15; * server instance 15; * server instance
@@ -70,3 +70,12 @@ StorageProvider = "OpenSim.Data.MySQL.dll"
70ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;" 70ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;"
71; Realm = "users" 71; Realm = "users"
72 72
73; * This is the new style grid service.
74; * "Realm" is the table that is used for user lookup.
75; * It defaults to "regions", which uses the legacy tables
76; *
77[GridService]
78 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
79 StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
80 ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=grid;"
81 Realm = "regions"
diff --git a/bin/OpenSim.Services.ini.example b/bin/OpenSim.Services.ini.example
deleted file mode 100644
index b2e0f96..0000000
--- a/bin/OpenSim.Services.ini.example
+++ /dev/null
@@ -1,19 +0,0 @@
1[Startup]
2; These are also available as command line options
3
4; console = "local" ; Use "basic" to use this on a pipe
5; inifile = "OpenSim.Servers.AssetServer.ini"
6; logfile = "AssetServer.log" ; Also read from application config file
7
8; Connectors, comma separated
9ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector"
10
11[Network]
12port = 8003
13
14[AssetService]
15LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
16StorageProvider = "OpenSim.Data.MySQL.dll"
17ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim;"
18DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
19AssetLoaderArgs = "assets/AssetSets.xml"
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 1f42ef2..50198b3 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -305,6 +305,10 @@
305 http_listener_sslport = 9001 ; Use this port for SSL connections 305 http_listener_sslport = 9001 ; Use this port for SSL connections
306 http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer 306 http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer
307 307
308 ; Hostname to use in llRequestURL/llRequestSecureURL
309 ; if not defined - default machine name is being used
310 ; (on Windows this mean NETBIOS name - useably only inside local network)
311 ; ExternalHostNameForLSL=127.0.0.1
308 ; Uncomment below to enable llRemoteData/remote channels 312 ; Uncomment below to enable llRemoteData/remote channels
309 ; remoteDataPort = 20800 313 ; remoteDataPort = 20800
310 314
@@ -322,7 +326,7 @@
322 326
323 ; The MessagingServer is a companion of the UserServer. It uses 327 ; The MessagingServer is a companion of the UserServer. It uses
324 ; user_send_key and user_recv_key, too 328 ; user_send_key and user_recv_key, too
325 messaging_server_url = "http://127.0.0.1:8006" 329 ;messaging_server_url = "http://127.0.0.1:8006"
326 330
327 ; What is reported as the "X-Secondlife-Shard" 331 ; What is reported as the "X-Secondlife-Shard"
328 ; Defaults to the user server url if not set 332 ; Defaults to the user server url if not set
@@ -1307,7 +1311,7 @@
1307 ;NoticesEnabled = true 1311 ;NoticesEnabled = true
1308 1312
1309 ; This makes the Groups modules very chatty on the console. 1313 ; This makes the Groups modules very chatty on the console.
1310 ;DebugEnabled = true 1314 DebugEnabled = false
1311 1315
1312 ; Specify which messaging module to use for groups messaging and if it's enabled 1316 ; Specify which messaging module to use for groups messaging and if it's enabled
1313 ;MessagingModule = GroupsMessagingModule 1317 ;MessagingModule = GroupsMessagingModule
diff --git a/bin/config-include/Grid.ini b/bin/config-include/Grid.ini
index 10f7dbd..261c1b8 100644
--- a/bin/config-include/Grid.ini
+++ b/bin/config-include/Grid.ini
@@ -12,5 +12,12 @@
12 InventoryServices = "RemoteInventoryServicesConnector" 12 InventoryServices = "RemoteInventoryServicesConnector"
13 AuthorizationServices = "RemoteAuthorizationServicesConnector" 13 AuthorizationServices = "RemoteAuthorizationServicesConnector"
14 NeighbourServices = "RemoteNeighbourServicesConnector" 14 NeighbourServices = "RemoteNeighbourServicesConnector"
15 GridServices = "RemoteGridServicesConnector"
15 NeighbourServiceInConnector = true 16 NeighbourServiceInConnector = true
16 LandServiceInConnector = true 17 LandServiceInConnector = true
18
19[GridService]
20 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
21 ; for the LocalGridServicesConnector which is used by the Remote one
22 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
23 \ No newline at end of file
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index 3a8ec35..e9d3728 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -15,6 +15,11 @@
15 ; 15 ;
16 InventoryServerURI = "http://myinventoryserver.com:8004" 16 InventoryServerURI = "http://myinventoryserver.com:8004"
17 17
18[GridService]
19 ;
20 ; change this to your grid-wide inventory server
21 ;
22 GridServerURI = "http://mygridserver.com:8001"
18 23
19[Modules] 24[Modules]
20 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. 25 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.
diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini
index 8b65ab8..f5aa603 100644
--- a/bin/config-include/GridHypergrid.ini
+++ b/bin/config-include/GridHypergrid.ini
@@ -7,13 +7,17 @@
7[Includes] 7[Includes]
8 Include-Common = "config-include/GridCommon.ini" 8 Include-Common = "config-include/GridCommon.ini"
9 9
10[Startup]
11 hypergrid = true
12
10[Modules] 13[Modules]
11 AssetServices = "HGAssetBroker" 14 AssetServices = "HGAssetBroker"
12 InventoryServices = "HGInventoryBroker" 15 InventoryServices = "HGInventoryBroker"
13 NeighbourServices = "RemoteNeighbourServicesConnector" 16 NeighbourServices = "RemoteNeighbourServicesConnector"
17 GridServices = "HGGridServicesConnector"
14 NeighbourServiceInConnector = true 18 NeighbourServiceInConnector = true
15 LandServiceInConnector = true 19 LandServiceInConnector = true
16 20 HypergridServiceInConnector = true
17 21
18[AssetService] 22[AssetService]
19 LocalGridAssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector" 23 LocalGridAssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"
@@ -22,3 +26,11 @@
22[InventoryService] 26[InventoryService]
23 LocalGridInventoryService = "OpenSim.Region.CoreModules.dll:RemoteInventoryServicesConnector" 27 LocalGridInventoryService = "OpenSim.Region.CoreModules.dll:RemoteInventoryServicesConnector"
24 HypergridInventoryService = "OpenSim.Services.Connectors.dll:HGInventoryServiceConnector" 28 HypergridInventoryService = "OpenSim.Services.Connectors.dll:HGInventoryServiceConnector"
29
30[GridService]
31 ; for the HGGridServicesConnector to instantiate
32 GridServiceConnectorModule = "OpenSim.Region.CoreModules.dll:RemoteGridServicesConnector"
33 ; RemoteGridServicesConnector instantiates a LocalGridServicesConnector,
34 ; which in turn uses this
35 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
36 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
diff --git a/bin/config-include/Standalone.ini b/bin/config-include/Standalone.ini
index 24020b6..a6c089c 100644
--- a/bin/config-include/Standalone.ini
+++ b/bin/config-include/Standalone.ini
@@ -12,6 +12,7 @@
12 InventoryServices = "LocalInventoryServicesConnector" 12 InventoryServices = "LocalInventoryServicesConnector"
13 NeighbourServices = "LocalNeighbourServicesConnector" 13 NeighbourServices = "LocalNeighbourServicesConnector"
14 AuthorizationServices = "LocalAuthorizationServicesConnector" 14 AuthorizationServices = "LocalAuthorizationServicesConnector"
15 GridServices = "LocalGridServicesConnector"
15 16
16[AssetService] 17[AssetService]
17 LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" 18 LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
@@ -21,3 +22,7 @@
21 22
22[AuthorizationService] 23[AuthorizationService]
23 LocalServiceModule = "OpenSim.Services.AuthorizationService.dll:AuthorizationService" 24 LocalServiceModule = "OpenSim.Services.AuthorizationService.dll:AuthorizationService"
25
26[GridService]
27 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
28 Realm = "regions"
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example
index bac7983..b0e2de3 100644
--- a/bin/config-include/StandaloneCommon.ini.example
+++ b/bin/config-include/StandaloneCommon.ini.example
@@ -32,3 +32,10 @@
32[FreeswitchService] 32[FreeswitchService]
33 ;; Configuration for the freeswitch service goes here 33 ;; Configuration for the freeswitch service goes here
34 LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" 34 LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService"
35
36[GridService]
37 ;; For in-memory region storage (default)
38 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
39 ;;--- For MySql region storage (alternative)
40 ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
41 ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index aa122be..baff811 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -7,14 +7,21 @@
7[Includes] 7[Includes]
8 Include-Common = "config-include/StandaloneCommon.ini" 8 Include-Common = "config-include/StandaloneCommon.ini"
9 9
10[Startup]
11 hypergrid = true
12
10[Modules] 13[Modules]
11 AssetServices = "HGAssetBroker" 14 AssetServices = "HGAssetBroker"
12 InventoryServices = "HGInventoryBroker" 15 InventoryServices = "HGInventoryBroker"
13 NeighbourServices = "LocalNeighbourServicesConnector" 16 NeighbourServices = "RemoteNeighbourServicesConnector"
14 AuthorizationServices = "LocalAuthorizationServicesConnector" 17 AuthorizationServices = "LocalAuthorizationServicesConnector"
18 GridServices = "HGGridServicesConnector"
15 InventoryServiceInConnector = true 19 InventoryServiceInConnector = true
16 AssetServiceInConnector = true 20 AssetServiceInConnector = true
17 HGAuthServiceInConnector = true 21 HGAuthServiceInConnector = true
22 HypergridServiceInConnector = true
23 NeighbourServiceInConnector = true
24
18 25
19[AssetService] 26[AssetService]
20 ; For the AssetServiceInConnector 27 ; For the AssetServiceInConnector
@@ -39,4 +46,9 @@
39 ; For the HGAuthServiceInConnector 46 ; For the HGAuthServiceInConnector
40 LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:HGAuthenticationService" 47 LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:HGAuthenticationService"
41 48
42 \ No newline at end of file 49[GridService]
50 ; for the HGGridServicesConnector to instantiate
51 GridServiceConnectorModule = "OpenSim.Region.CoreModules.dll:LocalGridServicesConnector"
52 ; LocalGridServicesConnector needs this
53 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
54 Realm = "regions"
diff --git a/prebuild.xml b/prebuild.xml
index 70f5cfd..22ff3d7 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -170,7 +170,9 @@
170 <Reference name="OpenSim.Framework"/> 170 <Reference name="OpenSim.Framework"/>
171 171
172 <Files> 172 <Files>
173 <Match pattern="*.cs" recurse="true"/> 173 <Match pattern="*.cs" recurse="true">
174 <Exclude name="Tests" pattern="Tests"/>
175 </Match>
174 </Files> 176 </Files>
175 </Project> 177 </Project>
176 178
@@ -371,7 +373,6 @@
371 <Reference name="System"/> 373 <Reference name="System"/>
372 <Reference name="System.Xml"/> 374 <Reference name="System.Xml"/>
373 <Reference name="OpenSim.Data"/> 375 <Reference name="OpenSim.Data"/>
374 <Reference name="OpenSim.Server.Base"/>
375 <Reference name="OpenSim.Framework"/> 376 <Reference name="OpenSim.Framework"/>
376 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 377 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
377 <Reference name="OpenSim.Framework.Console"/> 378 <Reference name="OpenSim.Framework.Console"/>
@@ -956,7 +957,7 @@
956 </Project> 957 </Project>
957 958
958 959
959 <Project frameworkVersion="v3_5" name="OpenSim.Grid.UserServer.Modules" path="OpenSim/Grid/UserServer.Modules" type="Library"> 960 <Project frameworkVersion="v3_5" name="OpenSim.Grid.MessagingServer.Modules" path="OpenSim/Grid/MessagingServer.Modules" type="Library">
960 <Configuration name="Debug"> 961 <Configuration name="Debug">
961 <Options> 962 <Options>
962 <OutputPath>../../../bin/</OutputPath> 963 <OutputPath>../../../bin/</OutputPath>
@@ -972,23 +973,17 @@
972 <Reference name="System"/> 973 <Reference name="System"/>
973 <Reference name="System.Data"/> 974 <Reference name="System.Data"/>
974 <Reference name="System.Xml"/> 975 <Reference name="System.Xml"/>
975 <Reference name="System.Web"/>
976 <Reference name="OpenSim.Framework"/> 976 <Reference name="OpenSim.Framework"/>
977 <Reference name="OpenSim.Framework.Console"/> 977 <Reference name="OpenSim.Framework.Console"/>
978 <Reference name="OpenSim.Framework.Communications"/> 978 <Reference name="OpenSim.Framework.Communications"/>
979 <Reference name="OpenSim.Data"/> 979 <Reference name="OpenSim.Data"/>
980 <Reference name="OpenSim.Framework.Capabilities"/>
981 <Reference name="OpenSim.Framework.Servers"/> 980 <Reference name="OpenSim.Framework.Servers"/>
982 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 981 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
983 <Reference name="OpenSim.Framework.Statistics"/>
984 <Reference name="OpenSim.Grid.Framework"/> 982 <Reference name="OpenSim.Grid.Framework"/>
985 <Reference name="OpenSim.Grid.Communications.OGS1"/>
986 <Reference name="OpenMetaverse.dll"/>
987 <Reference name="OpenMetaverseTypes.dll"/> 983 <Reference name="OpenMetaverseTypes.dll"/>
988 <Reference name="OpenMetaverse.StructuredData.dll"/> 984 <Reference name="OpenMetaverse.dll"/>
989 <Reference name="XMLRPC.dll"/> 985 <Reference name="XMLRPC.dll"/>
990 <Reference name="log4net.dll"/> 986 <Reference name="log4net.dll"/>
991 <Reference name="DotNetOpenId.dll"/>
992 987
993 <Files> 988 <Files>
994 <Match pattern="*.cs" recurse="true"/> 989 <Match pattern="*.cs" recurse="true"/>
@@ -996,7 +991,7 @@
996 </Project> 991 </Project>
997 992
998 993
999 <Project frameworkVersion="v3_5" name="OpenSim.Grid.UserServer" path="OpenSim/Grid/UserServer" type="Exe"> 994 <Project frameworkVersion="v3_5" name="OpenSim.Grid.MessagingServer" path="OpenSim/Grid/MessagingServer" type="Exe">
1000 <Configuration name="Debug"> 995 <Configuration name="Debug">
1001 <Options> 996 <Options>
1002 <OutputPath>../../../bin/</OutputPath> 997 <OutputPath>../../../bin/</OutputPath>
@@ -1012,31 +1007,26 @@
1012 <Reference name="System"/> 1007 <Reference name="System"/>
1013 <Reference name="System.Data"/> 1008 <Reference name="System.Data"/>
1014 <Reference name="System.Xml"/> 1009 <Reference name="System.Xml"/>
1015 <Reference name="System.Web"/>
1016 <Reference name="OpenSim.Framework"/> 1010 <Reference name="OpenSim.Framework"/>
1017 <Reference name="OpenSim.Framework.Console"/> 1011 <Reference name="OpenSim.Framework.Console"/>
1018 <Reference name="OpenSim.Framework.Communications"/> 1012 <Reference name="OpenSim.Framework.Communications"/>
1019 <Reference name="OpenSim.Data"/> 1013 <Reference name="OpenSim.Data"/>
1020 <Reference name="OpenSim.Framework.Servers"/> 1014 <Reference name="OpenSim.Framework.Servers"/>
1021 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1015 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1022 <Reference name="OpenSim.Framework.Statistics"/>
1023 <Reference name="OpenSim.Grid.Communications.OGS1"/>
1024 <Reference name="OpenSim.Grid.Framework"/> 1016 <Reference name="OpenSim.Grid.Framework"/>
1025 <Reference name="OpenSim.Grid.UserServer.Modules"/> 1017 <Reference name="OpenSim.Grid.MessagingServer.Modules"/>
1026 <Reference name="OpenMetaverseTypes.dll"/> 1018 <Reference name="OpenMetaverseTypes.dll"/>
1027 <Reference name="OpenMetaverse.StructuredData.dll"/>
1028 <Reference name="OpenMetaverse.dll"/> 1019 <Reference name="OpenMetaverse.dll"/>
1029 <Reference name="XMLRPC.dll"/> 1020 <Reference name="XMLRPC.dll"/>
1030 <Reference name="log4net.dll"/> 1021 <Reference name="log4net.dll"/>
1031 <Reference name="Nini.dll"/> 1022 <Reference name="Nini.dll"/>
1032 <Reference name="DotNetOpenId.dll"/>
1033 1023
1034 <Files> 1024 <Files>
1035 <Match pattern="*.cs" recurse="true"/> 1025 <Match pattern="*.cs" recurse="true"/>
1036 </Files> 1026 </Files>
1037 </Project> 1027 </Project>
1038 1028
1039 <Project frameworkVersion="v3_5" name="OpenSim.Grid.MessagingServer.Modules" path="OpenSim/Grid/MessagingServer.Modules" type="Library"> 1029 <Project frameworkVersion="v3_5" name="OpenSim.Server.Base" path="OpenSim/Server/Base" type="Library">
1040 <Configuration name="Debug"> 1030 <Configuration name="Debug">
1041 <Options> 1031 <Options>
1042 <OutputPath>../../../bin/</OutputPath> 1032 <OutputPath>../../../bin/</OutputPath>
@@ -1050,18 +1040,14 @@
1050 1040
1051 <ReferencePath>../../../bin/</ReferencePath> 1041 <ReferencePath>../../../bin/</ReferencePath>
1052 <Reference name="System"/> 1042 <Reference name="System"/>
1053 <Reference name="System.Data"/>
1054 <Reference name="System.Xml"/> 1043 <Reference name="System.Xml"/>
1044 <Reference name="System.Web"/>
1045 <Reference name="OpenMetaverseTypes.dll"/>
1046 <Reference name="OpenMetaverse.dll"/>
1055 <Reference name="OpenSim.Framework"/> 1047 <Reference name="OpenSim.Framework"/>
1056 <Reference name="OpenSim.Framework.Console"/> 1048 <Reference name="OpenSim.Framework.Console"/>
1057 <Reference name="OpenSim.Framework.Communications"/>
1058 <Reference name="OpenSim.Data"/>
1059 <Reference name="OpenSim.Framework.Servers"/>
1060 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1049 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1061 <Reference name="OpenSim.Grid.Framework"/> 1050 <Reference name="Nini.dll" />
1062 <Reference name="OpenMetaverseTypes.dll"/>
1063 <Reference name="OpenMetaverse.dll"/>
1064 <Reference name="XMLRPC.dll"/>
1065 <Reference name="log4net.dll"/> 1051 <Reference name="log4net.dll"/>
1066 1052
1067 <Files> 1053 <Files>
@@ -1069,8 +1055,7 @@
1069 </Files> 1055 </Files>
1070 </Project> 1056 </Project>
1071 1057
1072 1058 <Project frameworkVersion="v3_5" name="OpenSim.Services.Base" path="OpenSim/Services/Base" type="Library">
1073 <Project frameworkVersion="v3_5" name="OpenSim.Grid.MessagingServer" path="OpenSim/Grid/MessagingServer" type="Exe">
1074 <Configuration name="Debug"> 1059 <Configuration name="Debug">
1075 <Options> 1060 <Options>
1076 <OutputPath>../../../bin/</OutputPath> 1061 <OutputPath>../../../bin/</OutputPath>
@@ -1084,28 +1069,20 @@
1084 1069
1085 <ReferencePath>../../../bin/</ReferencePath> 1070 <ReferencePath>../../../bin/</ReferencePath>
1086 <Reference name="System"/> 1071 <Reference name="System"/>
1087 <Reference name="System.Data"/>
1088 <Reference name="System.Xml"/>
1089 <Reference name="OpenSim.Framework"/>
1090 <Reference name="OpenSim.Framework.Console"/>
1091 <Reference name="OpenSim.Framework.Communications"/>
1092 <Reference name="OpenSim.Data"/>
1093 <Reference name="OpenSim.Framework.Servers"/>
1094 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1095 <Reference name="OpenSim.Grid.Framework"/>
1096 <Reference name="OpenSim.Grid.MessagingServer.Modules"/>
1097 <Reference name="OpenMetaverseTypes.dll"/> 1072 <Reference name="OpenMetaverseTypes.dll"/>
1098 <Reference name="OpenMetaverse.dll"/> 1073 <Reference name="OpenMetaverse.dll"/>
1099 <Reference name="XMLRPC.dll"/> 1074 <Reference name="OpenSim.Framework"/>
1075 <Reference name="OpenSim.Framework.Console"/>
1076 <Reference name="OpenSim.Services.Interfaces"/>
1077 <Reference name="Nini.dll" />
1100 <Reference name="log4net.dll"/> 1078 <Reference name="log4net.dll"/>
1101 <Reference name="Nini.dll"/>
1102 1079
1103 <Files> 1080 <Files>
1104 <Match pattern="*.cs" recurse="true"/> 1081 <Match pattern="*.cs" recurse="true"/>
1105 </Files> 1082 </Files>
1106 </Project> 1083 </Project>
1107 1084
1108 <Project frameworkVersion="v3_5" name="OpenSim.Services.Base" path="OpenSim/Services/Base" type="Library"> 1085 <Project frameworkVersion="v3_5" name="OpenSim.Services.UserService" path="OpenSim/Services/UserService" type="Library">
1109 <Configuration name="Debug"> 1086 <Configuration name="Debug">
1110 <Options> 1087 <Options>
1111 <OutputPath>../../../bin/</OutputPath> 1088 <OutputPath>../../../bin/</OutputPath>
@@ -1123,7 +1100,10 @@
1123 <Reference name="OpenMetaverse.dll"/> 1100 <Reference name="OpenMetaverse.dll"/>
1124 <Reference name="OpenSim.Framework"/> 1101 <Reference name="OpenSim.Framework"/>
1125 <Reference name="OpenSim.Framework.Console"/> 1102 <Reference name="OpenSim.Framework.Console"/>
1103 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1126 <Reference name="OpenSim.Services.Interfaces"/> 1104 <Reference name="OpenSim.Services.Interfaces"/>
1105 <Reference name="OpenSim.Services.Base"/>
1106 <Reference name="OpenSim.Data"/>
1127 <Reference name="Nini.dll" /> 1107 <Reference name="Nini.dll" />
1128 <Reference name="log4net.dll"/> 1108 <Reference name="log4net.dll"/>
1129 1109
@@ -1132,7 +1112,7 @@
1132 </Files> 1112 </Files>
1133 </Project> 1113 </Project>
1134 1114
1135 <Project frameworkVersion="v3_5" name="OpenSim.Services.UserService" path="OpenSim/Services/UserService" type="Library"> 1115 <Project frameworkVersion="v3_5" name="OpenSim.Services.Connectors" path="OpenSim/Services/Connectors" type="Library">
1136 <Configuration name="Debug"> 1116 <Configuration name="Debug">
1137 <Options> 1117 <Options>
1138 <OutputPath>../../../bin/</OutputPath> 1118 <OutputPath>../../../bin/</OutputPath>
@@ -1146,23 +1126,28 @@
1146 1126
1147 <ReferencePath>../../../bin/</ReferencePath> 1127 <ReferencePath>../../../bin/</ReferencePath>
1148 <Reference name="System"/> 1128 <Reference name="System"/>
1129 <Reference name="System.Xml"/>
1130 <Reference name="System.Drawing"/>
1149 <Reference name="OpenMetaverseTypes.dll"/> 1131 <Reference name="OpenMetaverseTypes.dll"/>
1150 <Reference name="OpenMetaverse.dll"/> 1132 <Reference name="OpenMetaverse.dll"/>
1133 <Reference name="OpenMetaverse.StructuredData.dll"/>
1134 <Reference name="OpenSim.Services.Interfaces"/>
1151 <Reference name="OpenSim.Framework"/> 1135 <Reference name="OpenSim.Framework"/>
1136 <Reference name="OpenSim.Framework.Communications"/>
1152 <Reference name="OpenSim.Framework.Console"/> 1137 <Reference name="OpenSim.Framework.Console"/>
1153 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1138 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1154 <Reference name="OpenSim.Services.Interfaces"/> 1139 <Reference name="OpenSim.Server.Base"/>
1155 <Reference name="OpenSim.Services.Base"/>
1156 <Reference name="OpenSim.Data"/>
1157 <Reference name="Nini.dll" /> 1140 <Reference name="Nini.dll" />
1158 <Reference name="log4net.dll"/> 1141 <Reference name="log4net.dll"/>
1142 <Reference name="XMLRPC.dll" />
1159 1143
1160 <Files> 1144 <Files>
1161 <Match pattern="*.cs" recurse="true"/> 1145 <Match pattern="*.cs" recurse="true"/>
1162 </Files> 1146 </Files>
1163 </Project> 1147 </Project>
1164 1148
1165 <Project frameworkVersion="v3_5" name="OpenSim.Services.Connectors" path="OpenSim/Services/Connectors" type="Library"> 1149
1150 <Project frameworkVersion="v3_5" name="OpenSim.Grid.UserServer.Modules" path="OpenSim/Grid/UserServer.Modules" type="Library">
1166 <Configuration name="Debug"> 1151 <Configuration name="Debug">
1167 <Options> 1152 <Options>
1168 <OutputPath>../../../bin/</OutputPath> 1153 <OutputPath>../../../bin/</OutputPath>
@@ -1176,25 +1161,75 @@
1176 1161
1177 <ReferencePath>../../../bin/</ReferencePath> 1162 <ReferencePath>../../../bin/</ReferencePath>
1178 <Reference name="System"/> 1163 <Reference name="System"/>
1164 <Reference name="System.Data"/>
1179 <Reference name="System.Xml"/> 1165 <Reference name="System.Xml"/>
1180 <Reference name="OpenMetaverseTypes.dll"/> 1166 <Reference name="System.Web"/>
1167 <Reference name="OpenSim.Framework"/>
1168 <Reference name="OpenSim.Framework.Console"/>
1169 <Reference name="OpenSim.Framework.Communications"/>
1170 <Reference name="OpenSim.Data"/>
1171 <Reference name="OpenSim.Framework.Capabilities"/>
1172 <Reference name="OpenSim.Framework.Servers"/>
1173 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1174 <Reference name="OpenSim.Framework.Statistics"/>
1175 <Reference name="OpenSim.Services.Interfaces"/>
1176 <Reference name="OpenSim.Services.Connectors"/>
1177 <Reference name="OpenSim.Grid.Framework"/>
1178 <Reference name="OpenSim.Grid.Communications.OGS1"/>
1181 <Reference name="OpenMetaverse.dll"/> 1179 <Reference name="OpenMetaverse.dll"/>
1180 <Reference name="OpenMetaverseTypes.dll"/>
1182 <Reference name="OpenMetaverse.StructuredData.dll"/> 1181 <Reference name="OpenMetaverse.StructuredData.dll"/>
1183 <Reference name="OpenSim.Services.Interfaces"/> 1182 <Reference name="XMLRPC.dll"/>
1183 <Reference name="log4net.dll"/>
1184 <Reference name="DotNetOpenId.dll"/>
1185 <Reference name="Nini.dll"/>
1186
1187 <Files>
1188 <Match pattern="*.cs" recurse="true"/>
1189 </Files>
1190 </Project>
1191
1192
1193 <Project frameworkVersion="v3_5" name="OpenSim.Grid.UserServer" path="OpenSim/Grid/UserServer" type="Exe">
1194 <Configuration name="Debug">
1195 <Options>
1196 <OutputPath>../../../bin/</OutputPath>
1197 </Options>
1198 </Configuration>
1199 <Configuration name="Release">
1200 <Options>
1201 <OutputPath>../../../bin/</OutputPath>
1202 </Options>
1203 </Configuration>
1204
1205 <ReferencePath>../../../bin/</ReferencePath>
1206 <Reference name="System"/>
1207 <Reference name="System.Data"/>
1208 <Reference name="System.Xml"/>
1209 <Reference name="System.Web"/>
1184 <Reference name="OpenSim.Framework"/> 1210 <Reference name="OpenSim.Framework"/>
1185 <Reference name="OpenSim.Framework.Communications"/>
1186 <Reference name="OpenSim.Framework.Console"/> 1211 <Reference name="OpenSim.Framework.Console"/>
1212 <Reference name="OpenSim.Framework.Communications"/>
1213 <Reference name="OpenSim.Data"/>
1214 <Reference name="OpenSim.Framework.Servers"/>
1187 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1215 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1188 <Reference name="Nini.dll" /> 1216 <Reference name="OpenSim.Framework.Statistics"/>
1217 <Reference name="OpenSim.Grid.Communications.OGS1"/>
1218 <Reference name="OpenSim.Grid.Framework"/>
1219 <Reference name="OpenSim.Grid.UserServer.Modules"/>
1220 <Reference name="OpenMetaverseTypes.dll"/>
1221 <Reference name="OpenMetaverse.StructuredData.dll"/>
1222 <Reference name="OpenMetaverse.dll"/>
1223 <Reference name="XMLRPC.dll"/>
1189 <Reference name="log4net.dll"/> 1224 <Reference name="log4net.dll"/>
1190 <Reference name="XMLRPC.dll" /> 1225 <Reference name="Nini.dll"/>
1226 <Reference name="DotNetOpenId.dll"/>
1191 1227
1192 <Files> 1228 <Files>
1193 <Match pattern="*.cs" recurse="true"/> 1229 <Match pattern="*.cs" recurse="true"/>
1194 </Files> 1230 </Files>
1195 </Project> 1231 </Project>
1196 1232
1197
1198 <Project frameworkVersion="v3_5" name="OpenSim.Services.AssetService" path="OpenSim/Services/AssetService" type="Library"> 1233 <Project frameworkVersion="v3_5" name="OpenSim.Services.AssetService" path="OpenSim/Services/AssetService" type="Library">
1199 <Configuration name="Debug"> 1234 <Configuration name="Debug">
1200 <Options> 1235 <Options>
@@ -1319,7 +1354,7 @@
1319 </Files> 1354 </Files>
1320 </Project> 1355 </Project>
1321 1356
1322 <Project frameworkVersion="v3_5" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library"> 1357 <Project frameworkVersion="v3_5" name="OpenSim.Services.GridService" path="OpenSim/Services/GridService" type="Library">
1323 <Configuration name="Debug"> 1358 <Configuration name="Debug">
1324 <Options> 1359 <Options>
1325 <OutputPath>../../../bin/</OutputPath> 1360 <OutputPath>../../../bin/</OutputPath>
@@ -1336,7 +1371,6 @@
1336 <Reference name="OpenMetaverseTypes.dll"/> 1371 <Reference name="OpenMetaverseTypes.dll"/>
1337 <Reference name="OpenMetaverse.dll"/> 1372 <Reference name="OpenMetaverse.dll"/>
1338 <Reference name="OpenSim.Framework"/> 1373 <Reference name="OpenSim.Framework"/>
1339 <Reference name="OpenSim.Framework.Capabilities"/>
1340 <Reference name="OpenSim.Framework.Console"/> 1374 <Reference name="OpenSim.Framework.Console"/>
1341 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1375 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1342 <Reference name="OpenSim.Services.Interfaces"/> 1376 <Reference name="OpenSim.Services.Interfaces"/>
@@ -1351,7 +1385,7 @@
1351 </Files> 1385 </Files>
1352 </Project> 1386 </Project>
1353 1387
1354 <Project frameworkVersion="v3_5" name="OpenSim.Server.Base" path="OpenSim/Server/Base" type="Library"> 1388 <Project frameworkVersion="v3_5" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library">
1355 <Configuration name="Debug"> 1389 <Configuration name="Debug">
1356 <Options> 1390 <Options>
1357 <OutputPath>../../../bin/</OutputPath> 1391 <OutputPath>../../../bin/</OutputPath>
@@ -1365,13 +1399,16 @@
1365 1399
1366 <ReferencePath>../../../bin/</ReferencePath> 1400 <ReferencePath>../../../bin/</ReferencePath>
1367 <Reference name="System"/> 1401 <Reference name="System"/>
1368 <Reference name="System.Xml"/>
1369 <Reference name="System.Web"/>
1370 <Reference name="OpenMetaverseTypes.dll"/> 1402 <Reference name="OpenMetaverseTypes.dll"/>
1371 <Reference name="OpenMetaverse.dll"/> 1403 <Reference name="OpenMetaverse.dll"/>
1372 <Reference name="OpenSim.Framework"/> 1404 <Reference name="OpenSim.Framework"/>
1405 <Reference name="OpenSim.Framework.Capabilities"/>
1373 <Reference name="OpenSim.Framework.Console"/> 1406 <Reference name="OpenSim.Framework.Console"/>
1374 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1407 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1408 <Reference name="OpenSim.Services.Interfaces"/>
1409 <Reference name="OpenSim.Services.Base"/>
1410 <Reference name="OpenSim.Services.Connectors"/>
1411 <Reference name="OpenSim.Data"/>
1375 <Reference name="Nini.dll" /> 1412 <Reference name="Nini.dll" />
1376 <Reference name="log4net.dll"/> 1413 <Reference name="log4net.dll"/>
1377 1414
@@ -1380,6 +1417,7 @@
1380 </Files> 1417 </Files>
1381 </Project> 1418 </Project>
1382 1419
1420
1383 <Project frameworkVersion="v3_5" name="OpenSim.Server.Handlers" path="OpenSim/Server/Handlers" type="Library"> 1421 <Project frameworkVersion="v3_5" name="OpenSim.Server.Handlers" path="OpenSim/Server/Handlers" type="Library">
1384 <Configuration name="Debug"> 1422 <Configuration name="Debug">
1385 <Options> 1423 <Options>
@@ -3134,7 +3172,7 @@
3134 </Files> 3172 </Files>
3135 </Project> 3173 </Project>
3136 3174
3137 <Project name="lslc" path="OpenSim/Tools/Compiler" type="Exe"> 3175 <Project name="OpenSim.Tools.lslc" path="OpenSim/Tools/Compiler" type="Exe">
3138 <Configuration name="Debug"> 3176 <Configuration name="Debug">
3139 <Options> 3177 <Options>
3140 <OutputPath>../../../bin/</OutputPath> 3178 <OutputPath>../../../bin/</OutputPath>
@@ -3189,6 +3227,35 @@
3189 </Files> 3227 </Files>
3190 </Project> 3228 </Project>
3191 3229
3230 <!-- Test Clients -->
3231 <Project frameworkVersion="v3_5" name="OpenSim.Tests.Clients.GridClient" path="OpenSim/Tests/Clients/Grid" type="Exe">
3232 <Configuration name="Debug">
3233 <Options>
3234 <OutputPath>../../../../bin/</OutputPath>
3235 </Options>
3236 </Configuration>
3237 <Configuration name="Release">
3238 <Options>
3239 <OutputPath>../../../../bin/</OutputPath>
3240 </Options>
3241 </Configuration>
3242
3243 <ReferencePath>../../../../bin/</ReferencePath>
3244 <Reference name="System"/>
3245 <Reference name="OpenMetaverseTypes.dll"/>
3246 <Reference name="OpenMetaverse.dll"/>
3247 <Reference name="OpenSim.Framework"/>
3248 <Reference name="OpenSim.Services.Interfaces" />
3249 <Reference name="OpenSim.Services.Connectors" />
3250 <Reference name="Nini.dll" />
3251 <Reference name="log4net.dll"/>
3252
3253 <Files>
3254 <Match pattern="*.cs" recurse="true"/>
3255 </Files>
3256 </Project>
3257
3258
3192 <!-- Test assemblies --> 3259 <!-- Test assemblies -->
3193 <Project frameworkVersion="v3_5" name="OpenSim.Tests.Common" path="OpenSim/Tests/Common" type="Library"> 3260 <Project frameworkVersion="v3_5" name="OpenSim.Tests.Common" path="OpenSim/Tests/Common" type="Library">
3194 <Configuration name="Debug"> 3261 <Configuration name="Debug">
@@ -3406,6 +3473,38 @@
3406 </Files> 3473 </Files>
3407 </Project> 3474 </Project>
3408 3475
3476 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Serialization.Tests" path="OpenSim/Framework/Serialization/Tests" type="Library">
3477 <Configuration name="Debug">
3478 <Options>
3479 <OutputPath>../../../../bin/</OutputPath>
3480 </Options>
3481 </Configuration>
3482 <Configuration name="Release">
3483 <Options>
3484 <OutputPath>../../../../bin/</OutputPath>
3485 </Options>
3486 </Configuration>
3487
3488 <ReferencePath>../../../../bin/</ReferencePath>
3489 <Reference name="System"/>
3490 <Reference name="OpenMetaverse.dll"/>
3491 <Reference name="OpenMetaverseTypes.dll"/>
3492 <Reference name="OpenMetaverse.StructuredData.dll"/>
3493 <Reference name="OpenSim.Data"/>
3494 <Reference name="OpenSim.Services.Interfaces"/>
3495 <Reference name="OpenSim.Tests.Common"/>
3496 <Reference name="OpenSim.Framework"/>
3497 <Reference name="OpenSim.Framework.Serialization"/>
3498 <Reference name="OpenSim.Framework.Serialization.External"/>
3499 <Reference name="log4net.dll"/>
3500 <Reference name="nunit.framework.dll" />
3501
3502 <Files>
3503 <Match pattern="*.cs" recurse="true">
3504 </Match>
3505 </Files>
3506 </Project>
3507
3409 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Servers.Tests" path="OpenSim/Framework/Servers/Tests" type="Library"> 3508 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Servers.Tests" path="OpenSim/Framework/Servers/Tests" type="Library">
3410 <Configuration name="Debug"> 3509 <Configuration name="Debug">
3411 <Options> 3510 <Options>
@@ -3531,6 +3630,7 @@
3531 <Match path="World/Archiver/Tests" pattern="*.cs" recurse="true" /> 3630 <Match path="World/Archiver/Tests" pattern="*.cs" recurse="true" />
3532 <Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" /> 3631 <Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" />
3533 <Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" /> 3632 <Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" />
3633 <Match path="ServiceConnectorsOut/Grid/Tests" pattern="*.cs" recurse="true" />
3534 </Files> 3634 </Files>
3535 </Project> 3635 </Project>
3536 3636
@@ -3564,6 +3664,7 @@
3564 <Reference name="OpenSim.Region.Framework"/> 3664 <Reference name="OpenSim.Region.Framework"/>
3565 <Reference name="OpenSim.Region.CoreModules"/> 3665 <Reference name="OpenSim.Region.CoreModules"/>
3566 <Reference name="OpenSim.Region.Physics.Manager"/> 3666 <Reference name="OpenSim.Region.Physics.Manager"/>
3667 <Reference name="OpenSim.Services.Interfaces"/>
3567 3668
3568 <!-- Unit tests --> 3669 <!-- Unit tests -->
3569 <!-- <Reference name="OpenSim.Tests.Common"/> --> 3670 <!-- <Reference name="OpenSim.Tests.Common"/> -->
@@ -3617,6 +3718,7 @@
3617 <Reference name="OpenSim.Region.ClientStack"/> 3718 <Reference name="OpenSim.Region.ClientStack"/>
3618 <Reference name="OpenSim.Region.ClientStack.LindenUDP"/> 3719 <Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
3619 <Reference name="OpenSim.Region.Framework"/> 3720 <Reference name="OpenSim.Region.Framework"/>
3721 <Reference name="OpenSim.Services.Interfaces"/>
3620 <Reference name="OpenSim.Tests.Common"/> 3722 <Reference name="OpenSim.Tests.Common"/>
3621 3723
3622 <Files> 3724 <Files>