本文整理汇总了C#中libsecondlife.LLUUID类的典型用法代码示例。如果您正苦于以下问题:C# LLUUID类的具体用法?C# LLUUID怎么用?C# LLUUID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LLUUID类属于libsecondlife命名空间,在下文中一共展示了LLUUID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
// parse the command line
string target = String.Empty;
for (int ct = 0; ct < args.Length; ct++)
target = target + args[ct] + " ";
target = target.TrimEnd();
// initialize results list
List<InventoryBase> found = new List<InventoryBase>();
try
{
// find the folder
found = Client.Inventory.LocalFind(Client.Inventory.Store.RootFolder.UUID, target.Split('/'), 0, true);
if (found.Count.Equals(1))
{
// move the folder to the trash folder
Client.Inventory.MoveFolder(found[0].UUID, Client.Inventory.FindFolderForType(AssetType.TrashFolder));
return String.Format("Moved folder {0} to Trash", found[0].Name);
}
}
catch (InvalidOutfitException ex)
{
return "Folder Not Found: (" + ex.Message + ")";
}
return string.Empty;
}
示例2: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
int faceIndex;
LLUUID textureID;
if (args.Length != 2)
return "Usage: findtexture [face-index] [texture-uuid]";
if (Int32.TryParse(args[0], out faceIndex) &&
LLUUID.TryParse(args[1], out textureID))
{
Client.Network.CurrentSim.ObjectsPrimitives.ForEach(
delegate(Primitive prim)
{
if (prim.Textures != null && prim.Textures.FaceTextures[faceIndex] != null)
{
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
{
Logger.Log(String.Format("Primitive {0} ({1}) has face index {2} set to {3}",
prim.ID.ToString(), prim.LocalID, faceIndex, textureID.ToString()),
Helpers.LogLevel.Info, Client);
}
}
}
);
return "Done searching";
}
else
{
return "Usage: findtexture [face-index] [texture-uuid]";
}
}
示例3: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
string inventoryName;
uint timeout;
string fileName;
if (args.Length != 3)
return "Usage: uploadimage [inventoryname] [timeout] [filename]";
TextureID = LLUUID.Zero;
inventoryName = args[0];
fileName = args[2];
if (!UInt32.TryParse(args[1], out timeout))
return "Usage: uploadimage [inventoryname] [timeout] [filename]";
Console.WriteLine("Loading image " + fileName);
byte[] jpeg2k = LoadImage(fileName);
if (jpeg2k == null)
return "Failed to compress image to JPEG2000";
Console.WriteLine("Finished compressing image to JPEG2000, uploading...");
start = DateTime.Now;
DoUpload(jpeg2k, inventoryName);
if (UploadCompleteEvent.WaitOne((int)timeout, false))
{
return String.Format("Texture upload {0}: {1}", (TextureID != LLUUID.Zero) ? "succeeded" : "failed",
TextureID);
}
else
{
return "Texture upload timed out";
}
}
示例4: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
bool success = false;
// Register a handler for the appearance event
AutoResetEvent appearanceEvent = new AutoResetEvent(false);
AppearanceManager.AppearanceUpdatedCallback callback =
delegate(LLObject.TextureEntry te) { appearanceEvent.Set(); };
Client.Appearance.OnAppearanceUpdated += callback;
// Start the appearance setting process (with baking enabled or disabled)
Client.Appearance.SetPreviousAppearance(!(args.Length > 0 && args[0].Equals("nobake")));
// Wait for the process to complete or time out
if (appearanceEvent.WaitOne(1000 * 120, false))
success = true;
// Unregister the handler
Client.Appearance.OnAppearanceUpdated -= callback;
// Return success or failure message
if (success)
return "Successfully set appearance";
else
return "Timed out while setting appearance";
}
示例5: Execute
/// <summary>
/// Get a list of current friends
/// </summary>
/// <param name="args">optional testClient command arguments</param>
/// <param name="fromAgentID">The <seealso cref="libsecondlife.LLUUID"/>
/// of the agent making the request</param>
/// <returns></returns>
public override string Execute(string[] args, LLUUID fromAgentID)
{
// initialize a StringBuilder object used to return the results
StringBuilder sb = new StringBuilder();
// Only iterate the Friends dictionary if we actually have friends!
if (Client.Friends.FriendList.Count > 0)
{
// iterate over the InternalDictionary using a delegate to populate
// our StringBuilder output string
Client.Friends.FriendList.ForEach(delegate(FriendInfo friend)
{
// append the name of the friend to our output
sb.AppendLine(friend.Name);
});
}
else
{
// we have no friends :(
sb.AppendLine("No Friends");
}
// return the result
return sb.ToString();
}
示例6: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
Primitive closest = null;
double closestDistance = Double.MaxValue;
lock (Client.SimPrims)
{
if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim))
{
foreach (Primitive p in Client.SimPrims[Client.Network.CurrentSim].Values)
{
float distance = Helpers.VecDist(Client.Self.Position, p.Position);
if (closest == null || distance < closestDistance)
{
closest = p;
closestDistance = distance;
}
}
}
}
if (closest != null)
{
Client.Self.RequestSit(closest.ID, LLVector3.Zero);
Client.Self.Sit();
return "Sat on " + closest.ID + ". Distance: " + closestDistance;
}
else
{
return "Couldn't find a nearby prim to sit on";
}
}
示例7: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length == 1)
{
try
{
string treeName = args[0].Trim(new char[] { ' ' });
Tree tree = (Tree)Enum.Parse(typeof(Tree), treeName);
LLVector3 treePosition = Client.Self.SimPosition;
treePosition.Z += 3.0f;
Client.Objects.AddTree(Client.Network.CurrentSim, new LLVector3(0.5f, 0.5f, 0.5f),
LLQuaternion.Identity, treePosition, tree, Client.GroupID, false);
return "Attempted to rez a " + treeName + " tree";
}
catch (Exception)
{
return "Type !tree for usage";
}
}
string usage = "Usage: !tree [";
foreach (string value in Enum.GetNames(typeof(Tree)))
{
usage += value + ",";
}
usage = usage.TrimEnd(new char[] { ',' });
usage += "]";
return usage;
}
示例8: Main
static void Main(string[] args)
{
SecondLife client = new SecondLife();
if (args.Length < 4)
{
Console.WriteLine("Usage: Key2Name [loginfirstname] [loginlastname] [password] [key]");
return;
}
Console.WriteLine("Attempting to connect and login to Second Life.");
// Setup Login to Second Life
Dictionary<string, object> loginParams = client.Network.DefaultLoginValues(args[0],
args[1], args[2], "00:00:00:00:00:00", "last", "Win", "0", "key2name",
"[email protected]");
Dictionary<string, object> loginReply = new Dictionary<string, object>();
if (!client.Network.Login(loginParams))
{
// Login failed
Console.WriteLine("Error logging in: " + client.Network.LoginError);
return;
}
AvatarTracker avatarTracker = new AvatarTracker(client);
LLUUID lookup = new LLUUID(args[3]);
Console.WriteLine("Looking up name for " + lookup.ToStringHyphenated());
string name = avatarTracker.GetAvatarName(lookup);
Console.WriteLine("Name: " + name + ". Press enter to logout.");
Console.ReadLine();
client.Network.Logout();
}
示例9: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length < 3)
return "Usage: im [firstname] [lastname] [message]";
ToAvatarName = args[0] + " " + args[1];
// Build the message
string message = String.Empty;
for (int ct = 2; ct < args.Length; ct++)
message += args[ct] + " ";
message = message.TrimEnd();
if (message.Length > 1023) message = message.Remove(1023);
if (!Name2Key.ContainsKey(ToAvatarName.ToLower()))
{
// Send the Query
Client.Avatars.RequestAvatarNameSearch(ToAvatarName, LLUUID.Random());
NameSearchEvent.WaitOne(6000, false);
}
if (Name2Key.ContainsKey(ToAvatarName.ToLower()))
{
LLUUID id = Name2Key[ToAvatarName.ToLower()];
Client.Self.InstantMessage(id, message, id);
return "Instant Messaged " + id.ToStringHyphenated() + " with message: " + message;
}
else
{
return "Name lookup for " + ToAvatarName + " failed";
}
}
示例10: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
Client.MasterKey = LLUUID.Parse(args[0]);
lock (Client.Network.Simulators)
{
for (int i = 0; i < Client.Network.Simulators.Count; i++)
{
Avatar master = Client.Network.Simulators[i].ObjectsAvatars.Find(
delegate(Avatar avatar)
{
return avatar.ID == Client.MasterKey;
}
);
if (master != null)
{
Client.Self.InstantMessage(master.ID,
"You are now my master. IM me with \"help\" for a command list.");
break;
}
}
}
return "Master set to " + Client.MasterKey.ToString();
}
示例11: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
StringBuilder output = new StringBuilder();
output.AppendLine(Client.Network.CurrentSim.ToString());
output.Append("UUID: ");
output.AppendLine(Client.Network.CurrentSim.ID.ToStringHyphenated());
uint x, y;
Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out x, out y);
output.AppendLine(String.Format("Handle: {0} (X: {1} Y: {2})", Client.Network.CurrentSim.Handle, x, y));
output.Append("Access: ");
output.AppendLine(Client.Network.CurrentSim.Access.ToString());
output.Append("Flags: ");
output.AppendLine(Client.Network.CurrentSim.Flags.ToString());
output.Append("TerrainBase0: ");
output.AppendLine(Client.Network.CurrentSim.TerrainBase0.ToStringHyphenated());
output.Append("TerrainBase1: ");
output.AppendLine(Client.Network.CurrentSim.TerrainBase1.ToStringHyphenated());
output.Append("TerrainBase2: ");
output.AppendLine(Client.Network.CurrentSim.TerrainBase2.ToStringHyphenated());
output.Append("TerrainBase3: ");
output.AppendLine(Client.Network.CurrentSim.TerrainBase3.ToStringHyphenated());
output.Append("TerrainDetail0: ");
output.AppendLine(Client.Network.CurrentSim.TerrainDetail0.ToStringHyphenated());
output.Append("TerrainDetail1: ");
output.AppendLine(Client.Network.CurrentSim.TerrainDetail1.ToStringHyphenated());
output.Append("TerrainDetail2: ");
output.AppendLine(Client.Network.CurrentSim.TerrainDetail2.ToStringHyphenated());
output.Append("TerrainDetail3: ");
output.AppendLine(Client.Network.CurrentSim.TerrainDetail3.ToStringHyphenated());
output.Append("Water Height: ");
output.AppendLine(Client.Network.CurrentSim.WaterHeight.ToString());
return output.ToString();
}
示例12: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
LLUUID target;
if (args.Length != 1)
return "Usage: touch UUID";
if (LLUUID.TryParse(args[0], out target))
{
Primitive targetPrim = Client.Network.CurrentSim.ObjectsPrimitives.Find(
delegate(Primitive prim)
{
return prim.ID == target;
}
);
if (targetPrim != null)
{
Client.Self.Touch(targetPrim.LocalID);
return "Touched prim " + targetPrim.LocalID;
}
}
return "Couldn't find a prim to touch with UUID " + args[0];
}
示例13: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 1)
return "Usage: debug [level] where level is one of None, Debug, Error, Info, Warn";
if (args[0].ToLower() == "debug")
{
Settings.LOG_LEVEL = Helpers.LogLevel.Debug;
return "Logging is set to Debug";
}
else if (args[0].ToLower() == "none")
{
Settings.LOG_LEVEL = Helpers.LogLevel.None;
return "Logging is set to None";
}
else if (args[0].ToLower() == "warn")
{
Settings.LOG_LEVEL = Helpers.LogLevel.Warning;
return "Logging is set to level Warning";
}
else if (args[0].ToLower() == "info")
{
Settings.LOG_LEVEL = Helpers.LogLevel.Info;
return "Logging is set to level Info";
}
else if (args[0].ToLower() == "error")
{
Settings.LOG_LEVEL = Helpers.LogLevel.Error;
return "Logging is set to level Error";
}
else
{
return "Usage: debug [level] where level is one of None, Debug, Error, Info, Warn";
}
}
示例14: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length < 1)
return "Usage: findsim [Simulator Name]";
// Build the simulator name from the args list
string simName = string.Empty;
for (int i = 0; i < args.Length; i++)
simName += args[i] + " ";
simName = simName.TrimEnd().ToLower();
//if (!GridDataCached[Client])
//{
// Client.Grid.RequestAllSims(GridManager.MapLayerType.Objects);
// System.Threading.Thread.Sleep(5000);
// GridDataCached[Client] = true;
//}
GridRegion region;
if (Client.Grid.GetGridRegion(simName, GridLayerType.Objects, out region))
return String.Format("{0}: handle={1} ({2},{3})", region.Name, region.RegionHandle, region.X, region.Y);
else
return "Lookup of " + simName + " failed";
}
示例15: AddUpload
public void AddUpload(LLUUID transactionID, AssetBase asset)
{
AssetTransaction upload = new AssetTransaction();
lock (this.transactions)
{
upload.Asset = asset;
upload.TransactionID = transactionID;
this.transactions.Add(transactionID, upload);
}
if (upload.Asset.Data.Length > 2)
{
//is complete
upload.UploadComplete = true;
AssetUploadCompletePacket response = new AssetUploadCompletePacket();
response.AssetBlock.Type = asset.Type;
response.AssetBlock.Success = true;
response.AssetBlock.UUID = transactionID.Combine(this.ourClient.SecureSessionID);
this.ourClient.OutPacket(response);
m_assetCache.AddAsset(asset);
}
else
{
upload.UploadComplete = false;
upload.XferID = Util.GetNextXferID();
RequestXferPacket xfer = new RequestXferPacket();
xfer.XferID.ID = upload.XferID;
xfer.XferID.VFileType = upload.Asset.Type;
xfer.XferID.VFileID = transactionID.Combine(this.ourClient.SecureSessionID);
xfer.XferID.FilePath = 0;
xfer.XferID.Filename = new byte[0];
this.ourClient.OutPacket(xfer);
}
}