2008-01-01 00:29:51 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient.Commands
|
2008-01-01 00:29:51 +00:00
|
|
|
{
|
|
|
|
|
class ShowEventDetailsCommand : Command
|
|
|
|
|
{
|
|
|
|
|
public ShowEventDetailsCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "showevent";
|
|
|
|
|
Description = "Shows an Events details. Usage: showevent [eventID]";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.Other;
|
2008-01-01 00:29:51 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2008-01-01 00:29:51 +00:00
|
|
|
{
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
return "Usage: showevent [eventID] (use searchevents to get ID)";
|
2009-10-10 06:38:07 +00:00
|
|
|
|
|
|
|
|
Client.Directory.EventInfoReply += Directory_EventDetails;
|
2008-01-01 00:29:51 +00:00
|
|
|
uint eventID;
|
|
|
|
|
|
|
|
|
|
if (UInt32.TryParse(args[0], out eventID))
|
|
|
|
|
{
|
|
|
|
|
Client.Directory.EventInfoRequest(eventID);
|
2009-10-10 06:38:07 +00:00
|
|
|
return "Sent query for Event " + eventID;
|
2008-01-01 00:29:51 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "Usage: showevent [eventID] (use searchevents to get ID)";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-10 06:38:07 +00:00
|
|
|
void Directory_EventDetails(object sender, EventInfoReplyEventArgs e)
|
2008-01-01 00:29:51 +00:00
|
|
|
{
|
2009-10-10 06:38:07 +00:00
|
|
|
float x, y;
|
|
|
|
|
Helpers.GlobalPosToRegionHandle((float)e.MatchedEvent.GlobalPos.X, (float)e.MatchedEvent.GlobalPos.Y, out x, out y);
|
|
|
|
|
StringBuilder sb = new StringBuilder("secondlife://" + e.MatchedEvent.SimName + "/" + x + "/" + y + "/0" + System.Environment.NewLine);
|
|
|
|
|
sb.AppendLine(e.MatchedEvent.ToString());
|
|
|
|
|
|
|
|
|
|
//sb.AppendFormat(" Name: {0} ({1})" + System.Environment.NewLine, e.MatchedEvent.Name, e.MatchedEvent.ID);
|
|
|
|
|
//sb.AppendFormat(" Location: {0}/{1}/{2}" + System.Environment.NewLine, e.MatchedEvent.SimName, x, y);
|
|
|
|
|
//sb.AppendFormat(" Date: {0}" + System.Environment.NewLine, e.MatchedEvent.Date);
|
|
|
|
|
//sb.AppendFormat("Description: {0}" + System.Environment.NewLine, e.MatchedEvent.Desc);
|
2008-01-01 00:29:51 +00:00
|
|
|
Console.WriteLine(sb.ToString());
|
2009-10-10 06:38:07 +00:00
|
|
|
Client.Directory.EventInfoReply -= Directory_EventDetails;
|
2008-01-01 00:29:51 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|