check new agent access before creating other things

This commit is contained in:
UbitUmarov
2020-10-11 10:31:14 +01:00
parent 6e3f0a140c
commit 7e99db34c8
2 changed files with 49 additions and 54 deletions

View File

@@ -4066,6 +4066,40 @@ namespace OpenSim.Region.Framework.Scenes
}
}
if (teleportFlags != (uint)TPFlags.Default)
{
// Make sure root avatar position is in the region
if (acd.startpos.X < 0)
acd.startpos.X = 1f;
else if (acd.startpos.X >= RegionInfo.RegionSizeX)
acd.startpos.X = RegionInfo.RegionSizeX - 1f;
if (acd.startpos.Y < 0)
acd.startpos.Y = 1f;
else if (acd.startpos.Y >= RegionInfo.RegionSizeY)
acd.startpos.Y = RegionInfo.RegionSizeY - 1f;
}
// only check access, actual relocations will happen later on ScenePresence MakeRoot
// allow child agents creation
//if(!godlike && teleportFlags != (uint) TPFlags.Default)
if (teleportFlags != (uint)TPFlags.Default)
{
bool checkTeleHub;
// don't check hubs if via home or via lure
if ((teleportFlags & (uint)(TPFlags.ViaHome | TPFlags.ViaLure)) != 0)
checkTeleHub = false;
else
checkTeleHub = vialogin
|| (TelehubAllowLandmarks == true ? false : ((teleportFlags & (uint)(TPFlags.ViaLandmark | TPFlags.ViaLocation)) != 0));
if (!CheckLandPositionAccess(acd.AgentID, true, checkTeleHub, acd.startpos, out reason))
{
m_authenticateHandler.RemoveCircuit(acd);
return false;
}
}
// TODO: can we remove this lock?
lock (m_newUserConnLock)
{
@@ -4185,51 +4219,12 @@ namespace OpenSim.Region.Framework.Scenes
CacheUserName(null, acd);
}
//if (vialogin)
//{
// CleanDroppedAttachments();
//}
if (teleportFlags != (uint)TPFlags.Default)
{
// Make sure root avatar position is in the region
if (acd.startpos.X < 0)
acd.startpos.X = 1f;
else if (acd.startpos.X >= RegionInfo.RegionSizeX)
acd.startpos.X = RegionInfo.RegionSizeX - 1f;
if (acd.startpos.Y < 0)
acd.startpos.Y = 1f;
else if (acd.startpos.Y >= RegionInfo.RegionSizeY)
acd.startpos.Y = RegionInfo.RegionSizeY - 1f;
}
// only check access, actual relocations will happen later on ScenePresence MakeRoot
// allow child agents creation
//if(!godlike && teleportFlags != (uint) TPFlags.Default)
if (teleportFlags != (uint)TPFlags.Default)
{
bool checkTeleHub;
// don't check hubs if via home or via lure
if ((teleportFlags & (uint)(TPFlags.ViaHome | TPFlags.ViaLure)) != 0)
checkTeleHub = false;
else
checkTeleHub = vialogin
|| (TelehubAllowLandmarks == true ? false : ((teleportFlags & (uint)(TPFlags.ViaLandmark | TPFlags.ViaLocation)) != 0));
if (!CheckLandPositionAccess(acd.AgentID, true, checkTeleHub, acd.startpos, out reason))
{
m_authenticateHandler.RemoveCircuit(acd);
return false;
}
}
if (CapsModule != null)
{
CapsModule.ActivateCaps(acd.circuitcode);
}
return true;
}

View File

@@ -960,20 +960,20 @@ namespace OpenSim.Region.Framework.Scenes
// bad ugly
private static osUTF8 UUIDB = new osUTF8("UUID", true);
private static osUTF8 uuidB = new osUTF8("uuid", true);
private static osUTF8 SOPAnimsB = new osUTF8("SOPAnims", true);
private static osUTF8 CollisionSoundB = new osUTF8("CollisionSound", true);
private static osUTF8 SoundIDB = new osUTF8("SoundID", true);
private static osUTF8 SculptTextureB = new osUTF8("SculptTexture", true);
private static osUTF8 ExtraParamsB = new osUTF8("ExtraParams", true);
private static osUTF8 ParticleSystemB = new osUTF8("ParticleSystem", true);
private static osUTF8 TextureEntryB = new osUTF8("TextureEntry", true);
private static osUTF8 TaskInventoryB = new osUTF8("TaskInventory", true);
private static osUTF8 endTaskInventoryB = new osUTF8("/TaskInventory", true);
private static osUTF8 AssetIDB = new osUTF8("AssetID");
private static osUTF8 texturesB = new osUTF8("textures", true);
private static osUTF8 parametersB = new osUTF8("parameters", true);
private static byte[] UUIDB = osUTF8.GetASCIIBytes("UUID");
private static byte[] uuidB = osUTF8.GetASCIIBytes("uuid");
private static byte[] SOPAnimsB = osUTF8.GetASCIIBytes("SOPAnims");
private static byte[] CollisionSoundB = osUTF8.GetASCIIBytes("CollisionSound");
private static byte[] SoundIDB = osUTF8.GetASCIIBytes("SoundID");
private static byte[] SculptTextureB = osUTF8.GetASCIIBytes("SculptTexture");
private static byte[] ExtraParamsB = osUTF8.GetASCIIBytes("ExtraParams");
private static byte[] ParticleSystemB = osUTF8.GetASCIIBytes("ParticleSystem");
private static byte[] TextureEntryB = osUTF8.GetASCIIBytes("TextureEntry");
private static byte[] TaskInventoryB = osUTF8.GetASCIIBytes("TaskInventory");
private static byte[] endTaskInventoryB = osUTF8.GetASCIIBytes("/TaskInventory");
private static byte[] AssetIDB = osUTF8.GetASCIIBytes("AssetID");
private static byte[] texturesB = osUTF8.GetASCIIBytes("textures");
private static byte[] parametersB = osUTF8.GetASCIIBytes("parameters");
/// <summary>
/// Get all the asset uuids associated with a given object. This includes both those directly associated with