Added a few summary comments to OpenSim.World files

merge
MW 2007-05-31 10:12:55 +00:00
parent 5bf776e2df
commit f1e1346806
13 changed files with 351 additions and 105 deletions

View File

@ -10,21 +10,36 @@ namespace OpenSim.world
private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> updateList = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
private List<Entity> interestList = new List<Entity>();
/// <summary>
/// Forwards a packet to the Avatar's client (IClientAPI object).
/// Note: Quite likely to be obsolete once the Client API is finished
/// </summary>
/// <param name="packet"></param>
public void SendPacketToViewer(Packet packet)
{
this.ControllingClient.OutPacket(packet);
}
/// <summary>
///
/// </summary>
/// <param name="terseBlock"></param>
public void AddTerseUpdateToViewersList(ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock)
{
}
/// <summary>
///
/// </summary>
public void SendUpdateListToViewer()
{
}
/// <summary>
///
/// </summary>
private void UpdateInterestList()
{

View File

@ -10,65 +10,109 @@ namespace OpenSim.world
{
partial class Avatar
{
/// <summary>
///
/// </summary>
public override void update()
{
}
/// <summary>
///
/// </summary>
/// <param name="remoteAvatar"></param>
public void SendUpdateToOtherClient(Avatar remoteAvatar)
{
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public ObjectUpdatePacket CreateUpdatePacket()
{
return null;
}
/// <summary>
///
/// </summary>
public void SendInitialPosition()
{
Console.WriteLine("sending initial Avatar data");
this.ControllingClient.SendAvatarData(this.regionData, this.firstname, this.lastname, this.uuid, this.localid, new LLVector3(128, 128, 60));
}
/// <summary>
///
/// </summary>
public void SendOurAppearance()
{
}
/// <summary>
///
/// </summary>
/// <param name="OurClient"></param>
public void SendOurAppearance(IClientAPI OurClient)
{
this.ControllingClient.SendWearables(this.Wearables);
}
/// <summary>
///
/// </summary>
/// <param name="avatarInfo"></param>
public void SendAppearanceToOtherAgent(Avatar avatarInfo)
{
}
/// <summary>
///
/// </summary>
/// <param name="texture"></param>
/// <param name="visualParam"></param>
public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
{
}
/// <summary>
///
/// </summary>
public void StopMovement()
{
}
/// <summary>
/// Very likely to be deleted soon!
/// </summary>
/// <returns></returns>
public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
{
return null;
}
// Sends animation update
/// <summary>
///
/// </summary>
/// <param name="animID"></param>
/// <param name="seq"></param>
public void SendAnimPack(LLUUID animID, int seq)
{
}
/// <summary>
///
/// </summary>
public void SendAnimPack()
{

View File

@ -39,6 +39,13 @@ namespace OpenSim.world
private bool childAvatar = false;
private RegionInfo regionData;
/// <summary>
///
/// </summary>
/// <param name="theClient"></param>
/// <param name="world"></param>
/// <param name="clientThreads"></param>
/// <param name="regionDat"></param>
public Avatar(IClientAPI theClient, World world, Dictionary<uint, IClientAPI> clientThreads, RegionInfo regionDat)
{
@ -84,6 +91,9 @@ namespace OpenSim.world
* */
}
/// <summary>
///
/// </summary>
public PhysicsActor PhysActor
{
set
@ -96,21 +106,36 @@ namespace OpenSim.world
}
}
/// <summary>
///
/// </summary>
/// <param name="status"></param>
public void ChildStatusChange(bool status)
{
}
/// <summary>
///
/// </summary>
public override void addForces()
{
}
/// <summary>
/// likely to removed very soon
/// </summary>
/// <param name="name"></param>
public static void SetupTemplate(string name)
{
}
/// <summary>
/// likely to removed very soon
/// </summary>
/// <param name="objdata"></param>
protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
{
@ -118,32 +143,51 @@ namespace OpenSim.world
}
/// <summary>
///
/// </summary>
public void CompleteMovement()
{
this.ControllingClient.MoveAgentIntoRegion(this.regionData);
}
/// <summary>
///
/// </summary>
/// <param name="pack"></param>
public void HandleAgentUpdate(Packet pack)
{
this.HandleUpdate((AgentUpdatePacket)pack);
}
/// <summary>
///
/// </summary>
/// <param name="pack"></param>
public void HandleUpdate(AgentUpdatePacket pack)
{
}
//really really should be moved somewhere else (RegionInfo.cs ?)
/// <summary>
///
/// </summary>
public void SendRegionHandshake()
{
this.ControllingClient.SendRegionHandshake(this.regionData);
}
/// <summary>
///
/// </summary>
public static void LoadAnims()
{
}
/// <summary>
///
/// </summary>
public override void LandRenegerated()
{

View File

@ -11,10 +11,16 @@ namespace OpenSim.world
public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
/// <summary>
///
/// </summary>
public AvatarAnimations()
{
}
/// <summary>
///
/// </summary>
public void LoadAnims()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs:LoadAnims() - Loading avatar animations");

View File

@ -16,17 +16,22 @@ namespace OpenSim.world
public LLVector3 velocity;
public Quaternion rotation;
protected List<Entity> children;
protected LLVector3 m_pos;
protected PhysicsActor _physActor;
protected World m_world;
protected string m_name;
/// <summary>
///
/// </summary>
public virtual string Name
{
get { return m_name; }
}
protected LLVector3 m_pos;
protected PhysicsActor _physActor;
protected World m_world;
/// <summary>
///
/// </summary>
public virtual LLVector3 Pos
{
get
@ -76,6 +81,9 @@ namespace OpenSim.world
children = new List<Entity>();
}
/// <summary>
///
/// </summary>
public virtual void addForces()
{
foreach (Entity child in children)
@ -111,11 +119,17 @@ namespace OpenSim.world
return mesh;
}
/// <summary>
/// Called at a set interval to inform entities that they should back themsleves up to the DB
/// </summary>
public virtual void BackUp()
{
}
/// <summary>
/// Infoms the entity that the land (heightmap) has changed
/// </summary>
public virtual void LandRenegerated()
{

View File

@ -18,30 +18,53 @@ namespace OpenSim.world
private Dictionary<uint, IClientAPI> m_clientThreads;
private World m_world;
/// <summary>
///
/// </summary>
public SceneObject()
{
}
/// <summary>
///
/// </summary>
/// <param name="addPacket"></param>
/// <param name="agentID"></param>
/// <param name="localID"></param>
public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
{
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
public void CreateFromBytes(byte[] data)
{
}
/// <summary>
///
/// </summary>
public override void update()
{
}
/// <summary>
///
/// </summary>
public override void BackUp()
{
}
/// <summary>
///
/// </summary>
/// <param name="client"></param>
public void GetProperites(IClientAPI client)
{
/*

View File

@ -13,6 +13,12 @@ namespace OpenSim.world
{
public partial class World
{
/// <summary>
///
/// </summary>
/// <param name="action"></param>
/// <param name="north"></param>
/// <param name="west"></param>
public void ModifyTerrain(byte action, float north, float west)
{
switch (action)
@ -31,6 +37,14 @@ namespace OpenSim.world
return;
}
/// <summary>
///
/// </summary>
/// <param name="message"></param>
/// <param name="type"></param>
/// <param name="fromPos"></param>
/// <param name="fromName"></param>
/// <param name="fromAgentID"></param>
public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
{
Console.WriteLine("Chat message");
@ -79,59 +93,127 @@ namespace OpenSim.world
}
}
/// <summary>
///
/// </summary>
/// <param name="primAsset"></param>
/// <param name="pos"></param>
public void RezObject(AssetBase primAsset, LLVector3 pos)
{
}
/// <summary>
///
/// </summary>
/// <param name="packet"></param>
/// <param name="simClient"></param>
public void DeRezObject(Packet packet, IClientAPI simClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="remoteClient"></param>
public void SendAvatarsToClient(IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="parentPrim"></param>
/// <param name="childPrims"></param>
public void LinkObjects(uint parentPrim, List<uint> childPrims)
{
}
/// <summary>
///
/// </summary>
/// <param name="primLocalID"></param>
/// <param name="shapeBlock"></param>
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
{
}
/// <summary>
///
/// </summary>
/// <param name="primLocalID"></param>
/// <param name="remoteClient"></param>
public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="packet"></param>
/// <param name="remoteClient"></param>
public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="texture"></param>
/// <param name="remoteClient"></param>
public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="pos"></param>
/// <param name="remoteClient"></param>
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="rot"></param>
/// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="scale"></param>
/// <param name="remoteClient"></param>
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
{
}
/// <summary>
/// Sends prims to a client
/// </summary>
/// <param name="RemoteClient">Client to send to</param>
public void GetInitialPrims(IClientAPI RemoteClient)
{
}
}
}

View File

@ -14,11 +14,17 @@ namespace OpenSim.world
{
private Dictionary<string, IScriptEngine> scriptEngines = new Dictionary<string, IScriptEngine>();
/// <summary>
///
/// </summary>
private void LoadScriptEngines()
{
this.LoadScriptPlugins();
}
/// <summary>
///
/// </summary>
public void LoadScriptPlugins()
{
string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "ScriptEngines");
@ -31,6 +37,10 @@ namespace OpenSim.world
}
}
/// <summary>
///
/// </summary>
/// <param name="FileName"></param>
private void AddPlugin(string FileName)
{
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
@ -59,6 +69,13 @@ namespace OpenSim.world
pluginAssembly = null;
}
/// <summary>
///
/// </summary>
/// <param name="scriptType"></param>
/// <param name="scriptName"></param>
/// <param name="script"></param>
/// <param name="ent"></param>
public void LoadScript(string scriptType, string scriptName, string script, Entity ent)
{
if(this.scriptEngines.ContainsKey(scriptType))
@ -69,6 +86,11 @@ namespace OpenSim.world
#region IScriptAPI Methods
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
public OSVector3 GetEntityPosition(uint localID)
{
OSVector3 res = new OSVector3();
@ -85,6 +107,13 @@ namespace OpenSim.world
return res;
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="z"></param>
public void SetEntityPosition(uint localID, float x , float y, float z)
{
foreach (Entity entity in this.Entities.Values)
@ -103,6 +132,10 @@ namespace OpenSim.world
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public uint GetRandomAvatarID()
{
//Console.WriteLine("script- getting random avatar id");

View File

@ -36,6 +36,9 @@ namespace OpenSim.world
public string m_datastore;
#region Properties
/// <summary>
///
/// </summary>
public PhysicsScene PhysScene
{
set
@ -79,12 +82,11 @@ namespace OpenSim.world
TerrainManager = new TerrainManager(new SecondLife());
Terrain = new TerrainEngine();
Avatar.SetupTemplate("avatar-texture.dat");
// MainConsole.Instance.WriteLine("World.cs - Creating script engine instance");
// Initialise this only after the world has loaded
// Scripts = new ScriptEngine(this);
Avatar.LoadAnims();
this.SetDefaultScripts();
this.LoadScriptEngines();
//this.SetDefaultScripts();
//this.LoadScriptEngines();
}
@ -95,6 +97,9 @@ namespace OpenSim.world
}
#endregion
/// <summary>
///
/// </summary>
public void StartTimer()
{
m_heartbeatTimer.Enabled = true;
@ -102,79 +107,7 @@ namespace OpenSim.world
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
}
#region Script Methods
/// <summary>
/// Loads a new script into the specified entity
/// </summary>
/// <param name="entity">Entity to be scripted</param>
/// <param name="script">The script to load</param>
public void AddScript(Entity entity, Script script)
{
try
{
ScriptHandler scriptHandler = new ScriptHandler(script, entity, this);
m_scriptHandlers.Add(scriptHandler.ScriptId, scriptHandler);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString());
}
}
/// <summary>
/// Loads a new script into the specified entity, using a script loaded from a string.
/// </summary>
/// <param name="entity">The entity to be scripted</param>
/// <param name="scriptData">The string containing the script</param>
public void AddScript(Entity entity, string scriptData)
{
try
{
int scriptstart = 0;
int scriptend = 0;
string substring;
scriptstart = scriptData.LastIndexOf("<Script>");
scriptend = scriptData.LastIndexOf("</Script>");
substring = scriptData.Substring(scriptstart + 8, scriptend - scriptstart - 8);
substring = substring.Trim();
//Console.WriteLine("searching for script to add: " + substring);
ScriptFactory scriptFactory;
//Console.WriteLine("script string is " + substring);
if (substring.StartsWith("<ScriptEngine:"))
{
string substring1 = "";
string script = "";
// Console.WriteLine("searching for script engine");
substring1 = substring.Remove(0, 14);
int dev = substring1.IndexOf(',');
string sEngine = substring1.Substring(0, dev);
substring1 = substring1.Remove(0, dev + 1);
int end = substring1.IndexOf('>');
string sName = substring1.Substring(0, end);
//Console.WriteLine(" script info : " + sEngine + " , " + sName);
int startscript = substring.IndexOf('>');
script = substring.Remove(0, startscript + 1);
// Console.WriteLine("script data is " + script);
if (this.scriptEngines.ContainsKey(sEngine))
{
this.scriptEngines[sEngine].LoadScript(script, sName, entity.localid);
}
}
else if (this.m_scripts.TryGetValue(substring, out scriptFactory))
{
//Console.WriteLine("added script");
this.AddScript(entity, scriptFactory());
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString());
}
}
#endregion
#region Update Methods
@ -240,6 +173,10 @@ namespace OpenSim.world
updateLock.ReleaseMutex();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public bool Backup()
{
try
@ -321,14 +258,6 @@ namespace OpenSim.world
}
}
public void SetDefaultScripts()
{
this.m_scripts.Add("FollowRandomAvatar", delegate()
{
return new OpenSim.RegionServer.world.scripting.FollowRandomAvatar();
});
}
#endregion
#region Regenerate Terrain
@ -453,14 +382,6 @@ namespace OpenSim.world
#region Primitives Methods
/// <summary>
/// Sends prims to a client
/// </summary>
/// <param name="RemoteClient">Client to send to</param>
public void GetInitialPrims(IClientAPI RemoteClient)
{
}
/// <summary>
/// Loads the World's objects
@ -487,11 +408,21 @@ namespace OpenSim.world
}
/// <summary>
///
/// </summary>
/// <param name="addPacket"></param>
/// <param name="agentClient"></param>
public void AddNewPrim(Packet addPacket, IClientAPI agentClient)
{
AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentId);
}
/// <summary>
///
/// </summary>
/// <param name="addPacket"></param>
/// <param name="ownerID"></param>
public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
{
@ -501,6 +432,12 @@ namespace OpenSim.world
#region Add/Remove Avatar Methods
/// <summary>
///
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="agentID"></param>
/// <param name="child"></param>
public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{
remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData);
@ -552,6 +489,10 @@ namespace OpenSim.world
return;
}
/// <summary>
///
/// </summary>
/// <param name="agentID"></param>
public override void RemoveAvatar(LLUUID agentID)
{
return;
@ -562,6 +503,10 @@ namespace OpenSim.world
//The idea is to have a group of method that return a list of avatars meeting some requirement
// ie it could be all Avatars within a certain range of the calling prim/avatar.
/// <summary>
///
/// </summary>
/// <returns></returns>
public List<Avatar> RequestAvatarList()
{
List<Avatar> result = new List<Avatar>();

View File

@ -49,6 +49,9 @@ namespace OpenSim.world
#endregion
#region Constructors
/// <summary>
///
/// </summary>
public WorldBase()
{
@ -101,11 +104,21 @@ namespace OpenSim.world
#endregion
#region Add/Remove Agent/Avatar
/// <summary>
///
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="agentID"></param>
/// <param name="child"></param>
public virtual void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{
return ;
}
/// <summary>
///
/// </summary>
/// <param name="agentID"></param>
public virtual void RemoveAvatar(LLUUID agentID)
{
return ;
@ -113,6 +126,10 @@ namespace OpenSim.world
#endregion
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual RegionInfo GetRegionInfo()
{
return null;

View File

@ -9,16 +9,29 @@ namespace OpenSim.types
{
public List<Triangle> mesh;
/// <summary>
///
/// </summary>
public Mesh()
{
mesh = new List<Triangle>();
}
/// <summary>
///
/// </summary>
/// <param name="tri"></param>
public void AddTri(Triangle tri)
{
mesh.Add(tri);
}
/// <summary>
///
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
public static Mesh operator +(Mesh a, Mesh b)
{
a.mesh.AddRange(b.mesh);

View File

@ -11,6 +11,9 @@ namespace OpenSim.types
Vector3 b;
Vector3 c;
/// <summary>
///
/// </summary>
public Triangle()
{
a = new Vector3();
@ -18,6 +21,12 @@ namespace OpenSim.types
c = new Vector3();
}
/// <summary>
///
/// </summary>
/// <param name="A"></param>
/// <param name="B"></param>
/// <param name="C"></param>
public Triangle(Vector3 A, Vector3 B, Vector3 C)
{
a = A;

View File

@ -94,6 +94,7 @@ namespace OpenSim
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
ClientView.TerrainManager = new TerrainManager(new SecondLife());
if (m_sandbox)
{
this.SetupLocalGridServers();
@ -138,7 +139,7 @@ namespace OpenSim
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server");
httpServer.Start();
// Start UDP server
// Start UDP servers
for (int i = 0; i < m_udpServer.Count; i++)
{
this.m_udpServer[i].ServerListener();