本文整理汇总了C#中libsecondlife.LLUUID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LLUUID.ToString方法的具体用法?C# LLUUID.ToString怎么用?C# LLUUID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsecondlife.LLUUID
的用法示例。
在下文中一共展示了LLUUID.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 1)
return "Usage: downloadtexture [texture-uuid]";
TextureID = LLUUID.Zero;
DownloadHandle.Reset();
Image = null;
Asset = null;
if (LLUUID.TryParse(args[0], out TextureID))
{
Client.Assets.RequestImage(TextureID, ImageType.Normal);
if (DownloadHandle.WaitOne(120 * 1000, false))
{
if (Image != null && Image.Success)
{
if (Asset != null && Asset.Decode())
{
try { File.WriteAllBytes(Image.ID.ToString() + ".jp2", Asset.AssetData); }
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex); }
return String.Format("Saved {0}.jp2 ({1}x{2})", Image.ID, Asset.Image.Width, Asset.Image.Height);
}
else
{
return "Failed to decode texture " + TextureID.ToString();
}
}
else if (Image != null && Image.NotFound)
{
return "Simulator reported texture not found: " + TextureID.ToString();
}
else
{
return "Download failed for texture " + TextureID.ToString();
}
}
else
{
return "Timed out waiting for texture download";
}
}
else
{
return "Usage: downloadtexture [texture-uuid]";
}
}
示例2: LoadFromGrid
public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
{
try
{
Hashtable GridReqParams = new Hashtable();
GridReqParams["UUID"] = UUID.ToString();
GridReqParams["authkey"] = SendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(GridReqParams);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
Hashtable RespData = (Hashtable)GridResp.Value;
this.UUID = new LLUUID((string)RespData["UUID"]);
this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
this.regionname = (string)RespData["regionname"];
this.sim_ip = (string)RespData["sim_ip"];
this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
this.sendkey = SendKey;
this.recvkey = RecvKey;
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
return this;
}
示例3: Groups_OnGroupLeft
void Groups_OnGroupLeft(LLUUID groupID, bool success)
{
Console.WriteLine(Client.ToString() + (success ? " has left group " : " failed to left group ") + groupID.ToString());
leftGroup = success;
GroupsEvent.Set();
}
示例4: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 2)
return "Usage: exportoutfit avataruuid outputfile.xml";
LLUUID id;
try
{
id = new LLUUID(args[0]);
}
catch (Exception)
{
return "Usage: exportoutfit avataruuid outputfile.xml";
}
lock (TestClient.Appearances)
{
if (TestClient.Appearances.ContainsKey(id))
{
try
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
XmlWriter writer = XmlWriter.Create(args[1], settings);
try
{
TestClient.Appearances[id].ToXml(writer);
}
finally
{
writer.Close();
}
}
catch (Exception e)
{
return e.ToString();
}
return "Exported appearance for avatar " + id.ToString() + " to " + args[1];
}
else
{
return "Couldn't find an appearance for avatar " + id.ToString();
}
}
}
示例5: Avatars_OnLookAt
private void Avatars_OnLookAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
LookAtType lookType, float duration, LLUUID id)
{
if (ShowEffects)
Console.WriteLine(
"ViewerEffect [LookAt]: SourceID: {0} TargetID: {1} TargetPos: {2} Type: {3} Duration: {4} ID: {5}",
sourceID.ToString(), targetID.ToString(), targetPos, lookType, duration,
id.ToString());
}
示例6: Avatars_OnEffect
private void Avatars_OnEffect(EffectType type, LLUUID sourceID, LLUUID targetID,
LLVector3d targetPos, float duration, LLUUID id)
{
if (ShowEffects)
Console.WriteLine(
"ViewerEffect [{0}]: SourceID: {1} TargetID: {2} TargetPos: {3} Duration: {4} ID: {5}",
type, sourceID.ToString(), targetID.ToString(), targetPos, duration,
id.ToString());
}
示例7: Avatars_OnAvatarAppearance
void Avatars_OnAvatarAppearance(LLUUID avatarID, bool isTrial, LLObject.TextureEntryFace defaultTexture, LLObject.TextureEntryFace[] faceTextures, System.Collections.Generic.List<byte> visualParams)
{
if (IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.EyesBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) &&
IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.UpperBaked]))
{
Console.WriteLine("Avatar " + avatarID.ToString() + " may be a bot");
}
}
示例8: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
LLUUID landmark = new LLUUID();
if ( ! LLUUID.TryParse(args[0], out landmark) ) {
return "Invalid LLUID";
} else {
Console.WriteLine("Teleporting to " + landmark.ToString());
}
if ( Client.Self.Teleport(landmark) ) {
return "Teleport Succesful";
} else {
return "Teleport Failed";
}
}
示例9: LLUUIDs
public void LLUUIDs()
{
// Creation
LLUUID a = new LLUUID();
byte[] bytes = a.GetBytes();
for (int i = 0; i < 16; i++)
Assert.IsTrue(bytes[i] == 0x00);
// Comparison
a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF }, 0);
LLUUID b = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
Assert.IsTrue(a == b, "LLUUID comparison operator failed, " + a.ToString() + " should equal " +
b.ToString());
// From string
a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
string zeroonetwo = "00010203-0405-0607-0809-0a0b0c0d0e0f";
b = new LLUUID(zeroonetwo);
Assert.IsTrue(a == b, "LLUUID hyphenated string constructor failed, should have " + a.ToString() +
" but we got " + b.ToString());
// ToString()
string one = a.ToString();
string two = b.ToString();
Assert.IsTrue(a == b);
one = a.ToString();
two = b.ToString();
Assert.IsTrue(a == b);
Assert.IsTrue(a == zeroonetwo);
// TODO: CRC test
}
示例10: Execute
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 1)
return Description;
LLUUID targetID;
ReceivedProperties = false;
ReceivedInterests = false;
ReceivedGroups = false;
try
{
targetID = new LLUUID(args[0]);
}
catch (Exception)
{
return Description;
}
// Request all of the packets that make up an avatar profile
Client.Avatars.RequestAvatarProperties(targetID);
// Wait for all the packets to arrive
ReceivedProfileEvent.Reset();
ReceivedProfileEvent.WaitOne(5000, false);
// Check if everything showed up
if (!ReceivedInterests || !ReceivedProperties || !ReceivedGroups)
return "Failed to retrieve a complete profile for that UUID";
// Synchronize our profile
Client.Self.UpdateInterests(Interests);
Client.Self.UpdateProfile(Properties);
// TODO: Leave all the groups we're currently a member of? This could
// break TestClient connectivity that might be relying on group authentication
// Attempt to join all the groups
foreach (LLUUID groupID in Groups)
{
Client.Groups.RequestJoinGroup(groupID);
}
return "Synchronized our profile to the profile of " + targetID.ToString();
}
示例11: Groups_OnGroupJoined
void Groups_OnGroupJoined(LLUUID groupID, bool success)
{
Console.WriteLine(Client.ToString() + (success ? " joined " : " failed to join ") + groupID.ToString());
/* A.Biondi
* This code is not necessary because it is yet present in the
* GroupCommand.cs as well. So the new group will be activated by
* the mentioned command. If the GroupCommand.cs would change,
* just uncomment the following two lines.
if (success)
{
Console.WriteLine(Client.ToString() + " setting " + groupID.ToString() + " as the active group");
Client.Groups.ActivateGroup(groupID);
}
*/
joinedGroup = success;
GetGroupsSearchEvent.Set();
}
示例12: LLUUIDs
public void LLUUIDs()
{
// Comparison
LLUUID a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
LLUUID b = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
Assert.IsTrue(a == b, "LLUUID comparison operator failed, " + a.ToString() + " should equal " +
b.ToString());
// From string
a = new LLUUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
b = new LLUUID("00010203-0405-0607-0809-0a0b0c0d0e0f");
Assert.IsTrue(a == b, "LLUUID hyphenated string constructor failed, should have " + a.ToString() +
" but we got " + b.ToString());
// TODO: CRC test
}
示例13: Main
static void Main(string[] args)
{
if (args.Length < 4)
{
Console.WriteLine("Usage: Key2Name [loginfirstname] [loginlastname] [password] [key]");
return;
}
SecondLife client = new SecondLife();
client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);
Console.WriteLine("Attempting to connect and login to Second Life.");
// Login to Second Life
if (!client.Network.Login(args[0], args[1], args[2], "key2name", "[email protected]"))
{
// Login failed
Console.WriteLine("Error logging in: " + client.Network.LoginMessage);
return;
}
LLUUID lookup = new LLUUID();
LLUUID.TryParse(args[3], out lookup);
Console.WriteLine("Looking up name for " + lookup.ToString());
client.Avatars.RequestAvatarName(lookup);
if (!NameEvent.WaitOne(15 * 1000, false))
Console.WriteLine("Name lookup timed out.");
Console.WriteLine("Press enter to logout.");
Console.ReadLine();
client.Network.Logout();
}
示例14: Self_OnInstantMessage
private void Self_OnInstantMessage(LLUUID fromAgentID, string fromAgentName, LLUUID toAgentID, uint parentEstateID,
LLUUID regionID, LLVector3 position, byte dialog, bool groupIM, LLUUID imSessionID, DateTime timestamp,
string message, byte offline, byte[] binaryBucket)
{
if (Master.Length > 0)
{
if (fromAgentName.ToLower().Trim() != Master.ToLower().Trim())
{
// Received an IM from someone that is not the bot's master, ignore
Console.WriteLine("<IM>" + fromAgentName + " (not master): " + message + "@" + regionID.ToString() + ":" + position.ToString() );
return;
}
}
else
{
if (GroupMembers != null && !GroupMembers.ContainsKey(fromAgentID))
{
// Received an IM from someone outside the bot's group, ignore
Console.WriteLine("<IM>" + fromAgentName + " (not in group): " + message + "@" + regionID.ToString() + ":" + position.ToString());
return;
}
}
Console.WriteLine("<IM>" + fromAgentName + ": " + message);
if (Self.ID == toAgentID)
{
if (dialog == 22)
{
Console.WriteLine("Accepting teleport lure");
Self.TeleportLureRespond(fromAgentID, true);
}
else
{
DoCommand(message, fromAgentID, imSessionID);
}
}
else
{
// This shouldn't happen
Console.WriteLine("A bot that we aren't tracking received an IM?");
}
}
示例15: Execute
//.........这里部分代码省略.........
{
if (TestClient.SimPrims.ContainsKey(Client.Network.CurrentSim))
{
foreach (PrimObject prim in TestClient.SimPrims[Client.Network.CurrentSim].Values)
{
if (prim.ID == id)
{
if (prim.ParentID != 0)
{
localid = prim.ParentID;
}
else
{
localid = prim.LocalID;
}
break;
}
}
}
}
if (localid != 0)
{
// Check for export permission first
Client.Objects.RequestObjectPropertiesFamily(Client.Network.CurrentSim, id);
GotPermissionsEvent.WaitOne(5000, false);
if (!GotPermissions)
{
return "Couldn't fetch permissions for the requested object, try again";
}
else
{
GotPermissions = false;
if (Properties == null)
{
return "Null object properties returned, may be a bug. Try again";
}
if (Properties.OwnerID != Client.Network.AgentID)
{
// We need a MasterID field, those exports should be allowed as well
return "That object is owned by " + Properties.OwnerID + ", we don't have permission " +
"to export it";
}
}
try
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
XmlWriter writer = XmlWriter.Create(file, settings);
try
{
List<PrimObject> prims = new List<PrimObject>();
lock (TestClient.SimPrims)
{
if (TestClient.SimPrims.ContainsKey(Client.Network.CurrentSim))
{
foreach (PrimObject prim in TestClient.SimPrims[Client.Network.CurrentSim].Values)
{
if (prim.LocalID == localid || prim.ParentID == localid)
{
prims.Add(prim);
count++;
}
}
}
}
//Serialize it!
Helpers.PrimListToXml(prims, writer);
}
finally
{
writer.Close();
}
}
catch (Exception e)
{
string ret = "Failed to write to " + file + ":" + e.ToString();
if (ret.Length > 1000)
{
ret = ret.Remove(1000);
}
return ret;
}
return "Exported " + count + " prims to " + file;
}
else
{
return "Couldn't find UUID " + id.ToString() + " in the " +
TestClient.SimPrims[Client.Network.CurrentSim].Count +
"objects currently indexed in the current simulator";
}
}