mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
* Discerned between AddProfile and UpdateProfile in region registration
:: Believe it or not, but INSERT/UPDATE is actually a better pattern than REPLACE, since, with INSERT/UPDATE you can catch erroneous UPDATES to non-INSERTed items as well as catch erroneous re-INSERTS. in 95% of the cases, you SHOULD have a clear INSERT context, and a clear and separate UPDATE context. If you think your case falls within the 5%, maybe you should re-evaluate your code. ::
This commit is contained in:
@@ -333,7 +333,17 @@ namespace OpenSim.Grid.GridServer
|
||||
{
|
||||
try
|
||||
{
|
||||
DataResponse insertResponse = kvp.Value.AddProfile(sim);
|
||||
DataResponse insertResponse;
|
||||
|
||||
if( existingSim == null )
|
||||
{
|
||||
insertResponse = kvp.Value.AddProfile(sim);
|
||||
}
|
||||
else
|
||||
{
|
||||
insertResponse = kvp.Value.UpdateProfile(sim);
|
||||
}
|
||||
|
||||
switch (insertResponse)
|
||||
{
|
||||
case DataResponse.RESPONSE_OK:
|
||||
|
||||
Reference in New Issue
Block a user