本文整理汇总了C#中libsecondlife.SecondLife.Tick方法的典型用法代码示例。如果您正苦于以下问题:C# SecondLife.Tick方法的具体用法?C# SecondLife.Tick怎么用?C# SecondLife.Tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsecondlife.SecondLife
的用法示例。
在下文中一共展示了SecondLife.Tick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: ParcelDownloader [loginfirstname] [loginlastname] [password]");
return;
}
client = new SecondLife();
Dictionary<string, object> loginParams = NetworkManager.DefaultLoginValues(args[0], args[1], args[2],
"00:00:00:00:00:00", "last", "Win", "0", "ParcelDownload", "Adam \"Zaius\" Frisby <[email protected]>");
if (!client.Network.Login(loginParams))
{
// Login failed
Console.WriteLine("ERROR: " + client.Network.LoginError);
return;
}
// The magic happens in these three lines
client.Network.CurrentSim.Region.FillParcels(); // Tell libsl to download parcels
System.Threading.Thread.Sleep(10000); // Give it some time to do it
client.Tick(); // Let things happen
// Dump some info about our parcels
foreach (int pkey in client.Network.CurrentSim.Region.Parcels.Keys)
{
Parcel parcel = (Parcel)client.Network.CurrentSim.Region.Parcels[pkey];
// Probably should comment this out :-)
//parcel.Buy(client,false,new LLUUID());
Console.WriteLine("<Parcel>");
Console.WriteLine("\tName: " + parcel.Name);
Console.WriteLine("\tSize: " + parcel.Area);
Console.WriteLine("\tDesc: " + parcel.Desc);
}
client.Network.Logout();
return;
}
示例2: Main
static void Main(string[] args)
{
SecondLife client;
if (args.Length == 0 || (args.Length < 3 && args[0] != "--printmap"))
{
Console.WriteLine("Usage: sldump [--printmap] [--decrypt] [inputfile] [outputfile] [--protocol] [firstname] " +
"[lastname] [password]");
return;
}
if (args[0] == "--decrypt")
{
try
{
ProtocolManager.DecodeMapFile(args[1], args[2]);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
return;
}
client = new SecondLife();
if (args[0] == "--printmap")
{
ProtocolManager protocol;
try
{
protocol = new ProtocolManager("message_template.msg", client);
}
catch (Exception e)
{
// Error initializing the client, probably missing file(s)
Console.WriteLine(e.ToString());
return;
}
protocol.PrintMap();
return;
}
// Setup the packet callback and disconnect event handler
client.Network.RegisterCallback(PacketType.Default, new PacketCallback(DefaultHandler));
client.Network.OnDisconnected += new DisconnectCallback(DisconnectHandler);
Dictionary<string, object> loginParams = NetworkManager.DefaultLoginValues(args[0], args[1], args[2],
"0", "last", "Win", "0", "sldump", "[email protected]");
// An example of how to pass additional options to the login server
//loginParams["id0"] = "65e142a8d3c1ee6632259f111cb168c9";
//loginParams["viewer_digest"] = "0e63550f-0991-a092-3158-b4206e728ffa";
if (!client.Network.Login(loginParams/*, "http://127.0.0.1:8080/"*/))
{
// Login failed
Console.WriteLine("Error logging in: " + client.Network.LoginError);
return;
}
// Login was successful
Console.WriteLine("Message of the day: " + client.Network.LoginValues["message"]);
while (true)
{
client.Tick();
}
}
示例3: Main
static void Main(string[] args)
{
SecondLife client;
if (args.Length < 5)
{
Console.WriteLine("Usage: name2key [loginfirstname] [loginlastname] [password] [firstname] [lastname]");
return;
}
client = new SecondLife();
// Setup the callback
client.Network.RegisterCallback(PacketType.DirPeopleReply, new PacketCallback(QueryHandler));
// Setup the login values
Dictionary<string, object> loginParams = NetworkManager.DefaultLoginValues(args[0], args[1], args[2],
"00:00:00:00:00:00", "last", "Win", "0", "name2key", "[email protected]");
if (!client.Network.Login(loginParams))
{
// Login failed
Console.WriteLine("ERROR: " + client.Network.LoginError);
return;
}
// Send the Query
DirFindQueryPacket find = new DirFindQueryPacket();
find.AgentData.AgentID = client.Network.AgentID;
find.AgentData.SessionID = client.Network.SessionID;
find.QueryData.QueryFlags = 1;
find.QueryData.QueryText = Helpers.StringToField(args[3] + " " + args[4]);
find.QueryData.QueryID = new LLUUID("00000000000000000000000000000001");
find.QueryData.QueryStart = 0;
client.Network.SendPacket((Packet)find);
while (waiting)
{
client.Tick();
}
client.Network.Logout();
}