当前位置: 首页>>代码示例>>C#>>正文


C# libsecondlife.SecondLife类代码示例

本文整理汇总了C#中libsecondlife.SecondLife的典型用法代码示例。如果您正苦于以下问题:C# SecondLife类的具体用法?C# SecondLife怎么用?C# SecondLife使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SecondLife类属于libsecondlife命名空间,在下文中一共展示了SecondLife类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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.Directory.OnDirPeopleReply += new DirectoryManager.DirPeopleReplyCallback(DirQueryHandler);

			if (!client.Network.Login(args[0], args[1], args[2], "name2key", "[email protected]"))
			{
				// Login failed
				Console.WriteLine("ERROR: " + client.Network.LoginMessage);
				return;
			}

			// Send the Query
            queryID = client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, args[3] + " " + args[4], 0);
            
            // Wait for the event to trigger
            queryEvent.WaitOne(8000, false);

			client.Network.Logout();
		}
开发者ID:chrbayer84,项目名称:SLAgentCSServer,代码行数:30,代码来源:name2key.cs

示例2: Main

    public static void Main(string[] args)
    {
        // configure the proxy
        client = new SecondLife("../data/keywords.txt", "../data/message_template.msg");
        protocolManager = client.Protocol;
        ProxyConfig proxyConfig = new ProxyConfig("Analyst", "[email protected]", protocolManager, args);
        proxy = new Proxy(proxyConfig);

        // build the table of /command delegates
        InitializeCommandDelegates();

        // add delegates for login
        proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
        proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));

        // add a delegate for outgoing chat
        proxy.AddDelegate("ChatFromViewer", Direction.Incoming, new PacketDelegate(ChatFromViewerIn));
        proxy.AddDelegate("ChatFromViewer", Direction.Outgoing, new PacketDelegate(ChatFromViewerOut));

        //  handle command line arguments
        foreach (string arg in args)
            if (arg == "--log-all")
                LogAll();
            else if (arg == "--log-login")
                logLogin = true;

        // start the proxy
        proxy.Start();
    }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:29,代码来源:Analyst.cs

示例3: AppearanceManager

        public AppearanceManager(SecondLife client)
        {
            Client = client;
            AManager = client.Assets;

            RegisterCallbacks();
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:7,代码来源:AppearanceManager.cs

示例4: SleekInstance

        public SleekInstance(bool firstInstance)
        {
            this.firstInstance = firstInstance;

            client = new SecondLife();
            client.Settings.ALWAYS_REQUEST_OBJECTS = true;
            client.Settings.ALWAYS_DECODE_OBJECTS = true;
            client.Settings.OBJECT_TRACKING = true;
            client.Settings.ENABLE_SIMSTATS = true;
            client.Settings.FETCH_MISSING_INVENTORY = true;
            client.Settings.MULTIPLE_SIMS = true;
            client.Settings.SEND_AGENT_THROTTLE = true;
            client.Settings.SEND_AGENT_UPDATES = true;

            netcom = new SLNetCom(client);

            imageCache = new ImageCache();
            state = new StateManager(this);
            InitializeConfig();

            mainForm = new frmMain(this);
            mainForm.InitializeControls();
            tabsConsole = mainForm.TabConsole;

            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
        }
开发者ID:SObS,项目名称:SLeek,代码行数:26,代码来源:SleekInstance.cs

示例5: 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();
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:29,代码来源:Program.cs

示例6: frmGroupInfo

        public frmGroupInfo(Group group, SecondLife client)
        {
            InitializeComponent();

            while (!IsHandleCreated)
            {
                // Force handle creation
                IntPtr temp = Handle;
            }

            Group = group;
            Client = client;

            Client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);

            // Request the group information

            Client.Groups.BeginGetGroupProfile(Group.ID,
                new GroupManager.GroupProfileCallback(GroupProfileHandler));

            Client.Groups.BeginGetGroupMembers(Group.ID,
                new GroupManager.GroupMembersCallback(GroupMembersHandler));

            Client.Groups.BeginGetGroupTitles(Group.ID,
                new GroupManager.GroupTitlesCallback(GroupTitlesHandler));
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:26,代码来源:frmGroupInfo.cs

示例7: Shoot

 /// <summary>
 /// Aims at the specified position, enters mouselook, presses and
 /// releases the left mouse button, and leaves mouselook
 /// </summary>
 /// <param name="target">Target to shoot at</param>
 /// <returns></returns>
 public static bool Shoot(SecondLife client, LLVector3 target)
 {
     if (client.Self.Movement.TurnToward(target))
         return Shoot(client);
     else
         return false;
 }
开发者ID:chrbayer84,项目名称:SLAgentCSServer,代码行数:13,代码来源:Utilities.cs

示例8: Main

        static void Main(string[] args)
        {
            if (args.Length < 4)
            {
                Console.WriteLine("Usage: Key2Name [loginfirstname] [loginlastname] [password] [key]");
                return;
            }

            SecondLife client = new SecondLife();
            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;
            }

            AvatarTracker avatarTracker = new AvatarTracker(client);

            LLUUID lookup = new LLUUID();
            LLUUID.TryParse(args[3], out lookup);

            Console.WriteLine("Looking up name for " + lookup.ToStringHyphenated());

            string name = avatarTracker.GetAvatarName(lookup);

            Console.WriteLine("Name: " + name + Environment.NewLine + "Press enter to logout.");
            Console.ReadLine();

            client.Network.Logout();
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:33,代码来源:key2name.cs

示例9: frmGroupInfo

        public frmGroupInfo(Group group, SecondLife client)
        {
            InitializeComponent();

            while (!IsHandleCreated)
            {
                // Force handle creation
                IntPtr temp = Handle;
            }

            GroupProfileCallback = new GroupManager.GroupProfileCallback(GroupProfileHandler);
            GroupMembersCallback = new GroupManager.GroupMembersCallback(GroupMembersHandler);
            GroupTitlesCallback = new GroupManager.GroupTitlesCallback(GroupTitlesHandler);
            AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);
            ImageReceivedCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);

            Group = group;
            Client = client;
            
            // Register the callbacks for this form
            Client.Assets.OnImageReceived += ImageReceivedCallback;
            Client.Groups.OnGroupProfile += GroupProfileCallback;
            Client.Groups.OnGroupMembers += GroupMembersCallback;
            Client.Groups.OnGroupTitles += GroupTitlesCallback;
            Client.Avatars.OnAvatarNames += AvatarNamesCallback;

            // Request the group information
            Client.Groups.RequestGroupProfile(Group.ID);
            Client.Groups.RequestGroupMembers(Group.ID);
            Client.Groups.RequestGroupTitles(Group.ID);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:31,代码来源:frmGroupInfo.cs

示例10: SitCommand

        public SitCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client = (SecondLife)TestClient;

            Name = "sit";
            Description = "Attempt to sit on the closest prim";
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:8,代码来源:SitCommand.cs

示例11: LogoutCommand

        public LogoutCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client = (SecondLife)TestClient;

            Name = "logout";
            Description = "Log this avatar out";
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:8,代码来源:LogoutCommand.cs

示例12: FindSimCommand

        public FindSimCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client = (SecondLife)TestClient;

            Name = "findsim";
            Description = "Searches for a simulator and returns information about it. Usage: findsim [Simulator Name]";
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:8,代码来源:FindSimCommand.cs

示例13: LoadCommand

        public LoadCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client = (SecondLife)TestClient;

            Name = "load";
            Description = "Loads commands from a dll. (Usage: load AssemblyNameWithoutExtension)";
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:8,代码来源:LoadCommand.cs

示例14: SLNetCom

        public SLNetCom(SecondLife client)
        {
            this.client = client;
            loginOptions = new LoginOptions();

            AddClientEvents();
            AddPacketCallbacks();
        }
开发者ID:SObS,项目名称:SLeek,代码行数:8,代码来源:SLNetCom.cs

示例15: GridManager

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="client">Instance of type SecondLife to associate with this GridManager instance</param>
        public GridManager(SecondLife client)
        {
            Client = client;
            SunDirection = LLVector3.Zero;

            Client.Network.RegisterCallback(PacketType.MapBlockReply, new NetworkManager.PacketCallback(MapBlockReplyHandler));
            Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new NetworkManager.PacketCallback(TimeMessageHandler));
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:12,代码来源:GridManager.cs


注:本文中的libsecondlife.SecondLife类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。