MW 2007-05-29 17:49:39 +00:00
parent 36bcda6cfa
commit cb33169fe6
4 changed files with 8 additions and 42 deletions

View File

@ -70,5 +70,7 @@ namespace OpenSim.Framework.Interfaces
void OutPacket(Packet newPack); void OutPacket(Packet newPack);
void SendWearables(AvatarWearable[] wearables); void SendWearables(AvatarWearable[] wearables);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendLayerData(float[] map);
void SendRegionHandshake(RegionInfo regionInfo);
} }
} }

View File

@ -130,9 +130,9 @@ namespace OpenSim.world
} }
//really really should be moved somewhere else (RegionInfo.cs ?) //really really should be moved somewhere else (RegionInfo.cs ?)
public void SendRegionHandshake(World regionInfo) public void SendRegionHandshake(RegionInfo regionInfo)
{ {
this.ControllingClient.SendRegionHandshake(regionInfo);
} }
public static void LoadAnims() public static void LoadAnims()

View File

@ -504,7 +504,7 @@ namespace OpenSim.world
public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child) public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{ {
remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData); remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData);
remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
Avatar newAvatar = null; Avatar newAvatar = null;
try try
@ -513,7 +513,7 @@ namespace OpenSim.world
newAvatar = new Avatar(remoteClient, this, m_clientThreads, this.m_regInfo); newAvatar = new Avatar(remoteClient, this, m_clientThreads, this.m_regInfo);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake ");
newAvatar.SendRegionHandshake(this); newAvatar.SendRegionHandshake(this.m_regInfo);
PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
lock (this.LockPhysicsEngine) lock (this.LockPhysicsEngine)

View File

@ -85,28 +85,7 @@ namespace OpenSim.world
/// <param name="RemoteClient">Client to send to</param> /// <param name="RemoteClient">Client to send to</param>
public virtual void SendLayerData(IClientAPI RemoteClient) public virtual void SendLayerData(IClientAPI RemoteClient)
{ {
try RemoteClient.SendLayerData(Terrain.getHeights1D());
{
int[] patches = new int[4];
for (int y = 0; y < 16; y++)
{
for (int x = 0; x < 16; x = x + 4)
{
patches[0] = x + 0 + y * 16;
patches[1] = x + 1 + y * 16;
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
RemoteClient.OutPacket(layerpack);
}
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString());
}
} }
/// <summary> /// <summary>
@ -117,22 +96,7 @@ namespace OpenSim.world
/// <param name="RemoteClient">The client to send to</param> /// <param name="RemoteClient">The client to send to</param>
public void SendLayerData(int px, int py, IClientAPI RemoteClient) public void SendLayerData(int px, int py, IClientAPI RemoteClient)
{ {
try
{
int[] patches = new int[1];
int patchx, patchy;
patchx = px / 16;
patchy = py / 16;
patches[0] = patchx + 0 + patchy * 16;
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
RemoteClient.OutPacket(layerpack);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString());
}
} }
#endregion #endregion