* 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

@ -324,7 +324,7 @@ namespace OpenSim.Region.ClientStack
m_userEndPoint = remoteEP;
m_proxyEndPoint = proxyEP;
m_startpos = m_authenticateSessionsHandler.GetPosition(circuitCode);
// While working on this, the BlockingQueue had me fooled for a bit.

View File

@ -295,6 +295,17 @@ namespace OpenSim.Region.ClientStack
// new client
m_log.Debug("[UDPSERVER]: Adding New Client");
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
{

View File

@ -221,10 +221,35 @@ namespace OpenSim.Region.Environment
SetRegionDebug(remote_client, packet);
}
break;
case "teleporthomeuser":
if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
{
TeleportOneUserHome(remote_client,packet);
}
break;
default:
m_log.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
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)