Exemplo n.º 1
0
 /// <summary>
 /// Creates instance of the mesh uploader
 /// </summary>
 /// <param name="client">GridClient instance to communicate with the simulator</param>
 /// <param name="prims">List of ModelPrimitive objects to upload as a linkset</param>
 /// <param name="newInvName">Inventory name for newly uploaded object</param>
 /// <param name="newInvDesc">Inventory description for newly upload object</param>
 public ModelUploader(GridClient client, List<ModelPrim> prims, string newInvName, string newInvDesc)
 {
     this.Client = client;
     this.Prims = prims;
     this.InvName = newInvName;
     this.InvDescription = newInvDesc;
 }
Exemplo n.º 2
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Assets.OnImageReceived += new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
     _Client.Grid.OnCoarseLocationUpdate += new GridManager.CoarseLocationUpdateCallback(Grid_OnCoarseLocationUpdate);
     _Client.Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
 }
Exemplo n.º 3
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
     _Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
     _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
     _Client.Self.AlertMessage += Self_AlertMessage;
     _Client.Self.MoneyBalanceReply += Self_MoneyBalanceReply;
 }
Exemplo n.º 4
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Network.SimChanged += Network_OnCurrentSimChanged;
     _Client.Network.Disconnected += Network_OnDisconnected;
     _Client.Network.LoginProgress += Network_OnLogin;
     _Client.Self.AlertMessage += Self_AlertMessage;
     _Client.Self.MoneyBalanceReply += Self_MoneyBalanceReply;
 }
Exemplo n.º 5
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
     _Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
     _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
     _Client.Self.OnAlertMessage += new AgentManager.AlertMessageCallback(Self_OnAlertMessage);
     _Client.Self.OnMoneyBalanceReplyReceived += new AgentManager.MoneyBalanceReplyCallback(Self_OnMoneyBalanceReplyReceived);
 }
Exemplo n.º 6
0
        /// <summary>
        /// PictureBox control for the specified client's mini-map
        /// </summary>
        public MiniMap(GridClient client) : this ()
        {
            InitializeClient(client);

            _ToolTip = new ToolTip();
            _ToolTip.Active = true;
            _ToolTip.AutomaticDelay = 1;

            this.MouseHover += new System.EventHandler(MiniMap_MouseHover);
            this.MouseMove += new MouseEventHandler(MiniMap_MouseMove);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to the GridClient object</param>
        /// <param name="bakeType"></param>
        /// <param name="textureCount">Total number of layers this layer set is
        /// composed of</param>
        /// <param name="paramValues">Appearance parameters the drive the 
        /// baking process</param>
        public Baker(GridClient 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();
        }
Exemplo n.º 8
0
        public static void ProcessParameters(this SerializedNotification.Parameter o, GridClient Client,
                                             Configuration corradeConfiguration, string type, List <object> args,
                                             Dictionary <string, string> store, object sync, LanguageDetector languageDetector,
                                             BayesSimpleTextClassifier bayesSimpleClassifier)
        {
            object value;

            switch (o.Value != null)
            {
            case false:
                var arg = o.Type != null
                        ? args.AsParallel()
                          .FirstOrDefault(
                    a =>
                    string.Equals(a.GetType().FullName, o.Type) ||
                    a.GetType()
                    .GetBaseTypes()
                    .AsParallel()
                    .Any(t => string.Equals(t.FullName, o.Type)))
                        : args.AsParallel()
                          .FirstOrDefault(
                    a =>
                    string.Equals(a.GetType().FullName, type) ||
                    a.GetType()
                    .GetBaseTypes()
                    .AsParallel()
                    .Any(t => string.Equals(t.FullName, o.Type)));

                if (arg == null)
                {
                    return;
                }

                // Process all conditions and return if they all fail.
                if (o.Condition != null)
                {
                    if (
                        o.Condition.AsParallel()
                        .Select(condition => new { condition, conditional = arg.GetFP(condition.Path) })
                        .Where(t => t.conditional != null && !t.conditional.Equals(t.condition.Value))
                        .Select(t => t.condition).Any())
                    {
                        return;
                    }
                }

                value = arg.GetFP(o.Path);

                if (o.Processing != null)
                {
                    foreach (var process in o.Processing)
                    {
                        if (process.ToLower != null)
                        {
                            value = process.ToLower.Culture != null
                                    ? value.ToString().ToLower()
                                    : value.ToString().ToLowerInvariant();

                            continue;
                        }

                        if (process.GetValue != null)
                        {
                            IDictionary iDict = null;
                            var         dict  = arg.GetFP(process.GetValue.Path);
                            var         internalDictionaryInfo = dict.GetType()
                                                                 .GetField("Dictionary",
                                                                           BindingFlags.Default | BindingFlags.CreateInstance | BindingFlags.Instance |
                                                                           BindingFlags.NonPublic);

                            if (dict is IDictionary)
                            {
                                iDict = dict as IDictionary;
                                goto PROCESS;
                            }

                            if (internalDictionaryInfo != null)
                            {
                                iDict = internalDictionaryInfo.GetValue(dict) as IDictionary;
                            }

PROCESS:
                            if (iDict != null)
                            {
                                var look = arg.GetFP(process.GetValue.Value);

                                if (!iDict.Contains(look))
                                {
                                    continue;
                                }

                                value = process.GetValue.Get != null
                                        ? iDict[look].GetFP(process.GetValue.Get)
                                        : iDict[look];
                            }
                            continue;
                        }

                        if (process.ConditionalSubstitution != null)
                        {
                            dynamic l = null;
                            dynamic r = null;
                            if (process.ConditionalSubstitution.Type != null)
                            {
                                arg =
                                    args.AsParallel()
                                    .FirstOrDefault(
                                        a =>
                                        string.Equals(a.GetType().FullName,
                                                      process.ConditionalSubstitution.Type));
                                if (arg != null)
                                {
                                    l = arg.GetFP(process.ConditionalSubstitution.Path);
                                    r = process.ConditionalSubstitution.Check;
                                }
                            }

                            if (l == null || r == null)
                            {
                                continue;
                            }

                            if (l == r)
                            {
                                value = process.ConditionalSubstitution.Value;
                                break;
                            }

                            continue;
                        }

                        if (process.TernarySubstitution != null)
                        {
                            dynamic l = null;
                            dynamic r = null;
                            if (process.TernarySubstitution.Type != null)
                            {
                                arg =
                                    args.AsParallel()
                                    .FirstOrDefault(
                                        a =>
                                        string.Equals(a.GetType().FullName,
                                                      process.TernarySubstitution.Type));
                                if (arg != null)
                                {
                                    l = arg.GetFP(process.TernarySubstitution.Path);
                                    r = process.TernarySubstitution.Value;
                                }
                            }

                            if (l == null || r == null)
                            {
                                continue;
                            }

                            value = l == r
                                    ? process.TernarySubstitution.Left
                                    : process.TernarySubstitution.Right;

                            continue;
                        }

                        if (process.Resolve != null)
                        {
                            switch (process.Resolve.ResolveType)
                            {
                            case SerializedNotification.ResolveType.AGENT:
                                switch (process.Resolve.ResolveDestination)
                                {
                                case SerializedNotification.ResolveDestination.UUID:
                                    var fullName  = new List <string>(wasOpenMetaverse.Helpers.GetAvatarNames(value as string));
                                    var agentUUID = UUID.Zero;
                                    if (!fullName.Any() ||
                                        !Resolvers.AgentNameToUUID(Client, fullName.First(), fullName.Last(),
                                                                   corradeConfiguration.ServicesTimeout,
                                                                   corradeConfiguration.DataTimeout,
                                                                   new DecayingAlarm(corradeConfiguration.DataDecayType),
                                                                   ref agentUUID))
                                    {
                                        break;
                                    }
                                    value = agentUUID;
                                    break;
                                }
                                break;
                            }
                            continue;
                        }

                        if (process.ToEnumMemberName != null && process.ToEnumMemberName.Type != null &&
                            process.ToEnumMemberName.Assembly != null)
                        {
                            value =
                                Enum.GetName(
                                    Assembly.Load(process.ToEnumMemberName.Assembly)
                                    .GetType(process.ToEnumMemberName.Type), value);
                            continue;
                        }

                        if (process.NameSplit != null)
                        {
                            if (process.NameSplit.Condition != null)
                            {
                                var nameSplitCondition =
                                    arg.GetFP(process.NameSplit.Condition.Path);
                                if (!nameSplitCondition.Equals(process.NameSplit.Condition.Value))
                                {
                                    continue;
                                }
                            }
                            var fullName = new List <string>(wasOpenMetaverse.Helpers.GetAvatarNames(value as string));
                            if (fullName.Any())
                            {
                                lock (sync)
                                {
                                    store.Add(process.NameSplit.First,
                                              fullName.First());
                                    store.Add(process.NameSplit.Last,
                                              fullName.Last());
                                }
                            }
                            return;
                        }

                        if (process.IdentifyLanguage != null)
                        {
                            var detectedLanguage = languageDetector.Detect(value as string);
                            if (detectedLanguage != null)
                            {
                                lock (sync)
                                {
                                    store.Add(process.IdentifyLanguage.Name, detectedLanguage);
                                }
                            }
                            continue;
                        }

                        if (process.BayesClassify != null)
                        {
                            var bayesClassification =
                                bayesSimpleClassifier.Classify(value as string).FirstOrDefault();
                            if (!bayesClassification.Equals(default(KeyValuePair <string, double>)))
                            {
                                lock (sync)
                                {
                                    store.Add(process.BayesClassify.Name, CSV.FromKeyValue(bayesClassification));
                                }
                            }
                            continue;
                        }

                        if (process.Method != null)
                        {
                            Type methodType;
                            switch (process.Method.Assembly != null)
                            {
                            case true:
                                methodType = Assembly.Load(process.Method.Assembly).GetType(process.Method.Type);
                                break;

                            default:
                                methodType = Type.GetType(process.Method.Type);
                                break;
                            }
                            object instance;
                            try
                            {
                                instance = Activator.CreateInstance(methodType);
                            }
                            catch (Exception)
                            {
                                instance = null;
                            }
                            switch (process.Method.Parameters != null)
                            {
                            case true:
                                value = methodType.GetMethod(process.Method.Name,
                                                             process.Method.Parameters.Values.Select(Type.GetType).ToArray())
                                        .Invoke(instance,
                                                process.Method.Parameters.Keys.Select(arg.GetFP).ToArray());
                                break;

                            default:
                                value =
                                    methodType.GetMethod(process.Method.Name)
                                    .Invoke(
                                        Activator.CreateInstance(methodType).GetFP(process.Method.Path),
                                        null);
                                break;
                            }
                            break;
                        }
                    }
                }
                break;

            default:
                if (!args.AsParallel().Any(a => string.Equals(a.GetType().FullName, type)))
                {
                    return;
                }
                value = o.Value;
                break;
            }

            var data = new HashSet <string>(wasOpenMetaverse.Reflection.wasSerializeObject(value));

            if (!data.Any())
            {
                return;
            }

            var output = CSV.FromEnumerable(data);

            if (data.Count.Equals(1))
            {
                output = data.First().Trim('"');
            }

            lock (sync)
            {
                store.Add(o.Name, output);
            }
        }
Exemplo n.º 9
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Inventory.OnSkeletonsReceived += new InventoryManager.SkeletonsReceived(Inventory_OnSkeletonsReceived);
 }
Exemplo n.º 10
0
 // Constructor. Lets us have access to various useful user things.
 public Events(User user)
 {
     this.Client = user.Client;
     this.user   = user;
 }
Exemplo n.º 11
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Groups.CurrentGroups += Groups_CurrentGroups;
 }
Exemplo n.º 12
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Self.OnChat += new AgentManager.ChatCallback(Self_OnChat);
 }
Exemplo n.º 13
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Grid.CoarseLocationUpdate += Grid_CoarseLocationUpdate;
     _Client.Network.SimChanged        += Network_OnCurrentSimChanged;
 }
Exemplo n.º 14
0
 /// <summary>
 /// PictureBox control for the specified client's mini-map
 /// </summary>
 public MiniMap(GridClient client) : this ()
 {
     InitializeClient(client);
 }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            if (args.Length < 3)
            {
                Console.WriteLine("Usage: VoiceTest.exe [firstname] [lastname] [password]");
                return;
            }

            string firstName = args[0];
            string lastName  = args[1];
            string password  = args[2];


            GridClient client = new GridClient();

            client.Settings.MULTIPLE_SIMS          = false;
            Settings.LOG_LEVEL                     = Helpers.LogLevel.None;
            client.Settings.LOG_RESENDS            = false;
            client.Settings.STORE_LAND_PATCHES     = true;
            client.Settings.ALWAYS_DECODE_OBJECTS  = true;
            client.Settings.ALWAYS_REQUEST_OBJECTS = true;
            client.Settings.SEND_AGENT_UPDATES     = true;

            string loginURI = client.Settings.LOGIN_SERVER;

            if (4 == args.Length)
            {
                loginURI = args[3];
            }

            VoiceManager voice = new VoiceManager(client);

            voice.OnProvisionAccount += voice_OnProvisionAccount;
            voice.OnParcelVoiceInfo  += voice_OnParcelVoiceInfo;

            client.Network.EventQueueRunning += client_OnEventQueueRunning;

            try
            {
                if (!voice.ConnectToDaemon())
                {
                    throw new VoiceException("Failed to connect to the voice daemon");
                }

                List <string> captureDevices = voice.CaptureDevices();

                Console.WriteLine("Capture Devices:");
                for (int i = 0; i < captureDevices.Count; i++)
                {
                    Console.WriteLine(String.Format("{0}. \"{1}\"", i, captureDevices[i]));
                }
                Console.WriteLine();

                List <string> renderDevices = voice.RenderDevices();

                Console.WriteLine("Render Devices:");
                for (int i = 0; i < renderDevices.Count; i++)
                {
                    Console.WriteLine(String.Format("{0}. \"{1}\"", i, renderDevices[i]));
                }
                Console.WriteLine();


                // Login
                Console.WriteLine("Logging into the grid as " + firstName + " " + lastName + "...");
                LoginParams loginParams =
                    client.Network.DefaultLoginParams(firstName, lastName, password, "Voice Test", "1.0.0");
                loginParams.URI = loginURI;
                if (!client.Network.Login(loginParams))
                {
                    throw new VoiceException("Login to SL failed: " + client.Network.LoginMessage);
                }
                Console.WriteLine("Logged in: " + client.Network.LoginMessage);


                Console.WriteLine("Creating voice connector...");
                int    status;
                string connectorHandle = voice.CreateConnector(out status);
                if (String.IsNullOrEmpty(connectorHandle))
                {
                    throw new VoiceException("Failed to create a voice connector, error code: " + status, true);
                }
                Console.WriteLine("Voice connector handle: " + connectorHandle);


                Console.WriteLine("Waiting for OnEventQueueRunning");
                if (!EventQueueRunningEvent.WaitOne(45 * 1000, false))
                {
                    throw new VoiceException("EventQueueRunning event did not occur", true);
                }
                Console.WriteLine("EventQueue running");


                Console.WriteLine("Asking the current simulator to create a provisional account...");
                if (!voice.RequestProvisionAccount())
                {
                    throw new VoiceException("Failed to request a provisional account", true);
                }
                if (!ProvisionEvent.WaitOne(120 * 1000, false))
                {
                    throw new VoiceException("Failed to create a provisional account", true);
                }
                Console.WriteLine("Provisional account created. Username: "******", Password: "******"Logging in to voice server " + voice.VoiceServer);
                string accountHandle = voice.Login(VoiceAccount, VoicePassword, connectorHandle, out status);
                if (String.IsNullOrEmpty(accountHandle))
                {
                    throw new VoiceException("Login failed, error code: " + status, true);
                }
                Console.WriteLine("Login succeeded, account handle: " + accountHandle);


                if (!voice.RequestParcelVoiceInfo())
                {
                    throw new Exception("Failed to request parcel voice info");
                }
                if (!ParcelVoiceInfoEvent.WaitOne(45 * 1000, false))
                {
                    throw new VoiceException("Failed to obtain parcel info voice", true);
                }


                Console.WriteLine("Parcel Voice Info obtained. Region name {0}, local parcel ID {1}, channel URI {2}",
                                  VoiceRegionName, VoiceLocalID, VoiceChannelURI);

                client.Network.Logout();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                if (e is VoiceException && (e as VoiceException).LoggedIn)
                {
                    client.Network.Logout();
                }
            }
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
Exemplo n.º 16
0
        /// <summary>
        ///     A wrapper for agent to UUID lookups using Corrade's internal cache.
        /// </summary>
        /// <param name="Client">the OpenMetaverse grid client</param>
        /// <param name="AgentUUIDs">a list of UUIDs to resolve</param>
        /// <param name="millisecondsTimeout">timeout for the search in milliseconds</param>
        /// <returns>a dictionary of UUIDs to names</returns>
        public static Dictionary <UUID, string> AgentUUIDToName(GridClient Client, List <UUID> AgentUUIDs, uint millisecondsTimeout)
        {
            var cachedNames = new Dictionary <UUID, string>();
            var lookupUUIDs = new HashSet <UUID>();
            var LockObject  = new[] {
                new object(),
                new object()
            };

            // Do not look up resolved agents that are in the cache.
            AgentUUIDs.AsParallel().ForAll(agentUUID =>
            {
                var agent = Cache.GetAgent(agentUUID);
                switch (!agent.Equals(default(Cache.Agent)))
                {
                case true:
                    lock (LockObject[0])
                    {
                        if (!cachedNames.ContainsKey(agentUUID))
                        {
                            cachedNames.Add(agentUUID, string.Join(" ", agent.FirstName, agent.LastName));
                        }
                    }
                    return;

                default:
                    lock (LockObject[1])
                    {
                        if (!lookupUUIDs.Contains(agentUUID))
                        {
                            lookupUUIDs.Add(agentUUID);
                        }
                    }
                    return;
                }
            });

            // Look up agents that are not in the cache.
            var resolvedNames = new Dictionary <UUID, string>();

            if (lookupUUIDs.Any())
            {
                Locks.ClientInstanceAvatarsLock.EnterWriteLock();
                resolvedNames = directAgentUUIDToName(Client, lookupUUIDs.ToList(), millisecondsTimeout);
                Locks.ClientInstanceAvatarsLock.ExitWriteLock();

                // Add agents to the cache.
                Task.Run(() =>
                         resolvedNames.AsParallel().ForAll(o =>
                {
                    var fullName = new List <string>(Helpers.GetAvatarNames(o.Value));
                    if (fullName.Any())
                    {
                        Cache.AddAgent(fullName.First(), fullName.Last(), o.Key);
                    }
                }));
            }

            return(cachedNames.Union(resolvedNames).AsParallel()
                   .GroupBy(o => o.Key)
                   .Select(o => o.FirstOrDefault())
                   .ToDictionary(o => o.Key, o => o.Value));
        }
Exemplo n.º 17
0
 void instance_ClientChanged(object sender, ClientChangedEventArgs e)
 {
     UnregisterClientEvents(Client);
     Client = e.Client;
     RegisterClientEvents(Client);
 }
Exemplo n.º 18
0
 void UnregisterClientEvents(GridClient client)
 {
     //if (client == null) return;
 }
Exemplo n.º 19
0
 void RegisterClientEvents(GridClient client)
 {
     //instance.ClientChanged += new EventHandler<ClientChangedEventArgs>(instance_ClientChanged);
     //client.Self.ChatFromSimulator += new EventHandler<ChatEventArgs>(Self_ChatFromSimulator);
 }
Exemplo n.º 20
0
        public static DirItem FromInventoryBase(GridClient Client, InventoryBase inventoryBase, uint millisecondsTimeout)
        {
            var item = new DirItem
            {
                Name        = inventoryBase.Name,
                Item        = inventoryBase.UUID,
                Permissions = CORRADE_CONSTANTS.PERMISSIONS.NONE
            };

            if (inventoryBase is InventoryFolder)
            {
                item.Type = Enumerations.DirItemType.FOLDER;
                item.Time = Client.Inventory.Store.GetNodeFor(inventoryBase.UUID).ModifyTime;
                return(item);
            }

            if (!(inventoryBase is InventoryItem))
            {
                return(item);
            }

            var inventoryItem = inventoryBase as InventoryItem;

            item.Permissions = Inventory.wasPermissionsToString(inventoryItem.Permissions);
            item.Time        = Client.Inventory.Store.GetNodeFor(inventoryItem.UUID).ModifyTime;

            if (inventoryItem is InventoryWearable)
            {
                item.Type =
                    (Enumerations.DirItemType) typeof(Enumerations.DirItemType).GetFields(BindingFlags.Public |
                                                                                          BindingFlags.Static)
                    .AsParallel().FirstOrDefault(
                        o =>
                        string.Equals(o.Name,
                                      Enum.GetName(typeof(WearableType),
                                                   (inventoryItem as InventoryWearable).WearableType),
                                      StringComparison.OrdinalIgnoreCase)).GetValue(null);
                return(item);
            }

            if (inventoryItem is InventoryTexture)
            {
                item.Type = Enumerations.DirItemType.TEXTURE;
                return(item);
            }

            if (inventoryItem is InventorySound)
            {
                item.Type = Enumerations.DirItemType.SOUND;
                return(item);
            }

            if (inventoryItem is InventoryCallingCard)
            {
                item.Type = Enumerations.DirItemType.CALLINGCARD;
                return(item);
            }

            if (inventoryItem is InventoryLandmark)
            {
                item.Type = Enumerations.DirItemType.LANDMARK;
                return(item);
            }

            if (inventoryItem is InventoryObject)
            {
                item.Type = Enumerations.DirItemType.OBJECT;
                return(item);
            }

            if (inventoryItem is InventoryNotecard)
            {
                item.Type = Enumerations.DirItemType.NOTECARD;
                return(item);
            }

            if (inventoryItem is InventoryCategory)
            {
                item.Type = Enumerations.DirItemType.CATEGORY;
                return(item);
            }

            if (inventoryItem is InventoryLSL)
            {
                item.Type = Enumerations.DirItemType.LSL;
                return(item);
            }

            if (inventoryItem is InventorySnapshot)
            {
                item.Type = Enumerations.DirItemType.SNAPSHOT;
                return(item);
            }

            if (inventoryItem is InventoryAttachment)
            {
                item.Type = Enumerations.DirItemType.ATTACHMENT;
                return(item);
            }

            if (inventoryItem is InventoryAnimation)
            {
                item.Type = Enumerations.DirItemType.ANIMATION;
                return(item);
            }

            if (inventoryItem is InventoryGesture)
            {
                item.Type = Enumerations.DirItemType.GESTURE;
                return(item);
            }

            item.Type = Enumerations.DirItemType.NONE;
            return(item);
        }
Exemplo n.º 21
0
 public GridClientNetworkSystem(GridClient client)
 {
     _gridClient    = client;
     _isInitialized = false;
 }
Exemplo n.º 22
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Friends.OnFriendNamesReceived += new FriendsManager.FriendNamesReceived(Friends_OnFriendNamesReceived);
     _Client.Friends.OnFriendOffline += new FriendsManager.FriendOfflineEvent(Friends_OnFriendOffline);
     _Client.Friends.OnFriendOnline += new FriendsManager.FriendOnlineEvent(Friends_OnFriendOnline);
     _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
 }
Exemplo n.º 23
0
 public ActionCommandsIn(METAboltInstance instance)
 {
     this.instance = instance;
     client        = this.instance.Client;
     netcom        = this.instance.Netcom;
 }
Exemplo n.º 24
0
 /// <summary>
 /// TreeView control for the specified client's group list
 /// </summary>
 public GroupList(GridClient client) : this()
 {
     InitializeClient(client);
 }
Exemplo n.º 25
0
 public PrimExporter(GridClient client)
 {
     Client = client;
     Client.Objects.ObjectPropertiesFamily += new EventHandler <ObjectPropertiesFamilyEventArgs>(Objects_OnObjectPropertiesFamily);
     Client.Objects.ObjectProperties       += new EventHandler <ObjectPropertiesEventArgs>(Objects_OnObjectProperties);
 }
Exemplo n.º 26
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);
 }
Exemplo n.º 27
0
 private void UnregisterClientEvents(GridClient client)
 {
     client.Grid.CoarseLocationUpdate -= new EventHandler <CoarseLocationUpdateEventArgs>(Grid_CoarseLocationUpdate);
     client.Self.TeleportProgress     -= new EventHandler <TeleportEventArgs>(Self_TeleportProgress);
     client.Network.SimDisconnected   -= new EventHandler <SimDisconnectedEventArgs>(Network_SimDisconnected);
 }
Exemplo n.º 28
0
 public FolderCopy(RadegastInstance instance)
 {
     this.Instance = instance;
     this.Client   = this.Instance.Client;
 }
Exemplo n.º 29
0
        /// <summary>
        /// Builds a composited terrain texture given the region texture
        /// and heightmap settings
        /// </summary>
        /// <param name="heightmap">Terrain heightmap</param>
        /// <param name="regionInfo">Region information including terrain texture parameters</param>
        /// <returns>A composited 256x256 RGB texture ready for rendering</returns>
        /// <remarks>Based on the algorithm described at http://opensimulator.org/wiki/Terrain_Splatting
        /// </remarks>
        /// HACK: Change RadegastInstance to GridClient
        public static Bitmap Splat(GridClient client, float[,] heightmap, UUID[] textureIDs, float[] startHeights, float[] heightRanges)
        {
            Debug.Assert(textureIDs.Length == 4);
            Debug.Assert(startHeights.Length == 4);
            Debug.Assert(heightRanges.Length == 4);
            int outputSize = 2048;

            Bitmap[] detailTexture = new Bitmap[4];

            // Swap empty terrain textureIDs with default IDs
            for (int i = 0; i < textureIDs.Length; i++)
            {
                if (textureIDs[i] == UUID.Zero)
                {
                    textureIDs[i] = DEFAULT_TERRAIN_DETAIL[i];
                }
            }

            #region Texture Fetching
            for (int i = 0; i < 4; i++)
            {
                AutoResetEvent textureDone = new AutoResetEvent(false);
                UUID           textureID   = textureIDs[i];

                client.Assets.RequestImage(textureID, TextureDownloadCallback(detailTexture, i, textureDone));

                textureDone.WaitOne(3 * 1000, false);
            }

            #endregion Texture Fetching

            // Fill in any missing textures with a solid color
            for (int i = 0; i < 4; i++)
            {
                if (detailTexture[i] == null)
                {
                    // Create a solid color texture for this layer
                    detailTexture[i] = new Bitmap(outputSize, outputSize, PixelFormat.Format24bppRgb);
                    using (Graphics gfx = Graphics.FromImage(detailTexture[i]))
                    {
                        using (SolidBrush brush = new SolidBrush(DEFAULT_TERRAIN_COLOR[i]))
                            gfx.FillRectangle(brush, 0, 0, outputSize, outputSize);
                    }
                }
                else if (detailTexture[i].Width != outputSize || detailTexture[i].Height != outputSize)
                {
                    detailTexture[i] = ResizeBitmap(detailTexture[i], 256, 256);
                }
            }

            #region Layer Map

            int     diff     = heightmap.GetLength(0) / RegionSize;
            float[] layermap = new float[RegionSize * RegionSize];

            for (int y = 0; y < heightmap.GetLength(0); y += diff)
            {
                for (int x = 0; x < heightmap.GetLength(1); x += diff)
                {
                    int   newX   = x / diff;
                    int   newY   = y / diff;
                    float height = heightmap[newX, newY];

                    float pctX = (float)newX / 255f;
                    float pctY = (float)newY / 255f;

                    // Use bilinear interpolation between the four corners of start height and
                    // height range to select the current values at this position
                    float startHeight = ImageUtils.Bilinear(
                        startHeights[0],
                        startHeights[2],
                        startHeights[1],
                        startHeights[3],
                        pctX, pctY);
                    startHeight = Utils.Clamp(startHeight, 0f, 255f);

                    float heightRange = ImageUtils.Bilinear(
                        heightRanges[0],
                        heightRanges[2],
                        heightRanges[1],
                        heightRanges[3],
                        pctX, pctY);
                    heightRange = Utils.Clamp(heightRange, 0f, 255f);

                    // Generate two frequencies of perlin noise based on our global position
                    // The magic values were taken from http://opensimulator.org/wiki/Terrain_Splatting
                    Vector3 vec = new Vector3
                                  (
                        newX * 0.20319f,
                        newY * 0.20319f,
                        height * 0.25f
                                  );

                    float lowFreq  = Perlin.noise2(vec.X * 0.222222f, vec.Y * 0.222222f) * 6.5f;
                    float highFreq = Perlin.turbulence2(vec.X, vec.Y, 2f) * 2.25f;
                    float noise    = (lowFreq + highFreq) * 2f;

                    // Combine the current height, generated noise, start height, and height range parameters, then scale all of it
                    float layer = ((height + noise - startHeight) / heightRange) * 4f;
                    if (Single.IsNaN(layer))
                    {
                        layer = 0f;
                    }
                    layermap[newY * RegionSize + newX] = Utils.Clamp(layer, 0f, 3f);
                }
            }

            #endregion Layer Map

            #region Texture Compositing
            Bitmap     output     = new Bitmap(outputSize, outputSize, PixelFormat.Format24bppRgb);
            BitmapData outputData = output.LockBits(new Rectangle(0, 0, outputSize, outputSize), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);

            unsafe
            {
                // Get handles to all of the texture data arrays
                BitmapData[] datas = new BitmapData[]
                {
                    detailTexture[0].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[0].PixelFormat),
                    detailTexture[1].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[1].PixelFormat),
                    detailTexture[2].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[2].PixelFormat),
                    detailTexture[3].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[3].PixelFormat)
                };

                int[] comps = new int[]
                {
                    (datas[0].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3,
                    (datas[1].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3,
                    (datas[2].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3,
                    (datas[3].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3
                };

                int[] strides = new int[]
                {
                    datas[0].Stride,
                    datas[1].Stride,
                    datas[2].Stride,
                    datas[3].Stride
                };

                IntPtr[] scans = new IntPtr[]
                {
                    datas[0].Scan0,
                    datas[1].Scan0,
                    datas[2].Scan0,
                    datas[3].Scan0
                };

                int ratio = outputSize / RegionSize;

                for (int y = 0; y < outputSize; y++)
                {
                    for (int x = 0; x < outputSize; x++)
                    {
                        float layer   = layermap[(y / ratio) * RegionSize + x / ratio];
                        float layerx  = layermap[(y / ratio) * RegionSize + Math.Min(outputSize - 1, (x + 1)) / ratio];
                        float layerxx = layermap[(y / ratio) * RegionSize + Math.Max(0, (x - 1)) / ratio];
                        float layery  = layermap[Math.Min(outputSize - 1, (y + 1)) / ratio * RegionSize + x / ratio];
                        float layeryy = layermap[(Math.Max(0, (y - 1)) / ratio) * RegionSize + x / ratio];

                        // Select two textures
                        int l0 = (int)Math.Floor(layer);
                        int l1 = Math.Min(l0 + 1, 3);

                        byte *ptrA = (byte *)scans[l0] + (y % 256) * strides[l0] + (x % 256) * comps[l0];
                        byte *ptrB = (byte *)scans[l1] + (y % 256) * strides[l1] + (x % 256) * comps[l1];
                        byte *ptrO = (byte *)outputData.Scan0 + y * outputData.Stride + x * 3;

                        float aB = *(ptrA + 0);
                        float aG = *(ptrA + 1);
                        float aR = *(ptrA + 2);

                        int   lX    = (int)Math.Floor(layerx);
                        byte *ptrX  = (byte *)scans[lX] + (y % 256) * strides[lX] + (x % 256) * comps[lX];
                        int   lXX   = (int)Math.Floor(layerxx);
                        byte *ptrXX = (byte *)scans[lXX] + (y % 256) * strides[lXX] + (x % 256) * comps[lXX];
                        int   lY    = (int)Math.Floor(layery);
                        byte *ptrY  = (byte *)scans[lY] + (y % 256) * strides[lY] + (x % 256) * comps[lY];
                        int   lYY   = (int)Math.Floor(layeryy);
                        byte *ptrYY = (byte *)scans[lYY] + (y % 256) * strides[lYY] + (x % 256) * comps[lYY];

                        float bB = *(ptrB + 0);
                        float bG = *(ptrB + 1);
                        float bR = *(ptrB + 2);

                        float layerDiff   = layer - l0;
                        float xlayerDiff  = layerx - layer;
                        float xxlayerDiff = layerxx - layer;
                        float ylayerDiff  = layery - layer;
                        float yylayerDiff = layeryy - layer;
                        // Interpolate between the two selected textures
                        *(ptrO + 0) = (byte)Math.Floor(aB + layerDiff * (bB - aB) +
                                                       xlayerDiff * (*ptrX - aB) +
                                                       xxlayerDiff * (*(ptrXX) - aB) +
                                                       ylayerDiff * (*ptrY - aB) +
                                                       yylayerDiff * (*(ptrYY) - aB));
                        *(ptrO + 1) = (byte)Math.Floor(aG + layerDiff * (bG - aG) +
                                                       xlayerDiff * (*(ptrX + 1) - aG) +
                                                       xxlayerDiff * (*(ptrXX + 1) - aG) +
                                                       ylayerDiff * (*(ptrY + 1) - aG) +
                                                       yylayerDiff * (*(ptrYY + 1) - aG));
                        *(ptrO + 2) = (byte)Math.Floor(aR + layerDiff * (bR - aR) +
                                                       xlayerDiff * (*(ptrX + 2) - aR) +
                                                       xxlayerDiff * (*(ptrXX + 2) - aR) +
                                                       ylayerDiff * (*(ptrY + 2) - aR) +
                                                       yylayerDiff * (*(ptrYY + 2) - aR));
                    }
                }

                for (int i = 0; i < 4; i++)
                {
                    detailTexture[i].UnlockBits(datas[i]);
                    detailTexture[i].Dispose();
                }
            }

            layermap = null;
            output.UnlockBits(outputData);

            output.RotateFlip(RotateFlipType.Rotate270FlipNone);

            #endregion Texture Compositing

            return(output);
        }
Exemplo n.º 30
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">The GridClient to use</param>
 public AutoPilot2(GridClient client)
 {
     Client = client;
     Client.Objects.TerseObjectUpdate += new System.EventHandler <TerseObjectUpdateEventArgs>(Objects_TerseObjectUpdate);
     ticker.Elapsed += new ElapsedEventHandler(ticker_Elapsed);
 }
Exemplo n.º 31
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Inventory.OnFolderUpdated += new InventoryManager.FolderUpdatedCallback(Inventory_OnFolderUpdated);
     _Client.Network.OnLogin           += new NetworkManager.LoginCallback(Network_OnLogin);
 }
Exemplo n.º 32
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Friends.FriendNames += Friends_FriendNames;
     _Client.Friends.FriendOffline += Friends_FriendUpdate;
     _Client.Friends.FriendOnline += Friends_FriendUpdate;
     _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
 }
Exemplo n.º 33
0
 /// <summary>
 /// TreeView control for the specified client's inventory
 /// </summary>
 /// <param name="client"></param>
 public InventoryTree(GridClient client) : this()
 {
     InitializeClient(client);
 }
Exemplo n.º 34
0
        private void InitializeClient(GridClient client)
        {
            _Client = client;

            _Client.Network.Disconnected += Network_OnDisconnected;
            _Client.Network.LoginProgress += Network_OnLogin;
        }
Exemplo n.º 35
0
 /// <summary>
 /// Registration of all GridClient (libomv) events go here
 /// </summary>
 /// <param name="client"></param>
 void RegisterClientEvents(GridClient client)
 {
     client.Self.ChatFromSimulator += new EventHandler <ChatEventArgs>(Self_ChatFromSimulator);
 }
Exemplo n.º 36
0
        private void InitializeClient(GridClient client)
        {
            _Client = client;

            _Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
            _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
        }
 public InventoryAISClient(GridClient client)
 {
     Client = client;
     httpClient.DefaultRequestHeaders.Accept.Clear();
     httpClient.DefaultRequestHeaders.Add("User-Agent", "LibreMetaverse AIS Client");
 }
Exemplo n.º 38
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Inventory.FolderUpdated += Inventory_OnFolderUpdated;
     _Client.Network.LoginProgress += Network_OnLogin;
 }
Exemplo n.º 39
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Self.ChatFromSimulator += new EventHandler<ChatEventArgs>(Self_ChatFromSimulator);
 }
Exemplo n.º 40
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Groups.CurrentGroups += Groups_CurrentGroups;
 }
Exemplo n.º 41
0
 /// <summary>
 /// TreeView control for the specified client's friend list
 /// </summary>
 public FriendList(GridClient client)
     : this()
 {
     InitializeClient(client);
 }
Exemplo n.º 42
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Grid.OnCoarseLocationUpdate += new GridManager.CoarseLocationUpdateCallback(Grid_OnCoarseLocationUpdate);
 }
Exemplo n.º 43
0
 /// <summary>
 /// TreeView control for the specified client's inventory
 /// </summary>
 /// <param name="client"></param>
 public InventoryTree(GridClient client) : this ()
 {
     InitializeClient(client);
 }
Exemplo n.º 44
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Groups.OnCurrentGroups += new GroupManager.CurrentGroupsCallback(Groups_OnCurrentGroups);
 }
Exemplo n.º 45
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Grid.CoarseLocationUpdate += Grid_CoarseLocationUpdate;
     _Client.Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
 }
        public override void Action()
        {
            GridClient client = Bot.Client;

//            // Fly to make the border cross easier.
//            client.Self.Movement.Fly = true;
//            client.Self.Movement.Fly = false;

            // Seek out neighbouring region
            Simulator currentSim = client.Network.CurrentSim;
            ulong     currentHandle = currentSim.Handle;
            uint      currentX, currentY;

            Utils.LongToUInts(currentHandle, out currentX, out currentY);

            List <GridRegion> candidateRegions = new List <GridRegion>();

            TryAddRegion(Utils.UIntsToLong(Math.Max(0, currentX - Constants.RegionSize), currentY), candidateRegions); // West
            TryAddRegion(Utils.UIntsToLong(currentX + Constants.RegionSize, currentY), candidateRegions);              // East
            TryAddRegion(Utils.UIntsToLong(currentX, Math.Max(0, currentY - Constants.RegionSize)), candidateRegions); // South
            TryAddRegion(Utils.UIntsToLong(currentX, currentY + Constants.RegionSize), candidateRegions);              // North

            if (candidateRegions.Count != 0)
            {
                GridRegion destRegion = candidateRegions[Bot.Manager.Rng.Next(candidateRegions.Count)];

                uint targetX, targetY;
                Utils.LongToUInts(destRegion.RegionHandle, out targetX, out targetY);

                Vector3 pos = client.Self.SimPosition;
                if (targetX < currentX)
                {
                    pos.X = -1;
                }
                else if (targetX > currentX)
                {
                    pos.X = Constants.RegionSize + 1;
                }

                if (targetY < currentY)
                {
                    pos.Y = -1;
                }
                else if (targetY > currentY)
                {
                    pos.Y = Constants.RegionSize + 1;
                }

                m_log.DebugFormat(
                    "[CROSS BEHAVIOUR]: {0} moving to cross from {1} into {2}, target {3}",
                    Bot.Name, currentSim.Name, destRegion.Name, pos);

                // Face in the direction of the candidate region
                client.Self.Movement.TurnToward(pos);

                // Listen for event so that we know when we've crossed the region boundary
                Bot.Client.Self.RegionCrossed += Self_RegionCrossed;

                // Start moving
                Bot.Client.Self.Movement.AtPos = true;

                // Stop when reach region target or border cross detected
                if (!m_regionCrossedMutex.WaitOne(m_regionCrossingTimeout))
                {
                    m_log.ErrorFormat(
                        "[CROSS BEHAVIOUR]: {0} failed to cross from {1} into {2} with {3}ms",
                        Bot.Name, currentSim.Name, destRegion.Name, m_regionCrossingTimeout);
                }
                else
                {
                    m_log.DebugFormat(
                        "[CROSS BEHAVIOUR]: {0} crossed from {1} into {2}",
                        Bot.Name, currentSim.Name, destRegion.Name);
                }

                Bot.Client.Self.RegionCrossed -= Self_RegionCrossed;

                // We will hackishly carry on travelling into the region for a little bit.
                Thread.Sleep(6000);

                m_log.DebugFormat(
                    "[CROSS BEHAVIOUR]: {0} stopped moving after cross from {1} into {2}",
                    Bot.Name, currentSim.Name, destRegion.Name);

                Bot.Client.Self.Movement.AtPos = false;
            }
            else
            {
                m_log.DebugFormat(
                    "[CROSS BEHAVIOUR]: No candidate region for {0} to cross into from {1}.  Ignoring.",
                    Bot.Name, currentSim.Name);
            }
        }
Exemplo n.º 47
0
 // Returns the event queue in JSON format.
 public string GetPendingJson(GridClient client)
 {
     enqueue(this.GetFooter(client));
     return(MakeJson.FromHashtableQueue(this.pending));
 }
Exemplo n.º 48
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Friends.FriendNames += Friends_FriendNames;
     _Client.Friends.FriendOffline += Friends_FriendUpdate;
     _Client.Friends.FriendOnline += Friends_FriendUpdate;
     _Client.Network.LoginProgress += Network_OnLogin;
 }
Exemplo n.º 49
0
 public PrimSerializer(GridClient c)
 {
     Client = c;
     Client.Objects.ObjectProperties += new System.EventHandler <ObjectPropertiesEventArgs>(Objects_ObjectProperties);
 }
Exemplo n.º 50
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Inventory.OnFolderUpdated += new InventoryManager.FolderUpdatedCallback(Inventory_OnFolderUpdated);
     _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
 }
Exemplo n.º 51
0
 /// <summary>
 ///  A psuedo-realistic chat function that uses the typing sound and
 /// animation, types at three characters per second, and randomly
 /// pauses. This function will block until the message has been sent
 /// </summary>
 /// <param name="client">A reference to the client that will chat</param>
 /// <param name="message">The chat message to send</param>
 public static void Chat(GridClient client, string message)
 {
     Chat(client, message, ChatType.Normal, 3);
 }
Exemplo n.º 52
0
 private void InitializeClient(GridClient client)
 {
     _Client = client;
     _Client.Grid.CoarseLocationUpdate += Grid_CoarseLocationUpdate;
     _Client.Network.SimChanged += Network_OnCurrentSimChanged;
 }
Exemplo n.º 53
0
        public static bool PersistentLogin(GridClient client, string firstName, string lastName, string password,
                                           string userAgent, string start, string author)
        {
            int unknownLogins = 0;

Start:

            if (client.Network.Login(firstName, lastName, password, userAgent, start, author))
            {
                Logger.Log("Logged in to " + client.Network.CurrentSim, Helpers.LogLevel.Info, client);
                return(true);
            }
            else
            {
                if (client.Network.LoginErrorKey == "god")
                {
                    Logger.Log("Grid is down, waiting 10 minutes", Helpers.LogLevel.Warning, client);
                    LoginWait(10);
                    goto Start;
                }
                else if (client.Network.LoginErrorKey == "key")
                {
                    Logger.Log("Bad username or password, giving up on login", Helpers.LogLevel.Error, client);
                    return(false);
                }
                else if (client.Network.LoginErrorKey == "presence")
                {
                    Logger.Log("Server is still logging us out, waiting 1 minute", Helpers.LogLevel.Warning, client);
                    LoginWait(1);
                    goto Start;
                }
                else if (client.Network.LoginErrorKey == "disabled")
                {
                    Logger.Log("This account has been banned! Giving up on login", Helpers.LogLevel.Error, client);
                    return(false);
                }
                else if (client.Network.LoginErrorKey == "timed out" || client.Network.LoginErrorKey == "no connection")
                {
                    Logger.Log("Login request timed out, waiting 1 minute", Helpers.LogLevel.Warning, client);
                    LoginWait(1);
                    goto Start;
                }
                else if (client.Network.LoginErrorKey == "bad response")
                {
                    Logger.Log("Login server returned unparsable result", Helpers.LogLevel.Warning, client);
                    LoginWait(1);
                    goto Start;
                }
                else
                {
                    ++unknownLogins;

                    if (unknownLogins < 5)
                    {
                        Logger.Log("Unknown login error, waiting 2 minutes: " + client.Network.LoginErrorKey,
                                   Helpers.LogLevel.Warning, client);
                        LoginWait(2);
                        goto Start;
                    }
                    else
                    {
                        Logger.Log("Too many unknown login error codes, giving up", Helpers.LogLevel.Error, client);
                        return(false);
                    }
                }
            }
        }
Exemplo n.º 54
0
        //private bool loading = true;
        //private bool restart = false;

        public PrefGeneralConsole(METAboltInstance instance)
        {
            InitializeComponent();

            string msg1 = "Disables toolbar nofications that popup from the bottom right hand corner of your screen. Be warned that important system information will not be displayed if this is disabled.";

            toolTip                  = new Popup(customToolTip = new CustomToolTip(instance, msg1));
            toolTip.AutoClose        = false;
            toolTip.FocusOnOpen      = false;
            toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend;

            string msg3 = "If you will be crossing SIMs or will be near SIM borders and want to see the avatars in the next SIM listed on your radar then you must enable this option. This option requires a restart.";

            toolTip2                  = new Popup(customToolTip = new CustomToolTip(instance, msg3));
            toolTip2.AutoClose        = false;
            toolTip2.FocusOnOpen      = false;
            toolTip2.ShowingAnimation = toolTip2.HidingAnimation = PopupAnimations.Blend;

            string msg5 = "Approximately 1 minute after login the avatar will autosit on an object that has its UUID in the object description. The object needs to be within 10 metre radius of the avatar.";

            toolTip4                  = new Popup(customToolTip = new CustomToolTip(instance, msg5));
            toolTip4.AutoClose        = false;
            toolTip4.FocusOnOpen      = false;
            toolTip4.ShowingAnimation = toolTip4.HidingAnimation = PopupAnimations.Blend;

            string msg6 = "Sets radar range (in metres) throughout the application for objects & avatars. Lower setting means using less bandwidth. Default is 64m. If set to 10, avatars & objects outside the 10m range will be ignored.";

            toolTip5                  = new Popup(customToolTip = new CustomToolTip(instance, msg6));
            toolTip5.AutoClose        = false;
            toolTip5.FocusOnOpen      = false;
            toolTip5.ShowingAnimation = toolTip5.HidingAnimation = PopupAnimations.Blend;

            string msg7 = "Sets the default object range used on the 'Object Manager' screen. The maximum value of this setting can not be greater than the selected 'radar range' value above.";

            toolTip6                  = new Popup(customToolTip = new CustomToolTip(instance, msg7));
            toolTip6.AutoClose        = false;
            toolTip6.FocusOnOpen      = false;
            toolTip6.ShowingAnimation = toolTip6.HidingAnimation = PopupAnimations.Blend;

            string msg8 = "Group Inviter users need to use the generated password or type your own in. Enter the same password into the Group Inviter in SL. Use 'reset' button to generate new one. For your security THIS FIELD MUST NOT BE BLANK.";

            toolTip7                  = new Popup(customToolTip = new CustomToolTip(instance, msg8));
            toolTip7.AutoClose        = false;
            toolTip7.FocusOnOpen      = false;
            toolTip7.ShowingAnimation = toolTip7.HidingAnimation = PopupAnimations.Blend;

            string msg9 = "For this to work you need to create a folder called 'GroupMan Items' under the root of your inventory and place your give away items in it.";

            toolTip8                  = new Popup(customToolTip = new CustomToolTip(instance, msg9));
            toolTip8.AutoClose        = false;
            toolTip8.FocusOnOpen      = false;
            toolTip8.ShowingAnimation = toolTip8.HidingAnimation = PopupAnimations.Blend;

            string msg10 = "If unchecked and a master avatar and/or object UUID is not specified, LSL commands from all avatars and objects (with MD5'ed METAbolt passwords in the command) will be accepted and processed.";

            toolTip9                  = new Popup(customToolTip = new CustomToolTip(instance, msg10));
            toolTip9.AutoClose        = false;
            toolTip9.FocusOnOpen      = false;
            toolTip9.ShowingAnimation = toolTip9.HidingAnimation = PopupAnimations.Blend;

            this.instance = instance;
            client        = this.instance.Client;
            config        = this.instance.Config;

            if (config.CurrentConfig.InterfaceStyle == 0)
            {
                rdoSystemStyle.Checked = true;
            }
            else if (config.CurrentConfig.InterfaceStyle == 1)
            {
                rdoOfficeStyle.Checked = true;
            }

            //chkRadar.Checked = config.CurrentConfig.iRadar;
            chkConnect4.Checked      = config.CurrentConfig.Connect4;
            chkNotifications.Checked = config.CurrentConfig.DisableNotifications;
            chkFriends.Checked       = config.CurrentConfig.DisableFriendsNotifications;
            chkAutoSit.Checked       = config.CurrentConfig.AutoSit;

            try
            {
                tBar1.Value = config.CurrentConfig.RadarRange;
            }
            catch
            {
                tBar1.Value = config.CurrentConfig.RadarRange = tBar1.Maximum;
                MessageBox.Show("Your radar setting was greater than the maximum allowed.\nIt has been changed to " + tBar1.Maximum.ToString(CultureInfo.CurrentCulture), "METAbolt");
            }

            textBox1.Text = tBar1.Value.ToString(CultureInfo.CurrentCulture);

            tbar2.Maximum = tBar1.Value;

            try
            {
                tbar2.Value = config.CurrentConfig.ObjectRange;
            }
            catch
            {
                tbar2.Value = tbar2.Minimum;
            }

            textBox2.Text            = tbar2.Value.ToString(CultureInfo.CurrentCulture);
            textBox3.Text            = config.CurrentConfig.GroupManPro;
            chkHide.Checked          = config.CurrentConfig.HideMeta;
            chkInvites.Checked       = config.CurrentConfig.DisableInboundGroupInvites;
            chkLookAt.Checked        = config.CurrentConfig.DisableLookAt;
            checkBox1.Checked        = config.CurrentConfig.GivePresent;
            checkBox2.Checked        = config.CurrentConfig.AutoRestart;
            nUD1.Value               = config.CurrentConfig.LogOffTime;
            nUD2.Value               = config.CurrentConfig.ReStartTime;
            textBox4.Text            = client.Settings.ASSET_CACHE_DIR;
            checkBox13.Checked       = config.CurrentConfig.HideDisconnectPrompt;
            chkDisableRadar.Checked  = config.CurrentConfig.DisableRadar;
            chkRestrictRadar.Checked = config.CurrentConfig.RestrictRadar;
            chkVoice.Checked         = config.CurrentConfig.DisableVoice;
            chkFavs.Checked          = config.CurrentConfig.DisableFavs;
            cbHHTPInv.Checked        = config.CurrentConfig.DisableHTTPinv;
            chkRadarMiniMap.Checked  = config.CurrentConfig.DisableRadarImageMiniMap;
            cbLLSD.Checked           = config.CurrentConfig.UseLLSD;

            numChatBuff.Value   = config.CurrentConfig.ChatBufferLimit;
            numScriptBuff.Value = config.CurrentConfig.ScriptUrlBufferLimit;

            if (config.CurrentConfig.BandwidthThrottle > 500.0f)
            {
                config.CurrentConfig.BandwidthThrottle = 500.0f;
            }

            if (config.CurrentConfig.BandwidthThrottle < 500.0f)
            {
                radioButton2.Checked = true;
                trackBar1.Enabled    = true;

                try
                {
                    trackBar1.Value = Convert.ToInt32(config.CurrentConfig.BandwidthThrottle);
                }
                catch
                {
                    trackBar1.Value = 160;
                }

                label19.Text = trackBar1.Value.ToString(CultureInfo.CurrentCulture);
            }
            else
            {
                radioButton1.Checked = true;
                trackBar1.Enabled    = false;

                try
                {
                    trackBar1.Value = 500;
                }
                catch
                {
                    trackBar1.Value = trackBar1.Maximum;
                }

                label19.Text = "500";
            }

            SetBarValue();

            comboBox1.SelectedIndex = 0;
            cbApp.SelectedIndex     = 0;
            cbLand.SelectedIndex    = 0;
            cbFn.SelectedIndex      = 0;

            if (config.CurrentConfig.ClassicChatLayout)
            {
                checkBox4.Checked = false;
            }
            else
            {
                checkBox4.Checked = true;
            }

            textBox7.BackColor = textBox6.BackColor = config.CurrentConfig.HeaderBackColour;
            //textBox9.BackColor = config.CurrentConfig.BgColour;

            if (config.CurrentConfig.HeaderFont != null)
            {
                headerfont      = config.CurrentConfig.HeaderFont;
                headerfontstyle = config.CurrentConfig.HeaderFontStyle;
                headerfontsize  = config.CurrentConfig.HeaderFontSize;

                FontStyle fontsy;

                switch (headerfontstyle.ToLower(CultureInfo.CurrentCulture))
                {
                case "bold":
                    fontsy = FontStyle.Bold;
                    break;

                case "italic":
                    fontsy = FontStyle.Italic;
                    break;

                default:
                    fontsy = FontStyle.Regular;
                    break;
                }

                textBox7.Font = new Font(headerfont, headerfontsize, fontsy);
                textBox7.Text = "size " + headerfontsize.ToString(CultureInfo.CurrentCulture);
            }

            if (config.CurrentConfig.TextFont != null)
            {
                textfont      = config.CurrentConfig.TextFont;
                textfontstyle = config.CurrentConfig.TextFontStyle;
                textfontsize  = config.CurrentConfig.TextFontSize;

                FontStyle fontst;

                switch (textfontstyle.ToLower(CultureInfo.CurrentCulture))
                {
                case "bold":
                    fontst = FontStyle.Bold;
                    break;

                case "italic":
                    fontst = FontStyle.Italic;
                    break;

                default:
                    fontst = FontStyle.Regular;
                    break;
                }

                textBox8.Font = new Font(textfont, textfontsize, fontst);
                textBox8.Text = "size " + textfontsize.ToString(CultureInfo.CurrentCulture);
            }

            checkBox6.Checked       = config.CurrentConfig.PlayFriendOnline;
            checkBox7.Checked       = config.CurrentConfig.PlayFriendOffline;
            checkBox8.Checked       = config.CurrentConfig.PlayIMreceived;
            checkBox9.Checked       = config.CurrentConfig.PlayGroupIMreceived;
            checkBox10.Checked      = config.CurrentConfig.PlayGroupNoticeReceived;
            checkBox11.Checked      = config.CurrentConfig.PlayInventoryItemReceived;
            checkBox5.Checked       = config.CurrentConfig.PlayPaymentReceived;
            chkMinimised.Checked    = config.CurrentConfig.StartMinimised;
            txtAdRemove.Text        = config.CurrentConfig.AdRemove.Trim();
            txtMavatar.Text         = config.CurrentConfig.MasterAvatar.Trim();
            txtMObject.Text         = config.CurrentConfig.MasterObject.Trim();
            chkAutoTransfer.Checked = config.CurrentConfig.AutoTransfer;
            chkTray.Checked         = config.CurrentConfig.DisableTrayIcon;
            chkTyping.Checked       = config.CurrentConfig.DisableTyping;
            chkAutoFriend.Checked   = config.CurrentConfig.AutoAcceptFriends;
            checkBox12.Checked      = config.CurrentConfig.EnforceLSLsecurity;
            chkLSL.Checked          = config.CurrentConfig.DisplayLSLcommands;
            //cbTag.Checked = config.CurrentConfig.BroadcastID;

            if (config.CurrentConfig.DeclineInv)
            {
                comboBox1.SelectedIndex = 1;
            }

            if (config.CurrentConfig.AutoAcceptItems)
            {
                comboBox1.SelectedIndex = 2;
            }

            cbApp.SelectedItem  = config.CurrentConfig.AppMenuPos;
            cbLand.SelectedItem = config.CurrentConfig.LandMenuPos;
            cbFn.SelectedItem   = config.CurrentConfig.FnMenuPos;
        }
Exemplo n.º 55
0
 /// <summary>
 /// TreeView control for the specified client's group list
 /// </summary>
 public GroupList(GridClient client) : this()
 {
     InitializeClient(client);
 }
Exemplo n.º 56
0
 /// <summary>
 /// Panel control for the specified client's local chat interaction
 /// </summary>
 public LocalChat(GridClient client) : this ()
 {
     _Client = client;
 }
Exemplo n.º 57
0
 public ClientChangedEventArgs(GridClient OldClient, GridClient Client)
 {
     m_OldClient = OldClient;
     m_Client    = Client;
 }