當前位置: 首頁>>代碼示例>>C#>>正文


C# SecondLife.Tick方法代碼示例

本文整理匯總了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;
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:40,代碼來源:ParcelDownload.cs

示例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();
            }
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:72,代碼來源:sldump.cs

示例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();
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:44,代碼來源:name2key.cs


注:本文中的libsecondlife.SecondLife.Tick方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。