Пример #1
0
        void netcom_ClientConnected(object sender, EventArgs e)
        {
            try
            {
                if (!Directory.Exists(ClientDir))
                    Directory.CreateDirectory(ClientDir);
            }
            catch (Exception ex)
            {
                Logger.Log("Failed to create client directory", Helpers.LogLevel.Warning, ex);
            }

            clientSettings = new Settings(Path.Combine(ClientDir, "client_settings.xml"));
            client.Self.RequestMuteList();
        }
Пример #2
0
        public MediaConsole(RadegastInstance instance)
        {
            InitializeComponent();
            DisposeOnDetachedClose = false;
            Text = "Media";

            Disposed += new EventHandler(MediaConsole_Disposed);

            this.instance = instance;
            this.parcelStream = new Media.Stream();

            s = instance.GlobalSettings;

            // Set some defaults in case we don't have them in config
            audioVolume = 0.2f;
            objVolume.Value = 50;
            instance.MediaManager.ObjectVolume = 1f;

            // Restore settings
            if (s["parcel_audio_url"].Type != OSDType.Unknown)
                txtAudioURL.Text = s["parcel_audio_url"].AsString();
            if (s["parcel_audio_vol"].Type != OSDType.Unknown)
                audioVolume = (float)s["parcel_audio_vol"].AsReal();
            if (s["parcel_audio_play"].Type != OSDType.Unknown)
                cbPlayAudioStream.Checked = s["parcel_audio_play"].AsBoolean();
            if (s["parcel_audio_keep_url"].Type != OSDType.Unknown)
                cbKeep.Checked = s["parcel_audio_keep_url"].AsBoolean();
            if (s["object_audio_enable"].Type != OSDType.Unknown)
                cbObjSoundEnable.Checked = s["object_audio_enable"].AsBoolean();
            if (s["object_audio_vol"].Type != OSDType.Unknown)
            {
                instance.MediaManager.ObjectVolume = (float)s["object_audio_vol"].AsReal();
                objVolume.Value = (int)(50f * instance.MediaManager.ObjectVolume);
            }
            if (s["ui_audio_vol"].Type != OSDType.Unknown)
            {
                instance.MediaManager.UIVolume = (float)s["ui_audio_vol"].AsReal();
                UIVolume.Value = (int)(50f * instance.MediaManager.UIVolume);
            }

            volAudioStream.Value = (int)(audioVolume * 50);
            instance.MediaManager.ObjectEnable = cbObjSoundEnable.Checked;

            configTimer = new System.Threading.Timer(SaveConfig, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);

            if (!instance.MediaManager.SoundSystemAvailable)
            {
                foreach (Control c in pnlParcelAudio.Controls)
                    c.Enabled = false;
            }

            // GUI Events
            volAudioStream.Scroll += new EventHandler(volAudioStream_Scroll);
            txtAudioURL.TextChanged += new EventHandler(txtAudioURL_TextChanged);
            cbKeep.CheckedChanged += new EventHandler(cbKeep_CheckedChanged);
            cbPlayAudioStream.CheckedChanged += new EventHandler(cbPlayAudioStream_CheckedChanged);
            lblStation.Tag = lblStation.Text = string.Empty;
            lblStation.Click += new EventHandler(lblStation_Click);

            objVolume.Scroll += new EventHandler(volObject_Scroll);
            cbObjSoundEnable.CheckedChanged += new EventHandler(cbObjEnableChanged);

            // Network callbacks
            client.Parcels.ParcelProperties += new EventHandler<ParcelPropertiesEventArgs>(Parcels_ParcelProperties);

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
Пример #3
0
        private void InitializeLoggingAndConfig()
        {
            try
            {
                userDir = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData), Properties.Resources.ProgramName);
                if (!Directory.Exists(userDir))
                {
                    Directory.CreateDirectory(userDir);
                }
            }
            catch (Exception)
            {
                userDir = System.Environment.CurrentDirectory;
            };

            globalLogFile = Path.Combine(userDir, Properties.Resources.ProgramName + ".log");
            globalSettings = new Settings(Path.Combine(userDir, "settings.xml"));
            frmSettings.InitSettigs(globalSettings);
        }
Пример #4
0
 void Network_LoginProgress(object sender, LoginProgressEventArgs e)
 {
     if (e.Status == LoginStatus.ConnectingToSim)
     {
         try
         {
             if (!Directory.Exists(ClientDir))
             {
                 Directory.CreateDirectory(ClientDir);
             }
             clientSettings = new Settings(Path.Combine(ClientDir, "client_settings.xml"));
         }
         catch (Exception ex)
         {
             Logger.Log("Failed to create client directory", Helpers.LogLevel.Warning, ex);
         }
     }
 }
Пример #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // These are order-dependant
            Network = new NetworkManager(this);
            Settings = new Settings(this);
            Parcels = new ParcelManager(this);
            Self = new AgentManager(this);
            Avatars = new AvatarManager(this);
            Friends = new FriendsManager(this);
            Grid = new GridManager(this);
            Objects = new ObjectManager(this);
            Groups = new GroupManager(this);
            Assets = new AssetManager(this);
            Appearance = new AppearanceManager(this, Assets);
            Inventory = new InventoryManager(this);
            Directory = new DirectoryManager(this);
            Terrain = new TerrainManager(this);
            Sound = new SoundManager(this);
            Throttle = new AgentThrottle(this);

            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };
        }
Пример #6
0
        public frmSettings(RadegastInstance instance)
            : base(instance)
        {
            if (settingInitialized)
            {
                frmSettings.InitSettigs(instance.GlobalSettings, instance.MonoRuntime);
            }

            InitializeComponent();
            AutoSavePosition = true;

            s = instance.GlobalSettings;
            tbpGraphics.Controls.Add(new Radegast.Rendering.GraphicsPreferences(instance));
            cbChatTimestamps.Checked = s["chat_timestamps"].AsBoolean();

            cbIMTimeStamps.Checked = s["im_timestamps"].AsBoolean();

            cbChatTimestamps.CheckedChanged += new EventHandler(cbChatTimestamps_CheckedChanged);
            cbIMTimeStamps.CheckedChanged += new EventHandler(cbIMTimeStamps_CheckedChanged);

            cbTrasactDialog.Checked = s["transaction_notification_dialog"].AsBoolean();
            cbTrasactChat.Checked = s["transaction_notification_chat"].AsBoolean();

            cbFriendsNotifications.Checked = s["show_friends_online_notifications"].AsBoolean();
            cbFriendsNotifications.CheckedChanged += new EventHandler(cbFriendsNotifications_CheckedChanged);

            cbAutoReconnect.Checked = s["auto_reconnect"].AsBoolean();
            cbAutoReconnect.CheckedChanged += new EventHandler(cbAutoReconnect_CheckedChanged);

            cbResolveURIs.Checked = s["resolve_uris"].AsBoolean();
            cbResolveURIs.CheckedChanged += new EventHandler(cbResolveURIs_CheckedChanged); ;

            cbHideLoginGraphics.Checked = s["hide_login_graphics"].AsBoolean();
            cbHideLoginGraphics.CheckedChanged += new EventHandler(cbHideLoginGraphics_CheckedChanged);

            cbRLV.Checked = s["rlv_enabled"].AsBoolean();
            cbRLV.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["rlv_enabled"] = new OSDBoolean(cbRLV.Checked);
            };

            cbRLVDebug.Checked = s["rlv_debugcommands"].AsBoolean();
            cbRLVDebug.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["rlv_debugcommands"] = new OSDBoolean(cbRLVDebug.Checked);
            };

            cbMUEmotes.Checked = s["mu_emotes"].AsBoolean();
            cbMUEmotes.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["mu_emotes"] = new OSDBoolean(cbMUEmotes.Checked);
            };

            if (s["chat_font_size"].Type != OSDType.Real)
            {
                s["chat_font_size"] = OSD.FromReal(((ChatConsole)instance.TabConsole.Tabs["chat"].Control).cbxInput.Font.Size);
            }

            cbFontSize.Text = s["chat_font_size"].AsReal().ToString(System.Globalization.CultureInfo.InvariantCulture);

            if (!s.ContainsKey("minimize_to_tray")) s["minimize_to_tray"] = OSD.FromBoolean(false);
            cbMinToTrey.Checked = s["minimize_to_tray"].AsBoolean();
            cbMinToTrey.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["minimize_to_tray"] = OSD.FromBoolean(cbMinToTrey.Checked);
            };

            cbNoTyping.Checked = s["no_typing_anim"].AsBoolean();
            cbNoTyping.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["no_typing_anim"] = OSD.FromBoolean(cbNoTyping.Checked);
            };

            txtAutoResponse.Text = s["auto_response_text"];
            txtAutoResponse.TextChanged += (object sender, EventArgs e) =>
            {
                s["auto_response_text"] = txtAutoResponse.Text;
            };
            AutoResponseType art = (AutoResponseType)s["auto_response_type"].AsInteger();
            switch (art)
            {
                case AutoResponseType.WhenBusy: rbAutobusy.Checked = true; break;
                case AutoResponseType.WhenFromNonFriend: rbAutoNonFriend.Checked = true; break;
                case AutoResponseType.Always: rbAutoAlways.Checked = true; break;
            }

            cbSyntaxHighlight.Checked = s["script_syntax_highlight"].AsBoolean();
            cbSyntaxHighlight.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["script_syntax_highlight"] = OSD.FromBoolean(cbSyntaxHighlight.Checked);
            };

            switch ((NameMode)s["display_name_mode"].AsInteger())
            {
                case NameMode.Standard: rbDNOff.Checked = true; break;
                case NameMode.Smart: rbDNSmart.Checked = true; break;
                case NameMode.DisplayNameAndUserName: rbDNDandUsernme.Checked = true; break;
                case NameMode.OnlyDisplayName: rbDNOnlyDN.Checked = true; break;
            }

            txtReconnectTime.Text = s["reconnect_time"].AsInteger().ToString();

            txtResolveURITime.Text = s["resolve_uri_time"].AsInteger().ToString();

            cbRadegastClientTag.Checked = s["send_rad_client_tag"];
            cbRadegastClientTag.CheckedChanged += (sender, e) =>
            {
                s["send_rad_client_tag"] = cbRadegastClientTag.Checked;
                instance.SetClientTag();
            };

            cbOnInvOffer.SelectedIndex = s["inv_auto_accept_mode"].AsInteger();
            cbOnInvOffer.SelectedIndexChanged += (sender, e) =>
            {
                s["inv_auto_accept_mode"] = cbOnInvOffer.SelectedIndex;
            };

            cbRadegastLogToFile.Checked = s["log_to_file"];

            cbDisableChatIMLog.Checked = s["disable_chat_im_log"];
            cbDisableChatIMLog.CheckedChanged += (sender, e) =>
            {
                s["disable_chat_im_log"] = cbDisableChatIMLog.Checked;
            };

            cbDisableLookAt.Checked = s["disable_look_at"];
            cbDisableLookAt.CheckedChanged += (sender, e) =>
            {
                s["disable_look_at"] = cbDisableLookAt.Checked;
            };

            cbConfirmExit.Checked = s["confirm_exit"];
            cbConfirmExit.CheckedChanged += (sender, e) =>
            {
                s["confirm_exit"] = cbConfirmExit.Checked;
            };

            cbTaskBarHighLight.Checked = s["taskbar_highlight"];
            cbTaskBarHighLight.CheckedChanged += (sender, e) =>
            {
                s["taskbar_highlight"] = cbTaskBarHighLight.Checked;
                UpdateEnabled();
            };

            cbFriendsHighlight.Checked = s["friends_notification_highlight"].AsBoolean();
            cbFriendsHighlight.CheckedChanged += (object sender, EventArgs e) =>
            {
                s["friends_notification_highlight"] = new OSDBoolean(cbFriendsHighlight.Checked);
            };

            cbHighlightChat.Checked = s["highlight_on_chat"];
            cbHighlightChat.CheckedChanged += (sender, e) =>
            {
                s["highlight_on_chat"] = cbHighlightChat.Checked;
            };

            cbHighlightIM.Checked = s["highlight_on_im"];
            cbHighlightIM.CheckedChanged += (sender, e) =>
            {
                s["highlight_on_im"] = cbHighlightIM.Checked;
            };

            cbHighlightGroupIM.Checked = s["highlight_on_group_im"];
            cbHighlightGroupIM.CheckedChanged += (sender, e) =>
            {
                s["highlight_on_group_im"] = cbHighlightGroupIM.Checked;
            };

            // disable_av_name_link
            if (instance.MonoRuntime)
            {
                cbNameLinks.Visible = false;
            }
            else
            {
                cbNameLinks.Checked = s["av_name_link"];
                cbNameLinks.CheckedChanged += (sender, e) =>
                {
                    s["av_name_link"] = cbNameLinks.Checked;
                };
            }

            cbDisableHTTPInventory.Checked = s["disable_http_inventory"];
            cbDisableHTTPInventory.CheckedChanged += (sender, e) =>
            {
                s["disable_http_inventory"] = cbDisableHTTPInventory.Checked;
            };

            cbShowScriptErrors.Checked = s["show_script_errors"];
            cbShowScriptErrors.CheckedChanged += (sender, e) =>
            {
                s["show_script_errors"] = cbShowScriptErrors.Checked;
            };

            autoSitPrefsUpdate();
            pseudoHomePrefsUpdated();
            LSLHelperPrefsUpdate();

            cbAutoScriptPermission.Text = s["on_script_question"];

            UpdateEnabled();
        }
Пример #7
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // Initialise SmartThreadPool when using mono
            if (Type.GetType("Mono.Runtime") != null)
            {
                WorkPool.Init(true);
            }

            // These are order-dependant
            Network = new NetworkManager(this);
            Settings = new Settings(this);
            Parcels = new ParcelManager(this);
            Self = new AgentManager(this);
            Avatars = new AvatarManager(this);
            Estate = new EstateTools(this);
            Friends = new FriendsManager(this);
            Grid = new GridManager(this);
            Objects = new ObjectManager(this);
            Groups = new GroupManager(this);
            Assets = new AssetManager(this);
            Appearance = new AppearanceManager(this);
            Inventory = new InventoryManager(this);
            Directory = new DirectoryManager(this);
            Terrain = new TerrainManager(this);
            Sound = new SoundManager(this);
            Throttle = new AgentThrottle(this);
            Stats = new OpenMetaverse.Stats.UtilizationStatistics();
        }
Пример #8
0
        public static void InitSettigs(Settings s, bool mono)
        {
            if (s["im_timestamps"].Type == OSDType.Unknown)
            {
                s["im_timestamps"] = OSD.FromBoolean(true);
            }

            if (s["rlv_enabled"].Type == OSDType.Unknown)
            {
                s["rlv_enabled"] = new OSDBoolean(false);
            }

            if (s["rlv_debugcommands"].Type == OSDType.Unknown)
            {
                s["rlv_debugcommands"] = new OSDBoolean(false);
            }

            if (s["mu_emotes"].Type == OSDType.Unknown)
            {
                s["mu_emotes"] = new OSDBoolean(false);
            }

            if (s["friends_notification_highlight"].Type == OSDType.Unknown)
            {
                s["friends_notification_highlight"] = new OSDBoolean(true);
            }

            if (!s.ContainsKey("no_typing_anim")) s["no_typing_anim"] = OSD.FromBoolean(false);

            if (!s.ContainsKey("auto_response_type"))
            {
                s["auto_response_type"] = (int)AutoResponseType.WhenBusy;
                s["auto_response_text"] = "The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed.  Your message will still be shown in their IM panel for later viewing.";
            }

            if (!s.ContainsKey("script_syntax_highlight")) s["script_syntax_highlight"] = OSD.FromBoolean(true);

            if (!s.ContainsKey("display_name_mode")) s["display_name_mode"] = (int)NameMode.Smart;

            // Convert legacy settings from first last name to username
            if (!s.ContainsKey("username") && (s.ContainsKey("first_name") && s.ContainsKey("last_name")))
            {
                s["username"] = s["first_name"] + " " + s["last_name"];
                s.Remove("first_name");
                s.Remove("last_name");
            }

            if (!s.ContainsKey("reconnect_time")) s["reconnect_time"] = 120;

            if (!s.ContainsKey("resolve_uri_time")) s["resolve_uri_time"] = 100;

            if (!s.ContainsKey("resolve_uris")) s["resolve_uris"] = true;

            if (!s.ContainsKey("transaction_notification_chat")) s["transaction_notification_chat"] = true;

            if (!s.ContainsKey("transaction_notification_dialog")) s["transaction_notification_dialog"] = true;

            if (!s.ContainsKey("minimize_to_tray")) s["minimize_to_tray"] = false;

            if (!s.ContainsKey("scene_window_docked")) s["scene_window_docked"] = true;

            if (!s.ContainsKey("taskbar_highlight")) s["taskbar_highlight"] = true;

            if (!s.ContainsKey("rendering_occlusion_culling_enabled2")) s["rendering_occlusion_culling_enabled2"] = false;

            if (!s.ContainsKey("rendering_use_vbo")) s["rendering_use_vbo"] = true;

            if (!s.ContainsKey("send_rad_client_tag")) s["send_rad_client_tag"] = true;

            if (!s.ContainsKey("log_to_file")) s["log_to_file"] = true;

            if (!s.ContainsKey("disable_chat_im_log")) s["disable_chat_im_log"] = false;

            if (!s.ContainsKey("disable_look_at")) s["disable_look_at"] = false;

            if (!s.ContainsKey("confirm_exit")) s["confirm_exit"] = false;

            if (!s.ContainsKey("highlight_on_chat")) s["highlight_on_chat"] = true;

            if (!s.ContainsKey("highlight_on_im")) s["highlight_on_im"] = true;

            if (!s.ContainsKey("highlight_on_group_im")) s["highlight_on_group_im"] = true;

            if (!s.ContainsKey("av_name_link")) s["av_name_link"] = false;

            if (!s.ContainsKey("disable_http_inventory"))
            {
                s["disable_http_inventory"] = mono;
            }

            if (!s.ContainsKey("on_script_question"))
            {
                s["on_script_question"] = "Ask";
            }
        }
Пример #9
0
 private void UpdateSelection(Settings.FontSetting selected)
 {
     currentlySelectedFontSetting = selected;
     cbxFontSize.SelectedItem = selected.Font.Size;
     cbxFont.SelectedItem = selected.Font.Name;
     cbxForeground.SelectedItem = selected.ForeColor;
     cbxBackground.SelectedItem = selected.BackColor;
     cbxBold.Checked = selected.Font.Bold;
     cbxItalic.Checked = selected.Font.Italic;
 }
Пример #10
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // These are order-dependant
            Log = new LoggerInstance();
            Network = new NetworkManager(Log);
            Terrain = new TerrainManager(Log, Network);
            Parcels = new ParcelManager(Log, Network, Terrain);
            Self = new AgentManager(Log, Network, Grid);
            Avatars = new AvatarManager(Log, Network);
            Friends = new FriendsManager(Log, Network, Inventory, Self, Avatars);
            Grid = new GridManager(Log, Network);
            Objects = new ObjectManager(Log, Network, Self);
            Groups = new GroupManager(Log, Network, Self);
            Assets = new AssetManager(Log, Network);
            Estate = new EstateTools(Log, Network, Assets);
            Appearance = new AppearanceManager(Log, Network, Inventory, Assets, Objects, Self);
            Inventory = new InventoryManager(Log, Network, Self, Assets);
            Directory = new DirectoryManager(Log, Network);
            Sound = new SoundManager(Log, Network, Self);
            Throttle = new AgentThrottle(Network);

            Settings = new Settings(this);
            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };

            Network.RegisterLoginResponseCallback(
                delegate(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
                {
                    if (loginSuccess) Log.BotName = replyData.FirstName + " " + replyData.LastName;
                });
        }
Пример #11
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public GridClient()
 {
     // These are order-dependant
     Network = new NetworkManager(this);
     Settings = new Settings(this);
     Parcels = new ParcelManager(this);
     Self = new AgentManager(this);
     Avatars = new AvatarManager(this);
     Estate = new EstateTools(this);
     Friends = new FriendsManager(this);
     Grid = new GridManager(this);
     Objects = new ObjectManager(this);
     Groups = new GroupManager(this);
     Assets = new AssetManager(this);
     Appearance = new AppearanceManager(this);
     Inventory = new InventoryManager(this);
     Directory = new DirectoryManager(this);
     Terrain = new TerrainManager(this);
     Sound = new SoundManager(this);
     Throttle = new AgentThrottle(this);
     Stats = new OpenMetaverse.Stats.UtilizationStatistics();
 }
Пример #12
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            #if USE_SMART_THREAD_POOL
            ThreadPool = new SmartThreadPool(-1, 25);
            #endif
            // These are order-dependant
            #if USE_SMART_THREAD_POOL
            Network = new NetworkManager(this, ThreadPool);
            #else
            Network = new NetworkManager(this);
            #endif
            Settings = new Settings(this);
            #if USE_SMART_THREAD_POOL
            Parcels = new ParcelManager(this, ThreadPool);
            #else
            Parcels = new ParcelManager(this);
            #endif
            Self = new AgentManager(this);
            Avatars = new AvatarManager(this);
            Friends = new FriendsManager(this);
            Grid = new GridManager(this);
            Objects = new ObjectManager(this);
            Groups = new GroupManager(this);
            #if USE_SMART_THREAD_POOL
            Assets = new AssetManager(this, ThreadPool);
            #else
            Assets = new AssetManager(this);
            #endif
            Appearance = new AppearanceManager(this, Assets);
            Inventory = new InventoryManager(this);
            Directory = new DirectoryManager(this);
            Terrain = new TerrainManager(this);
            Sound = new SoundManager(this);
            Throttle = new AgentThrottle(this);

            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };
        }