From 82d309d00765944654db023416a104d96de04328 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 18 Jun 2007 14:41:38 +0000 Subject: [PATCH] Fixed the flashing when crossing a border. --- .../Interfaces/IClientAPI.cs | 1 + OpenSim/OpenSim.Caches/AssetCache.cs | 106 +++++++++--------- .../OpenSim.Region/Scenes/Avatar.Update.cs | 2 +- OpenSim/OpenSim.Region/Scenes/Scene.cs | 29 +++-- .../NetworkServersInfo.cs | 2 + OpenSim/OpenSim.RegionServer/UDPServer.cs | 6 +- 6 files changed, 78 insertions(+), 68 deletions(-) diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index 6e758b2b43..afeae1fc3e 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -133,6 +133,7 @@ namespace OpenSim.Framework.Interfaces void SendChatMessage(string 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 SendLayerData(int px, int py, float[] map); void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); AgentCircuitData RequestClientInfo(); diff --git a/OpenSim/OpenSim.Caches/AssetCache.cs b/OpenSim/OpenSim.Caches/AssetCache.cs index 7622b301a4..eae0f801f1 100644 --- a/OpenSim/OpenSim.Caches/AssetCache.cs +++ b/OpenSim/OpenSim.Caches/AssetCache.cs @@ -556,63 +556,61 @@ namespace OpenSim.Caches return server; } - } - - public class AssetRequest - { - public IClientAPI RequestUser; - public LLUUID RequestAssetID; - public AssetInfo AssetInf; - public TextureImage ImageInfo; - public LLUUID TransferRequestID; - public long DataPointer = 0; - public int NumPackets = 0; - public int PacketCounter = 0; - public bool IsTextureRequest; - //public bool AssetInCache; - //public int TimeRequested; - - public AssetRequest() + public class AssetRequest { + public IClientAPI RequestUser; + public LLUUID RequestAssetID; + public AssetInfo AssetInf; + public TextureImage ImageInfo; + public LLUUID TransferRequestID; + public long DataPointer = 0; + public int NumPackets = 0; + public int PacketCounter = 0; + public bool IsTextureRequest; + //public bool AssetInCache; + //public int TimeRequested; + public AssetRequest() + { + + } + } + + public class AssetInfo : AssetBase + { + public AssetInfo() + { + + } + + public AssetInfo(AssetBase aBase) + { + Data = aBase.Data; + FullID = aBase.FullID; + Type = aBase.Type; + InvType = aBase.InvType; + Name = aBase.Name; + Description = aBase.Description; + } + } + + public class TextureImage : AssetBase + { + public TextureImage() + { + + } + + public TextureImage(AssetBase aBase) + { + Data = aBase.Data; + FullID = aBase.FullID; + Type = aBase.Type; + InvType = aBase.InvType; + Name = aBase.Name; + Description = aBase.Description; + } } } - - public class AssetInfo : AssetBase - { - public AssetInfo() - { - - } - - public AssetInfo(AssetBase aBase) - { - Data = aBase.Data; - FullID = aBase.FullID; - Type = aBase.Type; - InvType = aBase.InvType; - Name = aBase.Name; - Description = aBase.Description; - } - } - - public class TextureImage : AssetBase - { - public TextureImage() - { - - } - - public TextureImage(AssetBase aBase) - { - Data = aBase.Data; - FullID = aBase.FullID; - Type = aBase.Type; - InvType = aBase.InvType; - Name = aBase.Name; - Description = aBase.Description; - } - } - } diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs index 50d5a1434d..534bda4067 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs @@ -87,7 +87,7 @@ namespace OpenSim.Region.Scenes /// public void SendInitialPosition() { - this.ControllingClient.SendAvatarData(m_regionInfo, this.firstname, this.lastname, this.uuid, this.localid, new LLVector3(128, 128, 60)); + this.ControllingClient.SendAvatarData(m_regionInfo, this.firstname, this.lastname, this.uuid, this.localid, this.Pos); } /// diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 5744f1f687..cb3865f1c8 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs @@ -446,15 +446,7 @@ namespace OpenSim.Region.Scenes this.Terrain.setHeights1D(map); } - //create a texture asset of the terrain - byte[] data =this.Terrain.exportJpegImage("defaultstripe.png"); - this.m_regInfo.estateSettings.terrainImageID= LLUUID.Random(); - AssetBase asset = new AssetBase(); - asset.FullID = this.m_regInfo.estateSettings.terrainImageID; - asset.Data = data; - asset.Name = "terrainImage"; - asset.Type = 0; - this.assetCache.AddAsset(asset); + CreateTerrainTexture(); } catch (Exception e) @@ -462,6 +454,23 @@ namespace OpenSim.Region.Scenes OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); } } + + + /// + /// + /// + private void CreateTerrainTexture() + { + //create a texture asset of the terrain + byte[] data = this.Terrain.exportJpegImage("defaultstripe.png"); + this.m_regInfo.estateSettings.terrainImageID = LLUUID.Random(); + AssetBase asset = new AssetBase(); + asset.FullID = this.m_regInfo.estateSettings.terrainImageID; + asset.Data = data; + asset.Name = "terrainImage"; + asset.Type = 0; + this.assetCache.AddAsset(asset); + } #endregion #region Primitives Methods @@ -818,7 +827,7 @@ namespace OpenSim.Region.Scenes /// public override void SendLayerData(int px, int py, IClientAPI RemoteClient) { - RemoteClient.SendLayerData( Terrain.getHeights1D() ); + RemoteClient.SendLayerData(px, py, Terrain.getHeights1D()); } } } diff --git a/OpenSim/OpenSim.RegionServer/NetworkServersInfo.cs b/OpenSim/OpenSim.RegionServer/NetworkServersInfo.cs index d0cbe2b5b4..635bbdfbb1 100644 --- a/OpenSim/OpenSim.RegionServer/NetworkServersInfo.cs +++ b/OpenSim/OpenSim.RegionServer/NetworkServersInfo.cs @@ -32,6 +32,7 @@ using OpenSim.Framework.Interfaces; namespace OpenSim { + public class NetworkServersInfo { public string AssetURL = "http://127.0.0.1:8003/"; @@ -115,4 +116,5 @@ namespace OpenSim } } } + } diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs index 315cb2c91a..54ec480ecf 100644 --- a/OpenSim/OpenSim.RegionServer/UDPServer.cs +++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs @@ -151,20 +151,20 @@ namespace OpenSim public void ServerListener() { - m_console.WriteLine("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort); + m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort); ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort); Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); Server.Bind(ServerIncoming); - m_console.WriteLine("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen"); + m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen"); ipeSender = new IPEndPoint(IPAddress.Any, 0); epSender = (EndPoint)ipeSender; ReceivedData = new AsyncCallback(this.OnReceivedData); Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - m_console.WriteLine("UDPServer.cs:ServerListener() - Listening..."); + m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - Listening..."); }