示例#1
0
        private void Client_UploadDataCompleted(object sender, UploadDataCompletedEventArgs e)
        {
            if (OnComplete != null && !e.Cancelled)
            {
                if (e.Error == null)
                {
                    LLSD result = LLSDParser.DeserializeXml(e.Result);

                    try { OnComplete(this, result, e.Error); }
                    catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
                }
                else
                {
                    if (Helpers.StringContains(e.Error.Message, "502"))
                    {
                        // These are normal, retry the request automatically
                        SecondLife.DebugLogStatic("502 error from capability " + _Client.Location);
                        StartRequest(_PostData, _ContentType);
                    }
                    else
                    {
                        try { OnComplete(this, null, e.Error); }
                        catch (Exception ex) { SecondLife.LogStatic(ex.ToString(), Helpers.LogLevel.Error); }
                    }
                }
            }
            else if (e.Cancelled)
            {
                SecondLife.DebugLogStatic("Capability action at " + _Client.Location + " cancelled");
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public sceneviewer()
        {
            Graphics = new GraphicsDeviceManager(this);
            Graphics.MinimumPixelShaderProfile      = ShaderProfile.PS_2_0;
            Graphics.PreferMultiSampling            = false;
            Graphics.SynchronizeWithVerticalRetrace = false;

            Content = new ContentManager(Services);

            KeysPressedThisFrame  = new List <Keys>();
            KeysReleasedThisFrame = new List <Keys>();
            Prims  = new Dictionary <uint, PrimVisual>();
            Client = new SecondLife();

            this.IsMouseVisible      = true;
            Window.AllowUserResizing = true;

            CurrentKeyboardState = Keyboard.GetState();
            CurrentMouseState    = Mouse.GetState();
            KeysHeldDown         = Keyboard.GetState().GetPressedKeys();

            Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged);
            this.Exiting             += new EventHandler(sceneviewer_Exiting);

            Camera = new Camera(this.Window, new Vector3(-10, -10, 40), new Vector3(255, 255, 40));
        }
示例#3
0
        public ImageDownloader(SecondLife instance, SLNetCom netcoms, InventoryItem item, ImageCache imageCache, string savepath)
        {
            InitializeComponent();
            //SecondLife secondlife, SLNetCom netcoms,
            netcom          = netcoms;
            client          = instance;
            this.item       = item;
            this.imagecache = imageCache;
            this.FilePath   = savepath;

            if (imageCache.ContainsImage(item.AssetUUID))
            {
                SetFinalImage(this.imagecache.GetImage(item.AssetUUID));
            }
            else
            {
                this.Disposed += new EventHandler(InventoryImageConsole_Disposed);
                client.Assets.OnImageReceived += new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
                SetStatusBoxText("Requesting: " + item.Name);
                client.Assets.RequestImage(item.AssetUUID, ImageType.Normal, 125000.0f, 0);
                this.Decoded = false;
                // Wait for the event to trigger
                queryEvent.WaitOne(8000, false);
            }
        }
示例#4
0
        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", "*****@*****.**"))
            {
                // 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();
        }
示例#5
0
        public ConnectionManager(SecondLife client, int timerFrequency)
        {
            Client = client;

            CheckTimer = new System.Timers.Timer(timerFrequency);
            CheckTimer.Elapsed += new System.Timers.ElapsedEventHandler(CheckTimer_Elapsed);
        }
示例#6
0
        private void cmdConnect_Click(object sender, EventArgs e)
        {
            if (cmdConnect.Text == "Connect")
            {
                cmdConnect.Text      = "Disconnect";
                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;

                if (!Client.Network.Login(txtFirstName.Text, txtLastName.Text, txtPassword.Text, "SL Image Upload",
                                          "*****@*****.**"))
                {
                    MessageBox.Show(this, String.Format("Error logging in ({0}): {1}", Client.Network.LoginErrorKey,
                                                        Client.Network.LoginMessage));
                    cmdConnect.Text      = "Connect";
                    txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
                    DisableUpload();
                }
            }
            else
            {
                Client.Network.Logout();
                cmdConnect.Text      = "Connect";
                txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
                DisableUpload();

                // HACK: Create a new SecondLife object until it can clean up properly after itself
                Client = new SecondLife();
            }
        }
示例#7
0
        /// <summary>
        /// </summary>
        /// <param name="client"></param>
        internal AssetManager(SecondLife client)
        {
            slClient = client;

            // Used to upload small assets, or as an initial start packet for large transfers
            PacketCallback AssetUploadCompleteCallback = new PacketCallback(AssetUploadCompleteCallbackHandler);

            slClient.Network.RegisterCallback(PacketType.AssetUploadComplete, AssetUploadCompleteCallback);

            // Transfer Packets for downloading large assets
            PacketCallback TransferInfoCallback = new PacketCallback(TransferInfoCallbackHandler);

            slClient.Network.RegisterCallback(PacketType.TransferInfo, TransferInfoCallback);

            PacketCallback TransferPacketCallback = new PacketCallback(TransferPacketCallbackHandler);

            slClient.Network.RegisterCallback(PacketType.TransferPacket, TransferPacketCallback);

            // XFer packets for uploading large assets
            PacketCallback ConfirmXferPacketCallback = new PacketCallback(ConfirmXferPacketCallbackHandler);

            slClient.Network.RegisterCallback(PacketType.ConfirmXferPacket, ConfirmXferPacketCallback);

            PacketCallback RequestXferCallback = new PacketCallback(RequestXferCallbackHandler);

            slClient.Network.RegisterCallback(PacketType.RequestXfer, RequestXferCallback);
        }
示例#8
0
        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);
        }
示例#9
0
        /// <summary>
        /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
        /// </summary>
        /// <returns></returns>
        public static bool Shoot(SecondLife client)
        {
            if (client.Settings.SEND_AGENT_UPDATES)
            {
                client.Self.Movement.Mouselook    = true;
                client.Self.Movement.MLButtonDown = true;
                client.Self.Movement.SendUpdate();

                client.Self.Movement.MLButtonUp   = true;
                client.Self.Movement.MLButtonDown = false;
                client.Self.Movement.FinishAnim   = true;
                client.Self.Movement.SendUpdate();

                client.Self.Movement.Mouselook  = false;
                client.Self.Movement.MLButtonUp = false;
                client.Self.Movement.FinishAnim = false;
                client.Self.Movement.SendUpdate();

                return(true);
            }
            else
            {
                Logger.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning, client);
                return(false);
            }
        }
示例#10
0
        public frmBots(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            client        = this.instance.Client;
            //netcom = this.instance.Netcom;
            //netcom.NetcomSync = this;

            //client.Settings.DEBUG = true;
            //client.Settings.LOG_RESENDS = false;
            //client.Settings.SEND_AGENT_UPDATES = true;
            //client.Settings.USE_TEXTURE_CACHE = true;

            //client.Network.RegisterCallback(PacketType.AvatarAppearance, new NetworkManager.PacketCallback(AvatarAppearanceHandler));
            //PacketType.AvatarAppearance += new NetworkManager.PacketCallback(AvatarAppearanceHandler);



            //Console.WriteLine("setting " + currentGroup.Name + " as active group");
            //Client.Groups.ActivateGroup(currentGroup.ID);
            //GroupsEvent.WaitOne(30000, false);

            //Client.Network.UnregisterCallback(PacketType.AgentDataUpdate, pcallback);
        }
示例#11
0
        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));
        }
示例#12
0
        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",
                                                                                        "*****@*****.**");
            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();
        }
示例#13
0
        public TextureEntry AgentTextureEntry = new TextureEntry("C228D1CF4B5D4BA884F4899A0796AA97"); // if this isn't valid, blame JH ;-)



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

            RegisterCallbacks();
        }
示例#14
0
        public void AddClient(SecondLife client)
        {
            Global.ClientsMutex.WaitOne();
            Global.Clients.Add(client);
            Global.ClientsMutex.ReleaseMutex();

            Overview.ClientAdded(client);
        }
示例#15
0
        public SetAppearanceCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "setapp";
            Description = "Set appearance to what's stored in the DB.";
        }
示例#16
0
        public QuitCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "quit";
            Description = "Log all avatars out and shut down";
        }
        public ExportOutfitCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "exportoutfit";
            Description = "Exports an avatars outfit to an xml file. Usage: exportoutfit avataruuid outputfile.xml";
        }
示例#18
0
        public GotoCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "goto";
            Description = "Teleport to a location (e.g. \"goto Hooper/100/100/30\")";
        }
示例#19
0
        public EchoMasterCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "echoMaster";
            Description = "Repeat everything that master says.";
        }
        public ImportOutfitCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "importoutfit";
            Description = "Imports an appearance from an xml file. Usage: importoutfit inputfile.xml";
        }
示例#21
0
        public JumpCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "jump";
            Description = "Teleports to the specified height. (e.g. \"jump 1000\")";
        }
示例#22
0
        public LocationCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "location";
            Description = "Show the location.";
        }
示例#23
0
        public WhisperCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "whisper";
            Description = "Whisper something.";
        }
示例#24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="client"></param>
        public AppearanceManager(SecondLife client)
        {
            Client = client;
            Client.Network.RegisterCallback(libsecondlife.Packets.PacketType.AgentWearablesUpdate, new NetworkManager.PacketCallback(AgentWearablesUpdateCallbackHandler));

            AManager = client.Assets;
            AManager.TransferRequestCompletedEvent += new AssetManager.On_TransferRequestCompleted(AManager_TransferRequestCompletedEvent);
        }
示例#25
0
        public TreeCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "tree";
            Description = "Rez a tree.";
        }
示例#26
0
        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]";
        }
示例#27
0
        public PrimCountCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "primCount";
            Description = "Shows the number of prims that have been received.";
        }
示例#28
0
        public GiveAllCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "giveAll";
            Description = "Gives you all it's money.";
        }
示例#29
0
        public SitCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "sit";
            Description = "Attempt to sit on the closest prim";
        }
示例#30
0
        public UptimeCommand(TestClient testClient)
        {
            TestClient = testClient;
            Client     = (SecondLife)TestClient;

            Name        = "uptime";
            Description = "Shows the login name, login time and length of time logged on.";
        }
示例#31
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to the SecondLife client</param>
        /// <param name="totalLayers">Total number of layers this layer set is
        /// composed of</param>
        /// <param name="paramValues">Appearance parameters the drive the 
        /// baking process</param>
        /// <param name="width">Width of the final baked image</param>
        /// <param name="height">Height of the final baked image</param>
        public Baker(SecondLife client, AppearanceManager.BakeType bakeType, int textureCount, Dictionary<int, float> paramValues)
        {
            Client = client;
            BakeType = bakeType;
            TextureCount = textureCount;

            if (bakeType == AppearanceManager.BakeType.Eyes)
            {
                BakeWidth = 128;
                BakeHeight = 128;
            }
            else
            {
                BakeWidth = 512;
                BakeHeight = 512;
            }

            ParamValues = paramValues;

            if (textureCount == 0)
                Bake();
        }