Ejemplo n.º 1
0
        /// <summary></summary>
        /// <param name="packet"></param>
        /// <param name="simulator"></param>
        private void EstateOwnerMessageHandler(Packet packet, Simulator simulator)
        {
            EstateOwnerMessagePacket message = (EstateOwnerMessagePacket)packet;
            string method = Helpers.FieldToUTF8String(message.MethodData.Method);

            //FIXME - remove debug output
            Console.WriteLine("--- " + method + " ---");
            foreach (EstateOwnerMessagePacket.ParamListBlock block in message.ParamList)
            {
                Console.WriteLine(Helpers.FieldToUTF8String(block.Parameter));
            }
            Console.WriteLine("------");
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="prey"></param>
        public void KickUser(LLUUID prey)
        {
            EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
            estate.AgentData.AgentID = Client.Network.AgentID;
            estate.AgentData.SessionID = Client.Network.SessionID;
            estate.MethodData.Invoice = LLUUID.GenerateUUID();
            estate.MethodData.Method = Helpers.StringToField("kick");
            estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[2];
            estate.ParamList[0].Parameter = Helpers.StringToField(Client.Network.AgentID.ToStringHyphenated());
            estate.ParamList[1].Parameter = Helpers.StringToField(prey.ToStringHyphenated());

            Client.Network.SendPacket((Packet)estate);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="prey"></param>
        public void KickUser(LLUUID prey)
        {
            EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();

            estate.AgentData.AgentID      = Client.Network.AgentID;
            estate.AgentData.SessionID    = Client.Network.SessionID;
            estate.MethodData.Invoice     = LLUUID.GenerateUUID();
            estate.MethodData.Method      = Helpers.StringToField("kick");
            estate.ParamList              = new EstateOwnerMessagePacket.ParamListBlock[2];
            estate.ParamList[0].Parameter = Helpers.StringToField(Client.Network.AgentID.ToStringHyphenated());
            estate.ParamList[1].Parameter = Helpers.StringToField(prey.ToStringHyphenated());

            Client.Network.SendPacket((Packet)estate);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Used for setting and retrieving various estate panel settings
        /// </summary>
        /// <param name="method">EstateOwnerMessage Method field</param>
        /// <param name="listParams">List of parameters to include</param>
        /// <param name="createInvoice">Use LLUUID.Random() for Invoice field instead of LLUUID.Zero</param>
        public void EstateOwnerMessage(string method, List <string> listParams)
        {
            EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();

            estate.AgentData.AgentID   = Client.Self.AgentID;
            estate.AgentData.SessionID = Client.Self.SessionID;
            estate.MethodData.Invoice  = LLUUID.Random();
            estate.MethodData.Method   = Helpers.StringToField(method);
            estate.ParamList           = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
            for (int i = 0; i < listParams.Count; i++)
            {
                estate.ParamList[i]           = new EstateOwnerMessagePacket.ParamListBlock();
                estate.ParamList[i].Parameter = Helpers.StringToField(listParams[i]);
            }
            Client.Network.SendPacket((Packet)estate);
        }
Ejemplo n.º 5
0
        public void EstateOwnerMessage(string method, List <string> listParams)
        {
            EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();

            estate.AgentData.AgentID       = frame.AgentID;
            estate.AgentData.SessionID     = frame.SessionID;
            estate.AgentData.TransactionID = UUID.Zero;
            estate.MethodData.Invoice      = UUID.Random();
            estate.MethodData.Method       = Utils.StringToBytes(method);
            estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
            for (int i = 0; i < listParams.Count; i++)
            {
                estate.ParamList[i]           = new EstateOwnerMessagePacket.ParamListBlock();
                estate.ParamList[i].Parameter = Utils.StringToBytes(listParams[i]);
            }
            proxy.InjectPacket(estate, Direction.Outgoing);
        }
Ejemplo n.º 6
0
        private void SendEstateOwnerMessage(LLAgent agent, string method, string[] parameters, UUID invoiceID)
        {
            EstateOwnerMessagePacket message = new EstateOwnerMessagePacket();

            message.AgentData.AgentID       = agent.ID;
            message.AgentData.TransactionID = UUID.Zero;
            message.MethodData.Method       = Utils.StringToBytes(method);
            message.MethodData.Invoice      = invoiceID;
            message.ParamList = new EstateOwnerMessagePacket.ParamListBlock[parameters.Length];
            for (int i = 0; i < parameters.Length; i++)
            {
                message.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock {
                    Parameter = Utils.StringToBytes(parameters[i])
                }
            }
            ;

            m_udp.SendPacket(agent, message, ThrottleCategory.Task, false);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Used for setting and retrieving various estate panel settings
 /// </summary>
 /// <param name="method">EstateOwnerMessage Method field</param>
 /// <param name="listParams">List of parameters to include</param>
 public void EstateOwnerMessage(string method, List<string> listParams)
 {
     EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
     estate.AgentData.AgentID = Client.Self.AgentID;
     estate.AgentData.SessionID = Client.Self.SessionID;
     estate.AgentData.TransactionID = UUID.Zero;
     estate.MethodData.Invoice = UUID.Random();
     estate.MethodData.Method = Utils.StringToBytes(method);
     estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
     for (int i = 0; i < listParams.Count; i++)
     {
         estate.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock();
         estate.ParamList[i].Parameter = Utils.StringToBytes(listParams[i]);
     }
     Client.Network.SendPacket((Packet)estate);
 }
Ejemplo n.º 8
0
 public void EstateOwnerMessage(string method, List<string> listParams)
 {
     EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
     estate.AgentData.AgentID = frame.AgentID;
     estate.AgentData.SessionID = frame.SessionID;
     estate.AgentData.TransactionID = UUID.Zero;
     estate.MethodData.Invoice = UUID.Random();
     estate.MethodData.Method = Utils.StringToBytes(method);
     estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
     for (int i = 0; i < listParams.Count; i++)
     {
         estate.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock();
         estate.ParamList[i].Parameter = Utils.StringToBytes(listParams[i]);
     }
     proxy.InjectPacket(estate, Direction.Outgoing);
 }
Ejemplo n.º 9
0
        /// <summary></summary>
        /// <param name="packet"></param>
        /// <param name="simulator"></param>
        private void EstateOwnerMessageHandler(Packet packet, Simulator simulator)
        {
            EstateOwnerMessagePacket message = (EstateOwnerMessagePacket)packet;
            uint   estateID;
            string method = Utils.BytesToString(message.MethodData.Method);

            //List<string> parameters = new List<string>();

            if (method == "estateupdateinfo")
            {
                string estateName  = Utils.BytesToString(message.ParamList[0].Parameter);
                UUID   estateOwner = new UUID(Utils.BytesToString(message.ParamList[1].Parameter));
                estateID = Utils.BytesToUInt(message.ParamList[2].Parameter);

                /*
                 * foreach (EstateOwnerMessagePacket.ParamListBlock param in message.ParamList)
                 * {
                 *  parameters.Add(Utils.BytesToString(param.Parameter));
                 * }
                 */
                bool denyNoPaymentInfo;
                if (Utils.BytesToUInt(message.ParamList[8].Parameter) == 0)
                {
                    denyNoPaymentInfo = true;
                }
                else
                {
                    denyNoPaymentInfo = false;
                }

                if (OnGetEstateUpdateInfo != null)
                {
                    try
                    {
                        OnGetEstateUpdateInfo(estateName, estateOwner, estateID, denyNoPaymentInfo);
                    }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
            }

            else if (method == "setaccess")
            {
                int count;
                estateID = Utils.BytesToUInt(message.ParamList[0].Parameter);
                if (message.ParamList.Length > 1)
                {
                    //param comes in as a string for some reason
                    uint param;
                    if (!uint.TryParse(Utils.BytesToString(message.ParamList[1].Parameter), out param))
                    {
                        return;
                    }

                    EstateAccessReplyDelta accessType = (EstateAccessReplyDelta)param;

                    switch (accessType)
                    {
                    case EstateAccessReplyDelta.EstateManagers:
                        if (OnGetEstateManagers != null)
                        {
                            if (message.ParamList.Length > 5)
                            {
                                if (!int.TryParse(Utils.BytesToString(message.ParamList[5].Parameter), out count))
                                {
                                    return;
                                }
                                List <UUID> managers = new List <UUID>();
                                for (int i = 6; i < message.ParamList.Length; i++)
                                {
                                    try
                                    {
                                        UUID managerID = new UUID(message.ParamList[i].Parameter, 0);
                                        managers.Add(managerID);
                                    }
                                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                                }
                                try { OnGetEstateManagers(estateID, count, managers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.EstateBans:
                        if (OnGetEstateBans != null)
                        {
                            if (message.ParamList.Length > 6)
                            {
                                if (!int.TryParse(Utils.BytesToString(message.ParamList[4].Parameter), out count))
                                {
                                    return;
                                }
                                List <UUID> bannedUsers = new List <UUID>();
                                for (int i = 7; i < message.ParamList.Length; i++)
                                {
                                    try
                                    {
                                        UUID bannedID = new UUID(message.ParamList[i].Parameter, 0);
                                        bannedUsers.Add(bannedID);
                                    }
                                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                                }
                                try { OnGetEstateBans(estateID, count, bannedUsers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.AllowedUsers:
                        if (OnGetAllowedUsers != null)
                        {
                            if (message.ParamList.Length > 5)
                            {
                                if (!int.TryParse(Utils.BytesToString(message.ParamList[2].Parameter), out count))
                                {
                                    return;
                                }
                                List <UUID> allowedUsers = new List <UUID>();
                                for (int i = 6; i < message.ParamList.Length; i++)
                                {
                                    try
                                    {
                                        UUID allowedID = new UUID(message.ParamList[i].Parameter, 0);
                                        allowedUsers.Add(allowedID);
                                    }
                                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                                }
                                try { OnGetAllowedUsers(estateID, count, allowedUsers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.AllowedGroups:
                        if (OnGetAllowedGroups != null)
                        {
                            if (message.ParamList.Length > 5)
                            {
                                if (!int.TryParse(Utils.BytesToString(message.ParamList[3].Parameter), out count))
                                {
                                    return;
                                }
                                List <UUID> allowedGroups = new List <UUID>();
                                for (int i = 5; i < message.ParamList.Length; i++)
                                {
                                    try
                                    {
                                        UUID groupID = new UUID(message.ParamList[i].Parameter, 0);
                                        allowedGroups.Add(groupID);
                                    }
                                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                                }
                                try { OnGetAllowedGroups(estateID, count, allowedGroups); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;
                    }
                }
            }

            /*
             * Console.WriteLine("--- " + method + " ---");
             * foreach (EstateOwnerMessagePacket.ParamListBlock block in message.ParamList)
             * {
             *  Console.WriteLine(Utils.BytesToString(block.Parameter));
             * }
             * Console.WriteLine("------");
             */
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Used for setting and retrieving various estate panel settings
 /// </summary>
 /// <param name="method">EstateOwnerMessage Method field</param>
 /// <param name="listParams">List of parameters to include</param>
 /// <param name="createInvoice">Use LLUUID.Random() for Invoice field instead of LLUUID.Zero</param>
 public void EstateOwnerMessage(string method, List<string>listParams)
 {
     EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
     estate.AgentData.AgentID = Client.Network.AgentID;
     estate.AgentData.SessionID = Client.Network.SessionID;
     estate.MethodData.Invoice = LLUUID.Random();
     estate.MethodData.Method = Helpers.StringToField(method);
     estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[listParams.Count];
     for (int i = 0; i < listParams.Count; i++)
     {
         estate.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock();
         estate.ParamList[i].Parameter = Helpers.StringToField(listParams[i]);
     }
     Client.Network.SendPacket((Packet)estate);
 }
Ejemplo n.º 11
0
        private void SendEstateOwnerMessage(LLAgent agent, string method, string[] parameters, UUID invoiceID)
        {
            EstateOwnerMessagePacket message = new EstateOwnerMessagePacket();
            message.AgentData.AgentID = agent.ID;
            message.AgentData.TransactionID = UUID.Zero;
            message.MethodData.Method = Utils.StringToBytes(method);
            message.MethodData.Invoice = invoiceID;
            message.ParamList = new EstateOwnerMessagePacket.ParamListBlock[parameters.Length];
            for (int i = 0; i < parameters.Length; i++)
                message.ParamList[i] = new EstateOwnerMessagePacket.ParamListBlock { Parameter = Utils.StringToBytes(parameters[i]) };

            m_udp.SendPacket(agent, message, ThrottleCategory.Task, false);
        }
Ejemplo n.º 12
0
        private void EstateOwnerMessageHandler(Packet packet, LLAgent agent)
        {
            EstateOwnerMessagePacket message = (EstateOwnerMessagePacket)packet;
            string method = Utils.BytesToString(message.MethodData.Method);
            Estate estate;

            if (m_estateClient == null)
            {
                m_log.Warn("Ignoring estate owner message \"" + method + "\", no IEstateClient");
                return;
            }
            if (!m_estateClient.TryGetEstate(m_scene.ID, out estate))
            {
                m_log.Warn("Ignoring estate owner message \"" + method + "\", scene " + m_scene.Name + " has no estate");
                return;
            }
            if (m_permissions != null)
            {
                if (!m_permissions.IsEstateManager(agent))
                {
                    m_log.Warn("Ignoring estate owner message \"" + method + "\" from non-manager " + agent.Name);
                    return;
                }
            }

            string[] parameters = new string[message.ParamList.Length];

            for (int i = 0; i < message.ParamList.Length; i++)
            {
                parameters[i] = Utils.BytesToString(message.ParamList[0].Parameter);
            }

            switch (method)
            {
            case "getinfo":
                SendDetailedEstateData(agent, estate, message.MethodData.Invoice);
                SendEstateAccessList(agent, estate, EstateAccessFlags.Managers | EstateAccessFlags.AllowedAgents |
                                     EstateAccessFlags.AllowedGroups | EstateAccessFlags.BannedAgents, message.MethodData.Invoice);
                break;

            case "setregioninfo":
                SetRegionInfo(agent, estate, parameters);
                break;

            case " texturedetail":
                SetTextureDetail(agent, estate, parameters);
                break;

            case "textureheights":
                SetTextureHeights(agent, estate, parameters);
                break;

            case "texturecommit":
                BroadcastRegionHandshake();
                break;

            case "setregionterrain":
                SetRegionTerrain(agent, estate, parameters);
                break;

            case "restart":
                //RegionRestart(parameters);
                break;

            case "estatechangecovenantid":
                ChangeCovenantID(agent, estate, parameters, message.MethodData.Invoice);
                break;

            case "estateaccessdelta":
                ChangeEstateAccess(agent, estate, parameters, message.MethodData.Invoice);
                break;

            case "simulatormessage":
                //SimulatorMessage(agent, estate, parameters);
                break;

            case "instantmessage":
                //InstantMessage(agent, estate, parameters);
                break;

            case "setregiondebug":
                //SetRegionDebug(agent, estate, parameters);
                break;

            case "teleporthomeuser":
                //TeleportHomeUser(agent, estate, parameters);
                break;

            case "teleporthomeallusers":
                //TeleportHomeAllUsers(agent, estate, parameters);
                break;

            case "colliders":
                //GetColliders(agent, estate, parameters);
                break;

            case "scripts":
                //GetScripts(agent, estate, parameters);
                break;

            case "terrain":
                //GetTerrain(agent, estate, parameters);
                break;

            case "estatechangeinfo":
                //EstateChangeInfo(agent, estate, parameters);
                break;

            case "refreshmapvisibility":
                //RefreshMapVisibility();
                break;

            default:
                m_log.Warn("Unrecognized EstateOwnerMessage \"" + method + "\" from " + agent.Name);
                break;
            }
        }
Ejemplo n.º 13
0
        /// <summary></summary>
        /// <param name="packet"></param>
        /// <param name="simulator"></param>
        private void EstateOwnerMessageHandler(Packet packet, Simulator simulator)
        {
            EstateOwnerMessagePacket message = (EstateOwnerMessagePacket)packet;
            uint          estateID;
            string        method     = Helpers.FieldToUTF8String(message.MethodData.Method);
            List <string> parameters = new List <string>();

            if (method == "estateupdateinfo")
            {
                string estateName  = Helpers.FieldToUTF8String(message.ParamList[0].Parameter);
                LLUUID estateOwner = new LLUUID(Helpers.FieldToUTF8String(message.ParamList[1].Parameter));
                estateID = Helpers.BytesToUInt(message.ParamList[2].Parameter);

                /*
                 * foreach (EstateOwnerMessagePacket.ParamListBlock param in message.ParamList)
                 * {
                 *  parameters.Add(Helpers.FieldToUTF8String(param.Parameter));
                 * }
                 */
                bool denyNoPaymentInfo;
                if (Helpers.BytesToUInt(message.ParamList[8].Parameter) == 0)
                {
                    denyNoPaymentInfo = true;
                }
                else
                {
                    denyNoPaymentInfo = false;
                }

                if (OnGetEstateUpdateInfo != null)
                {
                    try
                    {
                        OnGetEstateUpdateInfo(estateName, estateOwner, estateID, denyNoPaymentInfo);
                    }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
            }

            else if (method == "setaccess")
            {
                int count;
                estateID = Helpers.BytesToUInt(message.ParamList[0].Parameter);
                if (message.ParamList.Length > 1)
                {
                    EstateAccessReplyDelta accessType = (EstateAccessReplyDelta)Helpers.BytesToUInt(message.ParamList[1].Parameter);
                    switch (accessType)
                    {
                    case EstateAccessReplyDelta.EstateManagers:
                        if (OnGetEstateManagers != null)
                        {
                            count = (int)Helpers.BytesToUInt(message.ParamList[3].Parameter);
                            List <LLUUID> managers = new List <LLUUID>();
                            if (message.ParamList.Length > 5)
                            {
                                for (int i = 5; i < message.ParamList.Length; i++)
                                {
                                    LLUUID managerID;
                                    if (LLUUID.TryParse(Helpers.FieldToUTF8String(message.ParamList[i].Parameter), out managerID))
                                    {
                                        managers.Add(managerID);
                                    }
                                }
                                try { OnGetEstateManagers(estateID, count, managers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.EstateBans:
                        if (OnGetEstateBans != null)
                        {
                            count = (int)Helpers.BytesToUInt(message.ParamList[4].Parameter);
                            List <LLUUID> bannedUsers = new List <LLUUID>();
                            if (message.ParamList.Length > 5)
                            {
                                for (int i = 5; i < message.ParamList.Length; i++)
                                {
                                    LLUUID bannedID;
                                    if (LLUUID.TryParse(Helpers.FieldToUTF8String(message.ParamList[i].Parameter), out bannedID))
                                    {
                                        bannedUsers.Add(bannedID);
                                    }
                                }
                                try { OnGetEstateBans(estateID, count, bannedUsers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.AllowedUsers:
                        if (OnGetAllowedUsers != null)
                        {
                            count = (int)Helpers.BytesToUInt(message.ParamList[2].Parameter);
                            List <LLUUID> allowedUsers = new List <LLUUID>();
                            if (message.ParamList.Length > 5)
                            {
                                for (int i = 5; i < message.ParamList.Length; i++)
                                {
                                    LLUUID userID;
                                    if (LLUUID.TryParse(Helpers.FieldToUTF8String(message.ParamList[i].Parameter), out userID))
                                    {
                                        allowedUsers.Add(userID);
                                    }
                                }
                                try { OnGetAllowedUsers(estateID, count, allowedUsers); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;

                    case EstateAccessReplyDelta.AllowedGroups:
                        if (OnGetAllowedGroups != null)
                        {
                            count = (int)Helpers.BytesToUInt(message.ParamList[3].Parameter);
                            List <LLUUID> allowedGroups = new List <LLUUID>();
                            if (message.ParamList.Length > 5)
                            {
                                for (int i = 5; i < message.ParamList.Length; i++)
                                {
                                    LLUUID groupID;
                                    if (LLUUID.TryParse(Helpers.FieldToUTF8String(message.ParamList[i].Parameter), out groupID))
                                    {
                                        allowedGroups.Add(groupID);
                                    }
                                }
                                try { OnGetAllowedGroups(estateID, count, allowedGroups); }
                                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                            }
                        }
                        break;
                    }

                    if (accessType == EstateAccessReplyDelta.EstateManagers)
                    {
                        if (OnGetEstateManagers != null)
                        {
                            count = (int)Helpers.BytesToUInt(message.ParamList[5].Parameter);
                            List <LLUUID> managers = new List <LLUUID>();

                            for (int i = 5; i < message.ParamList.Length; i++)
                            {
                                LLUUID managerID;
                                if (LLUUID.TryParse(Helpers.FieldToUTF8String(message.ParamList[i].Parameter), out managerID))
                                {
                                    managers.Add(managerID);
                                }
                            }
                            try { OnGetEstateManagers(estateID, count, managers); }
                            catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                        }
                    }
                }
            }

            /*
             * Console.WriteLine("--- " + method + " ---");
             * foreach (EstateOwnerMessagePacket.ParamListBlock block in message.ParamList)
             * {
             *  Console.WriteLine(Helpers.FieldToUTF8String(block.Parameter));
             * }
             * Console.WriteLine("------");
             */
        }