* Acks the first UseCircuitCode packet

* Implements Teleport One Agent Home
0.6.0-stable
Teravus Ovares 2008-04-17 15:58:50 +00:00
parent 15b36498be
commit 4ee368785d
3 changed files with 37 additions and 1 deletions

View File

@ -295,6 +295,17 @@ namespace OpenSim.Region.ClientStack
// new client // new client
m_log.Debug("[UDPSERVER]: Adding New Client"); m_log.Debug("[UDPSERVER]: Adding New Client");
AddNewClient(packet); AddNewClient(packet);
UseCircuitCodePacket p = (UseCircuitCodePacket)packet;
// Ack the first UseCircuitCode packet
PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
// TODO: don't create new blocks if recycling an old packet
ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
ack_it.Packets[0].ID = packet.Header.Sequence;
ack_it.Header.Reliable = false;
SendPacketTo(ack_it.ToBytes(),ack_it.ToBytes().Length,SocketFlags.None,p.CircuitCode.Code);
} }
else else
{ {

View File

@ -221,10 +221,35 @@ namespace OpenSim.Region.Environment
SetRegionDebug(remote_client, packet); SetRegionDebug(remote_client, packet);
} }
break; break;
case "teleporthomeuser":
if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
{
TeleportOneUserHome(remote_client,packet);
}
break;
default: default:
m_log.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); m_log.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
break; break;
} }
}
private void TeleportOneUserHome(object remove_client,EstateOwnerMessagePacket packet)
{
LLUUID invoice = packet.MethodData.Invoice;
LLUUID SenderID = packet.AgentData.AgentID;
LLUUID Prey = LLUUID.Zero;
Helpers.TryParse(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter),out Prey);
if (Prey != LLUUID.Zero)
{
ScenePresence s = m_scene.GetScenePresence(Prey);
if (s != null)
{
m_scene.TeleportClientHome(Prey, s.ControllingClient);
}
}
} }
private void SetRegionDebug(IClientAPI remote_client, EstateOwnerMessagePacket packet) private void SetRegionDebug(IClientAPI remote_client, EstateOwnerMessagePacket packet)