diff options
author | diva | 2009-04-05 03:27:50 +0000 |
---|---|---|
committer | diva | 2009-04-05 03:27:50 +0000 |
commit | 3c9cba162739b93a07067d8a286f6dad55e02217 (patch) | |
tree | c4f9054f524b002b37e4d36a382c206b028f25d9 /OpenSim/Grid | |
parent | * Fixed copyright headers on HyperGrid source files. (Now match the rest of O... (diff) | |
download | opensim-SC_OLD-3c9cba162739b93a07067d8a286f6dad55e02217.zip opensim-SC_OLD-3c9cba162739b93a07067d8a286f6dad55e02217.tar.gz opensim-SC_OLD-3c9cba162739b93a07067d8a286f6dad55e02217.tar.bz2 opensim-SC_OLD-3c9cba162739b93a07067d8a286f6dad55e02217.tar.xz |
Added CreateObject(regionhandle, userID, itemID) to post objects that are to be fetched from the user's inventory server and rezzed in the region. Added all code necessary to fetch the item and the asset, and rez it inworld. The access to the item is uncap-ed and unverified -- I may place it later either under a cap or with auth verification. But in this model regions don't have the user's inventory, so they would have to guess the item IDs.
Added safemode config to Standalone Hypergrid, similar effect to AllowRegionAccessToInventory in Inventory Server. Everyone should have these vars set to their default values except me!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 07fb19c..70efb85 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -76,8 +76,8 @@ namespace OpenSim.Grid.InventoryServer | |||
76 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); | 76 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
77 | 77 | ||
78 | m_httpServer = new BaseHttpServer(config.HttpPort); | 78 | m_httpServer = new BaseHttpServer(config.HttpPort); |
79 | if (config.RegionAccessToAgentsInventory) | 79 | |
80 | AddHttpHandlers(); | 80 | AddHttpHandlers(config.RegionAccessToAgentsInventory); |
81 | 81 | ||
82 | m_httpServer.Start(); | 82 | m_httpServer.Start(); |
83 | 83 | ||
@@ -92,55 +92,64 @@ namespace OpenSim.Grid.InventoryServer | |||
92 | "Add a random user inventory", HandleAddUser); | 92 | "Add a random user inventory", HandleAddUser); |
93 | } | 93 | } |
94 | 94 | ||
95 | protected void AddHttpHandlers() | 95 | protected void AddHttpHandlers(bool regionAccess) |
96 | { | 96 | { |
97 | m_httpServer.AddStreamHandler( | 97 | if (regionAccess) |
98 | new RestDeserialiseSecureHandler<Guid, InventoryCollection>( | 98 | { |
99 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory, m_inventoryService.CheckAuthSession)); | 99 | m_httpServer.AddStreamHandler( |
100 | new RestDeserialiseSecureHandler<Guid, InventoryCollection>( | ||
101 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory, m_inventoryService.CheckAuthSession)); | ||
100 | 102 | ||
101 | m_httpServer.AddStreamHandler( | 103 | m_httpServer.AddStreamHandler( |
102 | new RestDeserialiseTrustedHandler<Guid, bool>( | 104 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
103 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory, m_inventoryService.CheckTrustSource)); | 105 | "POST", "/UpdateFolder/", m_inventoryService.UpdateFolder, m_inventoryService.CheckAuthSession)); |
104 | 106 | ||
105 | m_httpServer.AddStreamHandler( | 107 | m_httpServer.AddStreamHandler( |
106 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( | 108 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
107 | "POST", "/NewFolder/", m_inventoryService.AddFolder, m_inventoryService.CheckAuthSession)); | 109 | "POST", "/MoveFolder/", m_inventoryService.MoveFolder, m_inventoryService.CheckAuthSession)); |
108 | 110 | ||
109 | m_httpServer.AddStreamHandler( | 111 | m_httpServer.AddStreamHandler( |
110 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( | 112 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
111 | "POST", "/UpdateFolder/", m_inventoryService.UpdateFolder, m_inventoryService.CheckAuthSession)); | 113 | "POST", "/PurgeFolder/", m_inventoryService.PurgeFolder, m_inventoryService.CheckAuthSession)); |
114 | |||
115 | m_httpServer.AddStreamHandler( | ||
116 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | ||
117 | "POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession)); | ||
118 | |||
119 | m_httpServer.AddStreamHandler( | ||
120 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | ||
121 | "POST", "/QueryItem/", m_inventoryService.QueryItem, m_inventoryService.CheckAuthSession)); | ||
122 | |||
123 | m_httpServer.AddStreamHandler( | ||
124 | new RestDeserialiseSecureHandler<InventoryFolderBase, InventoryFolderBase>( | ||
125 | "POST", "/QueryFolder/", m_inventoryService.QueryFolder, m_inventoryService.CheckAuthSession)); | ||
126 | |||
127 | } | ||
112 | 128 | ||
113 | m_httpServer.AddStreamHandler( | 129 | m_httpServer.AddStreamHandler( |
114 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( | 130 | new RestDeserialiseTrustedHandler<Guid, bool>( |
115 | "POST", "/MoveFolder/", m_inventoryService.MoveFolder, m_inventoryService.CheckAuthSession)); | 131 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory, m_inventoryService.CheckTrustSource)); |
116 | 132 | ||
117 | m_httpServer.AddStreamHandler( | 133 | m_httpServer.AddStreamHandler( |
118 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( | 134 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
119 | "POST", "/PurgeFolder/", m_inventoryService.PurgeFolder, m_inventoryService.CheckAuthSession)); | 135 | "POST", "/NewFolder/", m_inventoryService.AddFolder, m_inventoryService.CheckAuthSession)); |
120 | 136 | ||
121 | m_httpServer.AddStreamHandler( | 137 | m_httpServer.AddStreamHandler( |
122 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 138 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( |
123 | "POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession)); | 139 | "POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession)); |
124 | 140 | ||
125 | m_httpServer.AddStreamHandler( | 141 | m_httpServer.AddStreamHandler( |
126 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>( | ||
127 | "POST", "/GetItems/", m_inventoryService.GetFolderItems, m_inventoryService.CheckTrustSource)); | ||
128 | |||
129 | m_httpServer.AddStreamHandler( | ||
130 | new RestDeserialiseTrustedHandler<InventoryItemBase, bool>( | 142 | new RestDeserialiseTrustedHandler<InventoryItemBase, bool>( |
131 | "POST", "/AddNewItem/", m_inventoryService.AddItem, m_inventoryService.CheckTrustSource)); | 143 | "POST", "/AddNewItem/", m_inventoryService.AddItem, m_inventoryService.CheckTrustSource)); |
132 | 144 | ||
133 | m_httpServer.AddStreamHandler( | 145 | m_httpServer.AddStreamHandler( |
134 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 146 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>( |
135 | "POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession)); | 147 | "POST", "/GetItems/", m_inventoryService.GetFolderItems, m_inventoryService.CheckTrustSource)); |
136 | |||
137 | m_httpServer.AddStreamHandler( | ||
138 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | ||
139 | "POST", "/QueryItem/", m_inventoryService.QueryItem, m_inventoryService.CheckAuthSession)); | ||
140 | 148 | ||
149 | // for persistent active gestures | ||
141 | m_httpServer.AddStreamHandler( | 150 | m_httpServer.AddStreamHandler( |
142 | new RestDeserialiseSecureHandler<InventoryFolderBase, InventoryFolderBase>( | 151 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> |
143 | "POST", "/QueryFolder/", m_inventoryService.QueryFolder, m_inventoryService.CheckAuthSession)); | 152 | ("POST", "/ActiveGestures/", m_inventoryService.GetActiveGestures, m_inventoryService.CheckTrustSource)); |
144 | 153 | ||
145 | // WARNING: Root folders no longer just delivers the root and immediate child folders (e.g | 154 | // WARNING: Root folders no longer just delivers the root and immediate child folders (e.g |
146 | // system folders such as Objects, Textures), but it now returns the entire inventory skeleton. | 155 | // system folders such as Objects, Textures), but it now returns the entire inventory skeleton. |
@@ -150,11 +159,6 @@ namespace OpenSim.Grid.InventoryServer | |||
150 | m_httpServer.AddStreamHandler( | 159 | m_httpServer.AddStreamHandler( |
151 | new RestDeserialiseTrustedHandler<Guid, List<InventoryFolderBase>> | 160 | new RestDeserialiseTrustedHandler<Guid, List<InventoryFolderBase>> |
152 | ("POST", "/RootFolders/", m_inventoryService.GetInventorySkeleton, m_inventoryService.CheckTrustSource)); | 161 | ("POST", "/RootFolders/", m_inventoryService.GetInventorySkeleton, m_inventoryService.CheckTrustSource)); |
153 | |||
154 | // for persistent active gestures | ||
155 | m_httpServer.AddStreamHandler( | ||
156 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> | ||
157 | ("POST", "/ActiveGestures/", m_inventoryService.GetActiveGestures, m_inventoryService.CheckTrustSource)); | ||
158 | } | 162 | } |
159 | 163 | ||
160 | private void Work() | 164 | private void Work() |