Got LayerData working, need asset management to get the avatar to display
parent
93da2086a9
commit
b9f7e6c69f
|
@ -37,7 +37,7 @@
|
|||
<attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
|
||||
</attributes>
|
||||
</asminfo>
|
||||
<csc target="exe" output="bin/OpenSim.exe" debug="${debug}" verbose="true">
|
||||
<csc target="exe" output="bin/OpenSim.exe" debug="${debug}" verbose="true" warninglevel="4">
|
||||
<references basedir="bin/" failonempty="true">
|
||||
<include name="System" />
|
||||
<include name="System.Data" />
|
||||
|
|
|
@ -83,6 +83,9 @@ namespace OpenSim
|
|||
case PacketType.CompleteAgentMovement:
|
||||
ClientAvatar.CompleteMovement(OpenSim_Main.local_world);
|
||||
break;
|
||||
case PacketType.RegionHandshakeReply:
|
||||
OpenSim_Main.local_world.SendLayerData(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,7 +288,7 @@ namespace OpenSim
|
|||
AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
|
||||
AckTimer.Start();
|
||||
|
||||
Thread ClientThread = new Thread(new ThreadStart(AuthUser));
|
||||
ClientThread = new Thread(new ThreadStart(AuthUser));
|
||||
ClientThread.IsBackground = true;
|
||||
ClientThread.Start();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace OpenSim.world
|
|||
mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle;
|
||||
// TODO - dynamicalise this stuff
|
||||
mov.Data.Timestamp = 1169838966;
|
||||
mov.Data.Position = new LLVector3(100f, 100f, 22f);
|
||||
mov.Data.Position = new LLVector3(100f, 100f, 35f);
|
||||
mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
|
||||
|
||||
Console.WriteLine("Sending AgentMovementComplete packet");
|
||||
|
@ -49,7 +49,7 @@ namespace OpenSim.world
|
|||
handshake.RegionInfo.TerrainStartHeight10 = 20;
|
||||
handshake.RegionInfo.TerrainStartHeight11 = 20;
|
||||
handshake.RegionInfo.SimAccess = 13;
|
||||
handshake.RegionInfo.WaterHeight = 5;
|
||||
handshake.RegionInfo.WaterHeight = 10;
|
||||
handshake.RegionInfo.RegionFlags = 72458694;
|
||||
handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0");
|
||||
handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||
|
|
|
@ -410,7 +410,7 @@ namespace OpenSim
|
|||
return output;
|
||||
}
|
||||
|
||||
public Packet CreateLayerPacket(float[] heightmap, int minX, int maxX, int minY, int maxY)
|
||||
public Packet CreateLayerPacket(float[] heightmap, int minX, int minY, int maxX, int maxY)
|
||||
{
|
||||
//int minX = 0, maxX = 2, minY = 0, maxY = 1; //these should be passed to this function
|
||||
LayerDataPacket layer = new LayerDataPacket();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
|
@ -8,8 +9,10 @@ namespace OpenSim.world
|
|||
public class World
|
||||
{
|
||||
public Dictionary<libsecondlife.LLUUID, Entity> Entities;
|
||||
public SurfacePatch[] LandMap;
|
||||
public float[] LandMap;
|
||||
public ScriptEngine Scripts;
|
||||
public TerrainDecode terrainengine = new TerrainDecode();
|
||||
|
||||
|
||||
public World()
|
||||
{
|
||||
|
@ -18,13 +21,13 @@ namespace OpenSim.world
|
|||
|
||||
// We need a 16x16 array of 16m2 surface patches for a 256m2 sim
|
||||
Console.WriteLine("World.cs - creating LandMap");
|
||||
LandMap = new SurfacePatch[16*16];
|
||||
int xinc;
|
||||
int yinc;
|
||||
for(xinc=0; xinc<16; xinc++) for(yinc=0; yinc<16; yinc++) {
|
||||
LandMap[xinc+(yinc*16)]=new SurfacePatch();
|
||||
}
|
||||
|
||||
terrainengine = new TerrainDecode();
|
||||
LandMap = new float[65536];
|
||||
for(int i =0; i < 65536; i++) {
|
||||
LandMap[i] = 30.4989f;
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine("World.cs - Creating script engine instance");
|
||||
// Initialise this only after the world has loaded
|
||||
Scripts = new ScriptEngine(this);
|
||||
|
@ -38,6 +41,13 @@ namespace OpenSim.world
|
|||
}
|
||||
}
|
||||
|
||||
public void SendLayerData(OpenSimClient RemoteClient) {
|
||||
for(int i=1; i<16; i++) {
|
||||
Packet layerpack=this.terrainengine.CreateLayerPacket(LandMap, i,1,1,16);
|
||||
RemoteClient.OutPacket(layerpack);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddViewerAgent(OpenSimClient AgentClient) {
|
||||
Console.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
|
||||
Avatar NewAvatar = new Avatar(AgentClient);
|
||||
|
|
Loading…
Reference in New Issue