Merge branch 'dev-v3' into dev-v3-stub-audit

This commit is contained in:
Ima Mechanique 2013-07-11 01:21:29 +01:00
commit ef91041a0c
7 changed files with 93 additions and 46 deletions

5
TODO.txt Normal file
View file

@ -0,0 +1,5 @@
LSL-Editor v3 porting TODO list
The aim of this overhaul of the code-base is to make it multi-platform friendly and gain a better insight into the workings of all areas of the code. Hopefully this will lead to removal of any cruft and a leaner code-base.
===============================
1) Port window UI/control to GTK+.
2) Clean up all the 'syntax' stuff. Alphabetise all constants, events, functions, etc.)

View file

@ -103,7 +103,7 @@ namespace LSLEditor
System.Drawing.Point point = Properties.Settings.Default.RegionCorner; System.Drawing.Point point = Properties.Settings.Default.RegionCorner;
SecondLife.vector RegionCorner = new SecondLife.vector(point.X, point.Y, 0); SecondLife.vector RegionCorner = new SecondLife.vector(point.X, point.Y, 0);
SecondLife.vector pos = secondlife.llGetLocalPos(false); SecondLife.vector pos = secondlife.GetLocalPos;
wc.Headers.Add("X-SecondLife-Shard", Properties.Settings.Default.XSecondLifeShard); wc.Headers.Add("X-SecondLife-Shard", Properties.Settings.Default.XSecondLifeShard);
wc.Headers.Add("X-SecondLife-Object-Name", secondlife.host.GetObjectName()); wc.Headers.Add("X-SecondLife-Object-Name", secondlife.host.GetObjectName());

View file

@ -1327,6 +1327,12 @@
returns 0. returns 0.
</Word> </Word>
<Word name="llGetStaticPath">
list llGetStaticPath(vector Start, vector End, float Radius, list Parameters);
Returns a list of position vectors indicating pathfinding waypoints between positions at start and end, for a character of a given radius. The waypoints this function returns are for the 'static' nav mesh, meaning that objects set to "movable obstacle" or "movable phantom" are ignored.
</Word>
<Word name="llGetStatus"> <Word name="llGetStatus">
integer llGetStatus(integer status); integer llGetStatus(integer status);
@ -3303,7 +3309,7 @@
</Word> </Word>
<Word name="llWhisper"> <Word name="llWhisper">
llWhisper(integer channel, string text); void llWhisper(integer channel, string text);
Whisper text on channel. Channel 0 is the public chat channel that Whisper text on channel. Channel 0 is the public chat channel that
all avatars see as chat text. Channels 1 to 2,147,483,648 are all avatars see as chat text. Channels 1 to 2,147,483,648 are
@ -3317,11 +3323,11 @@
Returns the wind velocity below the object position + offset. Returns the wind velocity below the object position + offset.
</Word> </Word>
<Word name="llXorBase64StringsCorrect"> <Word name="llXorBase64">
string llXorBase64StringsCorrect(string s1, string s2) string llXorBase64(string sText1, string sText2);
Performs an xor on two Base64 strings and returns a Base64 string. Performs an XOR on two Base64 strings and returns a Base64 string.
s2 repeats if it is shorter than s1. sText2 repeats if it is shorter than sText1.
This function is for encrypting data. Put your data in s1 and This function is for encrypting data. Put your data in s1 and
your key in s2 to encrypt or put the encrypted data into s1 your key in s2 to encrypt or put the encrypted data into s1
with the same key in s2 to decrypt again. with the same key in s2 to decrypt again.
@ -4687,8 +4693,9 @@
</WordsSubsection> </WordsSubsection>
<WordsSubsection name="C.25. Character constants"> <WordsSubsection name="C.25. Character constants">
<Word name="AVOID_CHARACTERS" type="integer" value="1" status="beta"></Word> <Word name="AVOID_CHARACTERS" type="integer" value="1"></Word>
<Word name="AVOID_DYNAMIC_OBSTACLES" type="integer" value="2" status="beta"></Word> <Word name="AVOID_DYNAMIC_OBSTACLES" type="integer" value="2"></Word>
<Word name="AVOID_NONE" type="integer" value="0"></Word>
<Word name="CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES" type="integer" value="14">If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior.</Word> <Word name="CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES" type="integer" value="14">If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior.</Word>
<Word name="CHARACTER_AVOIDANCE_MODE" type="integer" value="5" status="beta">Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both.</Word> <Word name="CHARACTER_AVOIDANCE_MODE" type="integer" value="5" status="beta">Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both.</Word>
<Word name="CHARACTER_CMD_JUMP" type="integer" value="0x01" status="beta">Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list.</Word> <Word name="CHARACTER_CMD_JUMP" type="integer" value="0x01" status="beta">Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list.</Word>
@ -4858,21 +4865,18 @@
<Word name="LIST_STAT_SUM_SQUARES" /> <Word name="LIST_STAT_SUM_SQUARES" />
<Word name="OBJECT_ATTACHED_POINT" value="19">Gets the attachment point to which the object is attached.</Word> <Word name="OBJECT_ATTACHED_POINT" value="19">Gets the attachment point to which the object is attached.</Word>
<Word name="OBJECT_CREATOR" value=""> <Word name="OBJECT_CHARACTER_TIME" value="17"></Word>
Gets the object's creator key. <Word name="OBJECT_CREATOR" value="8">Gets the object's creator key.
If id is an avatar, a NULL_KEY is returned. If id is an avatar, a NULL_KEY is returned.
</Word> </Word>
<Word name="OBJECT_DESC" value=""> <Word name="OBJECT_DESC" value="">Gets the object's description.
Gets the object's description.
If id is an avatar, an empty string is returned. If id is an avatar, an empty string is returned.
</Word> </Word>
<Word name="OBJECT_GROUP" value=""> <Word name="OBJECT_GROUP" value="">Gets the prims's group key.
Gets the prims's group key.
If id is an avatar, a NULL_KEY is returned. If id is an avatar, a NULL_KEY is returned.
</Word> </Word>
<Word name="OBJECT_NAME" value="">Gets the object's name.</Word> <Word name="OBJECT_NAME" value="">Gets the object's name.</Word>
<Word name="OBJECT_OWNER" value=""> <Word name="OBJECT_OWNER" value="">Gets an object's owner's key.
Gets an object's owner's key.
If id is group owned, a NULL_KEY is returned. If id is group owned, a NULL_KEY is returned.
</Word> </Word>
<Word name="OBJECT_PATHFINDING_TYPE" type="integer" value="20">Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants.</Word> <Word name="OBJECT_PATHFINDING_TYPE" type="integer" value="20">Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants.</Word>
@ -5108,14 +5112,16 @@
<Word name="PROFILE_NONE">Disables profiling</Word> <Word name="PROFILE_NONE">Disables profiling</Word>
<Word name="PROFILE_SCRIPT_MEMORY">Enables memory profiling</Word> <Word name="PROFILE_SCRIPT_MEMORY">Enables memory profiling</Word>
<Word name="PU_EVADE_HIDDEN" type="integer" value="0x07" status="beta">Triggered when an llEvade character thinks it has hidden from its pursuer.</Word> <Word name="PU_EVADE_HIDDEN" type="integer" value="0x07">Triggered when an llEvade character thinks it has hidden from its pursuer.</Word>
<Word name="PU_EVADE_SPOTTED" type="integer" value="0x08" status="beta">Triggered when an llEvade character switches from hiding to running</Word> <Word name="PU_EVADE_SPOTTED" type="integer" value="0x08">Triggered when an llEvade character switches from hiding to running</Word>
<Word name="PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED" type="integer" value="10"></Word>
<Word name="PU_FAILURE_INVALID_GOAL" type="integer" value="0x03" status="beta">Goal is not on the navigation-mesh and cannot be reached.</Word> <Word name="PU_FAILURE_INVALID_GOAL" type="integer" value="0x03" status="beta">Goal is not on the navigation-mesh and cannot be reached.</Word>
<Word name="PU_FAILURE_INVALID_START" type="integer" value="0x02" status="beta">Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it.</Word> <Word name="PU_FAILURE_INVALID_START" type="integer" value="0x02" status="beta">Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it.</Word>
<Word name="PU_FAILURE_NO_NAVMESH" type="integer" value="0x09" status="beta">This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message.</Word> <Word name="PU_FAILURE_NO_NAVMESH" type="integer" value="0x09" status="beta">This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message.</Word>
<Word name="PU_FAILURE_NO_VALID_DESTINATION" type="integer" value="0x06" status="beta">There's no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable.</Word> <Word name="PU_FAILURE_NO_VALID_DESTINATION" type="integer" value="0x06" status="beta">There's no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable.</Word>
<Word name="PU_FAILURE_OTHER" type="integer" value="1000000" status="beta" /> <Word name="PU_FAILURE_OTHER" type="integer" value="1000000" status="beta" />
<Word name="PU_FAILURE_TARGET_GONE" type="integer" value="0x05" status="beta">Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region.</Word> <Word name="PU_FAILURE_TARGET_GONE" type="integer" value="0x05" status="beta">Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region.</Word>
<Word name="PU_FAILURE_PARCEL_UNREACHABLE" type="integer" value="11"></Word>
<Word name="PU_FAILURE_UNREACHABLE" type="integer" value="0x04" status="beta">Goal is no longer reachable for some reason - e.g., an obstacle blocks the path.</Word> <Word name="PU_FAILURE_UNREACHABLE" type="integer" value="0x04" status="beta">Goal is no longer reachable for some reason - e.g., an obstacle blocks the path.</Word>
<Word name="PU_GOAL_REACHED" type="integer" value="0x01" status="beta">Character has reached the goal and will stop or choose a new goal (if wandering).</Word> <Word name="PU_GOAL_REACHED" type="integer" value="0x01" status="beta">Character has reached the goal and will stop or choose a new goal (if wandering).</Word>
<Word name="PU_SLOWDOWN_DISTANCE_REACHED" type="integer" value="0x00" status="beta">Character is near current goal.</Word> <Word name="PU_SLOWDOWN_DISTANCE_REACHED" type="integer" value="0x00" status="beta">Character is near current goal.</Word>
@ -5190,6 +5196,7 @@
<Word name="llStopPointAt" /> <Word name="llStopPointAt" />
<Word name="llTakeCamera" /> <Word name="llTakeCamera" />
<Word name="llXorBase64Strings" /> <Word name="llXorBase64Strings" />
<Word name="llXorBase64StringsCorrect" />
</Words> </Words>

View file

@ -6,6 +6,23 @@
<body style="background-color: white; font-family: Verdana, sans-serif;font-size: 13px;line-height: 1.3"> <body style="background-color: white; font-family: Verdana, sans-serif;font-size: 13px;line-height: 1.3">
<div> <div>
<div> <div>
<h3><span class="date">2013-07-00</span> - Release 2.54.0</h3>
<div>
* Constants Added:
<ul>
<li>AVOID_NONE</li>
<li>OBJECT_CHARACTER_TIME</li>
<li>PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED</li>
<li>PU_FAILURE_PARCEL_UNREACHABLE</li>
</ul>
</div>
<div>
* Functions Added:
<ul>
<li>llGetStaticPath</li>
<li>llXorBase64</li>
</ul>
</div>
<h3><span class="date">2013-07-07</span> - Release 2.53.1</h3> <h3><span class="date">2013-07-07</span> - Release 2.53.1</h3>
<div> <div>
* Fixes * Fixes

View file

@ -92,8 +92,18 @@ namespace LSLEditor
#endregion #endregion
#region constructor #region Properties
public SecondLife()
public vector GetLocalPos
{
// TODO change this to use a call to llGetLocalPos specifying NOT to be Verbose. After all functions have been changed to allow verbose/silent option.
get { return m_pos; }
}
#endregion
#region constructor
public SecondLife()
{ {
host = null; host = null;
m_random = new Random(); m_random = new Random();
@ -279,6 +289,7 @@ namespace LSLEditor
public const int ATTACH_HUD_BOTTOM = 37; public const int ATTACH_HUD_BOTTOM = 37;
public const int ATTACH_HUD_BOTTOM_RIGHT = 38; public const int ATTACH_HUD_BOTTOM_RIGHT = 38;
public const int AVOID_NONE = 0;
public const int AVOID_CHARACTERS = 1; public const int AVOID_CHARACTERS = 1;
public const int AVOID_DYNAMIC_OBSTACLES = 2; public const int AVOID_DYNAMIC_OBSTACLES = 2;
@ -466,6 +477,7 @@ namespace LSLEditor
public const int MASK_OWNER = 1; public const int MASK_OWNER = 1;
public const int OBJECT_ATTACHED_POINT = 19; public const int OBJECT_ATTACHED_POINT = 19;
public const int OBJECT_CHARACTER_TIME = 17;
public const int OBJECT_NAME = 1; public const int OBJECT_NAME = 1;
public const int OBJECT_DESC = 2; public const int OBJECT_DESC = 2;
public const int OBJECT_POS = 3; public const int OBJECT_POS = 3;
@ -739,6 +751,8 @@ namespace LSLEditor
public const int PU_EVADE_HIDDEN = 0x07; public const int PU_EVADE_HIDDEN = 0x07;
public const int PU_EVADE_SPOTTED = 0x08; public const int PU_EVADE_SPOTTED = 0x08;
public const int PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED = 10;
public const int PU_FAILURE_PARCEL_UNREACHABLE = 11;
public const int PU_FAILURE_INVALID_GOAL = 0x03; public const int PU_FAILURE_INVALID_GOAL = 0x03;
public const int PU_FAILURE_INVALID_START = 0x02; public const int PU_FAILURE_INVALID_START = 0x02;
public const int PU_FAILURE_NO_VALID_DESTINATION = 0x06; public const int PU_FAILURE_NO_VALID_DESTINATION = 0x06;
@ -2210,11 +2224,9 @@ namespace LSLEditor
return iLength; return iLength;
} }
public vector llGetLocalPos(Boolean bVerbose = true) public vector llGetLocalPos()
{ {
if (bVerbose) { Verbose("llGetLocalPos()={0}", m_pos);
Verbose("llGetLocalPos()={0}", m_pos);
}
return m_pos; return m_pos;
} }
@ -2609,6 +2621,13 @@ namespace LSLEditor
return m_start_parameter; return m_start_parameter;
} }
public list llGetStaticPath(vector vStart, vector vEnd, Float fRadius, list lParameters)
{
list lReturn = new list();
Verbose("llGetStaticPath({0}, {1}, {2}, {3})={4}", vStart, vEnd, fRadius, lParameters.ToVerboseString(), lReturn.ToVerboseString());
return lReturn;
}
public integer llGetStatus(integer iRequestedStatus) public integer llGetStatus(integer iRequestedStatus)
{ {
integer iStatus = 0; integer iStatus = 0;
@ -4482,10 +4501,24 @@ namespace LSLEditor
return vector.ZERO_VECTOR; return vector.ZERO_VECTOR;
} }
public String llXorBase64StringsCorrect(String s1, String s2) public String llXorBase64(String sText1, String sText2)
{
string sResult = "";
Verbose(@"llXorBase64(""{0}"",""{1}"")=""{2}""", sText1, sText2, sResult);
return sResult;
}
public String llXorBase64Strings(String sText1, String sText2)
{
string sResult = "";
Verbose(@"llXorBase64Strings(""{0}"",""{1}"")=""{2}""", sText1, sText2, sResult);
return sResult;
}
public String llXorBase64StringsCorrect(String sText1, String sText2)
{ {
string S1 = Base64ToString(s1.ToString()); string S1 = Base64ToString(sText1.ToString());
string S2 = Base64ToString(s2.ToString()); string S2 = Base64ToString(sText2.ToString());
int intLength = S1.Length; int intLength = S1.Length;
if (S2.Length == 0) if (S2.Length == 0)
S2 = " "; S2 = " ";
@ -4495,9 +4528,9 @@ namespace LSLEditor
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int intI = 0; intI < intLength; intI++) for (int intI = 0; intI < intLength; intI++)
sb.Append((char)(S1[intI] ^ S2[intI])); sb.Append((char)(S1[intI] ^ S2[intI]));
string result = StringToBase64(sb.ToString()); string sResult = StringToBase64(sb.ToString());
Verbose(@"llXorBase64StringsCorrect(""{0}"",""{1}"")=""{2}""", s1, s2, result); Verbose(@"llXorBase64StringsCorrect(""{0}"",""{1}"")=""{2}""", sText1, sText2, sResult);
return result; return sResult;
} }
#endregion #endregion
} }

View file

@ -1,14 +0,0 @@
using System;
using System.Collections;
using System.Text;
namespace LSLEditor
{
public partial class SecondLife
{
public class jsonObject : DictionaryBase
{
}
}
}

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
@ -251,7 +251,6 @@
</Compile> </Compile>
<Compile Include="Plugins\Generic.cs" /> <Compile Include="Plugins\Generic.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SecondLife\json.cs" />
<Compile Include="Solution\GuidProperty.cs"> <Compile Include="Solution\GuidProperty.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>