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