Main class to expose grid functionality to clients. All of the classes needed for sending and receiving data are accessible through this class.
 public override bool Excecute(Automaton am, GridClient client, bool force)
 {
     if (!client.Network.Connected) { result.message = "Not Connected to grid"; return true; }
     result.data = am.GetTPOffers();
     result.success = true;
     return true;
 }
Пример #2
0
        public Form1(METAboltInstance instance)
        {
            this.instance = instance;
            client = this.instance.Client;

            InitializeComponent();
        }
Пример #3
0
        public TraceSession(Config cfg)
        {
            mConfig = cfg;
            mClient = new GridClient();
            mTracers = new List<ITracer>();
            mController = null;
            mConnectedSimName = null;
            mNeedsReconnect = false;
            mDisconnectTime = DateTime.Now;
            mReconnectWait = TimeSpan.FromSeconds(30);

            // We turn as many things off as possible -- features are *opt in* by
            // default, meaning specific loggers must enable these features if they
            // need them
            mClient.Settings.MULTIPLE_SIMS = false;
            mClient.Throttle.Asset = 0;
            mClient.Throttle.Cloud = 0;
            mClient.Throttle.Land = 0;
            mClient.Throttle.Texture = 0;
            mClient.Throttle.Wind = 0;

            // Set up our session management callbacks
            mClient.Network.OnConnected += new NetworkManager.ConnectedCallback(this.ConnectHandler);
            mClient.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(this.DisconnectHandler);
            mClient.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.SimConnectedHandler);
        }
Пример #4
0
        public SearchConsole(METAboltInstance instance)
        {
            InitializeComponent();

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddClientEvents();

            tabConsole = this.instance.TabConsole;

            console = new FindPeopleConsole(instance, UUID.Random());
            console.Dock = DockStyle.Fill;
            console.SelectedIndexChanged += new EventHandler(console_SelectedIndexChanged);
            pnlFindPeople.Controls.Add(console);

            eventsconsole = new FindEvents(instance, UUID.Random());
            eventsconsole.Dock = DockStyle.Fill;
            eventsconsole.SelectedIndexChanged += new EventHandler(eventsconsole_SelectedIndexChanged);
            pnlFindEvents.Controls.Add(eventsconsole);

            placesconsole = new FindPlaces(instance, UUID.Random());
            placesconsole.Dock = DockStyle.Fill;
            placesconsole.SelectedIndexChanged += new EventHandler(placesconsole_SelectedIndexChanged);
            pnlFindPlaces.Controls.Add(placesconsole);

            groupsconsole = new FindGroups(instance, UUID.Random());
            groupsconsole.Dock = DockStyle.Fill;
            groupsconsole.SelectedIndexChanged += new EventHandler(groupsconsole_SelectedIndexChanged);
            pnlFindGroups.Controls.Add(groupsconsole);
        }
Пример #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to <code>SecondLife</code> client</param>
        /// <param name="maxRequests">Maximum number of concurrent texture requests</param>
        public TexturePipeline(GridClient client, int maxRequests)
        {
            running = true;
            this.client = client;
            maxTextureRequests = maxRequests;

            requestQueue = new List<TaskInfo>();
            currentRequests = new Dictionary<UUID, int>(maxTextureRequests);
            completedDownloads = new Dictionary<UUID, ImageDownload>();
            resetEvents = new AutoResetEvent[maxTextureRequests];
            threadpoolSlots = new int[maxTextureRequests];

            // Pre-configure autoreset events/download slots
            for (int i = 0; i < maxTextureRequests; i++)
            {
                resetEvents[i] = new AutoResetEvent(false);
                threadpoolSlots[i] = -1;
            }

            client.Assets.OnImageReceived += Assets_OnImageReceived;
            client.Assets.OnImageReceiveProgress += Assets_OnImageReceiveProgress;

            // Fire up the texture download thread
            downloadMaster = new Thread(new ThreadStart(DownloadThread));
            downloadMaster.Start();
        }
Пример #6
0
        /// <summary>
        /// Provides a full representation of OpenMetaverse.GUI
        /// </summary>
        /// <param name="firstName"></param>
        /// <param name="lastName"></param>
        /// <param name="password"></param>
        public Dashboard(string firstName, string lastName, string password)
        {
            InitializeComponent();

            //force logout and exit when form is closed
            this.FormClosing += new FormClosingEventHandler(Dashboard_FormClosing);

            //initialize client object
            Client = new GridClient();
            Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
            LoginParams ClientLogin = Client.Network.DefaultLoginParams(firstName, lastName, password, "OpenMetaverse Dashboard", Assembly.GetExecutingAssembly().GetName().Version.ToString());
            ClientLogin.Start = "last";

            //define the client object for each GUI element
            avatarList1.Client = Client;
            friendsList1.Client = Client;
            groupList1.Client = Client;
            inventoryTree1.Client = Client;
            localChat1.Client = Client;
            miniMap1.Client = Client;

            //double-click events
            avatarList1.OnAvatarDoubleClick += new AvatarList.AvatarDoubleClickCallback(avatarList1_OnAvatarDoubleClick);
            friendsList1.OnFriendDoubleClick += new FriendList.FriendDoubleClickCallback(friendsList1_OnFriendDoubleClick);
            groupList1.OnGroupDoubleClick += new GroupList.GroupDoubleClickCallback(groupList1_OnGroupDoubleClick);

            //login
            Client.Network.BeginLogin(ClientLogin);
        }
Пример #7
0
        static void Main(string[] args)
        {
            int ircPort;

            if (args.Length < 7 || !UUID.TryParse(args[3], out _MasterID) || !int.TryParse(args[5], out ircPort) || args[6].IndexOf('#') == -1)
                Console.WriteLine("Usage: ircgateway.exe <firstName> <lastName> <password> <masterUUID> <ircHost> <ircPort> <#channel>");

            else
            {
                _Client = new GridClient();
                _Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
                _Client.Self.ChatFromSimulator += new EventHandler<ChatEventArgs>(Self_ChatFromSimulator);                
                _Client.Self.IM += Self_IM;
                _ClientLogin = _Client.Network.DefaultLoginParams(args[0], args[1], args[2], "", "IRCGateway");

                _AutoJoinChannel = args[6];
                _IRC = new IRCClient(args[4], ircPort, "SLGateway", "Second Life Gateway");
                _IRC.OnConnected += new IRCClient.ConnectCallback(_IRC_OnConnected);
                _IRC.OnMessage += new IRCClient.MessageCallback(_IRC_OnMessage);

                _IRC.Connect();

                string read = Console.ReadLine();
                while (read != null) read = Console.ReadLine();                
            }
        }
        public override bool Excecute(SteelCityAutomaton.Automaton am, OpenMetaverse.GridClient client, bool force)
        {
            if (!client.Network.Connected)
            {
                result.message = "Not Connected to grid"; return(true);
            }
            UUID target;

            result.data = uuid;
            if (UUID.TryParse(uuid, out target))
            {
                Primitive targetPrim = client.Network.CurrentSim.ObjectsPrimitives.Find(
                    delegate(Primitive prim)
                {
                    return(prim.ID == target);
                }
                    );

                if (targetPrim != null)
                {
                    client.Self.Touch(targetPrim.LocalID);
                    result.success = true;
                }
                else
                {
                    result.message = "Couldn't find prim";
                }
            }
            else
            {
                result.message = "Invalid uuid";
            }
            return(true);
        }
Пример #9
0
        public frmTeleport(METAboltInstance instance, string sSIM, float sX,float sY,float sZ, bool ismaps)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

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

            AddNetcomEvents();
            AddClientEvents();

            this.ismaps = ismaps;

            if (string.IsNullOrEmpty(sSIM))
            {
                SetDefaultValues();
            }
            else
            {
                decimal x = (decimal)sX;
                decimal y = (decimal)sY;
                decimal z = (decimal)sZ;

                txtSearchFor.Text = txtRegion.Text = sSIM;
                nudX.Value = x;
                nudY.Value = y;
                nudZ.Value = z;

                StartRegionSearch();
            }
        }
Пример #10
0
 public Scraper(GridClient theclient)
 {		
     client=theclient;
     
     Console.WriteLine("Starting scrape");
     scraperlogic();
 }
Пример #11
0
        public void StartTrace(TraceSession parent, OpenMetaverse.AgentManager avatarManager)
        {
            mGridClient = parent.Client;
            mAgentManager = avatarManager;

            mLastUpdate = DateTime.Now;
        }
 public override bool Excecute(Automaton am, GridClient client, bool force)
 {
     if (!client.Network.Connected) { result.message = "Not Connected to grid"; return true; }
     Console.WriteLine("[Stand] {0}",client.Self.Stand());
     result.success = true;
     return true;
 }
Пример #13
0
        public MainConsole(METAboltInstance instance)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            AddNetcomEvents();

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

            ////btnInfo_Click();
            //if (webBrowser == null)
            //    this.InitializeWebBrowser();

            this.InitializeWebBrowser();

            webBrowser1.Visible = true;
            //btnInfo.Text = "Hide Grid Status";
            label7.Text = "V " + Properties.Resources.METAboltVersion;

            Disposed += new EventHandler(MainConsole_Disposed);

            LoadGrids();
            InitGridCombo();
            cbxLocation.SelectedIndex = 0;
            InitializeConfig();
        }
Пример #14
0
        private void InitializeClient(bool initialize)
        {
            if (Client != null)
            {
                if (Client.Network.Connected)
                    Client.Network.Logout();

                Client = null;
            }

            if (!initialize) return;

            //initialize client object
            Client = new GridClient();
            Client.Settings.USE_LLSD_LOGIN = true;
            Client.Settings.USE_ASSET_CACHE = true;

            Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
            Client.Self.IM += Self_IM;

            //define the client object for each GUI element
            avatarList1.Client = Client;
            friendsList1.Client = Client;
            groupList1.Client = Client;
            inventoryTree1.Client = Client;
            localChat1.Client = Client;
            loginPanel1.Client = Client;
            messageBar1.Client = Client;
            miniMap1.Client = Client;
            statusOutput1.Client = Client;
        }
Пример #15
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">Reference to <code>SecondLife</code> client</param>
        public TexturePipeline(GridClient client)
        {
            Running = true;

            RequestQueue = new Queue<UUID>();
            CurrentRequests = new Dictionary<UUID, int>(MAX_TEXTURE_REQUESTS);

            RenderReady = new Dictionary<UUID, ImageDownload>();

            resetEvents = new AutoResetEvent[MAX_TEXTURE_REQUESTS];
            threadpoolSlots = new int[MAX_TEXTURE_REQUESTS];

            // pre-configure autoreset events/download slots
            for (int i = 0; i < MAX_TEXTURE_REQUESTS; i++)
            {
                resetEvents[i] = new AutoResetEvent(false);
                threadpoolSlots[i] = -1;
            }

            Client = client;

            DownloadCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
            DownloadProgCallback = new AssetManager.ImageReceiveProgressCallback(Assets_OnImageReceiveProgress);
            Client.Assets.OnImageReceived += DownloadCallback;
            Client.Assets.OnImageReceiveProgress += DownloadProgCallback;

            // Fire up the texture download thread
            downloadMaster = new Thread(new ThreadStart(DownloadThread));
            downloadMaster.Start();
        }
Пример #16
0
 /// <summary>
 /// Aims at the specified position, enters mouselook, presses and
 /// releases the left mouse button, and leaves mouselook
 /// </summary>
 /// <param name="client"></param>
 /// <param name="target">Target to shoot at</param>
 /// <returns></returns>
 public static bool Shoot(GridClient client, Vector3 target)
 {
     if (client.Self.Movement.TurnToward(target))
         return Shoot(client);
     else
         return false;
 }
Пример #17
0
        private void InitializeClient(bool initialize)
        {
            if (Client != null)
            {
                if (Client.Network.Connected)
                    Client.Network.Logout();

                Client = null;
            }

            if (!initialize) return;

            //initialize client object
            Client = new GridClient();
            Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
            Client.Settings.USE_TEXTURE_CACHE = true;

            //define the client object for each GUI element
            avatarList1.Client = Client;
            friendsList1.Client = Client;
            groupList1.Client = Client;
            inventoryTree1.Client = Client;
            localChat1.Client = Client;
            miniMap1.Client = Client;
            statusOutput1.Client = Client;
        }
Пример #18
0
        public frmGive(METAboltInstance instance, InventoryItem item)
        {
            InitializeComponent();

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

            textBox1.GotFocus += textBox1_GotFocus;
            textBox1.MouseUp += textBox1_MouseUp;
            textBox1.Leave += textBox1_Leave;

            client.Directory.DirPeopleReply += new EventHandler<DirPeopleReplyEventArgs>(Directory_OnDirPeopleReply);
            client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(GroupMembersHandler);
            client.Avatars.UUIDNameReply += new EventHandler<UUIDNameReplyEventArgs>(AvatarNamesHandler);

            groupmode = false;

            client.Groups.RequestCurrentGroups();

            label2.Text = "Give item: " + item.Name;

            lvwColumnSorter = new NumericStringComparer();
            lvwFindFriends.ListViewItemSorter = lvwColumnSorter;
            lvwSelected.ListViewItemSorter = lvwColumnSorter;
        }
Пример #19
0
        /// <summary>
        /// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
        /// </summary>
        /// <returns></returns>
        public static bool Shoot(GridClient client)
        {
            if (client.Settings.SEND_AGENT_UPDATES)
            {
                client.Self.Movement.Mouselook = true;
                client.Self.Movement.MLButtonDown = true;
                client.Self.Movement.SendUpdate();

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

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

                return true;
            }
            else
            {
                Logger.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning, client);
                return false;
            }
        }
 public override bool Excecute(Automaton am, GridClient client, bool force)
 {
     am.ClearChatLog();
     result.success = true;
     result.message = "cleared chat log";
     return true;
 }
Пример #21
0
        /// <summary>
        /// Routine called on a separate thread to load the avatars and objects from the simulators
        /// into LookingGlass.
        /// </summary>
        /// <param name="loadParam"></param>
        private static void LoadSims(Object loadParam)
        {
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: starting to load sim objects");
            try {
                Object[]             loadParams = (Object[])loadParam;
                List <OMV.Simulator> simsToLoad = (List <OMV.Simulator>)loadParams[0];
                OMV.GridClient       netComm    = (OMV.GridClient)loadParams[1];
                CommLLLP             worldComm  = (CommLLLP)loadParams[2];

                OMV.Simulator simm = null;
                try {
                    foreach (OMV.Simulator sim in simsToLoad)
                    {
                        simm = sim;
                        LoadASim(sim, netComm, worldComm);
                    }
                }
                catch (Exception e) {
                    LogManager.Log.Log(LogLevel.DBADERROR, "LoadWorldObjects: exception loading {0}: {1}",
                                       (simm == null ? "NULL" : simm.Name), e.ToString());
                }
            }
            catch (Exception e) {
                LogManager.Log.Log(LogLevel.DBADERROR, "LoadWorldObjects: exception: {0}", e.ToString());
            }
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: completed loading sim objects");
        }
Пример #22
0
        public ConferenceIMTabWindow(RadegastInstance instance, UUID session, string sessionName)
        {
            InitializeComponent();
            Disposed += new EventHandler(IMTabWindow_Disposed);

            this.instance = instance;
            this.client = instance.Client;
            this.SessionName = sessionName;
            netcom = this.instance.Netcom;

            this.session = session;

            textManager = new IMTextManager(this.instance, new RichTextBoxPrinter(rtbIMText), IMTextManagerType.Conference, this.session, sessionName);

            // Callbacks
            netcom.ClientLoginStatus += new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);
            netcom.ClientDisconnected += new EventHandler<DisconnectedEventArgs>(netcom_ClientDisconnected);
            instance.GlobalSettings.OnSettingChanged += new Settings.SettingChangedCallback(GlobalSettings_OnSettingChanged);

            if (!client.Self.GroupChatSessions.ContainsKey(session))
            {
                client.Self.ChatterBoxAcceptInvite(session);
            }

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
Пример #23
0
        public Scraper(GridClient theclient)
        {
            client = theclient;

            Logger.Log("Starting scrape", Helpers.LogLevel.Info);
            scraperlogic();
        }
Пример #24
0
 public AutoPilot(GridClient client)
 {
     Client = client;
     Ticker.Enabled = false;
     Ticker.Elapsed += new System.Timers.ElapsedEventHandler(Ticker_Elapsed);
     Client.Objects.TerseObjectUpdate += new System.EventHandler<TerseObjectUpdateEventArgs>(Objects_TerseObjectUpdate);
 }
Пример #25
0
        private void InitializeClient(bool initialize)
        {
            if (Client != null)
            {
                if (Client.Network.Connected)
                    Client.Network.Logout();

                Client = null;
            }

            if (!initialize) return;

            //initialize client object
            Client = new GridClient();
            Client.Settings.USE_TEXTURE_CACHE = true;

            Client.Network.OnCurrentSimChanged += new NetworkManager.CurrentSimChangedCallback(Network_OnCurrentSimChanged);
            Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
            Client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);

            //define the client object for each GUI element
            avatarList1.Client = Client;
            friendsList1.Client = Client;
            groupList1.Client = Client;
            inventoryTree1.Client = Client;
            localChat1.Client = Client;
            loginPanel1.Client = Client;
            messageBar1.Client = Client;
            miniMap1.Client = Client;
            statusOutput1.Client = Client;
        }
Пример #26
0
 public void conectar()
 {
     cliente = new GridClient();
     OpenMetaverse.Settings.LOG_LEVEL = OpenMetaverse.Helpers.LogLevel.None;
     cliente.Settings.LOGIN_SERVER = servidor;
     cliente.Network.Login(nombre, apellido, password, "Bot cliente", "1.0");
 }
Пример #27
0
 public NameTracker(GridClient conn)
 {
     client = conn;
     client.Avatars.UUIDNameReply += new EventHandler<UUIDNameReplyEventArgs>(Avatars_UUIDNameReply);
     agent_names_recieved = new Dictionary<UUID,String>();
     agent_names_requested = new Dictionary<UUID, DateTime>();
 }
Пример #28
0
 public CurrentOutfitFolder(RadegastInstance instance)
 {
     this.Instance = instance;
     this.Client = instance.Client;
     Instance.ClientChanged += new EventHandler<ClientChangedEventArgs>(instance_ClientChanged);
     RegisterClientEvents(Client);
 }
Пример #29
0
        public ConnectionManager(GridClient client, int timerFrequency)
        {
            Client = client;

            CheckTimer = new System.Timers.Timer(timerFrequency);
            CheckTimer.Elapsed += new System.Timers.ElapsedEventHandler(CheckTimer_Elapsed);
        }
 public override bool Excecute(Automaton am, GridClient client, bool force)
 {
     if (!client.Network.Connected) { result.message = "Not Connected to grid"; return true; }
     client.Self.Crouch(true);
     result.success = true;
     return true;
 }
Пример #31
0
        public frmGroupInfo(Group group, GridClient client)
        {
            InitializeComponent();

            while (!IsHandleCreated)
            {
                // Force handle creation
                // warning CS0219: The variable `temp' is assigned but its value is never used
                IntPtr temp = Handle;
            }

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

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

            // Request the group information
            Client.Groups.RequestGroupProfile(Group.ID);
            Client.Groups.RequestGroupMembers(Group.ID);
            Client.Groups.RequestGroupTitles(Group.ID);
        }
Пример #32
0
        public frmGroupInfo(Group group, GridClient client)
        {
            InitializeComponent();

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

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

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

            // Request the group information
            Client.Groups.RequestGroupProfile(Group.ID);
            Client.Groups.RequestGroupMembers(Group.ID);
            Client.Groups.RequestGroupTitles(Group.ID);
        }
Пример #33
0
        // Return 'true' if we don't have this region in our world yet
        private static bool WeDontKnowAboutThisSimulator(OMV.Simulator sim, OMV.GridClient netComm, CommLLLP worldComm)
        {
            LLRegionContext regn = worldComm.FindRegion(delegate(LLRegionContext rgn) {
                return(rgn.Simulator.ID == sim.ID);
            });

            return(regn == null);
        }
 public AssetFetcher(OMV.GridClient grid)
 {
     m_client = grid;
     // m_client.Assets.OnAssetReceived += new OMV.AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);
     m_requests            = new Dictionary <string, TRequest>();
     m_outstandingRequests = new List <TRequest>();
     m_stats               = new StatisticManager("AssetFetcher");
     m_totalRequests       = m_stats.GetCounter("TotalRequests");
     m_duplicateRequests   = m_stats.GetCounter("DuplicateRequests");
     m_requestsForExisting = m_stats.GetCounter("RequestsForExistingAsset");
 }
Пример #35
0
        private static void AddAvatars(OMV.Simulator sim, OMV.GridClient netComm, CommLLLP worldComm)
        {
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: loading {0} avatars", sim.ObjectsAvatars.Count);
            List <OMV.Avatar> avatarsToNew = new List <OpenMetaverse.Avatar>();

            sim.ObjectsAvatars.ForEach(delegate(OMV.Avatar av) {
                avatarsToNew.Add(av);
            });
            // this happens outside the avatar list lock
            foreach (OMV.Avatar av in avatarsToNew)
            {
                worldComm.Objects_AvatarUpdate(netComm, new OMV.AvatarUpdateEventArgs(sim, av, 0, true));
            }
        }
Пример #36
0
        private static void AddObjects(OMV.Simulator sim, OMV.GridClient netComm, CommLLLP worldComm)
        {
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: loading {0} primitives", sim.ObjectsPrimitives.Count);
            List <OMV.Primitive> primsToNew = new List <OpenMetaverse.Primitive>();

            sim.ObjectsPrimitives.ForEach(delegate(OMV.Primitive prim) {
                primsToNew.Add(prim);
            });
            foreach (OMV.Primitive prim in primsToNew)
            {
                // TODO: how can we tell if this prim might be an attachment?
                worldComm.Objects_ObjectUpdate(netComm, new OpenMetaverse.PrimEventArgs(sim, prim, 0, true, false));
            }
        }
Пример #37
0
        public override bool Excecute(SteelCityAutomaton.Automaton am, OpenMetaverse.GridClient client, bool force)
        {
            if (!client.Network.Connected)
            {
                result.message = "Not Connected to grid"; return(true);
            }
            UUID target;

            if (UUID.TryParse(uuid, out target) && amount > 0)
            {
                client.Self.GiveAvatarMoney(target, amount, description);
                result.success = true;
            }
            else
            {
                result.message = "Invalid key or ammount";
            }
            return(true);
        }
Пример #38
0
        public LocalChannel(OpenMetaverse.GridClient client, IIdentityMapper mapper)
        {
            this.client = client;
            this.mapper = mapper;
            this.nearby = new Dictionary <string, Dictionary <UUID, ChannelMembership> >();

            var selfmember = new ChannelMembership();

            selfmember.IsOperator = false;
            selfmember.Position   = PositionCategory.Whisper;
            selfmember.Subject    = mapper.MapUser(client.Self.AgentID, client.Self.Name);

            var thissimlist = new Dictionary <UUID, ChannelMembership>();

            thissimlist.Add(client.Self.AgentID, selfmember);
            nearby.Add(client.Network.CurrentSim.Name, thissimlist);

            client.Grid.CoarseLocationUpdate += OnLocationUpdate;
            client.Self.ChatFromSimulator    += OnLocalChat;
        }
Пример #39
0
        public static void Load(OMV.GridClient netComm, CommLLLP worldComm)
        {
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: loading existing context");
            List <OMV.Simulator> simsToLoad = new List <OMV.Simulator>();

            lock (netComm.Network.Simulators) {
                foreach (OMV.Simulator sim in netComm.Network.Simulators)
                {
                    if (WeDontKnowAboutThisSimulator(sim, netComm, worldComm))
                    {
                        // tell the world about this simulator
                        LogManager.Log.Log(LogLevel.DCOMMDETAIL, "LoadWorldObjects: adding simulator {0}", sim.Name);
                        worldComm.Network_SimConnected(netComm, new OMV.SimConnectedEventArgs(sim));
                        simsToLoad.Add(sim);
                    }
                }
            }
            Object[] loadParams = { simsToLoad, netComm, worldComm };
            ThreadPool.QueueUserWorkItem(LoadSims, loadParams);
            // ThreadPool.UnsafeQueueUserWorkItem(LoadSims, loadParams);
            LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: started thread to load sim objects");
        }
Пример #40
0
 public override bool Excecute(SteelCityAutomaton.Automaton am, OpenMetaverse.GridClient client, bool force)
 {
     result.data    = client.Self.Balance;
     result.success = true;
     return(true);
 }
Пример #41
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="client">Reference to the GridClient object</param>
 public CapsEventDictionary(GridClient client)
 {
     Client = client;
     _ThreadPoolCallback = new WaitCallback(ThreadPoolDelegate);
 }
Пример #42
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="client"></param>
 public PacketEventDictionary(GridClient client)
 {
     Client = client;
 }
Пример #43
0
 /// <summary>
 /// Send a log message to the logging engine
 /// </summary>
 /// <param name="message">The log message</param>
 /// <param name="level">The severity of the log entry</param>
 /// <param name="client">Instance of the client</param>
 public static void Log(object message, Helpers.LogLevel level, GridClient client)
 {
     Log(message, level, client, null);
 }
Пример #44
0
 /// <summary>Constructor</summary>
 /// <param name="client">Reference to a GridClient object</param>
 public Settings(GridClient client)
 {
     Client = client;
     Client.Network.RegisterCallback(Packets.PacketType.EconomyData, EconomyDataHandler);
 }
Пример #45
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="client"></param>
 public TerrainManager(GridClient client)
 {
     Client = client;
     Client.Network.RegisterCallback(PacketType.LayerData, LayerDataHandler);
 }
Пример #46
0
 /// <summary>
 /// Default constructor, uses a default high total of 1500 KBps (1536000)
 /// </summary>
 public AgentThrottle(GridClient client)
 {
     Client = client;
     Total  = 1536000.0f;
 }
Пример #47
0
 public Inventory(GridClient client, InventoryManager manager)
     : this(client, manager, client.Self.AgentID)
 {
 }
Пример #48
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="client">Reference to the GridClient object</param>
 public CapsEventDictionary(GridClient client)
 {
     Client = client;
 }
Пример #49
0
 public static void LoadASim(OMV.Simulator sim, OMV.GridClient netComm, CommLLLP worldComm)
 {
     LogManager.Log.Log(LogLevel.DCOMM, "LoadWorldObjects: loading avatars and objects for sim {0}", sim.Name);
     AddAvatars(sim, netComm, worldComm);
     AddObjects(sim, netComm, worldComm);
 }