estate kick now just kill user connection if on same region. The teleport home we did, does not make much sense, and would need more work anyways

0.9.1.0-post-fixes
UbitUmarov 2019-02-20 03:05:23 +00:00
parent fdf5274c25
commit b56eb2fe63
3 changed files with 39 additions and 22 deletions

View File

@ -1677,8 +1677,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendKillObject(List<uint> localIDs)
{
// foreach (uint id in localIDs)
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle);
// foreach (uint id in localIDs)
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, id, regionHandle);
// remove pending entities to reduce looping chances.
lock (m_entityProps.SyncRoot)
@ -1702,10 +1702,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(++nsent >= 200)
{
kill.Header.Reliable = true;
kill.Header.Zerocoded = true;
OutPacket(kill, ThrottleOutPacketType.Task);
perpacket = localIDs.Count - i - 1;
if(perpacket == 0)
break;
@ -1720,8 +1717,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(nsent != 0)
{
kill.Header.Reliable = true;
kill.Header.Zerocoded = true;
OutPacket(kill, ThrottleOutPacketType.Task);
}
}
@ -10047,7 +10042,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[1].Parameter), out Prey);
OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey);
OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey, false);
}
return true;
case "teleporthomeallusers":
@ -10195,7 +10190,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[0].Parameter), out Prey);
OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey);
OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey, true);
}
return true;

View File

@ -1204,28 +1204,33 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
}
private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey)
private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
return;
EstateTeleportOneUserHomeRequest evOverride = OnEstateTeleportOneUserHomeRequest;
if(evOverride != null)
{
evOverride(remover_client, invoice, senderID, prey);
evOverride(remover_client, invoice, senderID, prey, kick);
return;
}
if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
return;
if (prey != UUID.Zero)
ScenePresence s = Scene.GetScenePresence(prey);
if (s != null && !s.IsDeleted && !s.IsInTransit)
{
ScenePresence s = Scene.GetScenePresence(prey);
if (s != null && !s.IsDeleted && !s.IsInTransit)
if (kick)
{
if (!Scene.TeleportClientHome(prey, s.ControllingClient))
{
s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
Scene.CloseAgent(s.UUID, false);
}
s.ControllingClient.Kick("You have been kicked");
Scene.CloseAgent(s.UUID, false);
}
else if (!Scene.TeleportClientHome(prey, s.ControllingClient))
{
s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed ");
Scene.CloseAgent(s.UUID, false);
}
}
}

View File

@ -204,7 +204,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_EstateConnector.SendEstateMessage(estateID, FromID, FromName, Message);
}
private void OnEstateTeleportOneUserHomeRequest(IClientAPI client, UUID invoice, UUID senderID, UUID prey)
private void OnEstateTeleportOneUserHomeRequest(IClientAPI client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
return;
@ -227,8 +227,20 @@ namespace OpenSim.Region.CoreModules.World.Estate
ScenePresence p = scene.GetScenePresence(prey);
if (p != null && !p.IsChildAgent && !p.IsDeleted && !p.IsInTransit)
{
p.ControllingClient.SendTeleportStart(16);
scene.TeleportClientHome(prey, client);
if (kick)
{
p.ControllingClient.Kick("You have been kicked out");
s.CloseAgent(p.UUID, false);
}
else
{
p.ControllingClient.SendTeleportStart(16);
if (!s.TeleportClientHome(prey, client))
{
p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed");
s.CloseAgent(p.UUID, false);
}
}
return;
}
}
@ -259,6 +271,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
p.ControllingClient.SendTeleportStart(16);
scene.TeleportClientHome(p.ControllingClient.AgentId, client);
if (!s.TeleportClientHome(p.ControllingClient.AgentId, client))
{
p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
s.CloseAgent(p.UUID, false);
}
}
});
}